docs: compute Storybook preview hosts the way Vercel truncates them - #615
Conversation
Vercel truncates and hashes preview hostnames whose label passes 63 characters, so the URL template built from the branch name produced dead links for long branches (e.g. #614). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @alukach's task in 22s —— View job ✅ No blocking issues — safe to merge. The change only touches Notes (advisory)
Simplify (ponytail)
DocsContributor guidance only, with no user-facing flow or ADR decision touched. The description's "No UI, docs.source.coop or data-proxy ADR impact" statement is sufficient. 💰 Estimated review cost: $0.12 · 0m22s · 6 turns |
The Vercel bot comment only appears after the PR is opened, too late for the first description. Vercel's truncated label is <project>-git-<slug> cut to fit, then the first six hex chars of sha256("git-" + branch + project) and the team slug; the snippet reproduces it and matched 39 of the last 40 PRs (the miss is a fork, which Vercel prefixes with fork-<owner>-).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CLAUDE.md told agents to build Storybook preview links as
source-coop-ui-git-<branch>-radiantearth.vercel.app. Vercel caps a hostname label at 63 characters and truncates long branch names with a hash suffix, so forfeat/github-immutable-repository-lookup(#614) the guessed host doesn't resolve; the real one issource-coop-ui-git-feat-github-immutable-re-82950d-radiantearth.vercel.app.The Vercel bot comment carries the real host, but only after the PR is open — too late for the description written when it's created. So CLAUDE.md now gives a shell snippet that computes the host from the branch:
<project>-git-<slug>-radiantearthwhen that fits in 63 characters, otherwise<project>-git-<slug>cut to 43 characters, then the first six hex characters ofsha256("git-" + <raw branch> + <project>), then-radiantearth. It also says to check the links against the bot comment once the PR is open.Testing
Compared the snippet's output with the
source-coop-uihost in the Vercel bot comment on the last 40 PRs: 39 match. The one miss, #602, is from a fork, which Vercel namesfork-<owner>-<branch>; the snippet doesn't handle forks. Ran the snippet as written under bash and zsh for a short branch and a long (truncated) one.No UI, docs.source.coop or data-proxy ADR impact: this only changes contributor guidance in this repo.
🤖 Generated with Claude Code