Skip to content

feat(github): a release pull request gets a set number of copilot passes, and later review threads become follow-up issues #1345

Closed

Description

@dan-petty

Ready: implementation plan (refined 2026-10-17 at 3dd7fa6)

This section supersedes any text below that conflicts with it.

Decisions

  • How a pass is requested: gh pr edit <n> --add-reviewer @copilot, through run_gh. The pinned gh 2.102.0 (Dockerfile:17-19, and the devcontainer's gh) documents it in gh pr edit --help: "Add or re-request reviewers by their login. Use "@copilot" to request review from Copilot." The REST requested-reviewers route for the Copilot bot is not documented, so it is not used.
  • What counts against the budget: every Copilot review submitted on the pull request, whoever asked for it, plus a pass still running (_detect_copilot_status, src/devops_cli/github/pr_monitor.py:399). A Copilot review is one whose author login is exactly copilot-pull-request-reviewer[bot] (REST) or copilot-pull-request-reviewer (GraphQL), as read on feat(release): v0.2.28 #1283's 13 Copilot reviews. The logins go in constants.py, and _is_copilot_review_dict (pr_monitor.py:290) uses them instead of matching "copilot" anywhere in a login, so the monitor and the budget agree. The automatic pass when the pull request opens is pass 1 whenever the ruleset gives one. feat(release): v0.2.34 #1566, feat(release): v0.2.35 #1581 and feat(release): v0.2.36 #1615 got no Copilot review at all, so today the command also requests the first pass.
  • Where the budget lives: .github/roadmap.toml, key release_copilot_passes, a field on RoadmapConfig (src/devops_cli/roadmap/config.py:38, extra="forbid") with ge=1. Its default of 2 (DEFAULT_ROADMAP_RELEASE_COPILOT_PASSES) goes in defaults.py. It is read at the default branch, like every roadmap setting.
  • Per release pull request: the count comes from that pull request's reviews and nothing is stored, so a new release pull request starts with a fresh budget.
  • Which pull requests: release pull requests only (_is_release_pr, src/devops_cli/commands/pr.py:1462). Any other pull request is refused, which keeps ADR 0004's rule that Copilot reviews only pull requests into main.
  • devops release requests no pass: the first pass comes from the ruleset when the pull request opens, or from devops pr copilot-pass when the ruleset gives none. So the new command is the only code that requests one. devops pr edit has no reviewer option (pr.py:756), so nothing goes around the budget.
  • When the budget is spent: the command requests nothing, prints "Copilot budget spent: N of N passes", and exits 1. --dry-run makes no request.
  • The devops pr monitor gate once the budget is spent: the last Copilot review's "changes recommended" state no longer blocks (is_review_ready, pr_monitor.py:129-137). A pass still running, unresolved threads and a person's requested changes still block. No further pass could clear that state, and under the stop rule the threads are what block the release. If the reviews can't be read, the budget is unknown and the monitor blocks, as it does today for an unread state.
  • How threads become issues: devops pr threads file-issues <pr> previews by default, reading but writing nothing. --confirm writes, and --dry-run makes no request and prints the requests it would make (the repository's --dry-run rule, feat(cli): reachable --dry-run previews for delegated commands #412). --keep <thread-id>, repeatable, leaves a thread open for a regression fixed in the release. Release pull requests only.
  • How an issue is filed: through RoadmapStore.create_issue (src/devops_cli/roadmap/store.py:850), with no milestone and no priority. It is labeled source/agent, because the text is a model's, so feat(roadmap): agent filing quota: release credit, ratio throttle, borrowing and per-release tuning #1153's quota applies when intake places it. Intake takes it as "an open issue not on the board" (src/devops_cli/roadmap/intake.py:3), and no model is called here.
    • Title: chore(review): follow up <path>:<line> from #<pr>.
    • Body: the thread's comments inside a fenced block longer than any fence in the text, so no @name or #N in them notifies or links, cut to a constant length; then <path>:<line> and the thread's link.
    • The link is the first comment's url, which the thread queries add to their comment selection (src/devops_cli/github/pr_threads.py:110-117, :133-140) and ReviewComment (:17-23) carries.
  • Order and reruns: file, then reply "Filed as #N" with a marker constant, then resolve. A rerun resolves a thread whose reply already holds the marker without filing again, so a run that stops part-way never files twice.
  • The stop rule goes in RELEASE_CYCLE.md Step 3 (:199-210). ADR 0004's decision (line 3) and docs/SDLC.md:299 and :302 say re-reviews go through devops pr copilot-pass within the budget.

Delivery

  1. PR 1 (M): Refs feat(github): a release pull request gets a set number of copilot passes, and later review threads become follow-up issues #1345. The budget field and default, src/devops_cli/github/copilot_budget.py (count the passes, decide, request), the devops pr copilot-pass [<number>] [--dry-run] command, the monitor change, the stop rule and the policy text. Tests first:
    • In tests/test_github_copilot_budget.py, over canned pulls/{n}/reviews payloads and a fake run_gh, offline: no Copilot review means a pass is requested with --add-reviewer @copilot; one review out of 2 means a request; two reviews means no request, a "2 of 2" message and exit 1; a running pass counts; a user whose login contains "copilot" does not count; a pull request that is not a release pull request is refused; unread reviews fail with the read error; --dry-run makes no request.
    • In tests/test_roadmap_config.py: release_copilot_passes defaults to 2, and 0 or an unknown key fails, naming the key.
    • In tests/test_github_pr_monitor.py: once the budget is spent, changes recommended no longer block, while an unresolved thread and a running pass still do; a review by a user whose login contains "copilot" is not Copilot's.
    • Files: src/devops_cli/github/copilot_budget.py, src/devops_cli/github/pr_monitor.py, src/devops_cli/commands/pr.py, src/devops_cli/roadmap/config.py, src/devops_cli/config/defaults.py, src/devops_cli/config/constants.py, src/devops_cli/lang/en/help.py and messages.py, .github/roadmap.toml (the key, commented), RELEASE_CYCLE.md, docs/adr/0004-ci-is-the-authoritative-gate.md, docs/SDLC.md, the generated command docs, changelog.d/1345.md, and docs/agent/tasks/task-1345-*.md.
  2. PR 2 (M): closes feat(github): a release pull request gets a set number of copilot passes, and later review threads become follow-up issues #1345. devops pr threads file-issues. Tests first, in tests/test_github_pr_threads.py, with a scripted GraphQL runner and the in-memory roadmap store (src/devops_cli/roadmap/memory_store.py:519), offline:
    • two unresolved threads give two issues with the fenced text, path:line and the thread URL, label source/agent and no milestone, then a reply naming each issue, then a resolve, in that order;
    • --keep leaves its thread untouched;
    • the default mode writes nothing, and --dry-run makes no request;
    • a thread whose reply holds the marker is resolved and not filed again;
    • a failed create stops before the reply and resolve of that thread;
    • a thread that holds @someone and #12 gives a body where both sit inside the fence.
    • Files: src/devops_cli/github/pr_threads.py, src/devops_cli/commands/pr.py (threads_app, :2637), src/devops_cli/config/constants.py, src/devops_cli/lang/en/help.py and messages.py, tests/test_github_pr_threads.py, RELEASE_CYCLE.md, the generated command docs, changelog.d/1345.md (extended), and the task file.

Acceptance criteria

  • .github/roadmap.toml can set release_copilot_passes. The default is 2, and a value below 1 fails, naming the key.
  • devops pr copilot-pass requests a Copilot pass on a release pull request only while the submitted plus running Copilot passes are below the budget. Otherwise it requests nothing, says "N of N", and exits 1. It refuses any other pull request.
  • Only reviews by the two exact Copilot logins count.
  • No other code path requests a Copilot review: rg -n '@copilot' src finds only the budget module and its constants.
  • Once the budget is spent, devops pr monitor on the release pull request no longer waits on Copilot's changes-recommended state. It still waits on a running pass, on unresolved threads and on a person's requested changes.
  • devops pr threads file-issues <pr> --confirm turns every unresolved thread not named by --keep into one issue: fenced thread text, path:line, the thread link, source/agent, no milestone. It then replies with the issue number and resolves the thread. A rerun files nothing twice.
  • The default mode reads and writes nothing. --dry-run makes no request and lists the requests it would make.
  • RELEASE_CYCLE.md Step 3 states the stop rule: once the budget is spent, a remaining comment blocks the release only if it is a regression the release introduces, and every other comment becomes a follow-up issue through file-issues.
  • ADR 0004 and docs/SDLC.md say re-reviews go through devops pr copilot-pass.
  • The tests run offline over canned GitHub payloads.
  • changelog.d/1345.md records the change. CHANGELOG.md and docs/ROADMAP.md are not edited.
  • uv run devops ci passes.
  • Pending a person: on the v0.2.37 release pull request, uv run devops pr copilot-pass <n> requests a pass that Copilot submits, and a third call says the budget is spent.

Current references

  • RoadmapConfig: src/devops_cli/roadmap/config.py:38; roadmap defaults: src/devops_cli/config/defaults.py:836-845; CONST_ROADMAP_CONFIG_PATH: src/devops_cli/config/constants.py:2265
  • PRMonitorStatus, is_review_ready: src/devops_cli/github/pr_monitor.py:83, :129-137
  • _is_copilot_review_dict, which today matches "copilot" anywhere in a login: src/devops_cli/github/pr_monitor.py:290
  • _detect_copilot_status, _fetch_raw_reviews, get_pr_monitoring_status: src/devops_cli/github/pr_monitor.py:399, :500, :625
  • ReviewComment, thread queries: src/devops_cli/github/pr_threads.py:17-23, :110-117, :133-140
  • List, reply, resolve: src/devops_cli/github/pr_threads.py:246, :260, :275
  • _is_release_pr: src/devops_cli/commands/pr.py:1462; devops pr edit: :756; threads_app: :2637
  • RoadmapStore.create_issue: src/devops_cli/roadmap/store.py:850; in-memory: src/devops_cli/roadmap/memory_store.py:519; GitHub: src/devops_cli/roadmap/github_store.py:1645
  • source/agent: .github/labels.yml:137; CONST_ROADMAP_SOURCE_AGENT_LABEL: src/devops_cli/config/constants.py:2372
  • Release procedure Step 3: RELEASE_CYCLE.md:199-210; ADR 0004 decision: docs/adr/0004-ci-is-the-authoritative-gate.md:3; Copilot gate text: docs/SDLC.md:294, :299, :302

Dependencies and order


Problem

Copilot reviews only the release pull request, on purpose and within the owner's budget (ADR 0004). Re-reviews are requested by hand.

On 2026-10-07, #1283 got 11 Copilot passes (12:43 to 22:28 UTC):

Acceptance criteria

  • The release configuration sets how many Copilot passes a release pull request gets; the default is 2, one at the cut and one after fixes. devops release and devops pr request a pass only while the budget lasts, and say when it is spent.
  • One command turns a release pull request's unresolved review threads into follow-up issues:
    • each issue holds the thread's text, its path and line, and a link to the thread;
    • the issue gets no milestone, so the roadmap tooling places it;
    • the command replies in the thread with the issue number, then resolves the thread.
    • --dry-run lists the issues it would file and makes no request.
  • RELEASE_CYCLE.md states the stop rule: once the budget is spent, a remaining comment blocks the release only if it is a regression the release introduces; every other comment becomes a follow-up issue.
  • Tests cover the budget check and the thread-to-issue conversion over a recorded GitHub fake, offline.
  • changelog.d/<n>.md records the change; CHANGELOG.md and docs/ROADMAP.md are not edited.
  • uv run devops ci passes.

Key questions

  • Is the budget per release or per pull request? (proposed) Per release pull request. A re-cut gets a new budget.

Strategic alignment

Activity

  1. added
    type/feature
    scope/github
    priority/p1-high
    scope/release
    on Oct 7, 2026
  2. dan-petty-bot commented on Oct 8, 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: P2-Medium. It reduces manual release-process work and prevents unbounded Copilot spend, but it does not block a release or fix a defect.
    • Value: Medium. Saves repeated manual thread-to-issue filing and caps Copilot budget waste on large release diffs, but the release still ships without it.
    • Effort: Medium. Requires a budget check in two commands, a new thread-to-issue conversion command with dry-run, a doc update, and offline tests against a GitHub fake.
  3. dan-petty commented on Oct 9, 2026

    @dan-petty
    OwnerAuthor

    Folded in from the 2026-10-09 GitHub Actions warnings review

    Evidence from 2026-10-09, checked against the live settings:

  4. added this to the v0.2.37 milestone on Oct 11, 2026
  5. dan-petty commented on Oct 17, 2026

    @dan-petty
    OwnerAuthor

    Readiness check for v0.2.37, against release/v0.2.36 at 22d8748. Line numbers are at that commit.

    Status: needs a split.

    Today

    • Nothing in src/ requests a Copilot review: no code sets requested_reviewers.
    • There is no pass budget.
    • No command turns review threads into issues.
    • RELEASE_CYCLE.md:199-210 has no stop rule.
    • ADR 0004 (docs/adr/0004-ci-is-the-authoritative-gate.md, line 3) says a person requests re-reviews.

    Code to reuse

    • _is_copilot_review_dict in src/devops_cli/github/pr_monitor.py:290.
    • List, reply and resolve in src/devops_cli/github/pr_threads.py:246, :260 and :275. Its GraphQL query does not fetch thread URLs.
    • RoadmapStore.create_issue (src/devops_cli/roadmap/store.py:850) and its in-memory fake (src/devops_cli/roadmap/memory_store.py:519).
    • RoadmapConfig (src/devops_cli/roadmap/config.py:38), which uses extra="forbid".

    Dependencies: #1137 is related. #1283 and #1294 are closed.

    Questions for the owner

    • How is a pass requested: the REST requested-reviewers endpoint, or gh pr edit --add-reviewer @copilot? Neither is verified yet.
    • Does the automatic pass when the pull request opens count against the budget?
    • Does the budget live in roadmap.toml?
    • Once the budget is spent, should the Copilot gate in devops pr monitor (pr_monitor.py:133-138) stop blocking?

    Proposed split

    • (A, S–M) The budget, a command that requests a pass, and the stop rule in RELEASE_CYCLE.md.
    • (B, M) devops pr threads file-issues [--dry-run].
  6. added
    status/in-progress
    on Oct 18, 2026
  7. dan-petty commented on Oct 19, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1695, merged into release/v0.2.37 as e17de25.

    The second and last of #1345's pull requests: once the release pull request's Copilot budget is spent, the review threads still open become follow-up issues, so they stop holding the release without being forgotten.

    The command. devops pr threads file-issues <pr> [--repo] [--keep <thread-id>]... [--confirm] [--dry-run]. A person runs it on the release pull request, as RELEASE_CYCLE.md step 3 and the help say. It is excluded from the MCP tools.

    Refusals and preview:

    • It refuses a pull request that is not an open release pull request before reading any thread. One shared check in github/pr_branches.py, require_open_release_pr, now serves both this command and devops pr copilot-pass.
    • It refuses a --keep id that names no unresolved thread, before any write. A mistyped id would otherwise file and resolve the very thread it meant to keep.
    • Without --confirm it prints one line per unresolved thread, marks outdated ones, honours --keep, and writes nothing.

    Filing. With --confirm, for each thread in turn:

    • It opens an issue through RoadmapStore.create_issue with no milestone, then replies "Filed as #N" with the marker <!-- devops-cli: filed as #N --> as a whole line, then resolves the thread.
    • It prints each filing as it completes, so a run that stops part-way still shows what it filed.
    • source/agent goes on an issue only when the thread was started by Copilot's review account. A thread a person started is filed as a person's. Intake later…

    20 file(s) changed.

    How it was verified

    Check runs at dea717f:

    • Prune PR DevContainer Images: pass
    • Audit Defect PR Hardening: skipping
    • Service Image: skipping
    • DevContainer Image: skipping
    • Dependency Freshness: skipping
    • Tests & Coverage: pass
    • zizmor: pass
    • devops-cli: pass
    • bandit: pass
    • CodeQL: pass
    • Fail-to-Pass Check: pass
    • Changed-Test Independence: pass
    • Rule Pack Tests: pass
    • Fail-to-Pass Self-Check: pass
    • Analyze (python): pass
    • Analyze (actions): pass
    • Static Analysis: pass

    Acceptance Criteria of docs/agent/tasks/task-1345-release-copilot-pass-budget.md:

    • .github/roadmap.toml can set release_copilot_passes; the default is 2, and a value below 1 fails, naming the key (tests/test_roadmap_config.py), and the command holds to the value the file sets (test_the_command_holds_to_the_budget_the_file_sets).
    • devops pr copilot-pass requests a pass on the release pull request only while its submitted and running Copilot passes are below the budget; otherwise it requests nothing, says "N of N" and exits 1, and it refuses any other pull request and a merged or closed one (tests/test_github_copilot_budget.py, among them test_one_finished_pass_as_github_records_it_leaves_pass_2_to_request, test_a_pending_copilot_request_counts_as_one_pass, test_a_release_pull_request_that_is_not_open_is_refused and test_the_command_holds_to_the_budget_the_file_sets).
    • Only reviews by the two exact Copilot logins count (test_a_user_whose_login_contains_copilot_does_not_count, test_a_review_counts_by_copilots_rest_or_graphql_login_and_by_no_other, test_a_review_by_a_user_whose_login_contains_copilot_is_not_copilots).
    • No other code path requests a Copilot review: rg -n '@copilot' src finds only the budget module and its constant.
    • On the release pull request, devops pr monitor does not wait on Copilot's changes-recommended state once its threads are resolved, and still waits on a running pass, unresolved threads and a person's requested changes: the behaviour fix(github): treat copilot review as completed when zero unresolved threads remain #216 gave it, on feat(release): v0.2.28 #1283's recorded timeline (test_the_monitor_reads_1283s_recorded_copilot_passes: exit 0 once both passes have ended, 3 while a third runs, 2 with an unresolved thread; test_two_finished_copilot_passes_read_as_completed, test_pr_monitor_status_not_ready_changes_requested).
    • RELEASE_CYCLE.md Step 3 states the stop rule, and ADR 0004 and docs/SDLC.md say re-reviews go through devops pr copilot-pass.
    • The tests run offline over canned GitHub payloads, with no gh started.
    • devops pr threads file-issues <pr> --confirm turns every unresolved thread not named by --keep into one issue (fenced thread text, location, the thread link, no milestone), then replies with the issue number and resolves the thread, in that order (tests/test_github_pr_threads.py: test_each_unresolved_thread_is_filed_then_replied_to_then_resolved, test_an_issue_holds_the_fenced_thread_its_location_and_its_link, test_a_mention_and_an_issue_reference_stay_inside_a_fence_longer_than_any_in_the_text, test_a_kept_thread_is_left_untouched, test_a_failed_issue_stops_the_run_before_its_reply_and_resolve).
    • Only the open release pull request is filed: another pull request, and a merged or closed release pull request, is refused before its threads are read (test_a_pull_request_that_is_not_the_release_pull_request_is_refused, test_a_release_pull_request_that_is_not_open_is_refused_before_its_threads_are_read).
    • A --keep id that names no unresolved thread is refused before any write, with and without --confirm, and the preview keeps a kept thread (test_a_keep_id_that_names_no_unresolved_thread_is_refused_before_any_write, test_the_preview_keeps_a_kept_thread).
    • The marker counts only in the viewer's own reply: the viewer's marker reply, read past the first page of comments too, makes the thread resolve-only and names its issue, while a Copilot suggestion quoting the marker and a marker reply from another login leave the thread to be filed (test_a_thread_the_viewer_already_filed_is_resolved_and_not_filed_again, test_a_marker_reply_past_the_first_page_of_comments_is_read, test_a_copilot_suggestion_quoting_the_marker_leaves_its_thread_to_be_filed, test_a_marker_reply_from_another_login_does_not_count).
    • A rerun after a failed reply opens no second issue, and the failed run names the issue it opened; a run that fails part-way has printed the threads it filed (test_a_rerun_after_a_failed_reply_opens_no_second_issue, test_a_failure_part_way_reports_the_threads_already_filed). Through the GitHub session the issues are listed once a run, the open issue ending a line with the thread's link is the one named, not one whose link only begins with it nor a closed one, and a page that holds no list stops the run before any write (test_the_issues_are_listed_once_a_run_through_the_github_session, test_a_bad_page_of_the_issue_listing_stops_the_run_before_any_write).
    • source/agent goes only on a thread Copilot started (test_each_unresolved_thread_is_filed_then_replied_to_then_resolved, test_a_thread_a_person_started_is_filed_without_source_agent).
    • What GitHub leaves empty is filled in: a deleted author is ghost, a thread a push moved off the diff is placed by its original line, two threads on a whole file get titles that tell them apart, and the preview marks an outdated thread (test_a_deleted_author_is_named_ghost, test_a_thread_a_push_moved_off_the_diff_is_placed_by_its_original_line, test_two_threads_on_a_whole_file_get_titles_that_tell_them_apart, test_the_preview_marks_an_outdated_thread).
    • Without --confirm the command reads the threads and writes nothing, and --dry-run makes no request and lists the requests it would make, the viewer, later comment pages and issue listing reads included (test_without_confirm_the_threads_are_read_and_nothing_is_written, test_dry_run_makes_no_request_and_lists_the_requests).
    • changelog.d/1345.md records both pull requests; CHANGELOG.md and docs/ROADMAP.md are not edited.
    • Pending a person: on the v0.2.37 release pull request, uv run devops pr copilot-pass <pr> requests a pass that Copilot submits, and once two passes are on it, uv run devops pr copilot-pass <pr> prints Copilot budget spent: 2 of 2 passes and exits 1.
    • Pending a person: on the v0.2.37 release pull request, once its passes are spent, uv run devops pr threads file-issues <pr> --keep <regression-thread-id> lists each remaining thread and what it would do with it, the kept one kept; the same command with --confirm files the others and resolves them; and a second run with --confirm files nothing.
  8. added a commit that references this issue on Oct 20, 2026
  9. removed
    status/in-progress
    on Oct 30, 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

    priority/p1-highscope/githubscope/releasetype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions