Skip to content

feat: link the BDC-SB export page to Velsera behind a feature flag (#5027) - #5030

Merged
frano-m merged 2 commits into
mainfrom
frano-m/5027-velsera-bdc-export
Nov 11, 2026
Merged

frano-m merged 2 commits into
mainfrom
frano-m/5027-velsera-bdc-export

Conversation

@frano-m

@frano-m frano-m commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Closes #5027

What changed

  • Added the velseraexport feature flag (FEATURES.VELSERA_EXPORT). ?velseraexport=true turns it on and ?velseraexport=false turns it off.
  • New VelseraExportMethod component: the BDC-SB export method card on /export and on each dataset's export tab. It shows "Coming Soon" unless the flag is on, or when the platform is configured as coming soon.
  • ExportToPlatform builds the BDC-SB import URL from the signed PFB location returned by the manifest request, then shows the "Open BioData Catalyst" button (new tab, noopener noreferrer). The URL is built in ExportToPlatform/utils.ts (buildPlatformImportUrl, getPlatformImportUrl, isPlatformImportAvailable).
  • The import endpoint (https://platform.sb.biodatacatalyst.nhlbi.nih.gov/import/pfb) and source (bdc) are set as EXPORTS.BIO_DATA_CATALYST.platformImport in site-config/anvil-cmg/dev/export/constants.tsx.
  • On a platform export page, "Request Link" is disabled while the flag is off or when the platform has no platformImport (CAVATICA and CGC today). The pages stay reachable by URL.
  • "Coming soon" for CAVATICA and CGC moved from the view builders into EXPORT_METHODS site config. The view builders no longer set comingSoon.

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

  • The BDC-SB import endpoint is the one in the BDC document, 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).
  • The signed PFB URL is the location Azul returns for the verbatim PFB manifest request (issue open question 2). Whether BDC-SB can read it without AnVIL credentials is untested.
  • The flag lives in localStorage, so it is a rollout switch, not access control. Anyone can turn it on.
  • Because the site is statically exported and the flag only exists in the browser, useFeatureFlag is 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.
  • Enabling CAVATICA or CGC later is config only: add a platformImport and drop comingSoon in site-config/anvil-cmg/dev/export/constants.tsx. Their buttons also check the Velsera flag, so the flag would need generalising first.
  • renderDisabledButton sits in exportToPlatform.tsx next to the existing renderButton, following that file's pattern, because findable-ui's ExportButton has no disabled prop.

How to verify

Run the AnVIL explorer locally (npm run dev:anvil-cmg) or use a deployed dev build.

  1. Open /export with ?velseraexport=false. BDC-SB, CAVATICA and CGC all show "Coming Soon" and cannot be clicked.
  2. Open /export?velseraexport=true. BDC-SB is enabled. CAVATICA and CGC still show "Coming Soon".
  3. Click "Export to BioData Catalyst". Select organism type "Unspecified" and file format .txt (a small selection), then click "Request Link". After loading, "Open BioData Catalyst" appears. Its link is https://platform.sb.biodatacatalyst.nhlbi.nih.gov/import/pfb?URL=<encoded signed URL>&source=bdc and opens in a new tab.
  4. Click the button while signed in to BDC-SB. BDC-SB should start importing the PFB. (Not tested: needs a BDC-SB account.)
  5. Repeat steps 2 to 4 from a dataset's export tab, e.g. /datasets/825fae25-a969-5c1d-9867-e34f1858ca81/export (ANVIL_CMG_Sample_1).
  6. Visit with ?velseraexport=false. BDC-SB shows "Coming Soon" again. Open /export/biodata-catalyst directly: the page loads and "Request Link" is disabled.
  7. Open /export/cavatica, /export/cancer-genomics-cloud and /datasets/825fae25-a969-5c1d-9867-e34f1858ca81/export/cavatica directly, with the flag on or off. Each page loads with "Request Link" disabled.
  8. Run npm test. The import URL and render tests in __tests__/components/exportToPlatform.test.tsx and the comingSoon builder tests in __tests__/viewModelBuilders/export.test.ts and dataset-export.test.ts pass.

Definition of done:

  • A Velsera export flag exists in FEATURES and can be turned on and off with a URL parameter: steps 1, 2 and 6.
  • With the flag off, the BDC-SB export method still shows as disabled with "coming soon" on /export and on dataset export tabs: steps 1 and 6.
  • With the flag on, the BDC-SB export method is enabled and opens its export page, from both the cohort export and the dataset export: steps 2, 3 and 5.
  • CAVATICA and CGC still show "coming soon", with the flag on and with it off: steps 1, 2 and 7.
  • With the flag on, "Request Link" on the BDC-SB export page produces an "Open BioData Catalyst" button that opens the BDC-SB import URL with the signed PFB URL encoded in it and source=bdc: steps 3 to 5.
  • The BDC-SB import base URL and source value live in site config, not in the component: EXPORTS.BIO_DATA_CATALYST.platformImport in site-config/anvil-cmg/dev/export/constants.tsx.
  • A unit test covers building the BDC-SB import URL, including encoding of the signed URL and the source parameter: step 8.

Screenshots

data-browser-5027-bdc-request-link-disabled-flag-off data-browser-5027-cohort-bdc-link-ready data-browser-5027-cohort-export-flag-off data-browser-5027-cohort-export-flag-on data-browser-5027-cohort-export-flag-on data-browser-5027-dataset-bdc-link-ready data-browser-5027-dataset-export-flag-off data-browser-5027-dataset-export-flag-on data-browser-5027-dataset-export-flag-on

🤖 Generated with Claude Code
🐦 Built with cc-claude-tools

…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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@frano-m
frano-m marked this pull request as ready for review November 10, 2026 05:47

@NoopDog NoopDog left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. The view builders no longer force comingSoon: true, and nothing tests the new behaviour: re-adding comingSoon: true in either builder leaves all 278 tests passing (inline on viewModelBuilders.tsx).
  2. ExportToPlatform's wiring has no test: the flag hook, canImport, url, the button choice and renderDisabledButton are only covered through the pure helpers (inline on exportToPlatform.tsx:54).

Optional, left to you:

  1. 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).
  2. isPlatformImportAvailable's type predicate is unsound when only the flag is off (inline on utils.ts:46).
  3. "" as the "no URL" value in getPlatformImportUrl (inline on utils.ts:33).
  4. 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.

Comment thread pages/export/cavatica.tsx Resolved
…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>
@frano-m frano-m changed the title feat: link the bdc-sb export page to velsera behind a feature flag (#5027) feat: link the BDC-SB export page to Velsera behind a feature flag (#5027) Nov 11, 2026
@frano-m

frano-m commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks Dave. All six points are addressed in 2c20688 (replies are inline). On point 6, the PR title is now feat: link the BDC-SB export page to Velsera behind a feature flag (#5027), so the squash subject keeps the casing.

@frano-m
frano-m requested a review from NoopDog November 11, 2026 04:24

@NoopDog NoopDog left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@frano-m
frano-m merged commit 67c9b30 into main Nov 11, 2026
4 checks passed
@frano-m
frano-m deleted the frano-m/5027-velsera-bdc-export branch November 11, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AnVIL DX] Link the BDC-SB export page to Velsera behind a feature flag

3 participants