Repository navigation
feat(reporting): add a GitHub Actions annotations report format - #794
Conversation
A GitHub job that runs the CLI itself had no way to print workflow commands for inline annotations. -r github writes ::error, ::warning, and ::notice lines on stdout, combined with other formats, without a report file. CRITICAL/HIGH map to error, MEDIUM/LOW to warning, INFO to notice. Gate failures stay errors. Incomplete scanners are warnings. Findings are capped at GitHub's 10 errors and 10 warnings per step, with the omitted count on a closing notice. Message and property text is escaped so a finding cannot start a new workflow command. Signed-off-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
A catalog validated each skill as its own run, so -r github printed a capped stream and a summary per skill with one worker, and nothing at all with --workers above 1, because each worker's CliRunner captured stdout. Catalog runs now collect each skill's annotations instead of printing them. Workers return theirs to the parent with their result. The parent prints one stream, capped at 10 errors and 10 warnings, and one summary for the whole catalog after every skill finishes. Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
The catalog adds metadata.id conflicts to its failures after every skill has rendered, so -r github summarized two skills that share a blocking metadata.id as "2 passed, 0 failed" while catalog-summary.json recorded 0 passed and 2 failed, and no annotation named the duplicate. The closing notice now counts each skill from the catalog's final failures. A skill failed by a catalog-level check counts as failed; one that failed only because its own scan did not complete stays incomplete. Duplicate metadata.id findings and discovery problems are annotated on the affected skill's SKILL.md in the same capped stream: errors when the policy blocks, warnings when it is advisory. Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
A catalog discovery failure for a linked skill directory pointed its GitHub annotation at a manifest beneath the link. Git tracks the link itself, so that path is not in the diff. Discovery failures now use the directory path relative to the catalog root, without probing it, so the annotation lands on the tracked link. Findings on ordinary skill directories keep their manifest location. Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
rng1995
left a comment
There was a problem hiding this comment.
Thanks for adding GitHub Actions annotations. I reviewed the reporter, CLI/catalog integration, escaping, caps and report composition; the focused reporter/CLI/golden suites passed (398 tests). Two CLI replays exposed remaining issues: advisory failures contradict the successful run status in the single-skill summary, and a linked-directory discovery error can still annotate its in-repository target. The new summary finding is inline, and the link case is a reply in the existing thread.
rng1995
left a comment
There was a problem hiding this comment.
Thanks @mvanhorn for this contribution! I reviewed 10fc0ba003. I reproduced the problem on main, confirmed this change fixes it, checked that the new tests fail on main, and ran the new and related tests on this head (all pass). I left 3 inline comments (1 P2, 2 P3), in addition to the advisory-count and in-repository link items already raised on this head; please address them before this is merged. The DCO check also fails because the head commit 10fc0ba003 has no Signed-off-by: trailer (git commit --amend -s and a force-push fixes it). The Tests (Python 3.14) failure is a timing assertion in tests/test_harbor_secure_docker_environment.py, which this PR does not touch.
Resolve the CHANGELOG.md conflict in the Unreleased section: keep upstream's new Changed entries and move the GitHub Actions annotation entry into the existing Added section. Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
… discovery errors A discovery failure for a linked skill directory whose target sits inside the same checkout was annotated on the resolved target. The discovery annotation now resolves only the link's parent directory, so it names the tracked link wherever the target points. Manifest-based catalog findings keep their existing path handling. Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
|
Two updates on this branch:
|
|
@mvanhorn - Please resolve the comments once you have fixed it. |
When a scanner records its stop reason with add_error() and then calls mark_scan_incomplete(), the GitHub reporter printed that reason twice: once as an ::error from independent_errors() and once as the ::warning for incomplete/<tool>. Skip independent errors that are the incomplete reason for a listed scanner, so each incomplete scanner yields only its warning, and assert no ::error in the CLI test. Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
…sible GitHub shows at most 10 notices per step. INFO findings now stop at nine notices so the closing summary is always the tenth, and dropped notices are counted in the summary's omitted total. The summary text, module docstring and docs now name the notice limit too. Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
…tHub warning A scanner that records several errors before it is marked incomplete, such as Bandit with more than one entry in its errors list, printed the first as its incomplete warning and the rest as ::error while the summary counted the skill as incomplete. On a group with an incomplete scan, every independent error that is not a gate failure is now a warning titled incomplete/<tool>. Gate failures stay errors. Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
|
@rng1995 Status on the review threads: the in-repo link, notice cap, and incomplete-scanner threads are fixed, and each has a reply with its commit. Since you opened those threads, I've left them for you to resolve once you've checked them. Not fixed yet: advisory failure counting (P2) and the "see the other reports" wording (P3). |
The summary notice counted every raw failed result, so a failed advisory group such as Tier 2 dedup under --no-block-on-dedup reported the skill as failed while the JSON overall_status and the exit code said passed. The counts now come from resolve_run_status's headline, which ignores nonblocking groups and keeps a required incomplete scan as incomplete. Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
The Actions runner trims the whole property list of a workflow command before splitting it. A discovery annotation has no line number, so its file property came last, and a tracked path ending in a space (such as a linked skill directory) lost that space and no longer matched the Git index. The always-present title now comes last. The linked-directory test now also covers a link name with a trailing space and parses the command the way the runner does, comparing the file value with the path git ls-files reports. Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Head branch was pushed to by a user without write access
A rubric folder with no skills had no member list, so the GitHub summary counted its discovery failure as one checked skill. Record an empty member list for that folder result and report zero checked skills; the discovery error and exit 1 are unchanged. Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because an unpublished filename-handling issue can emit terminal-reset sequences, while stripping those controls risks pointing annotations at the wrong file.
No open issues 🎉
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because an unpublished finding indicates JSON save failures after incomplete scans can be omitted from GitHub annotations and counted as incomplete rather than failed.
No open issues 🎉
Review effort: Balanced
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
rng1995
left a comment
There was a problem hiding this comment.
Reviewed the updated annotation and documentation behavior. Both worker modes preserve the concrete report-write error, incomplete-only scans remain warnings, and all review threads are resolved. The follow-up is signed off. DCO still flags the earlier unsigned commits 891a5f0 and c4a7c22, and NVSkills signing evidence is still pending.
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
rng1995
left a comment
There was a problem hiding this comment.
The Bandit annotation test now exercises the validator with simulated scanner output. The Windows CI merge tree reproduced the original failure locally and passed with the updated fixture. Review threads remain resolved. DCO sign-offs for the earlier two commits and NVSkills signing evidence remain outstanding.
There was a problem hiding this comment.
🔵 Needs a closer look
The core behavior has not been exercised in a live GitHub Actions run, leaving runner parsing, PR-diff placement, and summary visibility for single-skill and parallel-catalog stdout streams awaiting human validation.
No open issues 🎉
Review effort: Balanced
|
Appreciate the merge, @rng1995. Good to see the |
Summary
-r githubprints GitHub Actions workflow commands on stdout so a job thatruns
skillevaluator validateortier1itself can put findings on the pullrequest diff and the run summary without uploading SARIF. The format writes
no file, needs no extra permission, and combines with other formats, for
example
-r cli,github,sarif.A CLI-only workflow currently has the terminal table, Markdown, or SARIF.
SARIF inline comments need a code scanning upload, which private
repositories without code scanning cannot use.
Before this change, a job that runs the CLI directly got no inline annotations, and
-r githubwas rejected as an invalid choice ('github' is not one of 'cli', 'json', 'html', 'markdown', 'sarif', 'junit', exit 2).Verification
make lintmake testmake buildRelease Impact
CHANGELOG.mdCommands run
Platform: Linux 6.12.113+ x86_64, Python 3.13.18 (uv),
python33.12.3.Baseline on untouched
upstream/mainaffe1acc3d0a24877c5d508d96ac69663a7fd92a:uv run make lint— All checks passeduv run python -m pytest tests/reporting— 15 failed, 2943 passed, 86 skipped in 143.81s. Failures are Rich markup, 80-column terminal polish, and token-usage wrappinguv run make build— Successfully builtskillevaluator-1.0.1.tar.gzandskillevaluator-1.0.1-py3-none-any.whlPYTHONUNBUFFERED=1 PYTEST_ADDOPTS='--deselect tests/test_harbor_secure_docker_environment.py::test_windows_transfer_repeated_cancellation_reaps_process_and_removes_partial_output' uv run make test— 57 failed, 39461 passed, 171 skipped, 20 deselected, 65 warnings in 1627.79s. Failures are this environment (no Docker client, Rich markup / 80-column wrapping, NeMo Gym process-group). The deselected Windows-transfer test hangs the serial run on untouchedupstream/main, so it is excluded on both sides.This branch:
uv run ruff format --checkon the touched Python files — 11 files already formatted (plustests/reporting/test_reporters.pyafter the non-UTF-8 wiring case)uv run make lint— All checks passeduv run python -m pytest tests/reporting/test_github_reporter.py tests/reporting/test_incomplete_scans.py tests/reporting/test_plugin_reports_runtime_composition.py tests/reporting/test_reporters.py tests/test_cli.py tests/golden/test_cli_surface.py— 389 passed in 3.43suv run python -m pytest tests/reporting tests/test_cli.py tests/golden— 15 failed, 3203 passed, 86 skipped in 136.88s. The 15 failures are the same names as the baseline reporting suiteuv run make build— Successfully builtskillevaluator-1.0.1.tar.gzandskillevaluator-1.0.1-py3-none-any.whl./fern/node_modules/.bin/fern check— Found 0 errors and 1 warning (Fern CLI upgrade notice)PYTHONUNBUFFERED=1 PYTEST_ADDOPTS='--deselect tests/test_harbor_secure_docker_environment.py::test_windows_transfer_repeated_cancellation_reaps_process_and_removes_partial_output' uv run make test— 58 failed, 39484 passed, 171 skipped, 20 deselected, 65 warnings in 1627.84s. Passed count is +23 versus baseline: 24 new GitHub-annotation tests, minus one existing test that failed here only (tests/test_nvidia_build_bridge.py::test_dynamic_bridge_ignores_prebound_old_port_and_checker_authenticates_health,Address already in usefrom running the two suites at the same time). That test passed in 2.39s when re-run alone. The other 57 failures are the same node IDs as the baseline.Ran make testis left unticked because the suite was only run with the hanging test deselected.Not verified: no live GitHub Actions run was tested, so the annotations have not been seen on a real pull request diff or run summary. Also not verified: Python 3.12 and 3.14; Windows.
Demo
Full recording (MP4): https://raw.githubusercontent.com/mvanhorn/pr-demo-assets/main/osc-bulk-1118/github-annotations/out.mp4