Repository navigation
feat(dataset): short-circuit unpublished datasets in readme + tree endpoints - #30
Merged
neuromechanist merged 3 commits intoMay 19, 2026
Conversation
…dpoints Detect versions:[] / latest:null via getLanding before attempting manifest fetch, return a clean 200 with an "unpublished" placeholder. Caps the worst-case response at ~1.5s instead of 5s+timeout+500, which removes the 500-driven retry cascade that was triggering per-IP 429s at the CF edge. Affects datasets that were onboarded but never had a published version (on005506, on005507, and the rest of the original #529 cohort). Fully published datasets are unchanged. Closes #28.
Closed
4 tasks
Deploying nemar-website with
|
| Latest commit: |
c8041cc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6d727353.nemar-website.pages.dev |
| Branch Preview URL: | https://28-clean-unpublished-state-r.nemar-website.pages.dev |
4 of 6 tasks
- Parallel-fire getLanding + getManifest + getMetadata so unpublished detection doesn't add 1.5s serial RTT to the published-dataset budget (code-reviewer finding 2) - Split cache constants: short SWR (60s/300s) for the unpublished branch so users don't see 24h of stale "not yet published" after a real release; keep 600s/86400s for the published response (silent-failure- hunter finding 2, code-reviewer finding 1) - console.warn when getLanding returns null so a degraded data layer is visible in logs rather than silently degrading to the slow path (silent-failure-hunter finding 1) - isUnpublished now uses !landing.latest instead of === null, catching the case where the upstream emits "" instead of null (pr-test-analyzer gap 3) - JSDoc on isUnpublished now documents the null contract and the why-not-AND choice; redundant JSDocs on render fns removed (comment-analyzer findings) - New tests: renderUnpublishedReadme + renderUnpublishedTree shape assertions (pr-test-analyzer gaps 1+2), plus the empty-string latest case for isUnpublished Out of scope (deferred): jsonFetch broad swallow + disambiguating 404 vs 5xx in getLanding null. Pre-existing on main, larger refactor.
Contributor
Author
Review findings addressed (commit f925b0f + c8041cc)From code-reviewer:
From silent-failure-hunter:
From pr-test-analyzer:
From comment-analyzer:
Deferred to follow-upsilent-failure-hunter finding 4 (jsonFetch broad swallow): pre-existing on main and affects every silent-failure-hunter finding 3 (404 vs 5xx disambiguation in landing null path): same — depends on the above. Net result: 120 tests pass (8 new), typecheck clean, biome clean on changed files, no new lint errors introduced (pre-existing debt in |
neuromechanist
added a commit
that referenced
this pull request
May 19, 2026
Critical: - readme.ts: fast path no longer silently drops the README when a dataset has no GitHub URL or the GH fetch fails. Now always falls through to the manifest path before settling for description. (code-reviewer finding 1, silent-failure finding 2) Important: - tree.ts: validate summary.paths is a non-empty array before using; fall through to manifest with a console.warn if summary is malformed or partial. (silent-failure finding 3) - console.warn on getSummary returning null in both endpoints so degraded data-layer is visible in logs. (silent-failure finding 4) - readme.ts module JSDoc rewritten to reflect actual 4-step resolution order; old JSDoc was misleading. (comment-analyzer finding 1) - findReadmePathInSummary JSDoc now documents the priority order + why subdirectory READMEs are intentionally skipped (BIDS spec). (comment-analyzer finding 4) - buildTreeFromPaths JSDoc explains the synthetic-filler choice + notes the renderer doesn't read entry.url. (comment-analyzer finding 3) Tests: - Pin "subdirectory README is ignored" (locks in BIDS-spec contract) - Pin "malformed segments don't throw" for buildTreeFromPaths Out of scope (PR comment): - jsonFetch broad-swallow (pre-existing on main; same as #30's deferred) - archiveZipUrl comment drift (pre-existing on main) - bids-tree.ts pre-existing inline comments (not touched by this PR) - Pure-helper extraction for endpoint branching (refactor; not blocking) - render-tree url="" finding was a false positive — render-tree.ts builds anchors from basePath+path and never reads entry.url
neuromechanist
deleted the
28-clean-unpublished-state-render-when-apidatasetidreadmetree-has-no-published-version
branch
May 19, 2026 03:23
This was referenced May 19, 2026
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.
Summary
Detects `versions: []` / `latest: null` from `data.nemar.org//` (via the existing `getLanding` + new `isUnpublished` pure helper) before any manifest fetch and returns a clean 200 placeholder. Caps worst-case response time at ~1.5s.
Removes the 500-driven retry cascade that was triggering per-IP 429s on the CF edge when users hit datasets that had been onboarded but never published.
What changed
Test plan
Notes