Remove obsolete destination-branch-check flag

This was removed in downstream recipes after it was turned on by default.

Bug: 740456
Change-Id: Idae1905af97333970c8b31508634f8b71550c6f9
Reviewed-on: https://chromium-review.googlesource.com/574030
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
changes/30/574030/2
Michael Achenbach 8 years ago committed by Commit Bot
parent 8aa774cfb0
commit 98681d113f

@ -43,22 +43,20 @@ Recipe module to ensure a checkout is consistent on a bot.
#### **class [BotUpdateApi](/recipes/recipe_modules/bot_update/api.py#11)([RecipeApi][recipe_engine/wkt/RecipeApi]):**
&mdash; **def [\_\_call\_\_](/recipes/recipe_modules/bot_update/api.py#35)(self, name, cmd, \*\*kwargs):**
&mdash; **def [\_\_call\_\_](/recipes/recipe_modules/bot_update/api.py#31)(self, name, cmd, \*\*kwargs):**
Wrapper for easy calling of bot_update.
&mdash; **def [\_\_init\_\_](/recipes/recipe_modules/bot_update/api.py#13)(self, issue, patch_issue, patchset, patch_set, patch_project, repository, patch_repository_url, gerrit_ref, patch_ref, patch_gerrit_url, rietveld, revision, parent_got_revision, deps_revision_overrides, fail_patch, \*args, \*\*kwargs):**
&mdash; **def [apply\_gerrit\_ref](/recipes/recipe_modules/bot_update/api.py#53)(self, root, gerrit_no_reset=False, gerrit_no_rebase_patch_ref=False, \*\*kwargs):**
&mdash; **def [apply\_gerrit\_ref](/recipes/recipe_modules/bot_update/api.py#49)(self, root, gerrit_no_reset=False, gerrit_no_rebase_patch_ref=False, \*\*kwargs):**
&mdash; **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#438)(self, bot_update_step):**
&mdash; **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#427)(self, bot_update_step):**
Deapplies a patch, taking care of DEPS and solution revisions properly.
&mdash; **def [enable\_destination\_branch\_check](/recipes/recipe_modules/bot_update/api.py#333)(self):**
&mdash; **def [ensure\_checkout](/recipes/recipe_modules/bot_update/api.py#73)(self, gclient_config=None, suffix=None, patch=True, update_presentation=True, patch_root=None, no_shallow=False, with_branch_heads=False, with_tags=False, refs=None, patch_oauth2=False, oauth2_json=False, use_site_config_creds=True, clobber=False, root_solution_revision=None, rietveld=None, issue=None, patchset=None, gerrit_no_reset=False, gerrit_no_rebase_patch_ref=False, disable_syntax_validation=False, \*\*kwargs):**
&mdash; **def [ensure\_checkout](/recipes/recipe_modules/bot_update/api.py#69)(self, gclient_config=None, suffix=None, patch=True, update_presentation=True, patch_root=None, no_shallow=False, with_branch_heads=False, with_tags=False, refs=None, patch_oauth2=False, oauth2_json=False, use_site_config_creds=True, clobber=False, root_solution_revision=None, rietveld=None, issue=None, patchset=None, gerrit_no_reset=False, gerrit_no_rebase_patch_ref=False, disable_syntax_validation=False, \*\*kwargs):**
Args:
use_site_config_creds: If the oauth2 credentials are in the buildbot
@ -75,7 +73,7 @@ Args:
Needed as migration paths for recipes dealing with older revisions,
such as bisect.
&mdash; **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#415)(self, project_name, gclient_config=None):**
&mdash; **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#404)(self, project_name, gclient_config=None):**
Returns all property names used for storing the checked-out revision of
a given project.
@ -89,7 +87,7 @@ Args:
Returns (list of str): All properties that'll hold the checked-out revision
of the given project. An empty list if no such properties exist.
&emsp; **@property**<br>&mdash; **def [last\_returned\_properties](/recipes/recipe_modules/bot_update/api.py#47)(self):**
&emsp; **@property**<br>&mdash; **def [last\_returned\_properties](/recipes/recipe_modules/bot_update/api.py#43)(self):**
### *recipe_modules* / [cipd](/recipes/recipe_modules/cipd)
[DEPS](/recipes/recipe_modules/cipd/__init__.py#1): [infra\_paths](#recipe_modules-infra_paths), [recipe\_engine/json][recipe_engine/recipe_modules/json], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/platform][recipe_engine/recipe_modules/platform], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/python][recipe_engine/recipe_modules/python], [recipe\_engine/raw\_io][recipe_engine/recipe_modules/raw_io], [recipe\_engine/step][recipe_engine/recipe_modules/step]

@ -25,10 +25,6 @@ class BotUpdateApi(recipe_api.RecipeApi):
self._deps_revision_overrides = deps_revision_overrides
self._fail_patch = fail_patch
# Controls if we query Gerrit for the destination branch of a change.
# TODO(machenbach): Deprecate when default is True.
self._enable_destination_branch_check = True
self._last_returned_properties = {}
super(BotUpdateApi, self).__init__(*args, **kwargs)
@ -327,12 +323,6 @@ class BotUpdateApi(recipe_api.RecipeApi):
return step_result
# TODO(machenbach): This switch is for a gradual roll-out of the feature.
# Downstream recipe's can set this to True. Deprecate it when it's true
# everywhere.
def enable_destination_branch_check(self):
self._enable_destination_branch_check = True
def _destination_branch(self, cfg, path):
"""Returns the destination branch of a CL for the matching project
if available or HEAD otherwise.
@ -350,9 +340,8 @@ class BotUpdateApi(recipe_api.RecipeApi):
A destination branch as understood by bot_update.py if available
and if different from master, returns 'HEAD' otherwise.
"""
# Bail out if the feature is not enabled or if this is not a gerrit issue.
if (not self._enable_destination_branch_check or
not self.m.tryserver.is_gerrit_issue or
# Bail out if this is not a gerrit issue.
if (not self.m.tryserver.is_gerrit_issue or
not self._gerrit or not self._issue):
return 'HEAD'

@ -47,11 +47,6 @@ def RunSteps(api):
gerrit_no_rebase_patch_ref = bool(
api.properties.get('gerrit_no_rebase_patch_ref'))
# TODO(machenbach): Remove this as soon as the feature is on by default.
if (api.properties.get('patch_project') == 'v8/v8' or
api.properties.get('buildername') == 'feature_rel'):
api.bot_update.enable_destination_branch_check()
if api.properties.get('test_apply_gerrit_ref'):
api.bot_update.apply_gerrit_ref(
root='/tmp/test/root',

Loading…
Cancel
Save