Expose bot_update step name function

To tag reproduction steps on chromium update we need to generate a tag
for the step. Rather than duplicate this piece of code, expose it
in the bot_update module

Bug: 349529661
Change-Id: Ibed143523b3b1af4de222a8617349b815f0c0aaa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5914637
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Struan Shrimpton <sshrimp@google.com>
changes/37/5914637/3
Struan Shrimpton 1 year ago committed by LUCI CQ
parent c109945e72
commit f5ff56488e

@ -63,7 +63,7 @@ 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#678)(self, bot_update_result):**
&mdash; **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#674)(self, bot_update_result):**
Deapplies a patch, taking care of DEPS and solution revisions properly.
@ -105,7 +105,7 @@ Args:
author.
* step_tags: a dict {tag name: tag value} of tags to add to the step
&mdash; **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#655)(self, project_name, gclient_config=None):**
&mdash; **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#651)(self, project_name, gclient_config=None):**
Returns all property names used for storing the checked-out revision of
a given project.
@ -121,10 +121,12 @@ Returns (list of str): All properties that'll hold the checked-out revision
&emsp; **@property**<br>&mdash; **def [last\_returned\_properties](/recipes/recipe_modules/bot_update/api.py#99)(self):**
&mdash; **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#606)(self, bot_update_result, name):**
&mdash; **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#602)(self, bot_update_result, name):**
Sets a fixed revision for a single dependency using project revision
properties.
&mdash; **def [step\_name](/recipes/recipe_modules/bot_update/api.py#691)(self, patch, suffix):**
### *recipe_modules* / [depot\_tools](/recipes/recipe_modules/depot_tools)
[DEPS](/recipes/recipe_modules/depot_tools/__init__.py#7): [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]

@ -423,11 +423,7 @@ class BotUpdateApi(recipe_api.RecipeApi):
commit_positions=self._test_data.get('commit_positions', True),
))
name = 'bot_update'
if not patch:
name += ' (without patch)'
if suffix:
name += ' - %s' % suffix
name = self.step_name(patch, suffix)
# Ah hah! Now that everything is in place, lets run bot_update!
step_result = None
@ -691,3 +687,11 @@ class BotUpdateApi(recipe_api.RecipeApi):
self.ensure_checkout(
patch=False, no_fetch_tags=True, update_presentation=False)
def step_name(self, patch, suffix):
name = 'bot_update'
if not patch:
name += ' (without patch)'
if suffix:
name += f' - {suffix}'
return name

Loading…
Cancel
Save