fix(runner): derive the current docs release instead of hard-coding it (DEV-2736) - #300
Merged
Merged
Conversation
…t (DEV-2736) `docs-buckets.json` reads ["18.0", "18.1", "next"] since the 18.1 import (#279), but three places still named 18.0. Same class as the literal #283 converted in docs-examples.spec.ts, one file over — except these assert nothing about the bucket, so instead of going red they kept passing. Two defects, both real: Coverage. docs-frameworks.spec.ts is the only container-engine coverage the Vue and Angular docs wrappers have, and it was exercising the previous release line. style-panel.spec.ts's two docs deep links likewise fetch from the real committed buckets. Prune-resistance. `writeDocsBucketIndex` rebuilds the index from the directory listing of public/docs-examples/ and never accumulates, so every 18.0 literal breaks at once when that bucket goes. In guide-tracks.test.mjs the literal is a *path*, so it does not fail an assertion — it throws ENOENT. `highestReleaseBucket` alone is not enough for a `?v=`: `planDocsBucket` derives the bucket through a strict `semver.parse`, which answers null for `18.1` and for `18`, landing a two-part version on the not-found screen. The new `currentDocsRelease` helper reads the full version out of the bucket's own manifest (`hotVersion`) rather than synthesising `${bucket}.0`, so a bucket regenerated at a later patch stays correct. The pipeline test needs only the directory name, and imports the helper from `dist` for the reason its neighbouring `version.js` import already documents. Left deliberately alone: the ~25 specs whose 18.0.0 is self-consistent with a stub they route themselves; docs-examples.spec.ts:470,548, where 17.1.0 is chosen *because* no such bucket exists; and the version prose in docs/guide/*.md. `catalog.ts`'s DEFAULT_VERSION is product behaviour, not a test literal, so it is a separate decision. Verification. Derivation resolves to {bucket: "18.1", version: "18.1.0"}. Pipeline suite 966 passed / 0 failed. Deterministic e2e 241 passed / 151 skipped / 0 failed, with nothing else holding 4173 — and master measured the same way lands on the identical 241/151/0. (An earlier local master run showed 8 failures; that was an untracked .env.local VITE_DEV_USER signing the app in and breaking the anonymous-visitor specs, not this change. One full-suite run also saw a lone transient failure in "the theme survives a reload", which passes 3/3 in isolation on both master and this branch.) Live containers against prod: both docs-frameworks tests pass at 18.1.0. Discriminating, not just green. Forcing the helper to a bogus bucket turns exactly the two style-panel docs tests red. For guide-tracks no bucket substitution can fail (the guide prints one path, present in all three buckets), so the proof is a simulated prune: with 18.0/ parked and the index trimmed, master throws ENOENT and this passes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
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.
runner/docs-buckets.jsonhas read["18.0", "18.1", "next"]since the 18.1 docs import (#279), but three places still named18.0. Same class as the literal #283 converted indocs-examples.spec.ts, one file over — except these assert nothing about the bucket, so instead of going red they kept passing.Two defects, both real
Coverage.
docs-frameworks.spec.tsis the only container-engine coverage the Vue and Angular docs wrappers have, and it was exercising the previous release line.style-panel.spec.ts's two docs deep links likewise fetch from the real committed buckets (this spec aborts the bundler, not the docs manifest), and they run in PR CI.Prune-resistance.
writeDocsBucketIndex(pipeline/import-docs.mjs:367-379) rebuilds the index from the directory listing ofapps/authoring/public/docs-examples/and never accumulates, so every18.0literal breaks at once when that bucket goes. Inguide-tracks.test.mjsthe literal is a path, so it does not fail an assertion — it throwsENOENT.The change
highestReleaseBucketalone is not enough for a?v=.planDocsBucketderives the bucket through a strictsemver.parse, which answersnullfor18.1and for18, landing a two-part version on the not-found screen. (The partial/bare-major coercion documented indocs/guide/developers.md:43lives invalidateHandsontableVersionand is not on this path.) So the newcurrentDocsReleasehelper ine2e/helpers.tsreads the full version out of the bucket's ownmanifest.json(hotVersion) rather than synthesising${bucket}.0— a bucket regenerated at a later patch stays correct.The pipeline test needs only the directory name, and imports the helper from
distfor the reason its neighbouringversion.jsimport already documents (--experimental-strip-typescannot resolvesemverthrough the./types.jsspecifiers). The e2e layer imports fromsrc, the waydocs-examples.spec.tsdoes post-#283.Adding to
helpers.tsrather than rewiringdocs-examples.spec.ts's preamble follows that file's own stated policy: new specs import from here, existing ones migrate opportunistically.Verification
The whole defect is a test that passes while covering nothing, so a green run proves nothing on its own.
{bucket: "18.1", version: "18.1.0"}.E2E_LIVE=1,--workers=1): bothdocs-frameworkstests pass at 18.1.0. This spec runs only ine2e-live.yml's container step, so CI here will skip it.Discriminating, not just green. Forcing the helper to a bogus bucket turns exactly the two
style-paneldocs tests red. Forguide-tracksno bucket substitution can fail — the guide prints one distinct?docs=path and it exists in all three buckets — so the proof is a simulated prune: with18.0/parked and the index trimmed, master throwsENOENTand this passes.Two local-environment findings surfaced while establishing the baseline, neither caused by this change: an untracked
apps/authoring/.env.localcarryingVITE_DEV_USERsigns the app in and fails 8 anonymous-visitor specs; andpnpm --filter … preview -- --port Nsilently binds 4173 because pnpm eats the flags, which is how a stray worktree server can poison an A/B.Left deliberately alone
The ~25 specs whose
18.0.0is self-consistent with a stub they route themselves (regen-proof);docs-examples.spec.ts:470,548, where17.1.0is chosen because no such bucket exists; the deliberate16.2.0/14.0.0/99.99.99pins; and the version prose indocs/guide/*.md.catalog.ts'sDEFAULT_VERSION = "18.0.0"is product behaviour, not a test literal, so it is a separate decision.🤖 Generated with Claude Code
Note
Low Risk
Test-only changes to version resolution for docs fixtures; no production routing or runtime behavior is modified.
Overview
Stops hard-coded
18.0/18.0.0docs versions in e2e and pipeline tests from silently exercising the wrong release bucket after imports or failing withENOENTwhen a pruned bucket is gone.Adds
currentDocsRelease()ine2e/helpers.ts: picks the newest release fromdocs-buckets.jsonviahighestReleaseBucket, then readshotVersionfrom that bucket’smanifest.jsonso?v=uses a full semver (not a synthesized18.1.0-style guess thatplanDocsBucketwould reject).docs-frameworks.spec.tsandstyle-panel.spec.tswire their real-bucket?docs=…&v=…URLs through that helper.guide-tracks.test.mjsresolves the release bucket the same way when asserting guide?docs=URLs exist in the current manifest.Reviewed by Cursor Bugbot for commit 7d7e79d. Bugbot is set up for automated code reviews on this repo. Configure here.