Repository navigation
Add advisory enforcement mode to Tier 1 reusable workflow - #431
Conversation
rng1995
left a comment
There was a problem hiding this comment.
Found two issues: advisory mode suppresses runtime failures as well as policy verdicts, and the onboarding example passes an unsupported input to the release-pinned workflow. Focused validation: tests/ci/test_evaluate_workflow.py passes (10 tests); reproduced a Docker startup failure with exit 125 and no retained reports using the actual scan shell.
rng1995
left a comment
There was a problem hiding this comment.
Review of the advisory enforcement mode: 6 inline comments. The main concern is that continue-on-error in advisory mode also hides configuration and infrastructure failures, not just a failing verdict.
|
@rng1995 Thanks for the advisory-mode update — the direction makes total sense. I still see one gap that affects adoption: incomplete scan failures remain blocking and often don’t provide enough actionable detail for downstream users. I resorted to run this diagnostic when scan was incomplete to understand where the exceptions were thrown for evaluated skills Could we keep current fail/strictness but improve diagnostics for incomplete/runtime paths? Some suggestions
|
|
@pt-bhavsar thanks for this PR. Two things are needed before it can merge:
The Package check failure doesn't look related to your change. The wheel smoke test passes locally on this branch, and the check will re-run after you push. |
chrisknvidia
left a comment
There was a problem hiding this comment.
Thanks for the work on this, and for the notes about incomplete scans. The earlier review points are all handled in the current head: the Docker step stays blocking, the mode is validated first, the downgrade only happens inside run_tier1.py after the reports are validated and rendered, and the new tests run the real shell steps and runner paths. Strict mode passes the same arguments to the image as before, and an older image rejects --enforcement-mode instead of ignoring it, so that fails closed.
What is left before this can merge:
- DCO: commit d273ad8 has no Signed-off-by line.
git rebase --signoff origin/main && git push --force-with-leasefixes it and is also where you resolve the next point. - CHANGELOG.md conflicts with main (both sides added bullets at the top of Unreleased > Added). Keep both. Main also reworked docs/github-actions.mdx, so please check where the advisory text lands after the rebase.
- The Package check failed in the wheel smoke-test step. This PR does not touch anything that goes into the wheel and the same step passed on other runs at the time, so it looks like a one-off. It should go green when CI runs again on the rebased branch; if not, let us know.
- Advisory mode and the hosted-report publisher: with a failing verdict the run now ends as success, but ci/publish_reports.py rejects a run whose conclusion is success when summary.json says overall_passed is false ("The workflow conclusion contradicts the report artifact verdict"). So an advisory run with a failing skill will not get a hosted report or PR comment. Either record the downgrade in summary.json and teach the publisher to accept that combination (with a test), or say in the docs that advisory mode does not publish hosted reports yet.
Smaller things, not blocking: add an enforcement-mode row to the input table in ci/README.md; finding annotations are still ::error in advisory mode, so you get red annotations on a green check; and the CHANGELOG bullet can drop the leading word 'Unreleased'.
On improving diagnostics for incomplete scans: that sounds useful, but it is separate from #396, which asks for those failures to stay blocking (and this PR keeps them blocking). A follow-up issue for a failure class in summary.json and a short 'why this failed' section would be a good home for it.
Refs NVIDIA#396 Co-authored-by: Copilot App <[email protected]> Signed-off-by: Prashant Bhavsar <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]> Signed-off-by: Prashant Bhavsar <[email protected]>
4297ddc to
f5922ee
Compare
Record advisory downgrade metadata in summary output, allow publisher success+failed only when marked as advisory downgrade, and add coverage for both accepted/rejected paths plus advisory warning annotations. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Prashant Bhavsar <[email protected]>
chrisknvidia
left a comment
There was a problem hiding this comment.
Re-reviewed at 43cb1b6. The runtime-failure fix and the publisher change look right:
downgradedis set only when every row ispassed/failed, has noincomplete_scans, exit code 0 or 1, and noerror. Configuration errors, skipped selections and checkpoints always recorddowngraded: false.validate_summaryrejects malformedenforcementmetadata anddowngraded: trueunless the verdict is failed and the mode is advisory.publishaccepts a success conclusion only for that combination. A strict failure with a success conclusion is still rejected (test_publish_rejects_success_conclusion_without_advisory_downgrade).- Finding annotations are
::warningin advisory mode and::errorin strict mode. - Every commit has a DCO sign-off, and the branch is behind
mainbut has no conflicts.
Checked locally: tests/ci/test_evaluate_workflow.py, test_run_tier1.py, test_publish_reports.py and test_image_build.py pass (418), and ruff check is clean.
Two small things:
- The docs paragraph about the hosted-report publisher is now out of date (inline).
- Nit:
ruff format --check tests/ci/test_publish_reports.pywants to wrap the two longarchive([...])lines in the new advisory publisher tests.make lintdoesn't run the formatter, so CI won't catch it, but the rest of the file is formatted.
Update GitHub Actions docs to match advisory downgrade publication behavior and apply formatter wrapping in publisher tests. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Prashant Bhavsar <[email protected]>
a53d5b6 to
d02cab3
Compare
rng1995
left a comment
There was a problem hiding this comment.
Re-checked all eight earlier comments at ebea9ea against the workflow shell and the runner, and each one is addressed: enforcement-mode is validated before checkout, advisory mode no longer hides input or runner errors, strict mode fails in the scan step itself, the docs and onboarding example match the inputs, the new tests exercise the real step scripts, and the CHANGELOG entry sits under Unreleased. Approving.
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Thank you @pt-bhavsar for your contribution and for your patience throughout the review process. The advisory enforcement behavior and remaining documentation feedback are addressed, and the PR merges cleanly with main. Verified 418 focused workflow, runner, publisher and image tests, Ruff, and Fern documentation validation. Approved; auto-merge will remain subject to the required CI checks.
Thank you @rng1995 and @chrisknvidia I appreciate your support. |
Summary
Add
enforcement-mode: strict|advisoryto the Tier 1 reusable workflow, defaulting tostrict.Closes #396.
Verification
make lint— passedmake test— attempted; blocked during collection by 52 import errors for missing optional Harbor/provider dependencies (harbor,openai,anthropic,botocore,toml)make build— passedFocused validation:
python -m pytest tests/ci/test_evaluate_workflow.py tests/ci/test_run_tier1.py tests/ci/test_image_build.py -q— 172 passed.fern check— 0 errors, 1 warning.git diff --check— passed.Release Impact
CHANGELOG.md