Commit 5484b866 authored by Andrii Shyshkalov's avatar Andrii Shyshkalov Committed by Commit Bot

bot_update: use buildbucket's gitiles_commit as repo/revision input.

Today, whenever LUCI scheduler sets gitiles_commit, a revision property
is also always set, thus this CL will have no effect on today's production.

The goal of CL is to pave the way to avoid this duplication. For starters,
one could start real writing tests with

    + api.buildbucket.ci_build(..., revision='sha1')

without the need to duplicate the same revision as a property. All
recipes which WAI with such input are thus ready to work w/o 'revision'
property. After that, we'll be able to stop the duplication in LUCI scheduler.

R=hinoka

Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: build
Change-Id: I1773b1c3d2a98a9dbd1cfdd9ac2b4fb99745ee99
Reviewed-on: https://chromium-review.googlesource.com/1123713
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: 's avatarRyan Tseng <hinoka@chromium.org>
parent 43033409
This diff is collapsed.
......@@ -2,6 +2,7 @@ DEPS = [
'depot_tools',
'gclient',
'gerrit',
'recipe_engine/buildbucket',
'recipe_engine/context',
'recipe_engine/json',
'recipe_engine/path',
......
......@@ -28,6 +28,12 @@ class BotUpdateApi(recipe_api.RecipeApi):
self._last_returned_properties = {}
super(BotUpdateApi, self).__init__(*args, **kwargs)
def initialize(self):
gm = self.m.buildbucket.build_input.gitiles_commit
if self._revision is None and self._repository is None and gm:
self._revision = gm.id
self._repository = gm.host + '/' + gm.project
def __call__(self, name, cmd, **kwargs):
"""Wrapper for easy calling of bot_update."""
assert isinstance(cmd, (list, tuple))
......
[
{
"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': 'v8', 'url': 'https://chromium.googlesource.com/v8/v8'}]",
"--patch_root",
"v8",
"--revision_mapping_file",
"{}",
"--git-cache-dir",
"[GIT_CACHE]",
"--cleanup-dir",
"[CLEANUP]/bot_update",
"--output_json",
"/path/to/tmp/json",
"--revision",
"v8@2d72510e447ab60a9728aeea2362d8be2cbd7789"
],
"env_prefixes": {
"PATH": [
"RECIPE_PACKAGE_REPO[depot_tools]"
]
},
"infra_step": true,
"name": "bot_update",
"~followup_annotations": [
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"v8\": \"2d72510e447ab60a9728aeea2362d8be2cbd7789\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"manifest\": {}, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"v8\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {}, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"v8\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"source_manifest\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"directories\": {}, @@@",
"@@@STEP_LOG_LINE@json.output@ \"version\": 0@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]
\ No newline at end of file
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
'bot_update',
'gclient',
'recipe_engine/buildbucket',
]
def RunSteps(api):
cfg = api.gclient.make_config(CACHE_DIR='[GIT_CACHE]')
soln = cfg.solutions.add()
soln.name = 'v8'
soln.url = 'https://chromium.googlesource.com/v8/v8'
api.gclient.c = cfg
api.bot_update.ensure_checkout()
def GenTests(api):
yield api.test('ci') + api.buildbucket.ci_build(
'v8', 'ci', 'builder',
git_repo='https://chromium.googlesource.com/v8/v8',
revision='2d72510e447ab60a9728aeea2362d8be2cbd7789')
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