Skip to content

chore(github): Turn off AI Scan for pull requests to save allowance #1496

Closed

Description

@dan-petty

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.

Proposed remedy

One settings change by the owner (a person step), plus one ADR update:

  1. 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-scan with pr_scan=disabled.
  2. 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.
  3. Update ADR 0004 D6 to name the AI Scan setting, with the gh api command 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-scan returns {"pr_scan":"disabled"}.
  • After the next pull request into main opens, 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 ci passes.

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.

Activity

  1. added
    type/chore
    scope/github
    on Oct 9, 2026
  2. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    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.

    • Priority: P0-Critical. P0: the failed run 37703381734 is evidence GitHub confirms, from a trusted source.
    • Value: Medium. 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.
    • Effort: Low. Two toggle-level settings changes in GitHub (disable AI Scan, uncheck review_on_push) plus a one-line ADR edit; no code changes required.
  3. dan-petty-bot commented on Oct 10, 2026

    @dan-petty-bot
    Collaborator

    Status set to Ready at 69c99cf (see proposed design in issue body).

  4. changed the title [-]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[/+] on Oct 23, 2026
  5. dan-petty commented on Oct 26, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

  6. added
    priority/p2-medium
    status/new
    effort/low
    value/high
    on Oct 28, 2026
  7. devops-cli-service commented on Nov 1, 2026

    @devops-cli-service
    Contributor

    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.

  8. changed the title [-]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[/+] on Nov 6, 2026
  9. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    The job shortened the title of this item. The summary had 74 characters, and the limit is 60. The type and the scope stay.

    • Before: chore(github): ai scan for pull requests is off, so the copilot allowance lasts the month
    • After: chore(github): Turn off AI Scan for pull requests to save allowance
    • Source of the summary: the background model
  10. added
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 10, 2026
  11. removed
    status/in-review
    on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/githubtype/chorevalue/high

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions