Skip to content

feat: prevent users from initiating export of unfeasibly large anvil datasets (#4953) - #4992

Open
frano-m wants to merge 1 commit into
mainfrom
frano-m/4953-disable-anvil-terra-export
Open

frano-m wants to merge 1 commit into
mainfrom
frano-m/4953-disable-anvil-terra-export

Conversation

@frano-m

@frano-m frano-m commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Ticket

Closes #4953.

Reviewers

@NoopDog.

Changes

  • Added TERRA_EXPORT_UNAVAILABLE_DATASET_TITLES (the four eMERGE GWAS datasets from azul#8134) and the explanation text in app/viewModelBuilders/azul/anvil-cmg/common/constants.ts.
  • Dataset export: for these datasets, the "Export to Terra" method on the "Choose Export Method" tab is disabled with a footnote, and the dataset Terra route (/datasets/{id}/export/export-to-terra) renders a warning instead of the export form.
  • Cohort export: when one of these datasets is selected in the "Dataset" filter, the "Export to Terra" method is disabled with a footnote naming the dataset(s), and the cohort Terra route (/export/export-to-terra) renders a warning instead of the export form.
  • Cohort checks only run after hydration (once the file manifest is enabled / facets have loaded), because the selected filters are not known when the page is statically rendered.
  • Unit tests for the new helpers, builders, and render conditions.

Definition of Done (from ticket)

Disable the export to Terra functionality for the four datasets with an explanation as to why.

QA steps (optional)

Requires an account with access to the eMERGE GWAS datasets (they are managed access, so signed-out users only see the existing "request access" warning on their dataset export pages).

  1. Open the export page of e.g. ANVIL_eMERGE_GWAS_GRU — "Export to Terra" is disabled with the explanation; navigating directly to its /export/export-to-terra route shows the warning.
  2. Select ANVIL_eMERGE_GWAS_GRU in the "Dataset" filter and click Export — "Export to Terra" is disabled with the explanation; /export/export-to-terra shows the warning.
  3. Select any other dataset — Terra export works as before.

Known Issues

@NoopDog — please confirm the cohort-export scope:

  • The cohort check only catches datasets explicitly selected in the "Dataset" filter. Selections that include these datasets indirectly (e.g. by consent group, identifier phs001584, or no filters at all) are not blocked and can still start a Terra export that fails.
  • We can't do better client-side today: Azul filters only support is / within / contains / intersects (no "is not", so we can't exclude the datasets from an export), and the file facets the explorer fetches are limited to the top 25 datasets, so they can't reliably tell us whether a broad selection contains them. The cleaner fix for that case would be Azul failing early (or supporting an exclusion operator), as the ticket mentions.
  • The explanation is text-only for now; the link to the Broad team's document on accessing these datasets will be added in a follow-up once the URL is available.

🤖 Generated with Claude Code

4953-dataset-export-to-terra 4953-dataset-choose-export-method 4953-cohort-export-to-terra 4953-cohort-choose-export-method

@frano-m
frano-m requested a balanced review from Copilot October 15, 2026 03:03
@frano-m
frano-m marked this pull request as ready for review October 15, 2026 03:03

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

Human acceptance is needed for the documented cohort limitation that leaves indirectly selected restricted datasets unblocked.

0 open findings

What changed in this PR

Adds Terra export restrictions for four oversized eMERGE GWAS datasets in the AnVIL explorer.

Changes:

  • Disables Terra export options and shows explanatory warnings for affected datasets.
  • Blocks cohort exports when affected datasets are explicitly selected, with hydration-aware rendering.
  • Adds unit tests for restriction helpers, messages, and render conditions.
File Description
site-config/​anvil-cmg/​dev/​export/​export.ts Adds conditional cohort export warnings and forms.
site-config/​anvil-cmg/​dev/​detail/​dataset/​export/​export.ts Adds conditional dataset export warnings and forms.
app/​viewModelBuilders/​azul/​anvil-cmg/​common/​viewModelBuilders.tsx Implements restriction checks and warning builders.
app/​viewModelBuilders/​azul/​anvil-cmg/​common/​constants.ts Defines restricted datasets and explanation text.
tests/​viewModelBuilders/​export.test.ts Tests cohort restrictions and messages.
tests/​viewModelBuilders/​dataset-export.test.ts Tests dataset restrictions and rendering.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@NoopDog

NoopDog commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Thanks Fran, this is nicely done. We can't ship it without the link to the Broad document that tells users how to get these datasets, so I'm marking it blocked until we have that URL. Once the link is in, this is ready to go.

…datasets (#4953)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@frano-m
frano-m force-pushed the frano-m/4953-disable-anvil-terra-export branch from 1008b1e to 43c59fb Compare October 15, 2026 23:49

This branch has not been deployed

No deployments
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.

Prevent users from initiating export of unfeasibly large AnVIL datasets

3 participants