Skip to content

feat(release): item closure summaries, generated changelog and automatic release cut (devops roadmap close) #743

Closed

Description

@dan-petty

feat(release): item closure summaries and automatic release cut (devops roadmap close)

Problem Statement

Closure is the roadmap job that closes each delivered item with a summary of what changed, and cuts the release once every item in it is closed or descoped (CONTEXT.md, "Closure" and "Cut"). None of it runs today. Checked at 9c879ae (release/v0.2.25):

  • Items close only when someone runs a command by hand. Item PRs target release/vX.Y.Z, and GitHub acts on Closes #N only in PRs into the default branch (src/devops_cli/github/issue_closure.py:1-12).
    • devops gh issues close-merged (src/devops_cli/commands/gh.py:1161-1200) closes these issues, but no workflow runs it (rg close-merged .github finds nothing).
    • Its comment names the PR that closed the issue and says nothing about what changed or how it was checked (issue_closure.py:227-238).
    • It reads issue states newest first with --limit set to the highest wanted number, so it misses old issues (issue_closure.py:164-212).
  • Releases are cut by hand. docs/ROUTINE_TASKS.md:243-282 (table row at :46) and docs/SDLC.md:346 have a person run devops release prepare <version> --create-pr. No workflow runs it. Once the release PR merges into main, release.yml tags, publishes and closes the milestone (.github/workflows/release.yml:92-124); a failed close is ignored (|| echo, :124). The GitHub Release text comes from devops release notes, which reads the version's CHANGELOG section first (release.yml:86; src/devops_cli/commands/release.py:143-152, :293-300).
  • The release path the cut must call is being fixed by fix(release): one fail-closed release path: cut branch from the remote release tip, uv.lock bump, draft flag, required label and milestone #982, split out of this item by the owner's decision (decisions.json, Q2 and 743) and landing first in v0.2.26. Today release prepare --create-pr resets the release branch with git checkout -B (release.py:798-809, called at :1177), commits and pushes release/vX.Y.Z itself (:812-830), warns instead of stopping when the commit, push or gh pr create fails (:824-830, :1064-1078, :1102-1106), never bumps uv.lock, fixes the draft flag at the command (:1119-1122) and sets an undeclared release label (src/devops_cli/config/defaults.py:481; .github/labels.yml:78). fix(release): one fail-closed release path: cut branch from the remote release tip, uv.lock bump, draft flag, required label and milestone #982 delivers one shared cut function (dirty-tree refusal, chore/cut-vX.Y.Z built from origin/release/vX.Y.Z, uv.lock bump, fail-closed commit, push and PR, required label and milestone, the draft flag taken from the caller, the readiness exemption for chore/cut-vX.Y.Z into main, and the five convention sentences). This item calls that function; what remains wrong for closure and the cut trigger is the list above and the cut predicate below.

What v0.2.25 has delivered that this item builds on:

Not delivered: #740 (current release, cut lock, un-cut, release start). It is started in a worktree but has no commit on release/v0.2.25, is still unticked in the v0.2.25 section of docs/ROADMAP.md:1075, and is in neither the v0.2.26 nor the v0.2.27 open-item list.

Proposed Solution

