Skip to content

feat(website): introduce DB_ID_SPACE env var for environment-specific collection IDs#1278

Merged
fhennig merged 7 commits into
mainfrom
feat/db-id-space-env-var
Jun 25, 2026
Merged

feat(website): introduce DB_ID_SPACE env var for environment-specific collection IDs#1278
fhennig merged 7 commits into
mainfrom
feat/db-id-space-env-var

Conversation

@fhennig

@fhennig fhennig commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Introduces DB_ID_SPACE env var (prod | staging | local) to control which collection IDs the wastewater dashboard uses, replacing the existing isStaging boolean ternaries
  • DB_ID_SPACE is optional — when unset, it is derived from DASHBOARDS_ENVIRONMENT (dashboards-stagingstaging, otherwise prod). local always requires an explicit override.
  • Adds a byEnv(env, { prod, staging, local }) helper for readable three-way ID mapping
  • Fixes the local COVID variant filter default collection ID (XFG, not XEC.35.1)
  • Sets DB_ID_SPACE=local in the website Docker container in docker-compose.yml so E2E tests use the correct local collection IDs

This should fix the CI issues.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dashboards Ready Ready Preview, Comment Jun 25, 2026 12:53pm

Request Review

@fhennig

fhennig commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

@fengelniederhammer I think this might be the way to go.

… collection IDs

Wastewater dashboard collection IDs differ between prod, staging, and local
environments. Previously the config used isStaging booleans with hardcoded
ternaries. This introduces DB_ID_SPACE (prod/staging/local) and a byEnv()
helper to make the three-way mapping explicit and readable. Defaults to prod
when unset.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread website/src/types/wastewaterConfig.ts Outdated
@fhennig fhennig marked this pull request as ready for review June 24, 2026 09:01

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.

Warning

  • Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.

Pull request overview

This PR introduces a DB_ID_SPACE environment variable (prod | staging | local) to select environment-specific wastewater collection IDs, replacing the previous two-way isStaging mapping.

Changes:

  • Added DB_ID_SPACE parsing/validation (getDbIdSpace) and a byEnv(...) helper for 3-way ID selection.
  • Updated wastewater config consumers (Astro pages, header menu, unit tests, Playwright tests) to use wastewaterOrganismConfigs() instead of static exports.
  • Updated environment typings and environment files to support the new variable.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
website/tests/wastewater.spec.ts Updated Playwright tests to use wastewaterOrganismConfigs() accessor.
website/tests/WasapPage.ts Updated page object navigation to use wastewaterOrganismConfigs() accessor.
website/src/types/wastewaterConfig.ts Introduced env-driven config selection and 3-way ID mapping helper.
website/src/types/wastewaterConfig.spec.ts Updated unit tests to call wastewaterOrganismConfigs().
website/src/types/dbIdSpace.ts Added DB_ID_SPACE parsing/validation helper.
website/src/layouts/base/header/getPathogenMegaMenuSections.ts Updated header links/descriptions to use wastewaterOrganismConfigs() accessor.
website/src/env.d.ts Added DB_ID_SPACE to ImportMetaEnv typing.
website/src/components/views/wasap/Wasap.astro Removed isStaging branching and selected config via DB_ID_SPACE.
website/.env.e2e Updated e2e env file (content excluded from review).
website/.env.example Updated example env file (content excluded from review).
Files excluded by content exclusion policy (2)
  • website/.env.e2e
  • website/.env.example

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

Comment thread website/src/types/dbIdSpace.ts
Comment thread website/src/types/wastewaterConfig.ts
… positional

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…r default (XFG, not XEC.35.1)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… the literal union

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…default

DB_ID_SPACE is now an optional override. When unset, it falls back to
'staging' if DASHBOARDS_ENVIRONMENT is 'dashboards-staging', and 'prod'
otherwise. 'local' still requires an explicit DB_ID_SPACE=local.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.

Warning

  • Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Files excluded by content exclusion policy (2)
  • website/.env.e2e
  • website/.env.example

Comment thread website/src/types/wastewaterConfig.ts Outdated
Comment thread website/src/types/wastewaterConfig.ts
@fhennig fhennig merged commit ba788d6 into main Jun 25, 2026
10 of 11 checks passed
@fhennig fhennig deleted the feat/db-id-space-env-var branch June 25, 2026 12:53
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.

3 participants