Skip to content

fix(cli): use commit SHA in changelog URL for permanent links#15071

Merged
Swimburger merged 2 commits intomainfrom
devin/1776282802-fix-changelog-url-use-commit-sha
Apr 15, 2026
Merged

fix(cli): use commit SHA in changelog URL for permanent links#15071
Swimburger merged 2 commits intomainfrom
devin/1776282802-fix-changelog-url-use-commit-sha

Conversation

@Swimburger
Copy link
Copy Markdown
Member

@Swimburger Swimburger commented Apr 15, 2026

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

  • Replaced prBranch with repository.getHeadSha() in the changelog URL construction in GithubStep.executePullRequestMode
  • The resulting URL format changes from .../blob/fern-bot/2025-04-15T12-00Z/changelog.md to .../blob/<commit-sha>/changelog.md
  • Added version 0.9.8 entry in versions.yml for this fix

Testing

  • pnpm run check passes
  • No new unit tests — the changed line is deep inside a method that orchestrates git + GitHub API calls; the URL is passed through to parseCommitMessageForPR which is already tested independently
  • End-to-end validation requires deploying and triggering a real SDK generation

Review Checklist for Humans

  • Verify getHeadSha() timing: Called at line 202, after push()/forcePush() (lines 179–181) but before PR creation. HEAD should match the remote commit. Does this hold in all paths?
  • skipCommit (replay) path: When skipCommit=true, commitAllChanges is skipped but createReplayBranch has already committed, so HEAD should still be valid — but worth confirming.
  • Preview mode: When previewMode=true, push is skipped, so the SHA won't exist on GitHub. The old prBranch URL had the same problem (branch not pushed either), so this is not a regression — but the link will 404 in either case.
  • Local HEAD vs remote: Unlike the fiddle path (which creates a signed commit via GitHub API with a new SHA), this path uses standard 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


Open with Devin

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-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

remains valid after the PR branch is deleted or squash-merged.
type: fix
createdAt: "2026-04-15"
version: 0.9.8
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@Swimburger Swimburger merged commit 884f369 into main Apr 15, 2026
62 checks passed
@Swimburger Swimburger deleted the devin/1776282802-fix-changelog-url-use-commit-sha branch April 15, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants