Infra: Enable cross-repo tryjobs
Bug: skia: Change-Id: I560eb00b4b19643346b038822869e5bc77ce1454 Reviewed-on: https://skia-review.googlesource.com/13652 Reviewed-by: Ben Wagner <benjaminwagner@google.com> Commit-Queue: Eric Boren <borenet@google.com>
This commit is contained in:
parent
5777bec8c6
commit
0941950866
@ -234,6 +234,7 @@ func bundleRecipes(b *specs.TasksCfgBuilder) string {
|
||||
fmt.Sprintf("buildername=%s", BUNDLE_RECIPES_NAME),
|
||||
fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
|
||||
fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
|
||||
fmt.Sprintf("patch_repo=%s", specs.PLACEHOLDER_PATCH_REPO),
|
||||
fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
|
||||
fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
|
||||
fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
|
||||
@ -311,6 +312,7 @@ func compile(b *specs.TasksCfgBuilder, name string, parts map[string]string) str
|
||||
fmt.Sprintf("buildername=%s", name),
|
||||
fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
|
||||
fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
|
||||
fmt.Sprintf("patch_repo=%s", specs.PLACEHOLDER_PATCH_REPO),
|
||||
fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
|
||||
fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
|
||||
fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
|
||||
@ -340,6 +342,7 @@ func recreateSKPs(b *specs.TasksCfgBuilder, name string) string {
|
||||
fmt.Sprintf("buildername=%s", name),
|
||||
fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
|
||||
fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
|
||||
fmt.Sprintf("patch_repo=%s", specs.PLACEHOLDER_PATCH_REPO),
|
||||
fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
|
||||
fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
|
||||
fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
|
||||
@ -364,6 +367,7 @@ func ctSKPs(b *specs.TasksCfgBuilder, name string) string {
|
||||
fmt.Sprintf("buildername=%s", name),
|
||||
fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
|
||||
fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
|
||||
fmt.Sprintf("patch_repo=%s", specs.PLACEHOLDER_PATCH_REPO),
|
||||
fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
|
||||
fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
|
||||
fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
|
||||
@ -388,6 +392,7 @@ func housekeeper(b *specs.TasksCfgBuilder, name, compileTaskName string) string
|
||||
fmt.Sprintf("buildername=%s", name),
|
||||
fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
|
||||
fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
|
||||
fmt.Sprintf("patch_repo=%s", specs.PLACEHOLDER_PATCH_REPO),
|
||||
fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
|
||||
fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
|
||||
fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
|
||||
@ -410,6 +415,7 @@ func infra(b *specs.TasksCfgBuilder, name string) string {
|
||||
fmt.Sprintf("buildername=%s", name),
|
||||
fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
|
||||
fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
|
||||
fmt.Sprintf("patch_repo=%s", specs.PLACEHOLDER_PATCH_REPO),
|
||||
fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
|
||||
fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
|
||||
fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
|
||||
@ -449,6 +455,7 @@ func test(b *specs.TasksCfgBuilder, name string, parts map[string]string, compil
|
||||
fmt.Sprintf("buildername=%s", name),
|
||||
fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
|
||||
fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
|
||||
fmt.Sprintf("patch_repo=%s", specs.PLACEHOLDER_PATCH_REPO),
|
||||
fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
|
||||
fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
|
||||
fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
|
||||
@ -487,6 +494,7 @@ func test(b *specs.TasksCfgBuilder, name string, parts map[string]string, compil
|
||||
fmt.Sprintf("buildername=%s", name),
|
||||
fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
|
||||
fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
|
||||
fmt.Sprintf("patch_repo=%s", specs.PLACEHOLDER_PATCH_REPO),
|
||||
fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
|
||||
fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
|
||||
fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
|
||||
@ -534,6 +542,7 @@ func perf(b *specs.TasksCfgBuilder, name string, parts map[string]string, compil
|
||||
fmt.Sprintf("buildername=%s", name),
|
||||
fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
|
||||
fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
|
||||
fmt.Sprintf("patch_repo=%s", specs.PLACEHOLDER_PATCH_REPO),
|
||||
fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
|
||||
fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
|
||||
fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
|
||||
@ -567,6 +576,7 @@ func perf(b *specs.TasksCfgBuilder, name string, parts map[string]string, compil
|
||||
fmt.Sprintf("buildername=%s", name),
|
||||
fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
|
||||
fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
|
||||
fmt.Sprintf("patch_repo=%s", specs.PLACEHOLDER_PATCH_REPO),
|
||||
fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
|
||||
fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
|
||||
fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
|
||||
|
@ -94,6 +94,10 @@ class SkiaApi(recipe_api.RecipeApi):
|
||||
m = gclient_cfg.got_revision_mapping
|
||||
m[main_name] = 'got_revision'
|
||||
patch_root = main_name
|
||||
patch_repo = main.url
|
||||
if self.m.properties.get('patch_repo'):
|
||||
patch_repo = self.m.properties['patch_repo']
|
||||
patch_root = patch_repo.split('/')[-1].rstrip('.git')
|
||||
|
||||
if self.m.vars.need_pdfium_checkout:
|
||||
# Skia is a DEP of PDFium; the 'revision' property is a Skia revision, and
|
||||
@ -106,6 +110,7 @@ class SkiaApi(recipe_api.RecipeApi):
|
||||
gclient_cfg.patch_projects['skia'] = (skia_dep_path, 'HEAD')
|
||||
gclient_cfg.revisions[skia_dep_path] = self.m.properties['revision']
|
||||
m[skia_dep_path] = 'got_revision'
|
||||
patch_repo = 'https://skia.googlesource.com/skia.git'
|
||||
patch_root = skia_dep_path
|
||||
|
||||
if self.m.vars.need_flutter_checkout:
|
||||
@ -121,6 +126,7 @@ class SkiaApi(recipe_api.RecipeApi):
|
||||
gclient_cfg.patch_projects['skia'] = (skia_dep_path, 'HEAD')
|
||||
gclient_cfg.revisions[skia_dep_path] = self.m.properties['revision']
|
||||
m[skia_dep_path] = 'got_revision'
|
||||
patch_repo = 'https://skia.googlesource.com/skia.git'
|
||||
patch_root = skia_dep_path
|
||||
|
||||
self.update_repo(self.m.vars.checkout_root, main)
|
||||
@ -150,6 +156,7 @@ class SkiaApi(recipe_api.RecipeApi):
|
||||
self.m.bot_update._issue,
|
||||
self.m.bot_update._patchset,
|
||||
)
|
||||
self.m.bot_update._repository = patch_repo
|
||||
|
||||
self.m.gclient.c = gclient_cfg
|
||||
with self.m.step.context({'cwd': self.m.vars.checkout_root}):
|
||||
|
@ -0,0 +1,148 @@
|
||||
[
|
||||
{
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport sys, os\npath = sys.argv[1]\nmode = int(sys.argv[2])\nif not os.path.isdir(path):\n if os.path.exists(path):\n print \"%s exists but is not a dir\" % path\n sys.exit(1)\n os.makedirs(path, mode)\n",
|
||||
"[CUSTOM_/_B_WORK]",
|
||||
"511"
|
||||
],
|
||||
"infra_step": true,
|
||||
"name": "makedirs checkout_path",
|
||||
"~followup_annotations": [
|
||||
"@@@STEP_LOG_LINE@python.inline@@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@import sys, os@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@path = sys.argv[1]@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@mode = int(sys.argv[2])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@if not os.path.isdir(path):@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ if os.path.exists(path):@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ print \"%s exists but is not a dir\" % path@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ sys.exit(1)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ os.makedirs(path, mode)@@@",
|
||||
"@@@STEP_LOG_END@python.inline@@@"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"git",
|
||||
"remote",
|
||||
"set-url",
|
||||
"origin",
|
||||
"https://skia.googlesource.com/parent_repo.git"
|
||||
],
|
||||
"cwd": "[CUSTOM_/_B_WORK]/parent_repo",
|
||||
"infra_step": true,
|
||||
"name": "git remote set-url"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"git",
|
||||
"fetch"
|
||||
],
|
||||
"cwd": "[CUSTOM_/_B_WORK]/parent_repo",
|
||||
"infra_step": true,
|
||||
"name": "git fetch"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"git",
|
||||
"reset",
|
||||
"--hard",
|
||||
"abc123"
|
||||
],
|
||||
"cwd": "[CUSTOM_/_B_WORK]/parent_repo",
|
||||
"infra_step": true,
|
||||
"name": "git reset"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"git",
|
||||
"clean",
|
||||
"-d",
|
||||
"-f"
|
||||
],
|
||||
"cwd": "[CUSTOM_/_B_WORK]/parent_repo",
|
||||
"infra_step": true,
|
||||
"name": "git clean"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport sys\nos.remove(sys.argv[1])\n",
|
||||
"[CUSTOM_/_B_WORK]/.gclient_entries"
|
||||
],
|
||||
"infra_step": true,
|
||||
"name": "remove [CUSTOM_/_B_WORK]/.gclient_entries",
|
||||
"~followup_annotations": [
|
||||
"@@@STEP_LOG_LINE@python.inline@@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@import os@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@os.remove(sys.argv[1])@@@",
|
||||
"@@@STEP_LOG_END@python.inline@@@"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
|
||||
"--spec",
|
||||
"cache_dir = '[CUSTOM_/_B_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': False, 'name': 'parent_repo', 'url': 'https://skia.googlesource.com/parent_repo.git'}]",
|
||||
"--patch_root",
|
||||
"skia",
|
||||
"--revision_mapping_file",
|
||||
"{\"parent_repo\": \"got_revision\"}",
|
||||
"--git-cache-dir",
|
||||
"[CUSTOM_/_B_CACHE]",
|
||||
"--gerrit_repo",
|
||||
"https://skia.googlesource.com/skia.git",
|
||||
"--gerrit_ref",
|
||||
"refs/changes/89/456789/12",
|
||||
"--output_json",
|
||||
"/path/to/tmp/json",
|
||||
"--revision",
|
||||
"parent_repo@abc123",
|
||||
"--output_manifest"
|
||||
],
|
||||
"cwd": "[CUSTOM_/_B_WORK]",
|
||||
"env": {
|
||||
"GIT_HTTP_LOW_SPEED_LIMIT": "1000",
|
||||
"GIT_HTTP_LOW_SPEED_TIME": "300",
|
||||
"PATH": "%(PATH)s: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@ \"parent_repo\": \"abc123\"@@@",
|
||||
"@@@STEP_LOG_LINE@json.output@ }, @@@",
|
||||
"@@@STEP_LOG_LINE@json.output@ \"manifest\": {@@@",
|
||||
"@@@STEP_LOG_LINE@json.output@ \"parent_repo\": {@@@",
|
||||
"@@@STEP_LOG_LINE@json.output@ \"repository\": \"https://fake.org/parent_repo.git\", @@@",
|
||||
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"354f9075936db3e1e855a48538d2f8555b37ac5a\"@@@",
|
||||
"@@@STEP_LOG_LINE@json.output@ }@@@",
|
||||
"@@@STEP_LOG_LINE@json.output@ }, @@@",
|
||||
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
|
||||
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"skia\", @@@",
|
||||
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
|
||||
"@@@STEP_LOG_LINE@json.output@ \"got_revision\": \"354f9075936db3e1e855a48538d2f8555b37ac5a\", @@@",
|
||||
"@@@STEP_LOG_LINE@json.output@ \"got_revision_cp\": \"refs/heads/master@{#106773}\"@@@",
|
||||
"@@@STEP_LOG_LINE@json.output@ }, @@@",
|
||||
"@@@STEP_LOG_LINE@json.output@ \"root\": \"parent_repo\", @@@",
|
||||
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
|
||||
"@@@STEP_LOG_LINE@json.output@}@@@",
|
||||
"@@@STEP_LOG_END@json.output@@@",
|
||||
"@@@SET_BUILD_PROPERTY@got_revision@\"354f9075936db3e1e855a48538d2f8555b37ac5a\"@@@",
|
||||
"@@@SET_BUILD_PROPERTY@got_revision_cp@\"refs/heads/master@{#106773}\"@@@"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "$result",
|
||||
"recipe_result": null,
|
||||
"status_code": 0
|
||||
}
|
||||
]
|
@ -101,3 +101,26 @@ def GenTests(api):
|
||||
swarm_out_dir='[SWARM_OUT_DIR]') +
|
||||
api.path.exists(api.path['start_dir'].join('skp_output'))
|
||||
)
|
||||
|
||||
buildername = 'Build-Ubuntu-GCC-x86_64-Release'
|
||||
yield (
|
||||
api.test('cross_repo_trybot') +
|
||||
api.properties(
|
||||
repository='https://skia.googlesource.com/parent_repo.git',
|
||||
buildername=buildername,
|
||||
path_config='kitchen',
|
||||
swarm_out_dir='[SWARM_OUT_DIR]',
|
||||
revision='abc123',
|
||||
patch_issue=500,
|
||||
patch_repo='https://skia.googlesource.com/skia.git',
|
||||
patch_set=1,
|
||||
patch_storage='gerrit') +
|
||||
api.properties.tryserver(
|
||||
buildername=buildername,
|
||||
gerrit_project='skia',
|
||||
gerrit_url='https://skia-review.googlesource.com/',
|
||||
) +
|
||||
api.path.exists(
|
||||
api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
|
||||
)
|
||||
)
|
||||
|
@ -178,6 +178,7 @@ def GenTests(api):
|
||||
swarm_out_dir='[SWARM_OUT_DIR]',
|
||||
revision='abc123',
|
||||
patch_issue=500,
|
||||
patch_repo='https://skia.googlesource.com/skia.git',
|
||||
patch_set=1,
|
||||
patch_storage='gerrit') +
|
||||
api.properties.tryserver(
|
||||
@ -200,6 +201,7 @@ def GenTests(api):
|
||||
swarm_out_dir='[SWARM_OUT_DIR]',
|
||||
revision='abc123',
|
||||
patch_issue=500,
|
||||
patch_repo='https://skia.googlesource.com/skia.git',
|
||||
patch_set=1,
|
||||
patch_storage='gerrit') +
|
||||
api.properties.tryserver(
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user