feat(rulesets): narrow Copilot review to explicit repo+branch targets - #67
Merged
Merged
Conversation
The Copilot review ruleset from #60 was scoped via the gitflow custom property -- all 9 gitflow-tagged repos, and it grows automatically as more repos opt into gitflow. That ruleset was never applied (tofu apply was left as an operator step and never run), but the org has already exhausted its Copilot review capacity from unrelated usage. With 0 assigned Copilot seats, every review bills AI credits directly with no pooled allowance -- property-based scoping is the wrong shape for a budget that's already tight. Replace it with an explicit (branch, repo-list) target model, mirroring merge-gate.tf's existing for_each-over-buckets pattern rather than inventing a new one. Starting scope: just ansible-proxmox-apps on develop, in the new config/copilot-review.yml. Growing the pilot is a one-line YAML edit, never a broader property match. Since nothing was ever applied, this is a clean replacement: no import, no moved block, no state migration. The enforcement variable is renamed org_gitflow_copilot_review_enforcement -> org_copilot_review_enforcement since it's no longer gitflow-tied (safe -- variables aren't in state). Verified: tofu fmt/validate pass; tflint passes against v0.63.1 (the version CI resolves, via the signature = "pgp" pin from #61/#64).
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.
Summary
The Copilot review ruleset added in #60 was scoped via the
gitflowcustom property — every one of the 9 gitflow-tagged repos, on
develop,and the set grows automatically as more repos opt into git-flow. That
ruleset was never applied (
tofu applywas left as an explicitoperator step and never run — confirmed live via
gh api orgs/dryvist/rulesets, no ruleset with "copilot" in its nameexists on GitHub today).
The org has separately already run out of Copilot review capacity from
unrelated usage.
gh api orgs/dryvist/copilot/billingconfirms whyproperty-based scoping is the wrong shape for that:
seat_breakdown.total = 0, so every review bills AI credits directly with no pooled allowance.9 repos (and growing) is too broad a surface for a budget that's already
tight.
This replaces the property match with an explicit (branch, repo-list)
target model, starting with just
ansible-proxmox-appsondevelop.Design
Mirrors
merge-gate.tf's existing pattern — buckets keyed by a label,for_eachover buckets, repo list per bucket, decoded from a dedicatedconfig/*.yml— rather than inventing a new shape. Keyed by branchthis time (not check-context), since growing the pilot may mean a
different repo targeting a different branch, not just more repos on
develop:Growing the pilot going forward is a one-line YAML edit, never a code
change or a broader property match.
Why this is a clean replacement, not a migration
Because the old ruleset was never applied, there's no live state to
migrate — no
import, nomovedblock. The old resource(
org_gitflow_copilot_reviewinrulesets.tf) is deleted outright andreplaced by the new
copilot-review.tf. The enforcement variable isrenamed
org_gitflow_copilot_review_enforcement→org_copilot_review_enforcementsince it's no longer gitflow-tied —safe, since Terraform variables aren't tracked in state.
Verification
tofu fmt -check -recursive,tofu validate— both pass.tflint -f compactagainst v0.63.1 (the version CI resolves, viathe
signature = "pgp"pin from fix(ci): pin tflint plugin verification to pgp to unblock linting #61/chore(ci): pin tflint to v0.63.1 and hold upgrades for 60 days #64) — passes clean.none.
Cost impact
Scope reduction, not a new cost source. #60 already declared the
per-review cost (AI credits, no pooled allowance, 0 assigned seats). This
PR narrows the blast radius from 9 repos (property match, grows
automatically) to 1 explicit repo, in direct response to the org already
exhausting Copilot review capacity from unrelated usage.
tofu apply(making any version of this live) remains an explicit, unrun operator
step — same as before.