Skip to content

feat: use --id flag with branch name for stable preview URLs#108

Merged
kennyderek merged 5 commits intomainfrom
devin/1773866657-preview-id-branch-name
Mar 18, 2026
Merged

feat: use --id flag with branch name for stable preview URLs#108
kennyderek merged 5 commits intomainfrom
devin/1773866657-preview-id-branch-name

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot commented Mar 18, 2026

Summary

Updates the preview-docs.yml workflow to pass --id with the PR branch name to fern generate --docs --preview. This makes the preview URL stable across repeated pushes to the same PR branch — instead of generating a new random UUID each time, the same branch name produces the same preview URL.

Also bumps the Fern CLI version from 4.15.54.35.0 so the version redirection uses a release that includes --id support.

Depends on: fern-api/fern#13660 (adds --id flag to CLI, merged) and fern-api/fern-platform#8742 (FDR server support, merged).

Review & Testing Checklist for Human

  • Version bump 4.15.54.35.0: This is a significant version jump. Verify that docs generation still works correctly with the new CLI version — there may be breaking changes or behavioral differences unrelated to --id.
  • Branch names with / or special characters: github.head_ref can contain slashes (e.g. feature/my-docs-update). These get embedded into a DNS subdomain like {org}-preview-{id}.docs.buildwithfern.com. Slashes are invalid in DNS labels. Verify the FDR server sanitizes or rejects these gracefully.
  • Test plan: Open a test PR, verify the preview URL uses the branch name as the ID. Push another commit to the same PR, verify the preview URL stays the same and the old preview is overwritten.

Notes

  • Shell injection is mitigated: github.head_ref is passed via an env variable (HEAD_REF) rather than inline ${{ }} interpolation in the run block, so it's treated as data by bash.
  • Tested the --id flag end-to-end against the dev stack using fern-dev:build — confirmed it generates stable preview URLs (e.g. smoke-test-preview-my-test-preview.docs.dev.buildwithfern.com).
  • The || true on the fern command means a CLI failure would be silently swallowed — the URL grep would just produce empty output and the PR comment would have a blank link.

Link to Devin session: https://app.devin.ai/sessions/d3670821970e4e1687c12f99240e043e

devin-ai-integration bot and others added 2 commits March 18, 2026 20:44
Co-Authored-By: kenny <kenny@buildwithfern.com>
Co-Authored-By: kenny <kenny@buildwithfern.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 18, 2026

Co-Authored-By: kenny <kenny@buildwithfern.com>
devin-ai-integration bot and others added 2 commits March 18, 2026 21:02
Co-Authored-By: kenny <kenny@buildwithfern.com>
Co-Authored-By: kenny <kenny@buildwithfern.com>
@kennyderek kennyderek merged commit 05c59e8 into main Mar 18, 2026
2 checks passed
@kennyderek kennyderek deleted the devin/1773866657-preview-id-branch-name branch March 18, 2026 21:10
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.

1 participant