Skip to content

fix(release): search the whole cycle for changelog commits, and restore the lines 3.0.0 lost - #596

Merged
Vivswan merged 1 commit into
mainfrom
fix/release-changelog-depth
Nov 12, 2026
Merged

Vivswan merged 1 commit into
mainfrom
fix/release-changelog-depth

Conversation

@Vivswan

@Vivswan Vivswan commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Before

release run -> walk main back from its tip -> 500 commits read: stop -> changelog built from those 500
                                              (the 3.0.0 cycle reached 658 commits back, so the oldest 158 were never read)
$ census faf72dab
cycle v2.0.0..f2b96b13: 659 first-parent commits, 137 of type feat, fix, or perf
IN=112  ABSENT=25
control f68d78b: present
control 9ae375c: absent

After

release run -> walk main back from its tip -> last-release-sha reached? -> yes: stop, changelog built from the whole cycle
                                                                        -> no:  stop after 5000 commits
$ census 393e9b2e
cycle v2.0.0..f2b96b13: 659 first-parent commits, 137 of type feat, fix, or perf
IN=137  ABSENT=0
control f68d78b: present
control 9ae375c: present
  • Not changed: the published GitHub release notes of v3.0.0 still lack the 25 lines.
  • No guard: a cycle past 5000 commits would be cut the same silent way.
  • After the merge: release-please rebuilds the open 3.0.1 release PR, and its entry gains one Bug Fixes line for this PR.

How

  • The key: commit-search-depth: 5000 in release-please-config.json, where release-please's default is 500.
  • Why 5000: about 7.6 times the 659-commit cycle that overflowed.
  • No added cost: the walk still stops at last-release-sha, so the depth is only a ceiling.
  • The 25 lines: 5 under Features and 20 under Bug Fixes, each where release-please's own writer sorts it.
  • Library: release-please already owns the changelog, and the fix is its own option.

Proof

  • Diff: CHANGELOG.md gains 25 lines and loses none.
  • Rebuild: release-please 17.6.0's parser and writer reproduce the old entry at depth 500, and this one at full depth.
Technical details
  • Option source, schema: release-please's schemas/config.json defines the root key as "commit-search-depth": { "description": "When considering commit history, only look this many commits deep.", "type": "number" }.
  • Option source, docs: release-please's docs/manifest-releaser.md says "When fetching the list of commits to consider, only consider the last N commits." and "We expect to only need to consider the last 500 commits on a branch."
  • Option source, code: src/manifest.ts at v17.6.0 holds DEFAULT_COMMIT_SEARCH_DEPTH = 500 and hands the option to the commit walk as maxResults.
  • Version in use: the release workflow pins release-please-action v5.0.0, whose lockfile resolves release-please 17.6.0.
  • Where the walk stops: the same loop breaks when this.lastReleaseSha === commit.sha, the boundary the release hook keeps in last-release-sha.
  • Request size: the walk reads 10 commits a request by default, so its cost follows the cycle's length, never the ceiling.
  • Pace: the 659 commits took three months, so 5000 is about two years of commits at that pace.
  • Why the loss was silent: when the walk ends at the depth, release-please's loop just ends, and nothing compares the cycle's length with the depth.
  • 658 and 659: the cycle is 659 commits with the release commit, and 658 as release-please walked it back from 6dbc9a96.
  • Schema check: the edited config validates against that schema, which is closed at the root.
  • Schema control: the same config with the key misspelt is refused as an additional property, and a string value is refused.
  • Hook round-trip: the release hook rewrites the file with JSON.stringify(config, null, 2), which reproduces the edited file byte for byte.
  • Split at 500: counted back from 6dbc9a96, every listed feat, fix, or perf commit sits at position 496 or newer and every absent one at 503 or older.
  • Rebuild input: each cycle commit's message and its merged pull request's body, read from the GraphQL history release-please itself queries.
  • Rebuild control: fed the newest 500 commits, release-please 17.6.0's parseConventionalCommits and DefaultChangelogNotes return the 3.0.0 entry as it was committed, byte for byte below its dated heading.
  • Rebuild result: fed all 658, they return that entry plus 25 lines and no other difference, and this PR commits that output under the unchanged heading.
  • Order rule: conventional-changelog-writer 6.0.1 sorts a section by localeCompare over scope and subject joined, so a line without a scope sorts by its subject.
  • Order check: all 154 lines of the entry satisfy that rule, as the 129 before did.
  • Line check: each restored line carries its commit's subject, the pull request link its subject names, and its full-sha link.
  • Breaking: none of the 25 has a ! or a breaking footer, and the rebuild counts 50 breaking entries at both depths.
  • Features (5): 8a65765, 9ae375c, d062cf1, 51068cd, 83f3c84.
  • Bug Fixes (20): 44dab3b, 73b6b4a, ceb9f46, b9de617, b5db672, 7dcc225, 65f97a2, 9152a91, e41aa99, 0181f01, d34d031, f5c4c59, 6fb2603, ae278c9, 56ca3e4, 64aad27, c1fc169, 08d5585, 8543af8, 3fc0f85.
  • Tests: no test is added for a configuration value.
  • Existing tests: the two that read the config pass, release configuration contract and marker-bearing files equal the release-please extra-files set.
  • Gates: typecheck, lint, lint:arch, knip, check:compat, and build:check exit 0.
  • Census refs: census <ref> reads CHANGELOG.md at that ref, where faf72dab is main's tip under this branch and 393e9b2e is this PR's head.
  • Census controls: f68d78b is a line the entry always had, and 9ae375c is one of the 25.
  • Census failure: a failed git read, a missing ref, or a filter that matches no commit ends the function with a non-zero exit and no count line.
  • Census function: paste it into bash inside a clone that has the tags.
