Commit 11bc3991 authored by Nodir Turakulov's avatar Nodir Turakulov Committed by Commit Bot

[bot_update] add ignore_input_commit parameter

CrOS chromium-pfq builder uses bot_update, but checks out Chromium on its own,
effectively ignoring input commit in bot_update.
To resolve a P0, add ignore_input_commit parameter.
Long term, bot_update API must be redesigned.

TBR=tandrii@chromium.org
Bug: 882094
Change-Id: I4f43348e3d5f81bf603dd2c110829bce58acad16
Reviewed-on: https://chromium-review.googlesource.com/1216787Reviewed-by: 's avatarLann Martin <lannm@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
parent d91f0adc
......@@ -80,7 +80,7 @@ class BotUpdateApi(recipe_api.RecipeApi):
patchset=None, gerrit_no_reset=False,
gerrit_no_rebase_patch_ref=False,
disable_syntax_validation=False, manifest_name=None,
patch_refs=None,
patch_refs=None, ignore_input_commit=False,
**kwargs):
"""
Args:
......@@ -153,17 +153,20 @@ class BotUpdateApi(recipe_api.RecipeApi):
if solution.revision:
revisions[solution.name] = solution.revision
# Apply input gitiles_commit, if any.
input_commit = self.m.buildbucket.build.input.gitiles_commit
if input_commit.id or input_commit.ref:
repo_path = self._get_commit_repo_path(input_commit, cfg)
# Note: this is not entirely correct. build.input.gitiles_commit
# definition says "The Gitiles commit to run against.".
# However, here we ignore it if the config specified a revision.
# This is necessary because existing builders rely on this behavior, e.g.
# they want to force refs/heads/master at the config level.
revisions[repo_path] = (
revisions.get(repo_path) or input_commit.id or input_commit.ref)
# HACK: ensure_checkout API must be redesigned so that we don't pass such
# parameters. Existing semantics is too opiniated.
if not ignore_input_commit:
# Apply input gitiles_commit, if any.
input_commit = self.m.buildbucket.build.input.gitiles_commit
if input_commit.id or input_commit.ref:
repo_path = self._get_commit_repo_path(input_commit, cfg)
# Note: this is not entirely correct. build.input.gitiles_commit
# definition says "The Gitiles commit to run against.".
# However, here we ignore it if the config specified a revision.
# This is necessary because existing builders rely on this behavior,
# e.g. they want to force refs/heads/master at the config level.
revisions[repo_path] = (
revisions.get(repo_path) or input_commit.id or input_commit.ref)
# Guarantee that first solution has a revision.
# TODO(machenbach): We should explicitly pass HEAD for ALL solutions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment