test(templates): pin the starter list inside the mirrorable R2 namespace - #1452
Open
MaanilVerma wants to merge 1 commit into
Open
test(templates): pin the starter list inside the mirrorable R2 namespace#1452MaanilVerma wants to merge 1 commit into
MaanilVerma wants to merge 1 commit into
Conversation
`fetchJSON` already retries the GCS mirror when the primary fails, which is how regions with a throttled R2 edge reach our manifests. That only works while the URL sits under `R2_BASE_URL`: `r2MirrorUrl` returns undefined for anything else, so moving the document would cut those regions off with no failing test and no visible error, just the built-in list forever. Also pins the end state: with both legs unreachable the picker still renders all sixteen built-in cards rather than an empty tab. No production change. The remaining gap is operational, not code: starter-templates.json is currently 404 on the mirror bucket while latest.json and torch-index-stacks.json are both 200, so it needs adding to whatever keeps the two in sync.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughChangesStarter-template mirror coverage
Merge Risk: ⚪ Minimal · up to This test-only change adds coverage for starter-template mirror resolution and fallback behavior without changing production code. No actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
TL;DR: Tests only. Pins that the starter-templates document stays inside the R2 namespace, which is what lets restricted regions reach it through the GCS mirror.
Why:
fetchJSONalready retries the mirror on failure, so the starter list got that behaviour for free when it moved to R2. But it only works while the URL sits underR2_BASE_URL—r2MirrorUrlreturns undefined for anything else. That property lives in a string prefix, so a plausible refactor (own bucket, CDN alias) would cut those regions off with no failing test and no error.What changed: two tests. One asserts the derived mirror URL, one asserts a rejected fetch still yields all sixteen built-in cards. No source file touched.
Separate ops gap: the file isn't on the mirror yet.
latest.jsontorch-index-stacks.jsonstarter-templates.jsonNothing is broken — those users fall back to the built-in list. But content changes stay invisible to them until it's synced. Needs
Content-Type: application/json, or the client won't parse it and falls back the same silent way. Raised with @deepme987 .Testing: mutation-checked — pointing
STARTER_TEMPLATES_URLat a non-R2 host fails the namespace test, which is the refactor this exists to catch.