fix(cli): use commit SHA in changelog URL for permanent links#15071
fix(cli): use commit SHA in changelog URL for permanent links#15071Swimburger merged 2 commits intomainfrom
Conversation
The changelog URL was using the PR branch name which gets deleted after merge, causing 404s. Now uses the commit SHA via repository.getHeadSha(), which is permanent and always resolves correctly. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
| remains valid after the PR branch is deleted or squash-merged. | ||
| type: fix | ||
| createdAt: "2026-04-15" | ||
| version: 0.9.8 |
There was a problem hiding this comment.
🟡 Catalog pin in pnpm-workspace.yaml not updated to match new generator-cli version
Per the documented version bump process in packages/generator-cli/CLAUDE.md:96-100, when making changes to generator-cli, three files must be updated together: (1) packages/generator-cli/versions.yml, (2) pnpm-workspace.yaml catalog pin, and (3) packages/cli/cli/versions.yml. This PR only updates versions.yml to 0.9.8, but pnpm-workspace.yaml:63 still pins "@fern-api/generator-cli": 0.9.4. Since generators depend on "@fern-api/generator-cli": "catalog:" (e.g. generators/base/package.json:40), they will continue resolving to 0.9.4 and won't pick up the SHA-based changelog URL fix until the catalog pin is bumped.
Prompt for agents
The version bump process documented in packages/generator-cli/CLAUDE.md requires updating three files together:
1. packages/generator-cli/versions.yml (already done — version 0.9.8)
2. pnpm-workspace.yaml — Update the catalog pin on line 63 from 0.9.4 to 0.9.8
3. packages/cli/cli/versions.yml — Add a new CLI version entry to trigger CLI publish
Without updating the catalog pin in pnpm-workspace.yaml, generators that depend on @fern-api/generator-cli via catalog: will continue resolving to 0.9.4 and will not include this fix in their Docker images.
Was this helpful? React with 👍 or 👎 to provide feedback.
Description
Refs companion PR: fern-api/fiddle#703 (same fix for the fiddle coordinator path)
The "See full changelog" link in auto-versioned SDK PRs used the PR branch name (
prBranch) in the GitHub blob URL. After the PR is merged and the branch is deleted, this URL returns a 404. This change uses the commit SHA instead, which is permanent — it survives branch deletion and squash merges.Changes Made
prBranchwithrepository.getHeadSha()in the changelog URL construction inGithubStep.executePullRequestMode.../blob/fern-bot/2025-04-15T12-00Z/changelog.mdto.../blob/<commit-sha>/changelog.md0.9.8entry inversions.ymlfor this fixTesting
pnpm run checkpassesparseCommitMessageForPRwhich is already tested independentlyReview Checklist for Humans
getHeadSha()timing: Called at line 202, afterpush()/forcePush()(lines 179–181) but before PR creation. HEAD should match the remote commit. Does this hold in all paths?skipCommit(replay) path: WhenskipCommit=true,commitAllChangesis skipped butcreateReplayBranchhas already committed, so HEAD should still be valid — but worth confirming.previewMode=true, push is skipped, so the SHA won't exist on GitHub. The oldprBranchURL had the same problem (branch not pushed either), so this is not a regression — but the link will 404 in either case.git push, so local HEAD should always match the remote after push. Confirm no edge case breaks this assumption.Link to Devin session: https://app.devin.ai/sessions/46ab5d2460754756b7bce40428100c9b
Requested by: @Swimburger