Skip to content

feat: always show curl export option in non-production environments#4768

Merged
MillenniumFalconMechanic merged 3 commits intomainfrom
issue-4767-curl-export-non-prod
Apr 14, 2026
Merged

feat: always show curl export option in non-production environments#4768
MillenniumFalconMechanic merged 3 commits intomainfrom
issue-4767-curl-export-non-prod

Conversation

@MillenniumFalconMechanic
Copy link
Copy Markdown
Contributor

Ticket

Closes #4767

Summary

  • Add isProductionEnvironment() utility to detect production vs non-production environments based on NEXT_PUBLIC_SITE_CONFIG
  • Update curl export visibility to always show in non-production environments (AnVIL only)
  • Add runtime guards to protect curl download routes in production when NRES consent groups are not present

Test plan

  • Verify curl export option appears in dev environment regardless of consent group selection
  • Verify curl export option only appears in production when NRES/Unrestricted access datasets are selected
  • Verify direct navigation to /export/get-curl-command works in dev, returns 404 in prod without NRES
  • Verify direct navigation to /datasets/{id}/export/get-curl-command works in dev, returns 404 in prod without NRES

🤖 Generated with Claude Code

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates AnVIL curl-export behavior to be environment-aware so that curl export is always visible in non-production environments while retaining NRES/Unrestricted access gating in production, and adds route-level guards to prevent accessing curl-download pages in production when the required consent groups aren’t present.

Changes:

  • Added isProductionEnvironment() utility based on NEXT_PUBLIC_SITE_CONFIG.
  • Updated AnVIL CMG curl export visibility to always render in non-production environments.
  • Added production-only runtime 404 guards for curl download routes/pages when NRES/Unrestricted access consent groups are absent.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
app/config/utils.ts Adds isProductionEnvironment() helper used for environment-aware behavior.
app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders.tsx Updates cohort/dataset curl export conditional rendering to always show in non-prod.
pages/export/get-curl-command.tsx Adds production-only runtime guard to render 404 without NRES/Unrestricted access in current selection (AnVIL).
pages/[entityListType]/[...params].tsx Adds production-only runtime guard for dataset curl download routes based on dataset consent group.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds environment-aware behavior for AnVIL curl export so it’s always visible in non-production environments while remaining restricted in production unless NRES/Unrestricted access consent groups are present.

Changes:

  • Introduces isProductionEnvironment() based on NEXT_PUBLIC_SITE_CONFIG to distinguish prod vs non-prod.
  • Updates AnVIL curl export visibility logic to always show in non-production.
  • Adds production-only runtime guards that return a 404 UI for curl download routes when required consent groups aren’t present.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pages/export/get-curl-command.tsx Adds production-only guard for curl-command export page using manifest consent groups.
pages/[entityListType]/[...params].tsx Adds production-only guard for dataset curl-download route and broadens consent check to include Unrestricted access.
app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders.tsx Exposes hasNRESConsentGroup(...) and makes curl export options always visible in non-prod.
app/config/utils.ts Adds isProductionEnvironment() (and a new consent-group helper).
app/components/Export/.../downloadSection.tsx Updates call site to new hasNRESConsentGroup(...) signature.
app/apis/azul/anvil-cmg/common/transformers.ts Adds isNRESOrUnrestrictedAccess(...) helper for consent group checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…4767

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add isNRESOrUnrestrictedAccess to transformers.ts
- Update isNRESDataset to check for both NRES and Unrestricted access
- Remove isNRESConsentGroup wrapper, use hasNRESConsentGroup directly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@MillenniumFalconMechanic MillenniumFalconMechanic force-pushed the issue-4767-curl-export-non-prod branch from 107f9ec to 32b09f5 Compare April 14, 2026 22:22
@MillenniumFalconMechanic MillenniumFalconMechanic merged commit d7324b4 into main Apr 14, 2026
3 checks passed
@MillenniumFalconMechanic MillenniumFalconMechanic deleted the issue-4767-curl-export-non-prod branch April 14, 2026 22:32
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] Always show curl export option in non-production environments

3 participants