From 1e19f7dd61923b8835d9c6e1a7e560575dafaf1e Mon Sep 17 00:00:00 2001 From: Navil Date: Wed, 11 Sep 2024 16:49:49 +0000 Subject: [PATCH] sync: include TARGET_RELEASE when constructing smart sync target. 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 Reviewed-by: Yiwei Zhang Commit-Queue: Yiwei Zhang --- subcmds/sync.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/subcmds/sync.py b/subcmds/sync.py index 019ce3e0..0ae59f55 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -1496,6 +1496,19 @@ later is required to fix a server side protocol bug. [success, manifest_str] = server.GetApprovedManifest( branch, target ) + elif ( + "TARGET_PRODUCT" in os.environ + and "TARGET_BUILD_VARIANT" in os.environ + and "TARGET_RELEASE" in os.environ + ): + target = "%s-%s-%s" % ( + os.environ["TARGET_PRODUCT"], + os.environ["TARGET_RELEASE"], + os.environ["TARGET_BUILD_VARIANT"], + ) + [success, manifest_str] = server.GetApprovedManifest( + branch, target + ) elif ( "TARGET_PRODUCT" in os.environ and "TARGET_BUILD_VARIANT" in os.environ