Repository navigation
feat: link the BDC-SB export page to Velsera behind a feature flag (#5027) - #5030
Conversation
…5027) - add the velseraexport feature flag; with it on, the bdc-sb export method is enabled on the cohort and dataset export pages - build the bdc-sb pfb import url from the signed pfb location, with the import endpoint and source (bdc) in site config - disable request link on the bdc-sb page while the flag is off - show a 404 for platform export pages without an import endpoint (cavatica, cgc), and move their coming soon status into site config Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: cc-claude-tools <cc-claude-tools@clevercanary.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The BDC-SB endpoint’s AnVIL compatibility and ability to import Azul’s signed PFB URL remain unverified, requiring end-to-end validation with a BDC-SB account.
No open issues 🎉
What changed in this PR
Adds feature-flagged BDC-SB exports to the AnVIL Data Explorer for #5027, allowing testers to try the Velsera integration while other users continue to see “Coming Soon.”
Changes:
- Gates cohort and dataset BDC-SB export cards and link requests behind
velseraexport. - Builds platform import links from signed PFB URLs using site-configured endpoint and source values.
- Keeps CAVATICA and CGC disabled, renders unavailable platform pages as 404s, and adds focused tests.
| File | Description |
|---|---|
site-config/anvil-cmg/dev/export/utils.ts |
Detects platform routes without import configuration. |
site-config/anvil-cmg/dev/export/export.ts |
Uses the flag-aware cohort BDC-SB card. |
site-config/anvil-cmg/dev/export/constants.tsx |
Configures BDC-SB imports and other platforms’ coming-soon states. |
site-config/anvil-cmg/dev/detail/dataset/export/export.ts |
Uses the flag-aware dataset BDC-SB card. |
pages/export/cavatica.tsx |
Renders a 404 when imports are unavailable. |
pages/export/cancer-genomics-cloud.tsx |
Renders a 404 when imports are unavailable. |
pages/export/biodata-catalyst.tsx |
Adds the import-configuration availability guard. |
pages/[entityListType]/[...params].tsx |
Guards unavailable AnVIL dataset platform routes. |
app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders.tsx |
Passes import configuration and configured coming-soon states. |
app/shared/entities.ts |
Defines the velseraexport feature flag. |
app/components/index.tsx |
Exports the flag-aware card component. |
app/components/Export/components/AnVILExplorer/platform/VelseraExportMethod/velseraExportMethod.tsx |
Applies feature-flag gating to export cards. |
app/components/Export/components/AnVILExplorer/platform/ExportToPlatform/utils.ts |
Builds encoded import URLs and checks availability. |
app/components/Export/components/AnVILExplorer/platform/ExportToPlatform/types.ts |
Defines platform import configuration types. |
app/components/Export/components/AnVILExplorer/platform/ExportToPlatform/exportToPlatform.tsx |
Enables import links and disables unavailable requests. |
__tests__/site-config/export-utils.test.ts |
Tests route availability checks. |
__tests__/site-config/export-constants.test.ts |
Validates import settings and coming-soon configuration. |
__tests__/components/velseraExportMethod.test.tsx |
Tests flag-dependent card states. |
__tests__/components/exportToPlatform.test.ts |
Tests URL encoding and import availability conditions. |
Review effort: Balanced
NoopDog
left a comment
There was a problem hiding this comment.
Thanks Fran. The flag, the card, the URL building and the config all do what #5027 asks, every description claim matches the code, and the twelve mutations I ran against the helpers, the card and the config were all caught by the new tests.
Two things are required, both test coverage for changed core code:
- The view builders no longer force
comingSoon: true, and nothing tests the new behaviour: re-addingcomingSoon: truein either builder leaves all 278 tests passing (inline onviewModelBuilders.tsx). ExportToPlatform's wiring has no test: the flag hook,canImport,url, the button choice andrenderDisabledButtonare only covered through the pure helpers (inline onexportToPlatform.tsx:54).
Optional, left to you:
- The 404 for the CAVATICA and CGC pages is outside #5027's scope and changes behaviour those URLs had (inline on
pages/export/cavatica.tsx:22). isPlatformImportAvailable's type predicate is unsound when only the flag is off (inline onutils.ts:46).""as the "no URL" value ingetPlatformImportUrl(inline onutils.ts:33).- At merge time: "BDC-SB" and "Velsera" are proper nouns, so the squash subject keeps their casing:
feat: link the BDC-SB export page to Velsera behind a feature flag.
…5027) Addresses review feedback on #5030: - Drop the 404 for platform export pages without an import endpoint (CAVATICA, CGC); "Request Link" stays disabled on those pages instead. - Return a boolean from `isPlatformImportAvailable` and `undefined` from `getPlatformImportUrl` when no import URL is available. - Add render tests for `ExportToPlatform` and `comingSoon` tests for the platform export method builders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks Dave. All six points are addressed in 2c20688 (replies are inline). On point 6, the PR title is now |
NoopDog
left a comment
There was a problem hiding this comment.
Thanks Fran. All six points landed in 2c20688: the builder and ExportToPlatform tests catch every way I broke the wiring, the 404 pages are back to main, the predicate and the return type are honest, and the title keeps the casing.
Closes #5027
What changed
velseraexportfeature flag (FEATURES.VELSERA_EXPORT).?velseraexport=trueturns it on and?velseraexport=falseturns it off.VelseraExportMethodcomponent: the BDC-SB export method card on/exportand on each dataset's export tab. It shows "Coming Soon" unless the flag is on, or when the platform is configured as coming soon.ExportToPlatformbuilds the BDC-SB import URL from the signed PFBlocationreturned by the manifest request, then shows the "Open BioData Catalyst" button (new tab,noopener noreferrer). The URL is built inExportToPlatform/utils.ts(buildPlatformImportUrl,getPlatformImportUrl,isPlatformImportAvailable).https://platform.sb.biodatacatalyst.nhlbi.nih.gov/import/pfb) andsource(bdc) are set asEXPORTS.BIO_DATA_CATALYST.platformImportinsite-config/anvil-cmg/dev/export/constants.tsx.platformImport(CAVATICA and CGC today). The pages stay reachable by URL.EXPORT_METHODSsite config. The view builders no longer setcomingSoon.Why
We have links to test the BDC-SB export in production and want it enabled for testers only, with everyone else still seeing "coming soon" (#5027).
Assumptions I made
https://platform.sb.biodatacatalyst.nhlbi.nih.gov/import/pfb?URL=<signed url>&source=bdc. Nobody has confirmed it is right for AnVIL (issue open question 1).locationAzul returns for the verbatim PFB manifest request (issue open question 2). Whether BDC-SB can read it without AnVIL credentials is untested.localStorage, so it is a rollout switch, not access control. Anyone can turn it on.useFeatureFlagis false until hydration. A flagged user briefly sees the BDC-SB card as "Coming Soon" before it enables. We accepted this while the feature is behind the flag; it goes away when the flag is removed.platformImportand dropcomingSooninsite-config/anvil-cmg/dev/export/constants.tsx. Their buttons also check the Velsera flag, so the flag would need generalising first.renderDisabledButtonsits inexportToPlatform.tsxnext to the existingrenderButton, following that file's pattern, because findable-ui'sExportButtonhas nodisabledprop.How to verify
Run the AnVIL explorer locally (
npm run dev:anvil-cmg) or use a deployed dev build./exportwith?velseraexport=false. BDC-SB, CAVATICA and CGC all show "Coming Soon" and cannot be clicked./export?velseraexport=true. BDC-SB is enabled. CAVATICA and CGC still show "Coming Soon"..txt(a small selection), then click "Request Link". After loading, "Open BioData Catalyst" appears. Its link ishttps://platform.sb.biodatacatalyst.nhlbi.nih.gov/import/pfb?URL=<encoded signed URL>&source=bdcand opens in a new tab./datasets/825fae25-a969-5c1d-9867-e34f1858ca81/export(ANVIL_CMG_Sample_1).?velseraexport=false. BDC-SB shows "Coming Soon" again. Open/export/biodata-catalystdirectly: the page loads and "Request Link" is disabled./export/cavatica,/export/cancer-genomics-cloudand/datasets/825fae25-a969-5c1d-9867-e34f1858ca81/export/cavaticadirectly, with the flag on or off. Each page loads with "Request Link" disabled.npm test. The import URL and render tests in__tests__/components/exportToPlatform.test.tsxand thecomingSoonbuilder tests in__tests__/viewModelBuilders/export.test.tsanddataset-export.test.tspass.Definition of done:
FEATURESand can be turned on and off with a URL parameter: steps 1, 2 and 6./exportand on dataset export tabs: steps 1 and 6.source=bdc: steps 3 to 5.sourcevalue live in site config, not in the component:EXPORTS.BIO_DATA_CATALYST.platformImportinsite-config/anvil-cmg/dev/export/constants.tsx.sourceparameter: step 8.Screenshots
🤖 Generated with Claude Code
🐦 Built with cc-claude-tools