Enable setting a TurboCI check ID when deapplying a patch

This will enable Browser try builders to create source checks when
deapplying the patch to try and exonerate failed tests.

Bug: b/443496677
Change-Id: I96a6cf3acb9e67c0b4cc7bd8132cd8d6de5f06c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7237784
Reviewed-by: Robbie Iannucci <iannucci@google.com>
Commit-Queue: Garrett Beaty <gbeaty@google.com>
This commit is contained in:
Garrett Beaty
2025-12-12 10:18:12 -08:00
committed by LUCI CQ
parent 4244c70855
commit 883e6b91c0
2 changed files with 22 additions and 6 deletions

View File

@@ -65,10 +65,14 @@ Recipe module to ensure a checkout is consistent on a bot.
Wrapper for easy calling of bot_update.
&mdash; **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#915)(self, bot_update_result):**
&mdash; **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#915)(self, bot_update_result, \*, turboci_check_id: str=''):**
Deapplies a patch, taking care of DEPS and solution revisions properly.
Args:
turboci_check_id: The ID of the source check to create for checking out
the unpatched code. See documentation of the turboci_check_id parameter
of ensure_checkout for more information.
&mdash; **def [ensure\_checkout](/recipes/recipe_modules/bot_update/api.py#401)(self, gclient_config=None, \*, suffix=None, patch=True, update_presentation=True, patch_root=None, with_branch_heads=False, with_tags=False, no_fetch_tags=False, refs=None, clobber=False, root_solution_revision=None, gerrit_no_reset=False, gerrit_no_rebase_patch_ref=False, assert_one_gerrit_change=True, patch_refs=None, ignore_input_commit=False, add_blamelists=False, set_output_commit=False, step_test_data=None, enforce_fetch=False, download_topics=False, recipe_revision_overrides=None, step_tags=None, clean_ignored=False, turboci_check_id: str='', \*\*kwargs):**
@@ -134,7 +138,7 @@ Returns (list of str): All properties that'll hold the checked-out revision
Sets a fixed revision for a single dependency using project revision
properties.
&mdash; **def [step\_name](/recipes/recipe_modules/bot_update/api.py#932)(self, patch, suffix):**
&mdash; **def [step\_name](/recipes/recipe_modules/bot_update/api.py#944)(self, patch, suffix):**
### *recipe_modules* / [depot\_tools](/recipes/recipe_modules/depot_tools)
[DEPS](/recipes/recipe_modules/depot_tools/__init__.py#6): [recipe\_engine/cipd][recipe_engine/recipe_modules/cipd], [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/platform][recipe_engine/recipe_modules/platform], [recipe\_engine/runtime][recipe_engine/recipe_modules/runtime]

View File

@@ -912,8 +912,18 @@ class BotUpdateApi(recipe_api.RecipeApi):
if project == project_name
)
def deapply_patch(self, bot_update_result):
def deapply_patch(
self,
bot_update_result,
*,
turboci_check_id: str = '',
):
"""Deapplies a patch, taking care of DEPS and solution revisions properly.
Args:
turboci_check_id: The ID of the source check to create for checking out
the unpatched code. See documentation of the turboci_check_id parameter
of ensure_checkout for more information.
"""
# We only override first solution here to make sure that we correctly revert
# changes to DEPS file, which is particularly important for auto-rolls. It
@@ -926,8 +936,10 @@ class BotUpdateApi(recipe_api.RecipeApi):
bot_update_result.properties[rev_property])
self._resolve_fixed_revisions(bot_update_result)
self.ensure_checkout(
patch=False, no_fetch_tags=True, update_presentation=False)
self.ensure_checkout(patch=False,
no_fetch_tags=True,
update_presentation=False,
turboci_check_id=turboci_check_id)
def step_name(self, patch, suffix):
name = 'bot_update'