Repository navigation
Description
Filed at the owner's request from the 2026-10-09 review of GitHub Actions warnings and notices.
Problem
Checked at release/v0.2.32 (27cf6bd), and against the live repository settings on 2026-10-09.
- The owner's monthly Copilot allowance ran out on 2026-10-07 at 23:38 UTC, a week into the month.
- The Copilot review of feat(release): v0.2.28 #1283 failed with HTTP 402
errorCode: quota("You have exceeded your monthly quota"): https://github.com/dan-petty/devops-cli/actions/runs/37703381734 - Copilot then posted "Copilot was unable to review this pull request because the user who requested the review has reached their quota limit".
- The Copilot review of feat(release): v0.2.28 #1283 failed with HTTP 402
- Since then, the "GitHub Advanced Security" job "Code scanning AI findings on PR #N" fails on each release pull request with the same 402, in step
Processing Request (Linux): - Both of those pull requests were opened by the machine account, whose allowance is also spent, and neither got a Copilot review. No AI Scan or Copilot review has run on the owner's pull requests since 2026-10-07 either, release pull request feat(release): v0.2.29 #1455 included.
- Two settings spend the allowance:
- AI Scan for pull requests is on.
gh api repos/dan-petty/devops-cli/code-scanning/ai-scanreturns{"pr_scan":"enabled"}.- It runs on every pull request. It runs when the pull request opens and again after each new commit, and its usage consumes AI credits (AI Scan for pull requests). The failing runs above hit the pull request author's allowance.
- It ran 297 times from 2026-10-01 to 2026-10-07, and 465 times since its first run on 2026-09-16. That is the day GitHub dropped its CodeQL default-setup requirement (changelog); this repository uses advanced setup (
.github/workflows/codeql.yml). - Its findings are informational and block no merge. CodeQL and the rulesets'
code_scanningrule stay the gate.
- The
mainruleset (21466414) re-reviews on every push. Itscopilot_code_reviewrule hasreview_on_push: true.- Under the old release branches, every squash merge into the release branch was a push to the open release pull request. So Copilot re-reviewed the whole release diff each time, billed to the pull request author (Copilot code review).
- That was 13 runs on feat(release): v0.2.28 #1283 on 2026-10-07, and 31 in October.
- AI Scan for pull requests is on.
- The docs already say otherwise, but the settings never followed:
docs/adr/0004-ci-is-the-authoritative-gate.md(D6) recordsreview_on_push: false.AGENTS.md:316limits automatic Copilot review to pull requests intomain, because reviewing every pull request "used the monthly token budget halfway through the month".- chore(github): required CI checks bind merges into release and main, and ADR 0004 records the verification policy #842 closed with its person step "The
mainruleset's Copilot rule setsreview_on_push: false" still pending (docs/agent/tasks/task-842-required-ci-checks.md:42). - No document mentions AI Scan, which brought back per-pull-request, per-push Copilot spend.
- Seen in the same read, outside this item: chore(github): required CI checks bind merges into release and main, and ADR 0004 records the verification policy #842's other ruleset steps were not applied either.
mainhasrequired_status_checks: [],release(23059172) has no status-check rule, and both keepcode_coverage. ADR 0004 says both rulesets requireStatic AnalysisandTests & Coverage.
Proposed remedy
One settings change by the owner (a person step), plus one ADR update:
- Turn off AI Scan for pull requests under Settings -> Advanced Security -> Code scanning. The API equivalent is
PATCH repos/dan-petty/devops-cli/code-scanning/ai-scanwithpr_scan=disabled. - The Copilot review settings are not in this item. ADR 0012 decides that no pull request gets an automatic Copilot pass, and step 6 of chore(settings): the release App, the release environment, the squash settings and the required checks are in place #1864 turns off any automatic Copilot review. Copilot reviews only when a person asks.
- Update ADR 0004 D6 to name the AI Scan setting, with the
gh apicommand that reads it back, so drift shows up in a read rather than in a monthly failure.
Acceptance criteria
-
gh api repos/dan-petty/devops-cli/code-scanning/ai-scanreturns{"pr_scan":"disabled"}. - After the next pull request into
mainopens, the GitHub Advanced Security workflow (actions/workflows/359687710/runs?created=>=<date>) has no new runs. - ADR 0004 records the AI Scan setting and its read-back command.
-
uv run devops cipasses.
Proposed design
Problem statement
The owner's monthly Copilot allowance is exhausted within a week because two live GitHub settings consume AI credits on every pull request and every push: AI Scan for pull requests is enabled (297 runs in the first week of October 2026), and the main ruleset's Copilot code review rule has review_on_push set to true (causing re-reviews on every squash merge into the release branch, 31 runs in October). The documentation already records the intended state (ADR 0004 D6 says review_on_push: false, AGENTS.md limits Copilot review to PRs into main), but the live settings never followed. The fix aligns the settings with the documented intent and updates ADR 0004 to include read-back commands so future drift is caught by a read rather than a monthly quota failure.
Acceptance criteria
- Criterion 1: AI Scan for pull requests is disabled in the repository settings
Verification: gh api repos/dan-petty/devops-cli/code-scanning/ai-scan returns {"pr_scan":"disabled"} - Criterion 2: The main ruleset's Copilot code review rule has review_on_push set to false and review_draft_pull_requests set to false
Verification: gh api repos/dan-petty/devops-cli/rulesets/21466414 --jq '.rules[]|select(.type=="copilot_code_review").parameters' shows review_on_push: false and review_draft_pull_requests: false - Criterion 3: After the next release pull request opens and at least one item pull request merges into its branch, the Copilot workflow has at most one run and the GitHub Advanced Security workflow has no new runs
Verification: Check actions/workflows/347631663/runs?branch= for at most one run, and actions/workflows/359687710/runs?created=>= for no new runs - Criterion 4: ADR 0004 records both settings (AI Scan pr_scan and review_on_push) with their gh api read-back commands
Verification: Read docs/adr/0004-ci-is-the-authoritative-gate.md and confirm D6 names both settings and includes the gh api commands that read them back - Criterion 5: A changelog fragment records the change, and CHANGELOG.md and docs/ROADMAP.md are not edited
Verification: changelog.d/1496.md exists with an entry; git diff shows no changes to CHANGELOG.md or docs/ROADMAP.md - Criterion 6: CI passes
Verification: uv run devops ci exits 0
Key questions
- What is the current state of AI Scan for pull requests?: Enabled: gh api repos/dan-petty/devops-cli/code-scanning/ai-scan returns {"pr_scan":"enabled"}. It ran 297 times from 2026-10-01 to 2026-10-07 and 465 times since its first run on 2026-09-16. [sources: docs/adr/0004-ci-is-the-authoritative-gate.md]
- What is the current state of review_on_push in the main ruleset?: True: the main ruleset (21466414) copilot_code_review rule has review_on_push: true, causing 13 re-review runs on feat(release): v0.2.28 #1283 on 2026-10-07 and 31 in October. ADR 0004 D6 records the intended state as false, and task-842's pending person step confirms it was never applied. [sources: docs/agent/tasks/task-842-required-ci-checks.md, docs/adr/0004-ci-is-the-authoritative-gate.md]
- Should AI Scan for pull requests be turned off?: Yes. The owner's proposed remedy is to disable it via PATCH repos/dan-petty/devops-cli/code-scanning/ai-scan with pr_scan=disabled. Its findings are informational and block no merge; CodeQL and the rulesets' code_scanning rule remain the gate. (proposed) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md]
- Should review_on_push be set to false in the main ruleset?: Yes. ADR 0004 D6 already records review_on_push: false as the owner's decision, and AGENTS.md limits automatic Copilot review to pull requests into main. The setting was never applied. Any further pass is requested by a person, which feat(github): a release pull request gets a set number of copilot passes, and later review threads become follow-up issues #1345 budgets. (proposed) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md, AGENTS.md]
- Should ADR 0004 be updated to name both settings with their read-back commands?: Yes. The owner's proposed remedy includes updating ADR 0004 D6 to name both settings, each with the gh api command that reads it back, so drift shows up in a read rather than in a monthly failure. (proposed) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-01: not-applicable.
Tool: none found.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNew
- StatusShow more project fieldsReady
Activity
dan-petty-bot commentedon Oct 9, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
Restoring AI reviews and stopping wasted quota spend improves the review workflow, but the project can still ship without them since CodeQL is the authoritative gate.Two toggle-level settings changes in GitHub (disable AI Scan, uncheck review_on_push) plus a one-line ADR edit; no code changes required.dan-petty-bot commentedon Oct 10, 2026
Status set to Ready at 69c99cf (see proposed design in issue body).
[-]chore(github): copilot reviews each pull request into main once and ai scan for pull requests is off, so the copilot allowance lasts the month[/-][+]chore(github): ai scan for pull requests is off, so the copilot allowance lasts the month[/+]dan-petty commentedon Oct 26, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The issue impacts CI functionality but is not critical or urgent.Fixing the Copilot quota issue improves workflow efficiency for developers.Only one setting needs to be changed and it requires minimal effort.Both items relate to repository settings but the candidate focuses on Copilot usage and AI scan settings while #1864 relates to release workflow settings.devops-cli-service commentedon Nov 1, 2026
Alternatives check: not-applicable
Tool: none found
Checked on 2026-11-01. A person decides what this means for the item. The check changes no label and closes no issue.
[-]chore(github): ai scan for pull requests is off, so the copilot allowance lasts the month[/-][+]chore(github): Turn off AI Scan for pull requests to save allowance[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 74 characters, and the limit is 60. The type and the scope stay.
chore(github): ai scan for pull requests is off, so the copilot allowance lasts the monthchore(github): Turn off AI Scan for pull requests to save allowance