Skip to content

fix(release): Skip a named PR merged elsewhere; mark a published draft - #184

Merged
mpaulosky merged 5 commits into
mainfrom
fix/144-release-review-fixes
Sep 30, 2026
Merged

mpaulosky merged 5 commits into
mainfrom
fix/144-release-review-fixes

Conversation

@mpaulosky

@mpaulosky mpaulosky commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two flaws in the release pipeline (#172), found by Copilot's review of its port to atelier-store (mpaulosky/atelier-store#90). This keeps IssueTracker, the reference implementation, in step.

  • A manual run naming a PR merged elsewhere: release_queue.py queued the named PR without checking its base branch, so a PR merged into another branch failed the run with UnknownMergeOrder (its merge commit isn't on main). Only a named PR whose base is main is queued now.
  • Publishing a draft Release: the release job published a draft for its tag without touching its body. The planner and the ordering guard recognise a Release only by its Source PR: #n marker, so a draft without one stayed "owed" forever and blocked every later PR. The decision now lives in a tested helper, .github/scripts/draft_release.py: it appends the release notes unless the draft already names this PR on a line of its own (LF or CRLF), keeping the draft's own text. A draft that names a different PR is inconsistent, so the step stops with an error naming it rather than publish a Release with two sources. Markers count anywhere in a line, the pattern release_post.source_pr_of() uses, so a - Source PR: #5 list item is caught too.

Testing

  • New test_main_skips_a_manually_named_pr_merged_into_another_branch (it failed before the fix).
  • New test_draft_release.py (17 tests): no marker, an empty draft, this PR's line (also with CRLF endings), this PR only inside a longer line, another PR (alone, in a list item, or beside this PR's line), #5 against #15 and #50, agreement with source_pr_of(), and the CLI's output and stderr error.
  • All script tests: 158 passed, 1 skipped. A failing helper stops the step under bash -e, checked locally.
  • yamllint, actionlint and zizmor are clean, and the pre-push gate passed.

Refs #144

🤖 Generated with Claude Code

Two flaws found by Copilot's review of this pipeline's port to
atelier-store (mpaulosky/atelier-store#90):

- A manual run queued the PR it named without checking its base branch,
  so a PR merged into another branch failed the run on a merge commit
  main doesn't have. Only a PR merged into main is queued now.
- Publishing a draft Release kept its body, so a draft without the
  Source PR line stayed invisible to the planner and the ordering guard,
  blocking every later PR. The release notes are appended first unless
  the draft already names the PR, keeping the draft's own text.

Refs #144

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 04:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Conflicting source-PR metadata can publish an inconsistent release that remains queued or bypasses ordering checks.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Updates release handling to avoid queueing PRs merged outside main and to annotate draft releases before publication.

Changes:

  • Filters manually named PRs by base branch.
  • Adds regression coverage for non-main PRs.
  • Preserves draft notes while appending release metadata.
File Description
.github/​workflows/​release.yml Adds metadata before publishing drafts.
.github/​scripts/​release_queue.py Excludes named PRs not targeting main.
.github/​scripts/​tests/​test_release_queue.py Tests manual dispatch with another base branch.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/release.yml Outdated
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Test Results Summary

483 tests  ±0   483 ✅ ±0   20s ⏱️ -1s
  9 suites ±0     0 💤 ±0 
  9 files   ±0     0 ❌ ±0 

Results for commit 4413e1e. ± Comparison against base commit 3feeb2f.

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.40%. Comparing base (3feeb2f) to head (4413e1e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #184   +/-   ##
=======================================
  Coverage   85.40%   85.40%           
=======================================
  Files          77       77           
  Lines        1596     1596           
  Branches      150      150           
=======================================
  Hits         1363     1363           
  Misses        189      189           
  Partials       44       44           

A draft for this tag whose body already names a different PR would be
published with two Source PR lines, so the planner and the ordering
guard would disagree about which PR it releases. The step now stops
with an error naming the other PR instead. Addresses Copilot review on
#184.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 04:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Draft conflict detection does not recognize every source marker accepted by the planner.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Resolved since last review (1)

Comment thread .github/workflows/release.yml Outdated
release_post.source_pr_of() finds "Source PR: #n" anywhere in the body,
so the draft check now does too; a line like "- Source PR: #5" no longer
slips past it.

Refs #144

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 04:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The new draft-release behavior lacks automated regression coverage.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

Comment thread .github/workflows/release.yml Outdated
draft_release.py decides the body a draft is published with: append the
release notes unless the draft names this PR on a line of its own, and
fail when it names another PR. Sixteen tests cover the cases the workflow
step only had manual checks for.

Refs #144

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 04:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The marker check mishandles CRLF release bodies and unnecessarily duplicates release metadata.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

Comment thread .github/scripts/draft_release.py Outdated
A draft with CRLF line endings that already names this PR got the release
notes appended a second time, because the line-end match didn't allow the
carriage return. The workflow's idempotency check already accepts CRLF.

Refs #144

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 04:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The release fixes are focused, consistent with existing parsing behavior, and comprehensively tested.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@mpaulosky
mpaulosky merged commit 5fbc179 into main Sep 30, 2026
31 checks passed
@mpaulosky
mpaulosky deleted the fix/144-release-review-fixes branch September 30, 2026 04:38
mpaulosky added a commit that referenced this pull request Sep 30, 2026
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
mpaulosky added a commit to mpaulosky/atelier-store that referenced this pull request Sep 30, 2026
Port of mpaulosky/IssueTracker#184's later fixes. draft_release.py returns
the body to publish a draft with: the release notes are appended unless
the draft names this PR on a line of its own (LF or CRLF), and a draft
naming another PR, anywhere in a line, fails the job rather than give one
Release two sources.

Refs #86

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants