Repository navigation
ci(govulncheck): run on pull requests - #1762
mbrandenburger merged 1 commit into
Conversation
|
Hey @mbrandenburger 👋 thanks for the PR! This comment updates automatically as you push changes -- think of it as your PR's live scoreboard! PR Checks✅ DCO Sign-off -- All commits have valid sign-offs. Nice work! ❌ GPG Signature -- Heads up! The following commits don't have a verified GPG signature:
You'll need to sign your commits with GPG (e.g. ✅ Merge Conflicts -- No merge conflicts detected. Smooth sailing! ❌ Issue Link -- This PR is not linked to any issue. Please reference an issue using a closing keyword (e.g. ⏳ All checks must pass before this PR can be reviewed. You've got this! |
98177c6 to
146ae45
Compare
SaidAltury-ibm
left a comment
There was a problem hiding this comment.
Thank you @mbrandenburger, LGTM
|
Tick the box to add this pull request to the merge queue (same as
|
The scan has been on main and the weekly cron since hyperledger-labs#1754, which deliberately left the pull request trigger out: main carried a reachable finding with no upstream fix, and code scanning treats every finding as new until a branch baseline exists, so the trigger would have failed its own check. The baseline is now established across all four categories and those findings are dismissed, so add it. A concurrency group comes with it. It is a no-op for the existing triggers -- push and schedule fall back to run_id, which is unique per run -- but a newer push to a pull request makes the in-flight scan obsolete, so cancel it rather than paying for a result nobody reads. The What CI Gates table documents what CI gates on every pull request alongside a local equivalent, so it grows a govulncheck row, which only becomes accurate with this trigger in place. Backing that column with `make govulncheck` rather than a bare command keeps it consistent with every other row; it reuses the existing in_all_modules helper and so covers exactly the modules the CI matrix does. It is kept out of `checks` because it needs the tool installed and queries the vulnerability database over the network, and govulncheck is pinned in tools/tools.go so `make install-tools` provides it. govulncheck exits 0 in SARIF mode but not in text mode, and the CLI knows nothing about code scanning dismissals, so the local target can fail while CI is green. The table says so without naming individual advisories, which would go stale as they are dismissed or fixed. Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
146ae45 to
b442b41
Compare
What
Adds the
pull_requesttrigger to.github/workflows/govulncheck.yml, theconcurrencyblock that cancels superseded pull request runs, and the corresponding row in the What CI Gates table indocs/dev/development.md.This is the follow-up promised in #1754, and part of #1741.
Why
#1754 landed the scan on
pushtomainand a weekly cron, and deliberately left thepull_requesttrigger out. The reason was a reachable finding with no upstream fix, combined with the fact that code scanning treats every finding as new until a branch baseline exists — so apull_requesttrigger added there would have failed that PR's own check on something nobody could action.Both preconditions are now met: the baseline exists across all four categories, and the findings from that first
mainrun have been dismissed as won't fix.govulncheck-.govulncheck-integrationgovulncheck-platform/fabric/services/state/cc/querygovulncheck-platform/view/services/comm/host/libp2pA pull request's analysis is diffed against its base, so pre-existing findings are not attributed to the PR. Only a new finding — a dependency bump that introduces a reachable advisory, which is exactly what this is for — turns a check red.
How
pull_requestmirrors thepushtrigger'spaths-ignoreandcodeql-analysis.yml's shape exactly, includingbranches: [main].The
concurrencyblock is a no-op for the triggers that exist today:pushandschedulefall back togithub.run_id, which is unique per run, so each gets its own group and is never cancelled by — or queued behind — another run. It only bites on pull requests, where a newer push makes the in-flight scan obsolete.The docs row, and why it brought a
maketargetThe table is documented as what CI gates on every pull request, with a local-equivalent column, so the row is only accurate once this trigger exists — hence it lands here rather than in #1754.
Every other row in that table names a
maketarget, so this one does too.make govulncheckreuses the existingin_all_moduleshelper inchecks.mk, which means it covers exactly the four modules the CI matrix does and cannot drift from it —tools/is excluded in both, for the same build-tag reason. It is deliberately not part ofmake checks: it needs a tool installed and queries the Go vulnerability database over the network, neither of which belongs in the default read-only check pass.govulncheckis pinned intools/tools.go, somake install-toolsprovides it and the documented command actually runs.One asymmetry worth flagging for review
govulncheckexits 0 in-format sarifmode even with findings, which is what keeps CI green and leaves the pass/fail decision to code scanning. In text mode it does not — it exits 3. The CLI also knows nothing about code scanning dismissals, so dismissing an alert does not make the local command pass.make govulncheckcan therefore fail while CI is green — the one row in that table where the local equivalent and CI legitimately disagree. Rather than paper over it with|| true, which would hide real findings, the table notes it in a sentence, phrased without naming individual advisories so it does not go stale as they are dismissed or fixed.Testing
make checks— clean across all four modules.make tidy— no churn outsidetools/.make govulncheck— run end to end against every module, confirming the target reaches the same four the CI matrix does.govulncheckinstalled from the newtools/tools.gopin viago install, confirmingmake install-toolsprovides it (govulncheck@v1.7.0, Go 1.27.1).push,pull_request,schedule) and theconcurrencyblock are present and well-formed. Noactionlintin this repo or on this machine, so that check was not repeated from ci(govulncheck): scan every module on main and weekly #1754.Analyzejob — samesecurity-events: writeandupload-sarifshape — passes on cross-repo PRs such as chore(lint): enable gosec in golangci-lint #1757.This PR is itself the first live exercise of the trigger: the previous push ran all four matrix legs plus the code scanning check, and all five passed.