Revert "Fail tricium jobs that generate comments."
This reverts commit 3e006c26b817349e2c78434dbc5de380d22ae04a.
Reason for revert: If the build fails tricium is not posting comments.
Original change's description:
> Fail tricium jobs that generate comments.
>
> Currently the tricium jobs always pass independently of whether they
> post comments or not.
>
> Change-Id: Ia09e7c0f1f171fcced92d224ad9006f7dc4c4893
> Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/43840
> Reviewed-by: Ricardo Amador <ricardoamador@google.com>
> Commit-Queue: Godofredo Contreras <godofredoc@google.com>
> Reviewed-by: Keyong Han <keyonghan@google.com>
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Iaa11ec515cea72157c2922af2ad14d9b2466e338
Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/44006
Reviewed-by: Xilai Zhang <xilaizhang@google.com>
diff --git a/recipes/tricium/tricium.expected/failure.json b/recipes/tricium/tricium.expected/basic.json
similarity index 98%
rename from recipes/tricium/tricium.expected/failure.json
rename to recipes/tricium/tricium.expected/basic.json
index d2363a0..c7090e9 100644
--- a/recipes/tricium/tricium.expected/failure.json
+++ b/recipes/tricium/tricium.expected/basic.json
@@ -1090,14 +1090,10 @@
"cmd": [],
"name": "write results",
"~followup_annotations": [
- "@@@SET_BUILD_PROPERTY@tricium@\"{\\n\\\"comments\\\": [\\n{\\n\\\"category\\\": \\\"Format/YAPF\\\",\\n\\\"message\\\": \\\"File not formatted properly.\\\\nRun the following to format:\\\\n\\\\nyapf --in-place engine.py\\\",\\n\\\"path\\\": \\\"engine.py\\\"\\n}\\n]\\n}\"@@@"
+ "@@@SET_BUILD_PROPERTY@tricium@\"{\\n\\\"comments\\\": [\\n{\\n\\\"category\\\": \\\"Format/YAPF\\\",\\n\\\"message\\\": \\\"File not formatted properly.\\\\nRun the following to format:\\\\n\\\\nfx format-code --files=engine.py\\\",\\n\\\"path\\\": \\\"engine.py\\\"\\n}\\n]\\n}\"@@@"
]
},
{
- "failure": {
- "failure": {},
- "humanReason": "Please analyzer comments"
- },
"name": "$result"
}
]
\ No newline at end of file
diff --git a/recipes/tricium/tricium.expected/success.json b/recipes/tricium/tricium.expected/success.json
deleted file mode 100644
index c05f5b1..0000000
--- a/recipes/tricium/tricium.expected/success.json
+++ /dev/null
@@ -1,1099 +0,0 @@
-[
- {
- "cmd": [],
- "name": "checkout"
- },
- {
- "cmd": [
- "vpython3",
- "-u",
- "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
- "--json-output",
- "/path/to/tmp/json",
- "ensure-directory",
- "--mode",
- "0777",
- "[START_DIR]/recipes"
- ],
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.makedirs",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "init"
- ],
- "cwd": "[START_DIR]/recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.git init",
- "timeout": 60.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "remote",
- "add",
- "origin",
- "https://flutter.googlesource.com/recipes"
- ],
- "cwd": "[START_DIR]/recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.git remote",
- "timeout": 600.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "config",
- "fetch.uriprotocols",
- "https"
- ],
- "cwd": "[START_DIR]/recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.set fetch.uriprotocols",
- "timeout": 60.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@"
- ]
- },
- {
- "cmd": [],
- "name": "checkout.cache",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@"
- ]
- },
- {
- "cmd": [
- "vpython3",
- "-u",
- "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
- "--json-output",
- "/path/to/tmp/json",
- "ensure-directory",
- "--mode",
- "0777",
- "[CACHE]/git"
- ],
- "cwd": "[START_DIR]/recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.cache.ensure git cache dir",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@2@@@"
- ]
- },
- {
- "cmd": [
- "vpython3",
- "-u",
- "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
- "--json-output",
- "/path/to/tmp/json",
- "copy",
- "",
- "[CACHE]/git/.GUARD_FILE"
- ],
- "cwd": "[START_DIR]/recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.cache.write git cache guard file",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@2@@@"
- ]
- },
- {
- "cmd": [
- "vpython3",
- "-u",
- "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
- "--json-output",
- "/path/to/tmp/json",
- "ensure-directory",
- "--mode",
- "0777",
- "[CACHE]/git/flutter.googlesource.com-recipes"
- ],
- "cwd": "[START_DIR]/recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.cache.makedirs",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@2@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "init",
- "--bare"
- ],
- "cwd": "[CACHE]/git/flutter.googlesource.com-recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.cache.git init",
- "timeout": 60.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@2@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "config",
- "remote.origin.url",
- "https://flutter.googlesource.com/recipes"
- ],
- "cwd": "[CACHE]/git/flutter.googlesource.com-recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.cache.remote set-url",
- "timeout": 60.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@2@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "config",
- "fetch.uriprotocols",
- "https"
- ],
- "cwd": "[CACHE]/git/flutter.googlesource.com-recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.cache.set fetch.uriprotocols",
- "timeout": 60.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@2@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "config",
- "--replace-all",
- "remote.origin.fetch",
- "+refs/heads/*:refs/heads/*",
- "\\+refs/heads/\\*:.*"
- ],
- "cwd": "[CACHE]/git/flutter.googlesource.com-recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.cache.replace fetch configs",
- "timeout": 60.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@2@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "fetch",
- "--prune",
- "--tags",
- "--jobs",
- "4",
- "origin"
- ],
- "cwd": "[CACHE]/git/flutter.googlesource.com-recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.cache.git fetch",
- "timeout": 1200.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@2@@@"
- ]
- },
- {
- "cmd": [
- "vpython3",
- "-u",
- "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
- "--json-output",
- "/path/to/tmp/json",
- "ensure-directory",
- "--mode",
- "0777",
- "[START_DIR]/recipes/.git/objects/info"
- ],
- "cwd": "[START_DIR]/recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.cache.makedirs object/info",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@2@@@"
- ]
- },
- {
- "cmd": [
- "vpython3",
- "-u",
- "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
- "--json-output",
- "/path/to/tmp/json",
- "copy",
- "[CACHE]/git/flutter.googlesource.com-recipes/objects\n",
- "[START_DIR]/recipes/.git/objects/info/alternates"
- ],
- "cwd": "[START_DIR]/recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.cache.alternates",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@2@@@",
- "@@@STEP_LOG_LINE@alternates@[CACHE]/git/flutter.googlesource.com-recipes/objects@@@",
- "@@@STEP_LOG_END@alternates@@@"
- ]
- },
- {
- "cmd": [
- "vpython3",
- "-u",
- "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
- "--json-output",
- "/path/to/tmp/json",
- "remove",
- "[CACHE]/git/.GUARD_FILE"
- ],
- "cwd": "[START_DIR]/recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.cache.remove git cache guard file",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@2@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "fetch",
- "--tags",
- "--jobs",
- "4",
- "origin",
- "main"
- ],
- "cwd": "[START_DIR]/recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.git fetch",
- "timeout": 1200.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "checkout",
- "-f",
- "FETCH_HEAD"
- ],
- "cwd": "[START_DIR]/recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.git checkout",
- "timeout": 600.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "rev-parse",
- "HEAD"
- ],
- "cwd": "[START_DIR]/recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.git rev-parse",
- "timeout": 60.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "clean",
- "-f",
- "-d",
- "-x"
- ],
- "cwd": "[START_DIR]/recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.git clean",
- "timeout": 600.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@"
- ]
- },
- {
- "cmd": [],
- "name": "checkout.submodule",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "submodule",
- "sync"
- ],
- "cwd": "[START_DIR]/recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.submodule.git submodule sync",
- "timeout": 600.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@2@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "submodule",
- "update",
- "--init",
- "--jobs",
- "4"
- ],
- "cwd": "[START_DIR]/recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "checkout.submodule.git submodule update",
- "timeout": 600.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@2@@@"
- ]
- },
- {
- "cmd": [],
- "name": "ensure_packages"
- },
- {
- "cmd": [
- "cipd",
- "ensure",
- "-root",
- "[START_DIR]/cipd",
- "-ensure-file",
- "@Subdir go\nfuchsia/go/${platform} integration",
- "-max-threads",
- "0",
- "-json-output",
- "/path/to/tmp/json"
- ],
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "ensure_packages.ensure_installed",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@",
- "@@@STEP_LOG_LINE@json.output@{@@@",
- "@@@STEP_LOG_LINE@json.output@ \"result\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"go\": [@@@",
- "@@@STEP_LOG_LINE@json.output@ {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"instance_id\": \"resolved-instance_id-of-integration-----\", @@@",
- "@@@STEP_LOG_LINE@json.output@ \"package\": \"fuchsia/go/resolved-platform\"@@@",
- "@@@STEP_LOG_LINE@json.output@ }@@@",
- "@@@STEP_LOG_LINE@json.output@ ]@@@",
- "@@@STEP_LOG_LINE@json.output@ }@@@",
- "@@@STEP_LOG_LINE@json.output@}@@@",
- "@@@STEP_LOG_END@json.output@@@"
- ]
- },
- {
- "cmd": [],
- "name": "check commit tags"
- },
- {
- "cmd": [],
- "name": "check commit tags.ensure gerrit",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@"
- ]
- },
- {
- "cmd": [
- "vpython3",
- "-u",
- "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
- "--json-output",
- "/path/to/tmp/json",
- "copy",
- "RECIPE_MODULE[fuchsia::gerrit]/resources/tool_manifest.json",
- "/path/to/tmp/json"
- ],
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "check commit tags.ensure gerrit.read manifest",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@2@@@",
- "@@@STEP_LOG_LINE@tool_manifest.json@{@@@",
- "@@@STEP_LOG_LINE@tool_manifest.json@ \"path\": \"path/to/gerrit\",@@@",
- "@@@STEP_LOG_LINE@tool_manifest.json@ \"version\": \"version:pinned-version\"@@@",
- "@@@STEP_LOG_LINE@tool_manifest.json@}@@@",
- "@@@STEP_LOG_END@tool_manifest.json@@@"
- ]
- },
- {
- "cmd": [],
- "name": "check commit tags.ensure gerrit.install path/to/gerrit",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@2@@@"
- ]
- },
- {
- "cmd": [
- "vpython3",
- "-u",
- "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
- "--json-output",
- "/path/to/tmp/json",
- "ensure-directory",
- "--mode",
- "0777",
- "[START_DIR]/cipd_tool/path/to/gerrit/version%3Apinned-version"
- ],
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "check commit tags.ensure gerrit.install path/to/gerrit.ensure package directory",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@3@@@"
- ]
- },
- {
- "cmd": [
- "cipd",
- "ensure",
- "-root",
- "[START_DIR]/cipd_tool/path/to/gerrit/version%3Apinned-version",
- "-ensure-file",
- "path/to/gerrit version:pinned-version",
- "-max-threads",
- "0",
- "-json-output",
- "/path/to/tmp/json"
- ],
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "check commit tags.ensure gerrit.install path/to/gerrit.ensure_installed",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@3@@@",
- "@@@STEP_LOG_LINE@json.output@{@@@",
- "@@@STEP_LOG_LINE@json.output@ \"result\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"\": [@@@",
- "@@@STEP_LOG_LINE@json.output@ {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"instance_id\": \"resolved-instance_id-of-version:pinned-v\", @@@",
- "@@@STEP_LOG_LINE@json.output@ \"package\": \"path/to/gerrit\"@@@",
- "@@@STEP_LOG_LINE@json.output@ }@@@",
- "@@@STEP_LOG_LINE@json.output@ ]@@@",
- "@@@STEP_LOG_LINE@json.output@ }@@@",
- "@@@STEP_LOG_LINE@json.output@}@@@",
- "@@@STEP_LOG_END@json.output@@@"
- ]
- },
- {
- "cmd": [
- "[START_DIR]/cipd_tool/path/to/gerrit/version%3Apinned-version/gerrit",
- "change-detail",
- "-host",
- "https://fuchsia-review.googlesource.com",
- "-input",
- "{\"change_id\": \"123456\", \"params\": {\"o\": [\"ALL_COMMITS\", \"ALL_REVISIONS\"]}}",
- "-output",
- "/path/to/tmp/json"
- ],
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "check commit tags.get change details",
- "timeout": 600,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@",
- "@@@STEP_LOG_LINE@json.output@{@@@",
- "@@@STEP_LOG_LINE@json.output@ \"current_revision\": \"123abc\", @@@",
- "@@@STEP_LOG_LINE@json.output@ \"labels\": {}, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"revisions\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"123abc\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"_number\": 7, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"commit\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"message\": \"[foo] Add tests\"@@@",
- "@@@STEP_LOG_LINE@json.output@ }@@@",
- "@@@STEP_LOG_LINE@json.output@ }@@@",
- "@@@STEP_LOG_LINE@json.output@ }@@@",
- "@@@STEP_LOG_LINE@json.output@}@@@",
- "@@@STEP_LOG_END@json.output@@@",
- "@@@STEP_LOG_LINE@json.input@{@@@",
- "@@@STEP_LOG_LINE@json.input@ \"change_id\": \"123456\", @@@",
- "@@@STEP_LOG_LINE@json.input@ \"params\": {@@@",
- "@@@STEP_LOG_LINE@json.input@ \"o\": [@@@",
- "@@@STEP_LOG_LINE@json.input@ \"ALL_COMMITS\", @@@",
- "@@@STEP_LOG_LINE@json.input@ \"ALL_REVISIONS\"@@@",
- "@@@STEP_LOG_LINE@json.input@ ]@@@",
- "@@@STEP_LOG_LINE@json.input@ }@@@",
- "@@@STEP_LOG_LINE@json.input@}@@@",
- "@@@STEP_LOG_END@json.input@@@",
- "@@@STEP_LINK@gerrit link@https://fuchsia-review.googlesource.com/q/123456@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "log",
- "--oneline",
- "-n",
- "3"
- ],
- "cwd": "[START_DIR]/recipes",
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "git log"
- },
- {
- "cmd": [
- "git",
- "diff-tree",
- "--no-commit-id",
- "--name-only",
- "-r",
- "-z",
- "--diff-filter=d",
- "--ignore-submodules=all",
- "HEAD"
- ],
- "cwd": "[START_DIR]/recipes",
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "get changed files",
- "timeout": 60.0,
- "~followup_annotations": [
- "@@@STEP_LOG_LINE@files@[@@@",
- "@@@STEP_LOG_LINE@files@ \"engine.py\"@@@",
- "@@@STEP_LOG_LINE@files@]@@@",
- "@@@STEP_LOG_END@files@@@"
- ]
- },
- {
- "cmd": [],
- "name": "check for inclusivity"
- },
- {
- "cmd": [
- "vpython3",
- "-u",
- "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
- "--json-output",
- "/path/to/tmp/json",
- "copy",
- "[START_DIR]/recipes/engine.py",
- "/path/to/tmp/"
- ],
- "cwd": "[START_DIR]/recipes",
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "check for inclusivity.read engine.py",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "diff-tree",
- "--no-commit-id",
- "--diff-filter=d",
- "-U0",
- "HEAD",
- "--",
- "engine.py"
- ],
- "cwd": "[START_DIR]/recipes",
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "check for inclusivity.get change diff for engine.py",
- "timeout": 600.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@"
- ]
- },
- {
- "cmd": [],
- "name": "analyze engine.py"
- },
- {
- "cmd": [
- "git",
- "diff-tree",
- "--no-commit-id",
- "--diff-filter=d",
- "-U0",
- "HEAD",
- "--",
- "engine.py"
- ],
- "cwd": "[START_DIR]/recipes",
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "analyze engine.py.get change diff",
- "timeout": 600.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@",
- "@@@STEP_LOG_LINE@change_line_ranges@[Range(start=1, end=5)]@@@",
- "@@@STEP_LOG_END@change_line_ranges@@@"
- ]
- },
- {
- "cmd": [],
- "name": "analyze engine.py.yapf",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@"
- ]
- },
- {
- "cmd": [
- "[START_DIR]/cipd/yapf",
- "--in-place",
- "engine.py"
- ],
- "cwd": "[START_DIR]/recipes",
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "analyze engine.py.yapf.run",
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@2@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "diff-index",
- "--no-commit-id",
- "--diff-filter=d",
- "-U0",
- "HEAD",
- "--",
- "engine.py"
- ],
- "cwd": "[START_DIR]/recipes",
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "analyze engine.py.get formatted diff",
- "timeout": 600.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@",
- "@@@STEP_LOG_LINE@formatted_line_ranges@[]@@@",
- "@@@STEP_LOG_END@formatted_line_ranges@@@"
- ]
- },
- {
- "cmd": [
- "git",
- "reset",
- "--hard",
- "HEAD"
- ],
- "cwd": "[START_DIR]/recipes",
- "luci_context": {
- "realm": {
- "name": "fuchsia:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "analyze engine.py.reset",
- "timeout": 600.0,
- "~followup_annotations": [
- "@@@STEP_NEST_LEVEL@1@@@"
- ]
- },
- {
- "cmd": [],
- "name": "write results",
- "~followup_annotations": [
- "@@@SET_BUILD_PROPERTY@tricium@\"{}\"@@@"
- ]
- },
- {
- "name": "$result"
- }
-]
\ No newline at end of file
diff --git a/recipes/tricium/tricium.py b/recipes/tricium/tricium.py
index 3fdbe30..c62035b 100644
--- a/recipes/tricium/tricium.py
+++ b/recipes/tricium/tricium.py
@@ -1,12 +1,12 @@
# Copyright 2020 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-
"""Recipe for running Tricium analyzers."""
import functools
import collections
+from recipe_engine.post_process import MustRun
from PB.recipes.fuchsia.tricium.tricium import InputProperties
DEPS = [
@@ -29,61 +29,59 @@
# is unspecified, or explicitly set.
TRICIUM_GIT_ATTR = "tricium"
+
# Namedtuple to simulate a class generated by jiri checkout because flutter is
# not using jiri.
_CheckoutResult = collections.namedtuple(
'_CheckoutResult', ['root_dir', 'release_version']
)
-REMOTE = 'https://flutter.googlesource.com/recipes'
+REMOTE='https://flutter.googlesource.com/recipes'
def RunSteps(api, props):
- with api.context(infra_steps=True):
- checkout_path = api.path['start_dir'].join('recipes')
- api.git_checkout(REMOTE, path=checkout_path)
- # tricium is expecting a dictionary as a checkout.
- checkout = _CheckoutResult(checkout_path, '')
+ with api.context(infra_steps=True):
+ checkout_path = api.path['start_dir'].join('recipes')
+ api.git_checkout(REMOTE, path=checkout_path)
+ # tricium is expecting a dictionary as a checkout.
+ checkout = _CheckoutResult(checkout_path, '')
- # If specified, download CIPD packages.
- if props.cipd_packages:
- with api.step.nest("ensure_packages"):
- with api.context(infra_steps=True):
- cipd_dir = api.path['start_dir'].join("cipd")
- pkgs = api.cipd.EnsureFile()
- for package in props.cipd_packages:
- pkgs.add_package(package.name, package.version, subdir=package.subdir)
- api.cipd.ensure(cipd_dir, pkgs)
- api.tricium_analyze.yapf = cipd_dir.join("yapf")
+ # If specified, download CIPD packages.
+ if props.cipd_packages:
+ with api.step.nest("ensure_packages"):
+ with api.context(infra_steps=True):
+ cipd_dir = api.path['start_dir'].join("cipd")
+ pkgs = api.cipd.EnsureFile()
+ for package in props.cipd_packages:
+ pkgs.add_package(
+ package.name, package.version, subdir=package.subdir
+ )
+ api.cipd.ensure(cipd_dir, pkgs)
+ api.tricium_analyze.yapf = cipd_dir.join("yapf")
- api.tricium_analyze.check_commit_message()
- with api.context(cwd=checkout_path):
- api.step('git log', ['git', 'log', '--oneline', '-n', '3'])
- paths = api.git.get_changed_files(
- "get changed files",
- deleted=False,
- # If we include submodules then the output will include the
- # directory paths of those submodules, but tricium_analyze operates
- # on files, not directories. If we ever want to analyze changes to
- # files within submodules, we can instead do a submodule-aware diff
- # to get the paths to changed files within the submodule.
- ignore_submodules=True,
- )
- api.tricium_analyze.checkout = checkout
-
- # Print yapf commands directly.
- api.tricium_analyze.suggest_fx = False
- api.tricium_analyze(
- paths,
- enabled_analyzers=props.analyses,
- enabled_luci_analyzers=props.luci_analyzers,
- )
- if api.tricium_analyze.has_comments:
- raise api.step.StepFailure('Please analyzer comments')
+ api.tricium_analyze.check_commit_message()
+ with api.context(cwd=checkout_path):
+ api.step('git log', ['git', 'log', '--oneline', '-n', '3'])
+ paths = api.git.get_changed_files(
+ "get changed files",
+ deleted=False,
+ # If we include submodules then the output will include the
+ # directory paths of those submodules, but tricium_analyze operates
+ # on files, not directories. If we ever want to analyze changes to
+ # files within submodules, we can instead do a submodule-aware diff
+ # to get the paths to changed files within the submodule.
+ ignore_submodules=True,
+ )
+ api.tricium_analyze.checkout = checkout
+ api.tricium_analyze(
+ paths,
+ enabled_analyzers=props.analyses,
+ enabled_luci_analyzers=props.luci_analyzers,
+ )
def GenTests(api):
- DIFF = """diff --git a/{0} b/{0}
+ DIFF = """diff --git a/{0} b/{0}
index e684c1e..a76a10e 100644
--- a/{0}
+++ b/{0}
@@ -91,62 +89,48 @@
+ foo
+ bar
"""
- NO_DIFF = ""
- def changed_files_data(files):
- return api.git.get_changed_files("get changed files", files)
+ def changed_files_data(files):
+ return api.git.get_changed_files("get changed files", files)
- def change_diff_data(filename):
- return api.step_data(
- f"analyze {filename}.get change diff",
- api.raw_io.stream_output_text(DIFF.format(filename)),
+ def change_diff_data(filename):
+ return api.step_data(
+ f"analyze {filename}.get change diff",
+ api.raw_io.stream_output_text(DIFF.format(filename)),
+ )
+
+ def formatted_diff_data(filename):
+ return api.step_data(
+ f"analyze {filename}.get formatted diff",
+ api.raw_io.stream_output_text(DIFF.format(filename)),
+ )
+
+ def properties(cipd_packages=(), **kwargs):
+ defaults = dict(
+ manifest="flower",
+ remote="https://fuchsia.googlesource.com/integration",
+ )
+ # Using CIPD packages implies that we don't need to do a build, and
+ # vice versa.
+ if cipd_packages:
+ defaults["cipd_packages"] = cipd_packages
+ defaults.update(kwargs)
+ return api.properties(**defaults)
+
+ yield api.test(
+ 'basic',
+ api.buildbucket_util.test("default", tryjob=True),
+ properties(
+ analyses=["yapf"],
+ cipd_packages=[
+ {
+ "name": "fuchsia/go/${platform}",
+ "version": "integration",
+ "subdir": "go",
+ }
+ ],
+ ),
+ changed_files_data(["engine.py"]),
+ change_diff_data("engine.py"),
+ formatted_diff_data("engine.py")
)
-
- def formatted_diff_data(filename, diff):
- return api.step_data(
- f"analyze {filename}.get formatted diff",
- api.raw_io.stream_output_text(diff.format(filename)),
- )
-
- def properties(cipd_packages=(), **kwargs):
- defaults = dict(
- manifest="flower",
- remote="https://fuchsia.googlesource.com/integration",
- )
- # Using CIPD packages implies that we don't need to do a build, and
- # vice versa.
- if cipd_packages:
- defaults["cipd_packages"] = cipd_packages
- defaults.update(kwargs)
- return api.properties(**defaults)
-
- yield api.test(
- 'failure',
- api.buildbucket_util.test("default", tryjob=True, status='FAILURE'),
- properties(
- analyses=["yapf"],
- cipd_packages=[{
- "name": "fuchsia/go/${platform}",
- "version": "integration",
- "subdir": "go",
- }],
- ),
- changed_files_data(["engine.py"]),
- change_diff_data("engine.py"),
- formatted_diff_data("engine.py", DIFF),
- )
- yield api.test(
- 'success',
- api.buildbucket_util.test("default", tryjob=True),
- properties(
- analyses=["yapf"],
- cipd_packages=[{
- "name": "fuchsia/go/${platform}",
- "version": "integration",
- "subdir": "go",
- }],
- ),
- changed_files_data(["engine.py"]),
- change_diff_data("engine.py"),
- formatted_diff_data("engine.py", NO_DIFF),
- )