Skip to content

fix: pin changelog relative links in release PR, commit and release bodies - #458

Merged
Shinrai merged 2 commits into
nextfrom
fix/release-body-links
Nov 14, 2026
Merged

Shinrai merged 2 commits into
nextfrom
fix/release-body-links

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Relative links in a changelog file break once it becomes a PR or release body: GitHub resolves a PR body against the PR URL and a release body against the repo root. The files stay relative. The links get rewritten where the file turns into a body.

  • pinRelativeLinks (release-notes.mjs) resolves each relative link and image against the changelog's folder and pins it to a ref (blob/<ref>/…, raw/ for images). It skips absolute URLs, //host, anchors, mailto: and other schemes, fenced and inline code, and paths above the repo root.
  • Open release PR body: pinned to the PR's head branch (next, or hotfixes on the hotfix lane) so the links work during review. The generator takes it as changelog-link-ref; create-release-pr and update-release-pr pass the head branch, and the default is the tag.
  • Squash commit: release-merge runs the body through repinBranchLinks before the merge, so master's release commit carries blob/vX.Y.Z/… links.
  • Tag message and GitHub Release: tag links (create-release and sync-release-notes).
  • Merged release PR: sync-release-notes finds each release's PR from its release commit and rewrites the body to tag links once the tag exists. It also pins old, still-relative bodies and skips bodies that already have tag links. Its App token now requests pull_requests.
  • In sync, a file read from the default branch can link to something that didn't exist at the tag (a backfill); those links point at the default branch.

No head-SHA links anywhere. After this ships, a sync-release-notes run in each affected repo fixes the old release pages and release PRs.

Resolves #457

…R bodies

GitHub resolves a release body against the repo root and a PR body against
the PR URL, so relative links in a per-version changelog 404 there. A shared
pinRelativeLinks helper now resolves each relative link and image against the
changelog's own folder and pins it to blob/vX.Y.Z (raw/ for images). It skips
absolute URLs, anchors, mailto and other schemes, fenced and inline code, and
paths above the repo root.

Used by generate-comprehensive-changelog (release PR body, which becomes the
squash commit), create-release and sync-release-notes. Sync points links at
the default branch for files that don't exist at the tag (backfills).

Resolves #457
@cldmv-bot cldmv-bot Bot added ! fix → next v4 flow: fix contributor PR targeting the next integration branch area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure type: documentation Relates to docs, README updates, guides, or inline code comments labels Nov 14, 2026
The open release PR body now pins changelog links to its head branch
(next/hotfixes) so they work during review; a tag link is dead until the
release exists. Everything permanent gets tag links:

- release-merge moves the head-branch links to vX.Y.Z in the squash commit
  message (repinBranchLinks), so master's release commit carries tag links.
- The tag message and GitHub Release body use the tag, as before.
- sync-release-notes points each merged release PR's links at its tag once
  the tag exists (and pins old, still-relative bodies), leaving bodies that
  already have them alone. Its App token now requests pull_requests.

The generator takes the ref as changelog-link-ref (default: the tag);
create-release-pr and update-release-pr pass the head branch.

Resolves #457
@cldmv-bot cldmv-bot Bot added the type: ci Changes to CI workflows, actions, or build pipelines label Nov 14, 2026
@Shinrai Shinrai changed the title fix: pin changelog relative links to the release tag in release and PR bodies fix: pin changelog relative links in release PR, commit and release bodies Nov 14, 2026
@Shinrai
Shinrai merged commit 66e3131 into next Nov 14, 2026
14 checks passed
@cldmv-bot
cldmv-bot Bot deleted the fix/release-body-links branch November 14, 2026 03:15
cldmv-bot Bot added a commit that referenced this pull request Nov 14, 2026
# v4.36.1 — 2026-11-13

Patch release that fixes relative links in changelog files once they become a release PR body, a release commit, a tag message or a GitHub Release. GitHub resolves a PR body against the PR URL and a release body against the repo root, so a link like `../../drivers.md` that works in the file view 404'd on every release page. The changelog files stay relative; the links are rewritten where the file turns into a body.

## Bug Fixes

- **Changelog links pinned per surface.** A shared `pinRelativeLinks` helper in `release-notes.mjs` resolves each relative link and image against the changelog's own folder and turns it into an absolute `https://github.com/<repo>/blob/<ref>/…` URL (`raw/` for images). It leaves absolute URLs, `//host` links, `#anchors`, `mailto:` and other schemes, fenced and inline code, and paths above the repo root alone. The ref depends on where the text ends up. Resolves [#457](#457). ([#458](#458))
  - **Open release PR body:** the PR's head branch (`next`, or `hotfixes` on the hotfix lane), so the links work during review. generate-comprehensive-changelog takes it as the new `changelog-link-ref` input, which create-release-pr and update-release-pr set to the head branch. It defaults to the release tag.
  - **Release commit:** release-merge moves the head-branch links to `vX.Y.Z` before the squash merge, so the commit on `master` carries tag links.
  - **Tag message and GitHub Release:** the release tag, in create-release and sync-release-notes.
  - **Merged release PR:** once the tag exists, sync-release-notes finds each release's PR from its release commit and points its links at the tag. It also pins bodies from before this release that still have relative links, and leaves bodies that already carry tag links alone. Its App token now requests `pull_requests`.
  - **Backfilled changelogs:** sync-release-notes reads a changelog from the default branch, so it can link to something added after the release. Those links point at the default branch instead of a 404 at the tag.

## Upgrade notes

- No caller changes needed, and changelog files keep their relative links.
- Releases published before this one still show broken links until they are re-synced. Dispatch `sync-release-notes.yml` in each affected repo (dry run first, then a real run) to rewrite the old release pages and release PR bodies.



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

- @Shinrai

</details>

<!-- co-authors -->

Co-authored-by: Shinrai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure ! fix → next v4 flow: fix contributor PR targeting the next integration branch type: ci Changes to CI workflows, actions, or build pipelines type: documentation Relates to docs, README updates, guides, or inline code comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant