fix(ci): Add comment if govulncheck fails#3258
Conversation
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRenames and reconfigures the Go vulnerability scan step to continue-on-error, records failing module paths as short-lived artifacts per matrix job, and adds a follow-up job that aggregates those artifacts and posts or removes a sticky PR comment summarizing govulncheck failures. Changes
Sequence Diagram(s)sequenceDiagram
participant Runner as "Matrix Runner"
participant Actions as "GitHub Actions Artifacts"
participant CommentJob as "comment-govulncheck Job"
participant GitHubPR as "GitHub PR Comments"
Runner->>Runner: run `govulncheck` (continue-on-error)
alt vuln check fails
Runner->>Actions: upload `govulncheck-failure-<index>.txt` (short retention)
end
Note over Actions,CommentJob: After `go` job finishes
CommentJob->>Actions: download all `govulncheck-failure-*` artifacts
alt artifacts downloaded
CommentJob->>CommentJob: aggregate module paths into markdown
CommentJob->>GitHubPR: create/update sticky comment header "govulncheck-results"
else no artifacts
CommentJob->>GitHubPR: delete existing sticky comment "govulncheck-results"
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/checks.yaml:
- Around line 160-166: Replace the non-paginated call to
github.rest.issues.listComments with github.paginate to retrieve all comment
pages before searching for the marker; specifically, use
github.paginate(github.rest.issues.listComments, { owner: context.repo.owner,
repo: context.repo.repo, issue_number: context.issue.number }) to collect all
comments into the comments array and then run the existing find(c =>
c.body.includes(marker)) logic (so the existing variable names comments and
existing remain usable).
- Around line 121-126: The job currently gated by the `if` expression and
`needs: go` (see the `if:` line and the `needs: go` entry, likely in the
comment-govulncheck job) will be skipped when the `go` job fails; wrap the
entire existing condition with GitHub's always() so the job runs regardless of
dependency outcome (e.g. change the `if:` to use always(...) around
`github.event_name == 'pull_request' &&
!github.event.pull_request.head.repo.fork && !cancelled()`), keeping `needs: go`
intact so it still waits for the go job but still executes even if that job
fails.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 7bc3c916-6cb1-4db8-a45f-dffbef25dbb8
📒 Files selected for processing (1)
.github/workflows/checks.yaml
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
|
jakedoublev
left a comment
There was a problem hiding this comment.
Can we please use the sticky comment reusable GHA? https://github.com/marocchino/sticky-pull-request-comment
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/checks.yaml:
- Around line 128-135: The workflow currently checks steps.download.outcome to
detect "no artifacts" but actions/download-artifact sets outputs.download-path
to empty when pattern matches nothing; update the logic that references the
download step (step id "download" using actions/download-artifact@...) to test
steps.download.outputs.download-path == '' to detect the zero-artifact case and
delete the sticky comment only in that branch, and let real download/API
failures surface (remove or rework continue-on-error on the "download" step so
failures fail the job or handle them explicitly).
- Around line 74-89: The workflow currently sets continue-on-error: true for the
golang/govulncheck-action which lets the matrix leg pass even when
steps.govulncheck.outcome == 'failure'; after the artifact-upload step (uses:
actions/upload-artifact...) add a final conditional step gated by if:
steps.govulncheck.outcome == 'failure' that runs a simple failing command (e.g.,
run: exit 1) to re-fail the matrix leg so the top-level CI blocks on
vulnerabilities; ensure this new step comes after the upload so the artifact is
always saved before exiting non-zero.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4c44ab0f-486f-4d3f-bbbe-ed8fc8f9947a
📒 Files selected for processing (1)
.github/workflows/checks.yaml
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
|
Proposed Changes
Checklist
Testing Instructions
Summary by CodeRabbit