fix(ci): governance-enforce gate can pass having scanned nothing - #34
fix(ci): governance-enforce gate can pass having scanned nothing#34yakimoto wants to merge 2 commits into
Conversation
…ead nothing BASE=HEAD~1 scans one commit of a multi-commit push and reports the rest as passing; when HEAD~1 does not resolve it degrades to BASE=HEAD, an empty diff and a green job. Resolve to the empty-tree object so the full tree is scanned, and add merge_group so the gate runs in the merge queue. Refs #1747.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_1f8ce220-8a2c-4fff-ba35-fae806748220) |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 49 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Comment |
ApprovabilityVerdict: Needs human review Unable to check for correctness in 053f789. Unresolved review comments identify potential bugs: the empty-tree object may not be written to the local git database (missing You can customize Macroscope's approvability policy. Learn more. |
PR Summary by QodoFix governance-enforce CI gate to never pass with an empty/partial scan
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
|
|
||
| on: | ||
| pull_request: | ||
| merge_group: |
There was a problem hiding this comment.
🔍 merge_group added only to this workflow; other required checks may stall the queue
merge_group is added here, but the other per-commit workflows (.github/workflows/foundation-gate.yml:18-21, _checks.yml, shell-lint.yml) still only trigger on pull_request/push. If a merge queue is enabled and those checks are also required, queued entries will hang waiting for checks that never run. Also note cancel-in-progress: true combined with merge_group: the concurrency group is keyed on github.ref, which is unique per queue entry, so cancellation should not affect queued runs — but confirm this holds if the queue re-forms entries on the same ref.
Was this helpful? React with 👍 or 👎 to provide feedback.
Code Review by Qodo
1. Empty-tree hash not written
|
| # HEAD~1 would skip earlier commits in a multi-commit push and let a violation through | ||
| # (a config-no-silent-noop hole). Diff the full tree against git's empty-tree object so | ||
| # every introduced file is scanned; loud, never a silent empty/partial pass. | ||
| BASE=$(git hash-object -t tree /dev/null) |
There was a problem hiding this comment.
1. Empty-tree hash not written 🐞 Bug ☼ Reliability
The indeterminate-base fallback sets BASE to the empty-tree hash via `git hash-object -t tree /dev/null` but does not write that tree object into the local object database. If the empty-tree object is not already present, the downstream enforce.mjs --changed "$BASE" path can fail to resolve BASE as a git object and the required check will error in first-push/force-push cases.
Agent Prompt
## Issue description
The workflow computes the empty-tree ID with `git hash-object -t tree /dev/null` but does not write the object to `.git/objects`. If that object is missing locally, passing the ID to the governance enforcer (`--changed`) can cause git resolution failures.
## Issue Context
This branch is specifically exercised when `BASE` is indeterminate (first push / force-push). The fix should ensure the empty-tree object is guaranteed to exist locally before it is used as a diff base.
## Fix Focus Areas
- .github/workflows/governance-enforce.yml[46-54]
## Suggested change
Change:
- `BASE=$(git hash-object -t tree /dev/null)`
To one of:
- `BASE=$(git hash-object -t tree -w /dev/null)`
- `BASE=$(git mktree </dev/null)`
Either approach guarantees the object exists for subsequent git operations.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Qodo Fixer✅ Merged (0) · ☑ Fixed (0) Process
|
… fail open Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
Defect
.github/workflows/governance-enforce.ymlresolved its diff base toHEAD~1, which scans onlyONE commit of a multi-commit push and reports every earlier commit as passing. On an initial push,
force-push, or shallow clone this degrades further:
HEAD~1fails to resolve and falls back toBASE=HEAD, diffing HEAD against itself — an empty diff, zero lines scanned, job green. A gatethat passes without reading any line is worse than no gate.
Changes (targeted,
.github/workflows/governance-enforce.ymlonly)merge_group:trigger alongsidepull_request:/push:— also clears a latentmerge-queue deadlock (the gate previously never ran in the merge queue).
MERGE_BASE_SHA: ${{ github.event.merge_group.base_sha }}to the env of the step thatcomputes
BASE.BASE="${PR_BASE_SHA:-$PUSH_BEFORE_SHA}"becomesBASE="${PR_BASE_SHA:-${MERGE_BASE_SHA:-$PUSH_BEFORE_SHA}}", and the indeterminate-basefallback (previously
git rev-parse HEAD~1 2>/dev/null || git rev-parse HEAD) now diffs againstgit's empty-tree object (
git hash-object -t tree /dev/null) so the full tree is scanned —loud (
::warning::) and never a silent empty/partial pass.wave-av/wave-conferencing-bridge,wave-monitor,wave-desktop, andwave-multivieweralreadycarry the correct form of this file; this brings the same fix to this repo.
Out of scope (tracked separately, claude-workstation#1747)
This repo's gate still has three OTHER open defects tracked in #1747 which are deliberately NOT
addressed here: fail-open token scope, unpinned install scripts, and a caret (
^) version rangeon the
@wave-av/governancedependency.Refs claude-workstation#1747.
Note
Cursor Bugbot is generating a summary for commit 40d3395. Configure here.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is enabled.Note
Fix governance-enforce gate to scan full tree when diff base is indeterminate
merge_groupas a workflow trigger so the gate runs for merge queue events@wave-av/governancefrom^0.4.4to^0.4.6MERGE_BASE_SHAto the enforce step environment; base selection now prefersPR_BASE_SHA, thenMERGE_BASE_SHA, thenPUSH_BEFORE_SHAHEAD~1/HEADindeterminate-base fallback with the empty-tree object hash (git hash-object -t tree /dev/null), forcing a full-tree scan and emitting a workflow warning instead of silently passing with no files scannedMacroscope summarized 053f789.