Skip to content

fix(cut-release): enumerate merged PRs, not only squash titles - #4668

Merged
Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-fix-cut-release-change-list
Nov 21, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-fix-cut-release-change-list

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

scripts/list-changes-since-tag.sh (cut-release skill) read only squash-merge (#N) subjects with --no-merges. main lands PRs as merge commits (Merge pull request #N from ...), so it missed most PRs and picked up issue numbers cited in branch commits. The v0.38.0 draft (#4640) had to be built by hand.

Changes:

  • Enumerate authoritatively with gh pr list --state merged --base main --search "merged:>=<tag commit date>" --limit 500, then keep only PRs whose merge commit is reachable from HEAD and not from the tag (git merge-base --is-ancestor), so the window is exact.
  • Fallback when gh is missing or errors: [!] warning on stderr, then parse BOTH Merge pull request #N and squash (#N) subjects from first-parent git log <tag>..HEAD. If gh pr view fails for a PR, details come from the commit (title, author, changed paths) instead of dropping the PR.
  • New --self-test: builds a throwaway repo (tag, squash (#11), Merge pull request #12 from x/y, plus a pre-tag (#10) and a branch-only (#99) as negatives) and asserts the git-log parser finds exactly 11 and 12. Offline, no gh. Documented in --help and SKILL.md.
  • JSON output schema and exit codes unchanged. Dropped the bash-4 associative array so it also runs on macOS /bin/bash 3.2.
  • .agents/skills/cut-release/ mirror hand-synced byte-identically; apm.lock.yaml content hashes updated (APM Self-Check audits drift).

Before / after (main at 96a3ec5, since v0.37.0):

Script PRs listed
before (main) 7 (several are issue numbers, e.g. #3299, #4013 skipped as not-a-PR)
after 48

Issue and approved scope

Issue: Fixes #4667

Human scope-approval comment: requested by the release manager to unblock the 0.38.0 cut; approval to be recorded on #4667 by a maintainer.

Does this PR complete the issue, or what remains? Completes it.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally

  • All existing tests pass

  • Added tests for new functionality (if applicable)

  • bash .apm/skills/cut-release/scripts/list-changes-since-tag.sh --self-test -> passed ([+] self-test passed: found PRs 11 12), also under macOS /bin/bash 3.2.

  • Same self-test with the merge regex broken -> fails ([x] self-test: PR #12 not found), exit 1.

  • shellcheck .apm/skills/cut-release/scripts/list-changes-since-tag.sh -> clean.

  • Real run after git fetch --tags -> 48 PRs, exit 0; --bogus -> exit 2.

  • No Python touched; full pytest not run (no tests reference this script).

Changelog

  • One fragment per section, changelog.d/<pr>.<section>.md, holding
    one line: user-visible effect first, 25 words or fewer, ending with
    (#PR); breaking changes only under upgrade notes; no Highlights; no
    new lines under ## [Unreleased]. See changelog.d/README.md and
    .github/instructions/changelog.instructions.md.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated
    (new/changed <a id="req-XXX"></a> anchor + prose + Appendix C
    row).
  • Manifest edit: docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml
    updated.
  • Test edit: a @pytest.mark.req("req-XXX") test under
    tests/spec_conformance/ added or extended.
  • CONFORMANCE.{md,json} regenerated via
    uv run --extra dev python -m tests.spec_conformance.gen_statement
    and committed.
  • N/A -- this PR does not change OpenAPM-observable behaviour.

list-changes-since-tag.sh read only squash-merge '(#N)' subjects, but
main lands PRs as merge commits, so most PRs since a tag were missed.
Enumerate with gh pr list --state merged and keep PRs whose merge
commit is in <tag>..HEAD. Without gh, warn and parse both
'Merge pull request #N' and '(#N)' first-parent subjects. Add an
offline --self-test. Output schema and exit codes are unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The release-change script can silently return incomplete PR lists, abort its fallback on unmatched commits, and run self-test Git operations in the caller’s repository if temporary-directory setup fails.

3 open issues
What changed in this PR

Updates cut-release PR discovery to include merge commits, addressing #4667 and reducing manual work when preparing release notes.

Changes:

  • Uses gh pr list with ancestry filtering, plus a first-parent Git-log fallback.
  • Adds offline metadata recovery and a parser self-test; removes the Bash 4 associative-array dependency.
  • Updates skill documentation, synchronizes deployed copies, and refreshes lockfile hashes.
File Description
apm.lock.yaml Updates hashes for the deployed skill and script.
.apm/​skills/​cut-release/​SKILL.md Documents enumeration, fallback behavior, and the self-test.
.apm/​skills/​cut-release/​scripts/​list-changes-since-tag.sh Implements merged-PR discovery, metadata fallback, and self-testing.
.agents/​skills/​cut-release/​SKILL.md Mirrors the updated skill documentation.
.agents/​skills/​cut-release/​scripts/​list-changes-since-tag.sh Mirrors the release-enumeration script changes.

Review effort: Balanced

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 11f8f58 into main Nov 21, 2026
38 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-fix-cut-release-change-list branch November 21, 2026 18:51
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 21, 2026
…iew-followups

fix(cut-release): follow-ups from #4668 review
Mohit Mishra (mohitmishra786) pushed a commit to mohitmishra786/apm that referenced this pull request Nov 22, 2026
…r cd fails

run_self_test is called as 'run_self_test || exit 1', which disables
errexit inside it, so a failed mktemp or cd let git init/commit/checkout
run in the caller's real repository. Stop explicitly on either failure
and assert the cwd is the temp dir before git init (microsoft#4668 review).

Refs microsoft#4667

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.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.

[BUG] cut-release list-changes-since-tag.sh misses PRs landed as merge commits

2 participants