Skip to content

fix(generator-cli): sign every local-only commit when pushing, not just HEAD#16931

Merged
fern-support merged 1 commit into
mainfrom
devin/1783448121-sign-all-local-commits
Jul 7, 2026
Merged

fix(generator-cli): sign every local-only commit when pushing, not just HEAD#16931
fern-support merged 1 commit into
mainfrom
devin/1783448121-sign-all-local-commits

Conversation

@cadesark

@cadesark cadesark commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description

Linear ticket: Refs

Auth0 reported that on replay-generated PRs (e.g. auth0/auth0.net#1043) the first commit ([fern-generated] Update SDK) is unsigned while the head commit ([fern-replay] Applied customizations) is Verified.

Root cause: pushSignedCommit only recreates the branch HEAD via octokit.git.createCommit (which GitHub signs with the App key). Any earlier local commits on the branch — the [fern-generated] commit (and [fern-autoversion] when present) — are only uploaded as raw git objects via the temp ref, so they reach the remote unsigned.

Fix: sign the whole local-only commit chain:

signLocalCommitChain():
  chain = repository.getLocalOnlyCommits()   # rev-list --reverse HEAD --not --remotes=origin
  for sha in chain (oldest first):
      signed = octokit.git.createCommit(tree(sha), message(sha),
                                        parents(sha) remapped to signed predecessors)
  return signed SHA of HEAD

The branch ref is then updated to the signed head, so every commit on the PR shows as Verified. Falls back to signing HEAD only (previous behavior) when no remote-tracking refs are available or the chain exceeds a 20-commit safety cap.

Changes Made

  • packages/generator-cli/src/pipeline/github/pushSignedCommit.ts: extract signLocalCommitChain — recreates every local-only commit via the GitHub API, re-parenting each onto its signed predecessor
  • packages/commons/github/src/ClonedRepository.ts: add getLocalOnlyCommits(), getCommitMessage(sha), getCommitParents(sha)
  • packages/generator-cli/changes/unreleased/sign-all-local-commits.yml: changelog entry (fix)
  • Updated README.md generator (if applicable)

Testing

Link to Devin session: https://app.devin.ai/sessions/b913483a939e40dab7e227be14eb6135
Requested by: @cadesark


Open in Devin Review

…st HEAD

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@cadesark
cadesark requested a review from Swimburger as a code owner July 7, 2026 18:16
@cadesark cadesark self-assigned this Jul 7, 2026
@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, CI, and merge conflict monitoring

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

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.

✅ Devin Review: No Issues Found

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

Open in Devin Review

@fern-support
fern-support merged commit c9a6c73 into main Jul 7, 2026
64 checks passed
@fern-support
fern-support deleted the devin/1783448121-sign-all-local-commits branch July 7, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants