Repository navigation
fix(redirects): point a retired channel's flat URLs at the live page - #78
Merged
Merged
Conversation
ZodSharp's stable 3.0.0 promoted its prerelease channel, and the same release reorganised the docs into topic folders. The retired-channel pass runs first, so `writeDocsPageRedirects` mistook those freshly written redirect files for published pages and emitted a second hop inside the withdrawn base: /docs/<id>/prerelease/<old>/ -> /docs/<id>/prerelease/<new>/ A move is now forwarded only from the bases this build publishes, and a retired channel forwards a slug that only ever existed in its tree straight to the live channel's new address. The prerelease-only package test takes its subject from the release data instead of pinning Purview.ZodSharp.Http, which shipped 3.0.0.
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.
Why
Deploy run 43901718339 failed validation after ZodSharp published stable
v3.0.0(14:40Z). That one release did two things at once:prereleasedocs channel (stable caught up with3.0.0-prerelease.6), andlivechannel now publishes/docs/zodsharp/concepts/core-concepts/and the flat/docs/zodsharp/core-concepts/is gone.Two assertions in
src/tests/dist/built-output.test.tscaught it:a package with only prereleases is still listed— pinned toPurview.ZodSharp.Http, which now has a stable3.0.0.a promoted channel redirects its retired URLs to the live pages— the retired flat URL forwarded to/docs/zodsharp/prerelease/concepts/core-concepts/, i.e. a redirect pointing at another redirect inside a channel that is no longer published.The second is a real bug, not a stale test. The retired-channel pass runs first and writes
prerelease/<new slug>for every live page;writeDocsPageRedirectsthen treats those freshly written files as "published destinations" (its guard is a filesystem check) and writes the flat retired URL into the dead base.What changed
src/lib/docs/redirects.tsdocsPageRedirectsforwards a move only from the bases the build publishes (taken from the docs manifest's channels). A declared-but-withheld channel is not a base.retiredChannelRedirectsalso forwards the slugs that only ever existed in the retired tree: adocs.redirectspair whose destination the live channel publishes becomesR/F→L/T, so/docs/zodsharp/prerelease/core-concepts/lands directly on/docs/zodsharp/concepts/core-concepts/. A pair whose old slug is still a live page is skipped.Tests and docs
tests/unit/docs-redirects.test.ts: coverage for "a withheld channel is not a base for a move" and "a moved page it used to publish points at the live address"; the published-channel test now passes a manifest.tests/dist/built-output.test.ts: the prerelease-only package test derives its subject from the build's release data (todayevent-sourcing,containers,astroc4) instead of pinning a package, so a release that makes one stable moves the test on rather than reddening a deliberate product change.README.md, ADR 0009 §5, ADR 0011 §3 andskills/docs-aggregation-rules/SKILL.mdnow describe the published-base rule and the single-hop retired URL.Verification
just validatepasses locally in full (format, lint,astro check, 454 unit tests, catalogue check, build, discovery/SEO/link/generated checks, 48 dist tests with 6 skips). The rebuilt site writes 63 retired + 74 moved redirects, and both the nested and the flat retired ZodSharp URLs resolve to the live page in one hop.Follow-up for the product repo: the comment above
Purview.ZodSharp.Httpinpurview-dev/zodsharp's.config/purview-docs.ymlstill says "Published only as prereleases today".