devops roadmap close: one run reads the PRs merged into the current release's branch, closes each item they deliver with a two-part summary, and, once the release holds no open item, cuts it by calling #982's shared cut function, which pushes chore/cut-vX.Y.Z and opens the release PR into main. The changelog section comes from the fragments (#933); this item generates nothing from titles.

Store slice

Closure and the cut read and write GitHub through the store (#768). This item adds what the store lacks, to both adapters and the contract suite:

  • pull requests merged into a branch, all pages, fail-closed, with number, URL, body, labels, milestone, merge commit, head commit and changed paths (issues() deliberately omits PRs; a new merged_pull_requests(base) read with a frozen record model like IssueRecord, store.py:182-196; the in-memory adapter already seeds pull requests through seed_issue(pull_request=True), memory_store.py:139-171);
  • in the in-memory adapter, a log of every write that tests read (today it has comments_on and changes_since, memory_store.py:211-213, :339-342, not a general write log).

Already there and reused: close_issue(number, CloseReason.COMPLETED, comment) (comment, then close; the GitHub adapter makes two REST calls, github_store.py:623-639), repository_file(path, ref=<merge commit>) (github_store.py:641-652; memory_store.py:300-310), releases() and items(release=...). Check runs still come from fetch_pr_check_verdicts (src/devops_cli/github/check_verdict.py:311). The release PR is still opened with gh pr create, inside #982's function.

Closure per item

  • Reads every PR merged into release/vX.Y.Z through the store, all pages.
  • Closes as completed each open issue that a PR body closes with a closing keyword, parsed by extract_linked_issues (issue_closure.py:100-120). These close nothing: Part N of #M, keywords inside code or quotes (strip_non_prose, :88), issues in other repos, and numbers that belong to pull requests.
  • Posts one comment per closed issue from a fixed template, no model:
    • What changed: the PR link, the merge commit, the first section of the PR body (capped at a length in config/defaults.py) and the number of changed files.
    • How it was verified: each check run at the PR's head commit with its bucket (fetch_pr_check_verdicts), and the Acceptance Criteria section of each task file the PR added or changed whose name starts docs/agent/tasks/task-<N>-, read at the merge commit through repository_file. A PR with no such file says "No task file".
  • When a PR's check runs cannot be read (unread_reason set, check_verdict.py:75), its issue stays open; the run names the failure and exits non-zero; the next run retries.
  • Skips issues already closed. The board's built-in "Item closed" workflow moves the item to Done (CONST_PROJECT_WORKFLOW_EXPECTATIONS, constants.py:2655-2666; a person turns it on, task-739 pending step 7). Closure writes no board field.

The cut

Runs when the current release (the lowest-numbered open Release in store.releases(), which is CONTEXT.md's definition; computed here, adopted by #740 when it lands):

  • has no open item;
  • has at least one item closed as completed;
  • has no open release PR;
  • has no merged release PR (stops a second cut between the merge and release.yml closing the milestone, and after a failed close).

The release PR is one predicate, defined here: an open PR into the default branch with head chore/cut-vX.Y.Z, label release and milestone vX.Y.Z; merged means shipped.

It then, in the clone at --root:

  • collects the fragments into ## [X.Y.Z] - YYYY-MM-DD, joining any open ## [X.Y.Z] section and leaving ## [Unreleased] empty, as release prepare does today (_plan_changelog_or_exit, _write_version_changelog, release.py:486-520; collect_changelog_fragments, changelog_fragments.py:145);
  • writes docs/ROADMAP.md with devops roadmap render;
  • calls fix(release): one fail-closed release path: cut branch from the remote release tip, uv.lock bump, draft flag, required label and milestone #982's shared cut function with draft=False, base main and no docs sync (DocGenerator documents the running CLI, the generated docs carry no version, and every item PR passes devops docs check; release.py:767-769). That function refuses a dirty tree, builds chore/cut-vX.Y.Z from origin/release/vX.Y.Z after a fetch, bumps pyproject.toml, src/devops_cli/__init__.py and uv.lock, commits, pushes with --force-with-lease, and opens the release PR ready for review with title feat(release): vX.Y.Z (_format_release_title, release.py:540-550), label release and milestone vX.Y.Z, exiting non-zero at the first failure. The PR's Release Notes are the collected section, because _resolve_clean_release_notes reads the CHANGELOG section first (release.py:979-996);
  • reports the items closed as completed that have no changelog.d/<issue>.md, in the run's output and in the dry run, and proceeds with the cut (the owner's decision: a missing fragment is a docs gap a person fixes on the release PR); when there is no cut, reports the open items holding it with their status.

Removed without shims

  • devops gh issues close-merged (gh.py:1161-1200, imports at :35-38) and its help strings (src/devops_cli/lang/en/help.py:803-810), plus its entry in tests/test_all_commands_help_dryrun.py:68;
  • get_issue_states, close_issue, closure_comment, close_issues_for_pull_request, list_merged_pull_requests and close_issues_for_merged_pull_requests in github/issue_closure.py (:164-387, and their __all__ entries at :390-403). extract_linked_issues and strip_non_prose stay (readiness uses them, pr.py:1595), with their parser tests in tests/test_gh_issue_closure.py:61-136. Tests of roadmap close replace the sweep and command tests (:161-564). The _closes_one_issue docstring at pr.py:1595, which names close-merged, is reworded.
  • docs/CLI_REFERENCE.md:6505 and docs/commands/gh.md:580 are regenerated.

Docs

docs/ROUTINE_TASKS.md Cadence C (:243-282) and its table row (:46), and docs/SDLC.md:346, describe the cut as devops roadmap close, with release prepare --create-pr as the manual fallback (#982 rewrites the lines that describe what that command does, :267 and :275, and the convention sentences in AGENTS.md, RELEASE_CYCLE.md and docs/agent/tasks/README.md; this item does not edit them). docs/MCP_TOOLS.md gains the roadmap_close mirror beside roadmap_migrate (:1350). The item PR adds changelog.d/743.md and docs/agent/tasks/task-743-<slug>.md and does not edit CHANGELOG.md or docs/ROADMAP.md.

Scope

One devops roadmap close command and its dry-run MCP mirror; the store's merged-PR read and the in-memory write log; the closure comment; the cut predicate and the current-release computation; the cut's fragment collection, roadmap render and call into #982's shared function; removal of close-merged; the doc rewrites above. Effort: High. One PR, landing after #982.

Key Questions

Acceptance Criteria

Automated tests unless marked otherwise. GitHub is #768's in-memory adapter plus a fake gh; git is a temporary repo with a local bare remote (#982's module-scoped fixture, copied per test); nothing touches the network.

Store slice

  • The contract suite (tests/test_roadmap_store_contract.py) runs the merged-PR read against both adapters, beside the existing close_issue and repository_file cases (:436-494).
  • On the GitHub adapter with a stub runner (tests/test_roadmap_github_store.py), a merged-PR listing spanning three pages returns every PR; a failed page raises and never returns part of the list.

Closure

  • A PR merged into release/v0.2.26 with Closes #12 closes feat(release): v0.1.11 #12 as completed; comments_on(12) holds one comment with the PR link, merge commit, first section, changed-file count, each check name with its bucket, and the task file's Acceptance Criteria lines.
  • These bodies close nothing: Part 1 of #12 alone; Closes #12 in a code block or quote; Closes other/repo#12; Closes #13 where New Title #13 is a pull request.
  • A PR without a task file gets "No task file"; a PR that modifies an existing task-12-* file gets its Acceptance Criteria quoted.
  • Five merged PRs close five issues, including the repo's oldest issue.
  • An already-closed issue gets no comment; a second run makes no write (the adapter's write log stays empty).
  • When reading the merged PRs, an issue, or a PR's check runs fails, the run exits non-zero naming the failure, never reports "nothing to close", and the issue stays open.

When to cut (table-driven)

  • No cut while an item is open, while a release PR (chore/cut-v0.2.26 into main, label release, milestone v0.2.26) is open, after a release PR has merged with the milestone still open, or when no item closed as completed; each names its reason and lists the open items.
  • A cut once every item is closed; the current release is the lowest-numbered open Release when two are open.

Cut mechanics

  • With the clone on another branch, the run pushes chore/cut-v0.2.26 whose parent is the remote release/v0.2.26 tip, and the remote release/v0.2.26 does not move.
  • The cut commit changes exactly pyproject.toml, src/devops_cli/__init__.py, uv.lock, CHANGELOG.md, docs/ROADMAP.md and the deleted changelog.d/*.md (git show --stat).
  • CHANGELOG.md holds one ## [0.2.26] block built from the fragments and an empty ## [Unreleased], also when a ## [0.2.26] section was already open; _extract_changelog_notes(root, "0.2.26") returns its body and _get_latest_changelog_version returns 0.2.26.
  • An item closed as completed with no fragment is named in the run's output and in the dry run, and the cut still happens.
  • The fake gh pr create receives base main, head chore/cut-v0.2.26, title feat(release): v0.2.26, label release, milestone v0.2.26, no --draft.
  • After the first release PR closes unmerged and one more item PR merges, the next run rebuilds chore/cut-v0.2.26 from the new release tip and the section holds the new fragment.

No merge

  • Across these tests the fake gh never receives pr merge or pr review; nothing is pushed to release/** or main.

Dry run

  • --dry-run, and a run without --confirm, print each issue it would close with its comment, the cut's branch, changed files, PR title, the fragments it would collect and the completed items with no fragment; the write log stays empty and no git ref changes. The MCP mirror roadmap_close only ever runs this and accepts no confirm argument (tests/test_fastmcp_contracts.py, beside the roadmap_migrate case at :1315).

Removal

  • rg -n "close-merged|close_issues_for|get_issue_states|list_merged_pull_requests" src tests docs -g '!docs/ROADMAP.md' -g '!docs/agent/tasks/**' finds nothing (today it hits issue_closure.py, gh.py, pr.py:1595, tests/test_gh_issue_closure.py, tests/test_all_commands_help_dryrun.py:68, docs/CLI_REFERENCE.md:6505 and docs/commands/gh.md:580); CHANGELOG.md keeps its history.

Docs and gate

  • docs/ROUTINE_TASKS.md (Cadence C and the table row at :46) and docs/SDLC.md:346 describe the cut as devops roadmap close, naming release prepare --create-pr only as the manual fallback; docs/MCP_TOOLS.md lists roadmap_close.
  • uv run devops docs check passes; the new tests add at most 1 s (uv run pytest <new files> --durations=0); uv run devops ci passes.

Manual check (a person, against GitHub, once every item of the current release is closed)

  • Pending a person: uv run devops roadmap close --dry-run -R dan-petty/devops-cli, then --confirm; gh pr view <n> --json headRefName,baseRefName,labels,milestone,isDraft shows head chore/cut-vX.Y.Z, base main, label release, milestone vX.Y.Z, isDraft: false; git fetch origin && git show --stat origin/chore/cut-vX.Y.Z lists the files above and the PR's checks pass; gh issue view <item> --comments shows one two-part comment on each item closed in that run.

Out of Scope

Dependencies

Owner decision: changelog collection moves to #1103 (2026-10-03)

Decided (owner, 2026-10-03), between this item and #1103: #1103's design wins. Changelog fragments are collected when the release merges or publishes, never in a release-cut commit. The body stands, with these changes:

Proposed Solution, The cut (changed).

Title. "generated changelog" in the title no longer describes this item, which collects and generates no changelog. The body's own heading is the title to use: "feat(release): item closure summaries and automatic release cut (devops roadmap close)".

Scope (changed). "The cut's fragment collection" is removed from the list.

Key questions (changed).

Acceptance criteria (replaced).

  • The cut commit changes exactly pyproject.toml, src/devops_cli/__init__.py, uv.lock and docs/ROADMAP.md (git show --stat). (Replaces the criterion that listed CHANGELOG.md and the deleted changelog.d/*.md.)
  • CHANGELOG.md and every changelog.d/*.md in the cut commit are byte-identical to the remote release/v0.2.26 tip, also when a ## [0.2.26] section is already open; no ## [0.2.26] section is written. (Replaces the criterion on the ## [0.2.26] block, _extract_changelog_notes and _get_latest_changelog_version.)
  • After the first release PR closes unmerged and one more item PR merges, the next run rebuilds chore/cut-v0.2.26 from the new release tip, and the new fragment is in changelog.d/ on the rebuilt branch, uncollected. (Replaces "the section holds the new fragment".)
  • --dry-run, and a run without --confirm, list the fragments present on the release branch, none collected, in place of "the fragments it would collect"; the rest of the dry-run criterion stands.

The other criteria stand, including the missing-fragment report: an item closed as completed with no fragment is named in the run's output and in the dry run, and the cut still happens.

Dependencies (added).

Activity

  1. added this to the v0.2.26 milestone on Sep 30, 2026
  2. added
    type/feature
    priority/p1-high
    scope/release
    on Sep 30, 2026
  3. dan-petty commented on Oct 3, 2026

    @dan-petty
    OwnerAuthor

    #741 now lands before #982 (owner's order of 2026-10-03); no change to this item's code.

  4. dan-petty commented on Oct 4, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1170, merged into release/v0.2.26 as b61e5a0.

    Closes #743

    37 file(s) changed.

    How it was verified

    Check runs at 77d7f08:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Static Analysis: pass
    • Analyze (actions): pass
    • Analyze (python): pass
    • Tests & Coverage: pass
    • Service Image: skipping
    • DevContainer Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-743-roadmap-close-and-release-cut.md:

    Store slice

    • The contract suite reads merged pull requests: tests/test_roadmap_store_contract.py::test_merged_pull_requests_are_the_ones_merged_into_the_branch_with_their_paths.
    • A three-page listing returns every merged pull request with its files, and a failed page or files listing raises: tests/test_roadmap_github_store.py::test_merged_pull_requests_read_every_page_with_each_ones_files, ::test_a_failed_merged_pull_request_page_raises_and_returns_no_part (pages 1 to 3), ::test_a_failed_files_listing_raises.

    Closure (tests/test_roadmap_close.py)

    • Closes #1 closes Release v0.1.8 #1 as completed with one comment holding the link, merge commit, first section, file count, check buckets and the task file's Acceptance Criteria: ::test_a_merged_pull_request_closes_its_issue_with_a_two_part_comment.
    • Part 1 of #N, a code block, a quote, inline code, another repository and a pull request number close nothing: ::test_these_bodies_close_nothing.
    • No task file gives "No task file"; a changed task file is quoted: ::test_a_pull_request_without_a_task_file_says_so and the first test.
    • Five merged pull requests close five issues, the oldest included: ::test_five_merged_pull_requests_close_five_issues_including_the_oldest.
    • An already-closed issue gets no comment and a second run writes nothing: ::test_a_closed_issue_gets_no_comment_and_a_second_run_writes_nothing.
    • A failed merged-PR, issue or check-run read exits non-zero, names it, never says nothing to close, and leaves the issue open: ::test_a_failed_read_exits_non_zero_naming_it_and_the_issue_stays_open.

    When to cut

    • Held by an open item (listed), an open release PR, a merged one, and nothing delivered; cut when all are closed, with a closed unmerged release PR and a PR from another head ignored, and the lowest open release chosen: ::test_when_to_cut, ::test_no_open_release_holds_with_no_release.

    Cut mechanics

    • From a clone on another branch, chore/cut-v0.2.26 is pushed with the remote release/v0.2.26 tip as parent; release/v0.2.26 and main don't move; the commit changes exactly docs/ROADMAP.md, pyproject.toml, src/devops_cli/__init__.py and uv.lock; gh pr create gets base main, head chore/cut-v0.2.26, title feat(release): v0.2.26, label release, milestone v0.2.26, no --draft; a completed item without a fragment is named; gh never gets pr merge or pr review: ::test_the_cut_pushes_the_cut_branch_from_the_release_tip_and_opens_a_ready_pr.
    • After the release PR closes unmerged and another item merges, the next run rebuilds the cut from the new tip with the new fragment uncollected and CHANGELOG.md identical to the tip: ::test_a_cut_after_an_unmerged_release_pr_rebuilds_from_the_new_tip.
    • The cut names the missing fragments and the fragments present: ::test_the_cut_names_the_branch_base_title_and_missing_fragments.

    Dry run and preview

    • A run without --confirm prints each closing with its comment and the cut, writes nothing, changes no git ref and runs no gh: ::test_a_run_without_confirm_previews_and_changes_nothing.
    • --dry-run makes no request and lists the reads, the closes and the cut's git and gh commands, with no --draft: ::test_the_dry_run_lists_the_closes_and_the_cut_without_a_request, ::test_the_dry_run_command_makes_no_request_and_names_the_cut_files, and close added to tests/test_roadmap_dry_runs.py's jobs (entry-point probe).
    • roadmap_close takes plan or dry-run only: tests/test_fastmcp_contracts.py::test_the_roadmap_tools_are_registered_and_migrate_only_previews.

    Removal, docs and gate

    • rg -n "close-merged|close_issues_for|get_issue_states|list_merged_pull_requests" src tests docs -g '!docs/ROADMAP.md' -g '!docs/agent/tasks/**' finds nothing; the parser tests stay in tests/test_gh_issue_closure.py.
    • docs/ROUTINE_TASKS.md (Cadence C and its table row) and docs/SDLC.md describe the cut as devops roadmap close, with release prepare --create-pr as the manual fallback; docs/MCP_TOOLS.md lists roadmap_close; uv run devops docs check passes.
    • Fragment only: changelog.d/743.md; CHANGELOG.md and docs/ROADMAP.md are untouched. Every new test runs offline in under 1 s.
    • Pending a person: once every item of the current release is closed, uv run devops roadmap close --plan -R dan-petty/devops-cli, then --confirm from a clean clone; gh pr view <n> --json headRefName,baseRefName,labels,milestone,isDraft shows head chore/cut-vX.Y.Z, base main, label release, milestone vX.Y.Z, isDraft: false; git fetch origin && git show --stat origin/chore/cut-vX.Y.Z lists the files above (plus the service image tag fix(release): one fail-closed release path: cut branch from the remote release tip, uv.lock bump, draft flag, required label and milestone #982 bumps), the PR's checks pass, and gh issue view <item> --comments shows one two-part comment on each item closed in that run.
    • Pending a person: close fix(github): gh issues close-merged misses issues older than the newest n #778 as not planned if it is still open (superseded by this command).
  5. added a commit that references this issue on Oct 4, 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/releasetype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions