From 7a7798433110cd7ab1209bea46dd99806b82ba95 Mon Sep 17 00:00:00 2001 From: Haiyang Pan Date: Wed, 30 Oct 2019 19:53:56 +0000 Subject: [PATCH] Revert "Fetch the input commit ref when both ref and id are specified." This reverts commit 512f92b73181c8e1d99d38cd9b73fbf41151636a. Reason for revert: bot_update is having infra failure on ci bots. For example https://ci.chromium.org/p/chromium/builders/ci/Closure%20Compilation%20Linux/249684. Original change's description: > Fetch the input commit ref when both ref and id are specified. > > This causes --refs refs/head/master to be added to bot_update > calls when the input build message contains a commit id and the > refs/head/master ref. This is an effective no-op. > > Bug: 922150 > Change-Id: I119d9b3cede727713a0b66bff83b5ee4e1848790 > Recipe-Nontrivial-Roll: build > Recipe-Nontrivial-Roll: infra > Recipe-Nontrivial-Roll: build_limited_scripts_slave > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1884457 > Commit-Queue: Garrett Beaty > Auto-Submit: Garrett Beaty > Reviewed-by: Andrii Shyshkalov TBR=tandrii@google.com,gbeaty@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 922150 Change-Id: Ie9275c21827688f59449f052c768452a8652e139 No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1891000 Commit-Queue: Haiyang Pan Reviewed-by: Haiyang Pan --- recipes/README.recipes.md | 6 +- recipes/recipe_modules/bot_update/api.py | 2 - .../examples/full.expected/basic.json | 2 - .../examples/full.expected/basic_luci.json | 2 - .../basic_with_branch_heads.json | 2 - .../full.expected/no_cp_checkout_HEAD.json | 2 - .../no_cp_checkout_a_specific_commit.json | 2 - ..._a_specific_commit_with_a_branch_head.json | 58 ------------------- .../resolve_chromium_fixed_version.json | 2 - .../full.expected/with_manifest_name.json | 2 - .../bot_update/examples/full.py | 19 ------ 11 files changed, 3 insertions(+), 96 deletions(-) delete mode 100644 recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_specific_commit_with_a_branch_head.json diff --git a/recipes/README.recipes.md b/recipes/README.recipes.md index 8e3136c456..e0fcd33dd4 100644 --- a/recipes/README.recipes.md +++ b/recipes/README.recipes.md @@ -56,7 +56,7 @@ Recipe module to ensure a checkout is consistent on a bot. Wrapper for easy calling of bot_update. -— **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#480)(self, bot_update_step):** +— **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#478)(self, bot_update_step):** Deapplies a patch, taking care of DEPS and solution revisions properly. @@ -83,7 +83,7 @@ Args: step_test_data: a null function that returns test bot_update.py output. Use test_api.output_json to generate test data. -— **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#457)(self, project_name, gclient_config=None):** +— **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#455)(self, project_name, gclient_config=None):** Returns all property names used for storing the checked-out revision of a given project. @@ -101,7 +101,7 @@ Returns (list of str): All properties that'll hold the checked-out revision   **@property**
— **def [last\_returned\_properties](/recipes/recipe_modules/bot_update/api.py#36)(self):** -— **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#407)(self, bot_update_json, name):** +— **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#405)(self, bot_update_json, name):** Set a fixed revision for a single dependency using project revision properties. diff --git a/recipes/recipe_modules/bot_update/api.py b/recipes/recipe_modules/bot_update/api.py index 0eaf05d4be..200da96425 100644 --- a/recipes/recipe_modules/bot_update/api.py +++ b/recipes/recipe_modules/bot_update/api.py @@ -172,8 +172,6 @@ class BotUpdateApi(recipe_api.RecipeApi): # e.g. they want to force refs/heads/master at the config level. main_repo_path = self._get_commit_repo_path(in_commit, cfg) revisions[main_repo_path] = revisions.get(main_repo_path) or in_commit_rev - if in_commit.id and in_commit.ref: - refs = [in_commit.ref] + refs # Guarantee that first solution has a revision. # TODO(machenbach): We should explicitly pass HEAD for ALL solutions diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/basic.json b/recipes/recipe_modules/bot_update/examples/full.expected/basic.json index 4faffbe178..89eab3c875 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/basic.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/basic.json @@ -16,8 +16,6 @@ "/path/to/tmp/json", "--revision", "src@2d72510e447ab60a9728aeea2362d8be2cbd7789", - "--refs", - "refs/heads/master", "--disable-syntax-validation" ], "env_suffixes": { diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/basic_luci.json b/recipes/recipe_modules/bot_update/examples/full.expected/basic_luci.json index 4faffbe178..89eab3c875 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/basic_luci.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/basic_luci.json @@ -16,8 +16,6 @@ "/path/to/tmp/json", "--revision", "src@2d72510e447ab60a9728aeea2362d8be2cbd7789", - "--refs", - "refs/heads/master", "--disable-syntax-validation" ], "env_suffixes": { diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/basic_with_branch_heads.json b/recipes/recipe_modules/bot_update/examples/full.expected/basic_with_branch_heads.json index d0b552c018..4792337100 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/basic_with_branch_heads.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/basic_with_branch_heads.json @@ -16,8 +16,6 @@ "/path/to/tmp/json", "--revision", "src@2d72510e447ab60a9728aeea2362d8be2cbd7789", - "--refs", - "refs/heads/master", "--with_branch_heads", "--disable-syntax-validation" ], diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_HEAD.json b/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_HEAD.json index aec6ebe0ca..9330bd043a 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_HEAD.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_HEAD.json @@ -18,8 +18,6 @@ "got_revision@src", "--revision", "src@HEAD", - "--refs", - "refs/heads/master", "--disable-syntax-validation" ], "env_suffixes": { diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_specific_commit.json b/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_specific_commit.json index f9a6f3a86a..8d50705acf 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_specific_commit.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_specific_commit.json @@ -18,8 +18,6 @@ "got_revision@src", "--revision", "src@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "--refs", - "refs/heads/master", "--disable-syntax-validation" ], "env_suffixes": { diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_specific_commit_with_a_branch_head.json b/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_specific_commit_with_a_branch_head.json deleted file mode 100644 index f9b49a92ec..0000000000 --- a/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_specific_commit_with_a_branch_head.json +++ /dev/null @@ -1,58 +0,0 @@ -[ - { - "cmd": [ - "python", - "-u", - "RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py", - "--spec-path", - "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]", - "--revision_mapping_file", - "{\"got_angle_revision\": \"src/third_party/angle\", \"got_cr_revision\": \"src\", \"got_revision\": \"src\", \"got_v8_revision\": \"src/v8\"}", - "--git-cache-dir", - "[GIT_CACHE]", - "--cleanup-dir", - "[CLEANUP]/bot_update", - "--output_json", - "/path/to/tmp/json", - "--revision", - "got_revision@src", - "--revision", - "src@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "--refs", - "refs/branch-heads/x", - "--disable-syntax-validation" - ], - "env_suffixes": { - "PATH": [ - "RECIPE_REPO[depot_tools]" - ] - }, - "infra_step": true, - "name": "bot_update (without patch)", - "~followup_annotations": [ - "@@@STEP_LOG_LINE@json.output@{@@@", - "@@@STEP_LOG_LINE@json.output@ \"manifest\": {@@@", - "@@@STEP_LOG_LINE@json.output@ \"src\": {@@@", - "@@@STEP_LOG_LINE@json.output@ \"repository\": \"https://chromium.googlesource.com/chromium/src\", @@@", - "@@@STEP_LOG_LINE@json.output@ \"revision\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"@@@", - "@@@STEP_LOG_LINE@json.output@ }@@@", - "@@@STEP_LOG_LINE@json.output@ }, @@@", - "@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@", - "@@@STEP_LOG_LINE@json.output@ \"got_revision\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"@@@", - "@@@STEP_LOG_LINE@json.output@ }@@@", - "@@@STEP_LOG_LINE@json.output@}@@@", - "@@@STEP_LOG_END@json.output@@@", - "@@@SET_BUILD_PROPERTY@got_revision@\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"@@@" - ] - }, - { - "cmd": [], - "name": "set_output_gitiles_commit", - "~followup_annotations": [ - "@@@SET_BUILD_PROPERTY@$recipe_engine/buildbucket/output_gitiles_commit@{\"host\": \"chromium.googlesource.com\", \"id\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\", \"project\": \"chromium/src\", \"ref\": \"refs/branch-heads/x\"}@@@" - ] - }, - { - "name": "$result" - } -] \ No newline at end of file diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/resolve_chromium_fixed_version.json b/recipes/recipe_modules/bot_update/examples/full.expected/resolve_chromium_fixed_version.json index 4faffbe178..89eab3c875 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/resolve_chromium_fixed_version.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/resolve_chromium_fixed_version.json @@ -16,8 +16,6 @@ "/path/to/tmp/json", "--revision", "src@2d72510e447ab60a9728aeea2362d8be2cbd7789", - "--refs", - "refs/heads/master", "--disable-syntax-validation" ], "env_suffixes": { diff --git a/recipes/recipe_modules/bot_update/examples/full.expected/with_manifest_name.json b/recipes/recipe_modules/bot_update/examples/full.expected/with_manifest_name.json index 4fa67c7556..632a7c4448 100644 --- a/recipes/recipe_modules/bot_update/examples/full.expected/with_manifest_name.json +++ b/recipes/recipe_modules/bot_update/examples/full.expected/with_manifest_name.json @@ -16,8 +16,6 @@ "/path/to/tmp/json", "--revision", "src@2d72510e447ab60a9728aeea2362d8be2cbd7789", - "--refs", - "refs/heads/master", "--disable-syntax-validation" ], "env_suffixes": { diff --git a/recipes/recipe_modules/bot_update/examples/full.py b/recipes/recipe_modules/bot_update/examples/full.py index c61b4cbbe4..2531729970 100644 --- a/recipes/recipe_modules/bot_update/examples/full.py +++ b/recipes/recipe_modules/bot_update/examples/full.py @@ -311,25 +311,6 @@ def GenTests(api): ) ) - yield ( - api.test('no_cp_checkout_a_specific_commit_with_a_branch_head') + - ci_build(revision='a' * 40, git_ref='refs/branch-heads/x') + - api.properties( - revisions={'got_revision': 'src'}, - bot_update_output={ - 'properties': { - 'got_revision': 'a' * 40, - }, - 'manifest': { - 'src': { - 'revision': 'a' * 40, - 'repository': 'https://chromium.googlesource.com/chromium/src', - } - } - } - ) - ) - yield ( api.test('no_cp_checkout_HEAD') + ci_build(revision='HEAD') +