census() (
  set -euo pipefail
  ref="$1"                               # the tree whose CHANGELOG.md is read
  range=v2.0.0..f2b96b13                 # the 3.0.0 cycle, its release commit included
  changelog="$(git show "$ref:CHANGELOG.md")"
  cycle="$(git log --first-parent --format='%H%x09%s' "$range")"
  typed="$(grep -E $'^[0-9a-f]{40}\t(feat|fix|perf)[(:!]' <<<"$cycle")"
  in=0; absent=0
  while IFS=$'\t' read -r sha subject; do
    if grep -q -F "[${sha:0:7}](" <<<"$changelog"; then in=$((in + 1)); else absent=$((absent + 1)); fi
  done <<<"$typed"
  echo "cycle $range: $(wc -l <<<"$cycle") first-parent commits, $(wc -l <<<"$typed") of type feat, fix, or perf"
  echo "IN=$in  ABSENT=$absent"
  for control in f68d78b 9ae375c; do
    if grep -q -F "[$control](" <<<"$changelog"; then echo "control $control: present"; else echo "control $control: absent"; fi
  done
)

…re the lines 3.0.0 lost

release-please reads at most commit-search-depth commits of main when it builds a release, 500 by default. The 3.0.0 cycle ran 659 commits, so the oldest 158 were never read and the 25 feat and fix commits among them never reached CHANGELOG.md. Nothing failed: the walk just ended.

release-please-config.json now sets commit-search-depth to 5000, about 7.5 times that cycle. The walk still stops at last-release-sha, so the number is a ceiling and a normal run reads no more than its cycle.

CHANGELOG.md's 3.0.0 entry gains the 25 lines, 5 under Features and 20 under Bug Fixes, as release-please 17.6.0's own parser and writer produce them from the whole cycle: the same code, fed the newest 500 commits, reproduces the entry as it was committed. None of the 25 is breaking. The published GitHub release notes of v3.0.0 are not changed.
Copilot AI balanced review requested due to automatic review settings November 12, 2026 02:21
@github-actions

Copy link
Copy Markdown
Contributor

File size check

0 over a hard cap (fails), 6 warning(s).

File Size Tier Cap
src/engine/diff.ts:56 11 comment lines warn 10
src/github/api-error.ts:9 11 comment lines warn 10
src/problem.ts:73 18 comment lines warn 10
src/sections/contract/errors.ts:13 11 comment lines warn 10
src/sections/contract/module.ts:55 12 comment lines warn 10
src/sections/shared/list/decl.ts:265 14 comment lines warn 10

Split the file, wrap the line, shorten or exempt the comment, or list the path in .file-size-allow.local with a # reason.

5 managed file(s) skipped; repo-platform owns them.

@github-actions

Copy link
Copy Markdown
Contributor

Member shape check

1 finding(s).

File Line Rule
test/sections/contract/validate-hook.test.ts 80 all-or-none

Add the blank lines, make the comment one line directly above the item, comment every field or none, or list the path in .member-shape-allow.local with a # reason.

4 generated file(s) skipped.

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.

🟢 Approval recommended

No active review issues remain for the commit-search depth increase and changelog restoration.

No open issues 🎉

What changed in this PR

This PR expands release-please's commit-history search to cover longer release cycles and restores entries omitted from the 3.0.0 changelog.

Changes:

  • Raises the commit-search ceiling from 500 to 5,000, while retaining the last-release boundary.
  • Restores 25 changelog entries: 5 features and 20 bug fixes. Published GitHub release notes remain unchanged.
File Description
release-please-config.json Sets commit-search-depth to 5,000.
CHANGELOG.md Restores 25 missing entries under the existing 3.0.0 sections.

Review effort: Balanced

@Vivswan
Vivswan marked this pull request as ready for review November 12, 2026 02:47
@Vivswan Vivswan added the merge-when-green Owner approved: merge once every gate is green label Nov 12, 2026
@Vivswan
Vivswan merged commit 6256d8b into main Nov 12, 2026
32 checks passed
@Vivswan
Vivswan deleted the fix/release-changelog-depth branch November 12, 2026 04:44
This was referenced Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-when-green Owner approved: merge once every gate is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants