FE-1457: Point source links at the branch being built - #9254
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
kube
force-pushed
the
cf/fe-1457-arch-docs-point-source-links-at-the-branch-being-built
branch
from
August 19, 2026 17:32
d1f8efa to
88d9b6e
Compare
kube
force-pushed
the
cf/fe-1457-arch-docs-point-source-links-at-the-branch-being-built
branch
from
August 19, 2026 21:12
88d9b6e to
922c4b9
Compare
kube
force-pushed
the
cf/fe-1457-arch-docs-point-source-links-at-the-branch-being-built
branch
from
August 19, 2026 21:44
922c4b9 to
06c36b5
Compare
kube
force-pushed
the
cf/fe-1457-arch-docs-point-source-links-at-the-branch-being-built
branch
from
August 19, 2026 21:53
06c36b5 to
10f3dd6
Compare
kube
force-pushed
the
cf/fe-1457-arch-docs-point-source-links-at-the-branch-being-built
branch
from
August 19, 2026 22:16
10f3dd6 to
d2503f0
Compare
kube
force-pushed
the
cf/fe-1457-arch-docs-point-source-links-at-the-branch-being-built
branch
2 times, most recently
from
August 20, 2026 00:29
89697a5 to
9c1edf8
Compare
kube
force-pushed
the
cf/fe-1457-arch-docs-point-source-links-at-the-branch-being-built
branch
from
August 20, 2026 00:50
9c1edf8 to
ad107ba
Compare
kube
force-pushed
the
cf/fe-1457-arch-docs-point-source-links-at-the-branch-being-built
branch
from
August 20, 2026 01:12
ad107ba to
fcf6bef
Compare
kube
force-pushed
the
cf/fe-1457-arch-docs-point-source-links-at-the-branch-being-built
branch
from
August 20, 2026 01:56
fcf6bef to
015167a
Compare
kube
force-pushed
the
cf/fe-1457-arch-docs-point-source-links-at-the-branch-being-built
branch
from
August 20, 2026 09:31
015167a to
c398cf9
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🌟 What is the purpose of this PR?
Implements FE-1457: every generated page links to the file that declared a layer, and the target was hardcoded to
main. On a preview build those links showed the pre-change file, or 404'd for a file the branch adds.The ref now comes from the build environment:
Top of stack #9226, on FE-1456.
🔗 Related links
🔍 What does this change?
src/source-url.ts(new): resolves the ref from the first variable that holds a value, in orderPETRINAUT_ARCH_DOCS_SOURCE_REF,VERCEL_GIT_COMMIT_SHA,GITHUB_SHA,VERCEL_GIT_COMMIT_REF,GITHUB_HEAD_REF,GITHUB_REF_NAME, defaulting tomain. A SHA beats a branch name so the link survives the branch moving or being deleted. Slashes stay literal (they separate path segments in a blob URL) while#and%are encoded.architecture.config.ts:sourceUrlPrefixcalls the resolver. No literalmainremains.turbo.json: the six variables are declared indoc:architecture'senv, since Turborepo's strict env mode would otherwise hide them from the task.vercel-build.shand the generator's "Wrote" line: both name the resolved ref, so a preview build's log shows which commit its links point at.No workflow changes: nothing under
.github/workflows/builds the bundle, and GitHub Actions exports the variables the resolver reads.Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
turbo.json's have been updated to reflect thisdoc:architecturedeclares the ref variables. The task and its consumers are uncached, so a ref change cannot serve stale links.🛡 What tests cover this?
source-url.test.ts: the default, blank values skipped, SHA over branch for both providers, the local override over both, a branch name containing a slash, and#encoding.❓ How to test this?
yarn workspace @local/petrinaut-arch-docs doc:architectureand grep adeclaredInUrlinbundle/pages/architecture/cli.mdx: it points atblob/main/.GITHUB_HEAD_REF=<a branch>: the same link points at that branch. AddingGITHUB_SHA=<sha>switches it to the SHA.🐾 Next steps
Four hand-written
blob/main/...links remain in authored MDX. Those name specific files as references rather than being generated source links; giving them the same treatment needs a link helper in the authoring syntax.🤖 Generated with Claude Code