Skip to content

ci(govulncheck): run on pull requests - #1762

Merged
mbrandenburger merged 1 commit into
hyperledger-labs:mainfrom
mbrandenburger:worktree-govulncheck-pr-trigger
Sep 8, 2026
Merged

mbrandenburger merged 1 commit into
hyperledger-labs:mainfrom
mbrandenburger:worktree-govulncheck-pr-trigger

Conversation

@mbrandenburger

@mbrandenburger mbrandenburger commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

What

Adds the pull_request trigger to .github/workflows/govulncheck.yml, the concurrency block that cancels superseded pull request runs, and the corresponding row in the What CI Gates table in docs/dev/development.md.

This is the follow-up promised in #1754, and part of #1741.

Why

#1754 landed the scan on push to main and a weekly cron, and deliberately left the pull_request trigger 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 a pull_request trigger 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 main run have been dismissed as won't fix.

Category Results in baseline
govulncheck-. 1
govulncheck-integration 2
govulncheck-platform/fabric/services/state/cc/query 0
govulncheck-platform/view/services/comm/host/libp2p 2

A 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_request mirrors the push trigger's paths-ignore and codeql-analysis.yml's shape exactly, including branches: [main].

The concurrency block is a no-op for the triggers that exist today: push and schedule fall back to github.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 make target

The 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 make target, so this one does too. make govulncheck reuses the existing in_all_modules helper in checks.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 of make 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. govulncheck is pinned in tools/tools.go, so make install-tools provides it and the documented command actually runs.

One asymmetry worth flagging for review

govulncheck exits 0 in -format sarif mode 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 govulncheck can 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 outside tools/.
  • make govulncheck — run end to end against every module, confirming the target reaches the same four the CI matrix does.
  • govulncheck installed from the new tools/tools.go pin via go install, confirming make install-tools provides it (govulncheck@v1.7.0, Go 1.27.1).
  • Workflow YAML parsed to confirm all three triggers (push, pull_request, schedule) and the concurrency block are present and well-formed. No actionlint in this repo or on this machine, so that check was not repeated from ci(govulncheck): scan every module on main and weekly #1754.
  • Verified SARIF upload works for fork pull requests before relying on it: CodeQL's Analyze job — same security-events: write and upload-sarif shape — 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.

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Hey @mbrandenburger 👋 thanks for the PR!
I'm your friendly PR Helper Bot 🤖 and I'll be riding shotgun on this one, keeping track of your PR's status to help you get it approved and merged.

This comment updates automatically as you push changes -- think of it as your PR's live scoreboard!
Here's the latest:


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:

  • b442b41 ci(govulncheck): run on pull requests

You'll need to sign your commits with GPG (e.g. git commit -S). See the Signing Guide for a step-by-step walkthrough.


✅ 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. Fixes #123) and ensure the issue is assigned to you. Every PR needs a home!


⏳ All checks must pass before this PR can be reviewed. You've got this!

@github-actions github-actions Bot added the status: needs revision The pull request requires changes from the author before it can be reviewed or merged label Sep 8, 2026
@mbrandenburger mbrandenburger added this to the 26Q3 milestone Sep 8, 2026
@mbrandenburger
mbrandenburger force-pushed the worktree-govulncheck-pr-trigger branch from 98177c6 to 146ae45 Compare September 8, 2026 09:19

@SaidAltury-ibm SaidAltury-ibm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @mbrandenburger, LGTM

@mergify

mergify Bot commented Sep 8, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@mbrandenburger
mbrandenburger enabled auto-merge (squash) September 8, 2026 10:56
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>
@mbrandenburger
mbrandenburger force-pushed the worktree-govulncheck-pr-trigger branch from 146ae45 to b442b41 Compare September 8, 2026 10:56
@mbrandenburger
mbrandenburger merged commit fa1e963 into hyperledger-labs:main Sep 8, 2026
42 checks passed
@mbrandenburger
mbrandenburger deleted the worktree-govulncheck-pr-trigger branch September 8, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: needs revision The pull request requires changes from the author before it can be reviewed or merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants