Skip to content

Rewrite relative links when a changelog becomes the Release body #457

Closed

Description

@Shinrai

Changelog files use relative links, which work in the repo and on npm (npm rewrites them to blob/HEAD). They break on the Release page. GitHub resolves a release body against the repo root, so ../../drivers.md in docs/changelog/v0/v0.9.0.md links to /CLDMV/llm-translator/drivers.md and 404s, and ./v0.9.0.md turns into /blob/v0.9.0/v0.9.0.md. See https://github.com/CLDMV/llm-translator/releases/tag/v0.9.0.

The files should stay relative. The fix belongs where the file becomes the release body:

  1. Going forward: resolve each relative link or image against the changelog's own folder and rewrite it to https://github.com/<owner>/<repo>/blob/v<version>/<path> (raw/ for images). Leave absolute URLs, #anchors, mailto:, fenced code and inline code alone. The file is read in two places: readVersionChangelogFile in generate-comprehensive-changelog (the release PR body, which becomes the squash commit and the first release body) and release-notes.mjs for sync-release-notes. Both should use the same helper.
  2. Existing releases: once sync-release-notes does the rewrite, a run in each affected repo re-renders the old Release pages from their files.

26 repos have relative links in their changelogs right now. Each has its own issue (for example CLDMV/slothlet#769), and those can close once this ships and their release notes have been re-synced.

Activity

  1. added
    type: bug
    priority: medium
    status: not started
    on Nov 14, 2026
  2. Shinrai commented on Nov 14, 2026

    @Shinrai
    ContributorAuthor

    The release PR body has the same problem. GitHub keeps the links as written there, so the browser resolves them against the PR URL. On CLDMV/llm-translator#149, ../../drivers.md goes to https://github.com/CLDMV/drivers.md (404) and ./v0.9.0.md goes to /CLDMV/llm-translator/pull/v0.9.0.md.

    So generate-comprehensive-changelog should rewrite the PR body too. The tag doesn't exist while the PR is open, so tag-pinned links are dead until the release merges. Pinning the PR body to blob/next/... would make them work during review, but the PR body becomes the squash commit message, so the commit would then carry next links. Better to pin to the tag and accept that the links are dead only while the PR is open.

  3. added
    status: in progress
    and removed
    status: not started
    on Nov 14, 2026
  4. Shinrai commented on Nov 14, 2026

    @Shinrai
    ContributorAuthor

    Final design, replacing my earlier comment about the PR body.

    Every permanent record ends up with links to the release tag, so they show the files as they were in that release and don't depend on anything GitHub-specific. No head-SHA links.

    Where Links point at
    Release PR body while it's open next (blob/next/<path>), so they work during review
    Squash commit message on master the tag. release-merge already sends commit_message: pr.body, so it rewrites the next links to blob/v<version>/... before merging
    Tag message and Release body the tag
    Release PR body after the release the tag. sync-release-notes runs on release: published, finds the release's PR from the release commit and edits its body (PATCH /pulls/{n})

    One helper does all of it: it resolves relative links against the changelog's folder and takes the target ref, and it also turns its own blob/next/... links into tag links. It has to be idempotent, so a body that already has tag links is left alone.

    Re-running sync-release-notes in a repo after this ships fixes its old Release pages and its old release PR bodies.

    Tracked in #458.

  5. added 2 commits that reference this issue on Nov 14, 2026
    0c40a5c
    66e3131
  6. added
    status: implemented
    and removed
    status: in progress
    on Nov 14, 2026
  7. cldmv-bot commented on Nov 14, 2026

    @cldmv-bot
    Contributor

    Marked status: implemented — resolved by #458, merged into next. This issue closes automatically when that work ships to the default branch.

  8. added a commit that references this issue on Nov 14, 2026
    a642193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumstatus: implementedtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions