Skip to content

fix(changelog): drop merge commits from release-PR changelog - #48

Merged
Shinrai merged 1 commit into
nextfrom
fix/changelog-drop-merge-commits
May 26, 2026
Merged

Shinrai merged 1 commit into
nextfrom
fix/changelog-drop-merge-commits

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

No new features

🐛 Bug Fixes

  • fix(changelog): drop merge commits from release-PR changelog (7ccdfde)

🔧 Other Changes

No other changes

👥 Contributors

Under v4's merge-commit-only policy on `next`/`hotfixes`, every PR that
lands leaves two artifacts in the target branch's history:

  - The merge commit (subject: `<PR title> (#N)`, with two parents — the
    target branch and the PR's head)
  - The original commits from the PR's source branch, unchanged

`next-release.yml` walks `master..next` and feeds every commit in that
range to the changelog generator. Without filtering, the result is each
PR producing two adjacent changelog lines that say the same thing — one
for the merge commit (with the auto-appended `(#N)`) and one for the
original commit (without). E.g.:

    feat(redirect-hotfix-pr): ... (#41) (5fb9ffb)    ← merge commit
    feat(redirect-hotfix-pr): ... (c4e4c89)          ← original

The merge commit is structural — it joins histories — but it isn't a
real change-bearing commit. The contributor's original commit already
describes the change. The merge commit should never appear in a release
changelog.

Adds `filterMergeCommits(commits, range)` to generate-comprehensive-
changelog, which uses `git log --merges --format=%H <range>` to
enumerate merge commits in the range and drops them from the commits
array. Best-effort: failures log a warning and pass commits through
unchanged. One git call per generator run.

Runs in this order in the filter chain:
  1. filterBotCommits        (drops bot-attributed / automation commits)
  2. filterMergeCommits      (NEW: drops structural merge commits)
  3. filterAlreadyAppliedByPatchId   (drops stacked-PR duplicates by patch-id)
  4. augmentCommitsWithPRRefs        (appends (#N) to commits whose subject lacks it)

Combined effect on the example above: after the merge commit is dropped,
`c4e4c89` survives. augmentCommitsWithPRRefs then queries the API,
finds it's associated with PR #41, and produces:

    feat(redirect-hotfix-pr): ... (#41) (c4e4c89)

— one clean line per PR, with the PR link attached to the actual commit.
@cldmv-bot cldmv-bot Bot added the area: core label May 26, 2026
@Shinrai
Shinrai merged commit 7d06c21 into next May 26, 2026
9 checks passed
@cldmv-bot
cldmv-bot Bot deleted the fix/changelog-drop-merge-commits branch May 26, 2026 21:16
Shinrai added a commit that referenced this pull request May 26, 2026
…#40)

## 🚀 What's Changed

### 💥 Breaking Changes
_No breaking changes_

### ✨ Features

- #41 (5fb9ffb)
- feat(redirect-hotfix-pr): redirect Dependabot security PRs to the
hotfix lane (c4e4c89)

### 🐛 Bug Fixes

- #48 (7d06c21)
- fix(changelog): drop merge commits from release-PR changelog (7ccdfde)

- #47 (ff4207b)
- fix(v4): prefer "Create a merge commit" on next/hotfixes; dedupe
stacked-PR commits (c552494)

- #44
- fix(v4): per-branch merge methods + PR-ref annotation in release-PR
changelogs (29637d7)
- fix(rulesets): move Copilot review next/hotfixes; allow squash as
fallback (26dcea8)
- fix(changelog): drop redundant precondition check in
findAssociatedPullNumber (ea01889)

- #41 (5fb9ffb)
- Potential fix for pull request finding 'CodeQL / Missing regular
expression anchor' (329f7fe)

- #39 (91ddf1f)
- fix(cla): audit tool walks both default and override signature trees
(84ecbed)
- fix(cla): pass public_cla_url_template through reusable workflow;
document override behavior (97bb8d2)
- fix(cla): bot reads CLA from ledger (default) or consumer override;
per-text-hash scope (132bcb7)
- fix(cla): remove root CLA.md; bot must use the central ledger as
source (f01b007)

### 🔧 Other Changes

- #46 (454b724)
- docs(readme): modernize for v4; drop stale v3-launch markers; fix
ruleset-generator links (d09fdb8)

- #43 (417f110)
- docs(embedded-tests): surface the embedded-tests-ci feature in
onboarding (27a82f6)

- #42 (47a9ee4)
- chore(dependabot): add v4-tuned dependabot.yml template + update
auto-merge wiring (d52b60e)

- #39 (91ddf1f)
- docs(cla): describe override scope across all onboarding + reference
docs (7a25d06)

- #38 (9527fef)
- docs(cla): reframe public sample CLA, drop mirror-of-private framing
(549263a)
  - chore(cla): seed real CLA text + add boilerplate files (730a90e)


<details>
<summary>👥 Contributors</summary>

- @Shinrai

</details>

---------

Co-authored-by: Nate Corcoran <[email protected]>
Co-authored-by: cldmv-bot[bot] <230771808+cldmv-bot[bot]@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.

1 participant