static_checks: Skip docs on WIP changes on CQ+1
Don't fail on lack of docs for WIP changes unless on CQ+2.
Change-Id: I776acef8c8dee5f6dbf7bef5285983cf70e3f646
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/218371
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Taylor Cramer <cramertj@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
diff --git a/recipes/static_checks.expected/docs.wip_dry_run.json b/recipes/static_checks.expected/docs.wip_dry_run.json
new file mode 100644
index 0000000..ae10cd5
--- /dev/null
+++ b/recipes/static_checks.expected/docs.wip_dry_run.json
@@ -0,0 +1,299 @@
+[
+ {
+ "cmd": [],
+ "name": "ensure infra/tools/luci/gerrit/${platform}"
+ },
+ {
+ "cmd": [],
+ "name": "ensure infra/tools/luci/gerrit/${platform}.get packages",
+ "~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/cipd.ensure",
+ "/path/to/tmp/"
+ ],
+ "infra_step": true,
+ "luci_context": {
+ "realm": {
+ "name": "project:try"
+ },
+ "resultdb": {
+ "current_invocation": {
+ "name": "invocations/build:8945511751514863184",
+ "update_token": "token"
+ },
+ "hostname": "rdbhost"
+ }
+ },
+ "name": "ensure infra/tools/luci/gerrit/${platform}.get packages.read ensure file",
+ "~followup_annotations": [
+ "@@@STEP_NEST_LEVEL@2@@@",
+ "@@@STEP_LOG_LINE@cipd.ensure@infra/tools/luci/gerrit/${platform} version:pinned-version@@@",
+ "@@@STEP_LOG_END@cipd.ensure@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "ensure infra/tools/luci/gerrit/${platform}.install infra/tools/luci/gerrit",
+ "~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",
+ "0o777",
+ "[START_DIR]/cipd_tool/infra/tools/luci/gerrit/0e548aa33f8113a45a5b3b62201e114e98e63d00f97296912380138f44597b07"
+ ],
+ "infra_step": true,
+ "luci_context": {
+ "realm": {
+ "name": "project:try"
+ },
+ "resultdb": {
+ "current_invocation": {
+ "name": "invocations/build:8945511751514863184",
+ "update_token": "token"
+ },
+ "hostname": "rdbhost"
+ }
+ },
+ "name": "ensure infra/tools/luci/gerrit/${platform}.install infra/tools/luci/gerrit.ensure package directory",
+ "~followup_annotations": [
+ "@@@STEP_NEST_LEVEL@2@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "cipd",
+ "ensure",
+ "-root",
+ "[START_DIR]/cipd_tool/infra/tools/luci/gerrit/0e548aa33f8113a45a5b3b62201e114e98e63d00f97296912380138f44597b07",
+ "-ensure-file",
+ "infra/tools/luci/gerrit/${platform} version:pinned-version",
+ "-max-threads",
+ "0",
+ "-json-output",
+ "/path/to/tmp/json"
+ ],
+ "infra_step": true,
+ "luci_context": {
+ "realm": {
+ "name": "project:try"
+ },
+ "resultdb": {
+ "current_invocation": {
+ "name": "invocations/build:8945511751514863184",
+ "update_token": "token"
+ },
+ "hostname": "rdbhost"
+ }
+ },
+ "name": "ensure infra/tools/luci/gerrit/${platform}.install infra/tools/luci/gerrit.ensure_installed",
+ "~followup_annotations": [
+ "@@@STEP_NEST_LEVEL@2@@@",
+ "@@@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\": \"infra/tools/luci/gerrit/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": [
+ "[START_DIR]/cipd_tool/infra/tools/luci/gerrit/0e548aa33f8113a45a5b3b62201e114e98e63d00f97296912380138f44597b07/gerrit",
+ "change-detail",
+ "-host",
+ "https://pigweed-review.googlesource.com",
+ "-input",
+ "{\"change_id\": \"123456\", \"params\": {\"o\": [\"ALL_COMMITS\", \"ALL_REVISIONS\", \"ALL_FILES\"]}}",
+ "-output",
+ "/path/to/tmp/json"
+ ],
+ "infra_step": true,
+ "luci_context": {
+ "realm": {
+ "name": "project:try"
+ },
+ "resultdb": {
+ "current_invocation": {
+ "name": "invocations/build:8945511751514863184",
+ "update_token": "token"
+ },
+ "hostname": "rdbhost"
+ }
+ },
+ "name": "change details",
+ "timeout": 600,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@json.output@{@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"_number\": 1234,@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"current_revision\": \"HASH\",@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"labels\": {},@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"owner\": {@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"email\": \"nobody@example.com\"@@@",
+ "@@@STEP_LOG_LINE@json.output@ },@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"revert_of\": 0,@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"revisions\": {@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"HASH\": {@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"_number\": 1,@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"commit\": {@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"message\": \"\",@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"parents\": [@@@",
+ "@@@STEP_LOG_LINE@json.output@ {@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"commit\": \"PARENT\"@@@",
+ "@@@STEP_LOG_LINE@json.output@ }@@@",
+ "@@@STEP_LOG_LINE@json.output@ ],@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"subject\": \"\"@@@",
+ "@@@STEP_LOG_LINE@json.output@ },@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"description\": \"\",@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"files\": {}@@@",
+ "@@@STEP_LOG_LINE@json.output@ }@@@",
+ "@@@STEP_LOG_LINE@json.output@ },@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"work_in_progress\": true@@@",
+ "@@@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@ \"ALL_FILES\"@@@",
+ "@@@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://pigweed-review.googlesource.com/q/123456@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "[START_DIR]/cipd_tool/infra/tools/luci/gerrit/0e548aa33f8113a45a5b3b62201e114e98e63d00f97296912380138f44597b07/gerrit",
+ "list-change-comments",
+ "-host",
+ "https://pigweed-review.googlesource.com",
+ "-input",
+ "{\"change_id\": \"123456\"}",
+ "-output",
+ "/path/to/tmp/json"
+ ],
+ "infra_step": true,
+ "luci_context": {
+ "realm": {
+ "name": "project:try"
+ },
+ "resultdb": {
+ "current_invocation": {
+ "name": "invocations/build:8945511751514863184",
+ "update_token": "token"
+ },
+ "hostname": "rdbhost"
+ }
+ },
+ "name": "list change comments",
+ "timeout": 600,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@json.output@{@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"/PATCHSET_LEVEL\": [@@@",
+ "@@@STEP_LOG_LINE@json.output@ {@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"message\": \"\"@@@",
+ "@@@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@}@@@",
+ "@@@STEP_LOG_END@json.input@@@",
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/123456@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "TRYJOB DO NOT RETRY",
+ "~followup_annotations": [
+ "@@@SET_BUILD_PROPERTY@$recipe_engine/cq/output@{\"retry\": \"OUTPUT_RETRY_DENIED\"}@@@",
+ "@@@SET_BUILD_PROPERTY@do_not_retry@true@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "checking if revert",
+ "~followup_annotations": [
+ "@@@STEP_SUMMARY_TEXT@0@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "checking owner account",
+ "~followup_annotations": [
+ "@@@STEP_SUMMARY_TEXT@nobody@example.com@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "check docs"
+ },
+ {
+ "cmd": [],
+ "name": "check docs.checking comments",
+ "~followup_annotations": [
+ "@@@STEP_NEST_LEVEL@1@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "check docs.checking comments.comment (0)",
+ "~followup_annotations": [
+ "@@@STEP_NEST_LEVEL@2@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "check docs.checking changed files",
+ "~followup_annotations": [
+ "@@@STEP_NEST_LEVEL@1@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "check docs.failure",
+ "~followup_annotations": [
+ "@@@STEP_NEST_LEVEL@1@@@",
+ "@@@STEP_SUMMARY_TEXT@No *.rst or *.md changes in CL and no exception applies. Add docs or explain why they're not needed in a Gerrit comment with \"No-Docs-Update-Reason: <reason>\".@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "check requires"
+ },
+ {
+ "cmd": [],
+ "name": "check dns"
+ },
+ {
+ "name": "$result"
+ }
+]
\ No newline at end of file
diff --git a/recipes/static_checks.expected/docs.wip_full_run.json b/recipes/static_checks.expected/docs.wip_full_run.json
new file mode 100644
index 0000000..48b0c6a
--- /dev/null
+++ b/recipes/static_checks.expected/docs.wip_full_run.json
@@ -0,0 +1,290 @@
+[
+ {
+ "cmd": [],
+ "name": "ensure infra/tools/luci/gerrit/${platform}"
+ },
+ {
+ "cmd": [],
+ "name": "ensure infra/tools/luci/gerrit/${platform}.get packages",
+ "~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/cipd.ensure",
+ "/path/to/tmp/"
+ ],
+ "infra_step": true,
+ "luci_context": {
+ "realm": {
+ "name": "project:try"
+ },
+ "resultdb": {
+ "current_invocation": {
+ "name": "invocations/build:8945511751514863184",
+ "update_token": "token"
+ },
+ "hostname": "rdbhost"
+ }
+ },
+ "name": "ensure infra/tools/luci/gerrit/${platform}.get packages.read ensure file",
+ "~followup_annotations": [
+ "@@@STEP_NEST_LEVEL@2@@@",
+ "@@@STEP_LOG_LINE@cipd.ensure@infra/tools/luci/gerrit/${platform} version:pinned-version@@@",
+ "@@@STEP_LOG_END@cipd.ensure@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "ensure infra/tools/luci/gerrit/${platform}.install infra/tools/luci/gerrit",
+ "~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",
+ "0o777",
+ "[START_DIR]/cipd_tool/infra/tools/luci/gerrit/0e548aa33f8113a45a5b3b62201e114e98e63d00f97296912380138f44597b07"
+ ],
+ "infra_step": true,
+ "luci_context": {
+ "realm": {
+ "name": "project:try"
+ },
+ "resultdb": {
+ "current_invocation": {
+ "name": "invocations/build:8945511751514863184",
+ "update_token": "token"
+ },
+ "hostname": "rdbhost"
+ }
+ },
+ "name": "ensure infra/tools/luci/gerrit/${platform}.install infra/tools/luci/gerrit.ensure package directory",
+ "~followup_annotations": [
+ "@@@STEP_NEST_LEVEL@2@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "cipd",
+ "ensure",
+ "-root",
+ "[START_DIR]/cipd_tool/infra/tools/luci/gerrit/0e548aa33f8113a45a5b3b62201e114e98e63d00f97296912380138f44597b07",
+ "-ensure-file",
+ "infra/tools/luci/gerrit/${platform} version:pinned-version",
+ "-max-threads",
+ "0",
+ "-json-output",
+ "/path/to/tmp/json"
+ ],
+ "infra_step": true,
+ "luci_context": {
+ "realm": {
+ "name": "project:try"
+ },
+ "resultdb": {
+ "current_invocation": {
+ "name": "invocations/build:8945511751514863184",
+ "update_token": "token"
+ },
+ "hostname": "rdbhost"
+ }
+ },
+ "name": "ensure infra/tools/luci/gerrit/${platform}.install infra/tools/luci/gerrit.ensure_installed",
+ "~followup_annotations": [
+ "@@@STEP_NEST_LEVEL@2@@@",
+ "@@@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\": \"infra/tools/luci/gerrit/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": [
+ "[START_DIR]/cipd_tool/infra/tools/luci/gerrit/0e548aa33f8113a45a5b3b62201e114e98e63d00f97296912380138f44597b07/gerrit",
+ "change-detail",
+ "-host",
+ "https://pigweed-review.googlesource.com",
+ "-input",
+ "{\"change_id\": \"123456\", \"params\": {\"o\": [\"ALL_COMMITS\", \"ALL_REVISIONS\", \"ALL_FILES\"]}}",
+ "-output",
+ "/path/to/tmp/json"
+ ],
+ "infra_step": true,
+ "luci_context": {
+ "realm": {
+ "name": "project:try"
+ },
+ "resultdb": {
+ "current_invocation": {
+ "name": "invocations/build:8945511751514863184",
+ "update_token": "token"
+ },
+ "hostname": "rdbhost"
+ }
+ },
+ "name": "change details",
+ "timeout": 600,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@json.output@{@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"_number\": 1234,@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"current_revision\": \"HASH\",@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"labels\": {},@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"owner\": {@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"email\": \"nobody@example.com\"@@@",
+ "@@@STEP_LOG_LINE@json.output@ },@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"revert_of\": 0,@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"revisions\": {@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"HASH\": {@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"_number\": 1,@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"commit\": {@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"message\": \"\",@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"parents\": [@@@",
+ "@@@STEP_LOG_LINE@json.output@ {@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"commit\": \"PARENT\"@@@",
+ "@@@STEP_LOG_LINE@json.output@ }@@@",
+ "@@@STEP_LOG_LINE@json.output@ ],@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"subject\": \"\"@@@",
+ "@@@STEP_LOG_LINE@json.output@ },@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"description\": \"\",@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"files\": {}@@@",
+ "@@@STEP_LOG_LINE@json.output@ }@@@",
+ "@@@STEP_LOG_LINE@json.output@ },@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"work_in_progress\": true@@@",
+ "@@@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@ \"ALL_FILES\"@@@",
+ "@@@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://pigweed-review.googlesource.com/q/123456@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "[START_DIR]/cipd_tool/infra/tools/luci/gerrit/0e548aa33f8113a45a5b3b62201e114e98e63d00f97296912380138f44597b07/gerrit",
+ "list-change-comments",
+ "-host",
+ "https://pigweed-review.googlesource.com",
+ "-input",
+ "{\"change_id\": \"123456\"}",
+ "-output",
+ "/path/to/tmp/json"
+ ],
+ "infra_step": true,
+ "luci_context": {
+ "realm": {
+ "name": "project:try"
+ },
+ "resultdb": {
+ "current_invocation": {
+ "name": "invocations/build:8945511751514863184",
+ "update_token": "token"
+ },
+ "hostname": "rdbhost"
+ }
+ },
+ "name": "list change comments",
+ "timeout": 600,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@json.output@{@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"/PATCHSET_LEVEL\": [@@@",
+ "@@@STEP_LOG_LINE@json.output@ {@@@",
+ "@@@STEP_LOG_LINE@json.output@ \"message\": \"\"@@@",
+ "@@@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@}@@@",
+ "@@@STEP_LOG_END@json.input@@@",
+ "@@@STEP_LINK@gerrit link@https://pigweed-review.googlesource.com/q/123456@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "TRYJOB DO NOT RETRY",
+ "~followup_annotations": [
+ "@@@SET_BUILD_PROPERTY@$recipe_engine/cq/output@{\"retry\": \"OUTPUT_RETRY_DENIED\"}@@@",
+ "@@@SET_BUILD_PROPERTY@do_not_retry@true@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "checking if revert",
+ "~followup_annotations": [
+ "@@@STEP_SUMMARY_TEXT@0@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "checking owner account",
+ "~followup_annotations": [
+ "@@@STEP_SUMMARY_TEXT@nobody@example.com@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "check docs",
+ "~followup_annotations": [
+ "@@@STEP_FAILURE@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "check docs.checking comments",
+ "~followup_annotations": [
+ "@@@STEP_NEST_LEVEL@1@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "check docs.checking comments.comment (0)",
+ "~followup_annotations": [
+ "@@@STEP_NEST_LEVEL@2@@@"
+ ]
+ },
+ {
+ "cmd": [],
+ "name": "check docs.checking changed files",
+ "~followup_annotations": [
+ "@@@STEP_NEST_LEVEL@1@@@"
+ ]
+ },
+ {
+ "failure": {
+ "failure": {},
+ "humanReason": "No *.rst or *.md changes in CL and no exception applies. Add docs or explain why they're not needed in a Gerrit comment with \"No-Docs-Update-Reason: <reason>\"."
+ },
+ "name": "$result"
+ }
+]
\ No newline at end of file
diff --git a/recipes/static_checks.py b/recipes/static_checks.py
index 5b9bab4..d9b3a01 100644
--- a/recipes/static_checks.py
+++ b/recipes/static_checks.py
@@ -109,13 +109,22 @@
'"No-Docs-Update-Reason: <reason>".'
)
- if api.cv.active and api.cv.run_mode == api.cv.NEW_PATCHSET_RUN:
- with api.step.nest('failure') as pres:
- pres.status == 'FAILURE'
- pres.step_summary_text = error
- else:
+ raise_failure = True
+ if api.cv.active and api.cv.run_mode != api.cv.FULL_RUN:
+ if details.get("work_in_progress"):
+ raise_failure = False
+
+ if api.cv.run_mode == api.cv.NEW_PATCHSET_RUN:
+ raise_failure = False
+
+ if raise_failure:
raise api.step.StepFailure(error)
+ pres = api.step.empty('failure', raise_on_failure=False).presentation
+ pres.status == 'FAILURE'
+ pres.step_summary_text = error
+ return
+
@nest_step
def _check_requires(
@@ -319,6 +328,7 @@
owner='nobody@example.com',
revert_of=0,
votes=None,
+ work_in_progress=None,
):
labels = {}
if votes:
@@ -331,40 +341,44 @@
if isinstance(files, (list, tuple)):
files = {x: {'lines_inserted': 20, 'lines_deleted': 20} for x in files}
- return api.step_data(
- 'change details',
- api.json.output(
- {
- 'current_revision': 'HASH',
- 'revisions': {
- 'HASH': {
- '_number': 1,
- 'commit': {
- 'subject': msg.split('\n')[0],
- 'message': msg,
- 'parents': [
- {
- 'commit': 'PARENT',
- }
- ],
- },
- 'files': files,
- 'description': description,
- }
+ details = {
+ 'current_revision': 'HASH',
+ 'revisions': {
+ 'HASH': {
+ '_number': 1,
+ 'commit': {
+ 'subject': msg.split('\n')[0],
+ 'message': msg,
+ 'parents': [
+ {
+ 'commit': 'PARENT',
+ }
+ ],
},
- 'owner': {'email': owner},
- 'revert_of': revert_of,
- 'labels': labels,
- '_number': 1234,
- },
- ),
- )
+ 'files': files,
+ 'description': description,
+ }
+ },
+ 'owner': {'email': owner},
+ 'revert_of': revert_of,
+ 'labels': labels,
+ '_number': 1234,
+ }
+
+ if work_in_progress:
+ details['work_in_progress'] = work_in_progress
+
+ return api.step_data('change details', api.json.output(details))
def must_run(api, step):
return api.post_process(post_process.MustRun, step)
+def does_not_run(api, step):
+ return api.post_process(post_process.DoesNotRun, step)
+
+
def requires_tests(api):
def check_num_warnings(n):
if not n:
@@ -540,6 +554,20 @@
+ must_run(api, 'checking if revert.ignored')
)
+ yield (
+ test('wip_dry_run', work_in_progress=True)
+ + api.cv(run_mode='DRY_RUN')
+ + api.checkout.try_test_data()
+ + must_run(api, 'check docs.failure')
+ )
+
+ yield (
+ test('wip_full_run', work_in_progress=True, status='FAILURE')
+ + api.cv(run_mode='FULL_RUN')
+ + api.checkout.try_test_data()
+ + does_not_run(api, 'check_docs.failure')
+ )
+
def readability_tests(api):
def test(name, msg='', status='SUCCESS', **kwargs):