Repository navigation
AI review: give reviewers the failing step of each CI job, ignore Trivy failures - #18
Merged
Merged
Conversation
The reviewers have never received a failed job's log: every download in the gate failed in Actions with its error sent to /dev/null, so they saw only "(log unavailable)". Even a successful download kept the last 150 lines of the job, which are harden-runner's post-job cleanup rather than the failure. Keep the lines leading up to the last error before the post steps, cap long lines, and report a failed download as a warning with its error so the cause shows in the gate log. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A Trivy failure means a base image or dependency has a known vulnerability, which a fix to the PR cannot address, so the reviewers spent turns on it and it counted toward the CI fix rounds. Skip a failed job whose only failed steps are Trivy scans; a job that also failed elsewhere, such as an image build, is still reported. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The AI reviewers report that they can't see the logs of failed CI jobs. In the four recent cosmos AI Review runs checked (#3902, #3996, #3998, #4015), every failed job reached the agents as just
(log unavailable). There are two problems inai-review/ai_review_gate.sh:gh api repos/.../actions/jobs/<id>/logssent its stderr to/dev/null. The same call works locally with a user token, and the gate job's token hasActions: read, so the cause is still unknown.##[error]Process completed with exit code 1., followed by about 170 lines of cleanup.Changes
Post job cleanup.line, end at the last##[error]line, and keep theLOG_LINESlines before it. Also strip the byte-order mark, timestamps and colour codes, and cut lines at 1,000 characters.::warning::with gh's error, and the agents see(log unavailable: <error>).Follow-up
This makes the download failure visible but doesn't fix it. The next review of a PR with a failing job will show the error in the "Wait for CI and collect failures" step, and the cause can be fixed from that.
Ignore Trivy failures
A Trivy failure means a base image or dependency has a known vulnerability. A fix to the PR can't address that, but the reviewers still spent turns on it, and it counted toward the CI fix rounds. The gate now skips a failed job when every failed step has "trivy" in its name, and adds a
::notice::to the gate log. For example, cosmos's Trivy Scan fails on itsRun Trivy on image …steps.continue-on-errorand reports through a commit status, which the gate doesn't collect.Testing
python3 -m unittest discover -s tests: 89 tests pass🤖 Generated with Claude Code