feat(website): introduce DB_ID_SPACE env var for environment-specific collection IDs#1278
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
|
@fengelniederhammer I think this might be the way to go. |
67f055c to
4643ef3
Compare
4643ef3 to
b69c77a
Compare
b69c77a to
cf6ea5c
Compare
… 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>
cf6ea5c to
e3f23c8
Compare
Contributor
There was a problem hiding this comment.
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_SPACEparsing/validation (getDbIdSpace) and abyEnv(...)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.
… 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>
Contributor
There was a problem hiding this comment.
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
fengelniederhammer
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DB_ID_SPACEenv var (prod|staging|local) to control which collection IDs the wastewater dashboard uses, replacing the existingisStagingboolean ternariesDB_ID_SPACEis optional — when unset, it is derived fromDASHBOARDS_ENVIRONMENT(dashboards-staging→staging, otherwiseprod).localalways requires an explicit override.byEnv(env, { prod, staging, local })helper for readable three-way ID mappingDB_ID_SPACE=localin the website Docker container indocker-compose.ymlso E2E tests use the correct local collection IDsThis should fix the CI issues.
🤖 Generated with Claude Code