diff options
author | Navil <navil@google.com> | 2024-09-11 16:49:49 +0000 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2024-09-12 16:15:50 +0000 |
commit | 1e19f7dd61923b8835d9c6e1a7e560575dafaf1e (patch) | |
tree | 2b0cf9d44af1a4ae52c68c0d86dad620d8331b19 | |
parent | d8b4101eae8d7b650c9fd27d4f6495a032187279 (diff) | |
download | git-repo-1e19f7dd61923b8835d9c6e1a7e560575dafaf1e.tar.gz |
sync: include TARGET_RELEASE when constructing smart sync target.v2.47
When using the smart sync option, we try to construct the target that
was "lunched" from the TARGET_PRODUCT and TARGET_BUILD_VARIANT envvars.
However, an android target is now made of three parts,
{TARGET_PRODUCT}-{TARGET_RELEASE}-{TARGET_BUILD_VARIANT}.
I am leaving the option of creating a target if a TARGET_RELEASE is not
specified in case there are other consumers who depend on that option.
BUG=b:358101714
TEST=./run_tests
TEST=smart sync on android repo and manually inspecting
smart_sync_override.xml
Change-Id: I556137e33558783a86a0631f29756910b4a93d92
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/436977
Tested-by: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
-rw-r--r-- | subcmds/sync.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index 019ce3e0..0ae59f55 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -1499,6 +1499,19 @@ later is required to fix a server side protocol bug. | |||
1499 | elif ( | 1499 | elif ( |
1500 | "TARGET_PRODUCT" in os.environ | 1500 | "TARGET_PRODUCT" in os.environ |
1501 | and "TARGET_BUILD_VARIANT" in os.environ | 1501 | and "TARGET_BUILD_VARIANT" in os.environ |
1502 | and "TARGET_RELEASE" in os.environ | ||
1503 | ): | ||
1504 | target = "%s-%s-%s" % ( | ||
1505 | os.environ["TARGET_PRODUCT"], | ||
1506 | os.environ["TARGET_RELEASE"], | ||
1507 | os.environ["TARGET_BUILD_VARIANT"], | ||
1508 | ) | ||
1509 | [success, manifest_str] = server.GetApprovedManifest( | ||
1510 | branch, target | ||
1511 | ) | ||
1512 | elif ( | ||
1513 | "TARGET_PRODUCT" in os.environ | ||
1514 | and "TARGET_BUILD_VARIANT" in os.environ | ||
1502 | ): | 1515 | ): |
1503 | target = "%s-%s" % ( | 1516 | target = "%s-%s" % ( |
1504 | os.environ["TARGET_PRODUCT"], | 1517 | os.environ["TARGET_PRODUCT"], |