Skip to content

feat(config): Warn when undefined environments or groups are used in overrides #1880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: feat/manifest-loads-all-environments
Choose a base branch
from

Conversation

arthurpitman
Copy link
Contributor

@arthurpitman arthurpitman commented May 8, 2025

-- Please review #1876 first --

Why this PR?

When copying and pasting configs between projects, it is easy to forget to update any overrides. Currently, this is silent: the overrides simply have no effect, which can have undesirable consequences.

What has changed?

With this PR, a warning is emitted when an override references an environment or environment group that is not defined in the manifest.

A decision was made not to emit an error, at least for now, as this would be a breaking change.

How does it do it?

This PR builds on #1876, which preserves at least the names of all environments and groups in the loaded manifest, regardless of whether they're selected to be deployed or not.

Then, when a config entry is loaded, the environment or group name of each override is checked against those in the loader context

How is it tested?

Two extra tests are added to that explicitly check that warnings are logged:

  • TestLoadProjects_GroupOverrideWithUndefinedGroupProducesWarning
  • TestLoadProjects_EnvironmentOverrideWithUndefinedEnvironmentProducesWarning

How does it affect users?

Users will now receive a warning when an override references an environment or environment group that is not defined in the manifest.

@arthurpitman arthurpitman force-pushed the feat/warn-for-undefined-environments branch from e234621 to 8e0024b Compare May 8, 2025 15:45
@arthurpitman arthurpitman added the run-e2e-test Manually trigger the E2E tests for reviewed PRs label May 8, 2025
Copy link

github-actions bot commented May 8, 2025

E2E Test Results

    3 files    263 suites   24m 8s ⏱️
2 182 tests 2 180 ✅ 2 💤 0 ❌
2 413 runs  2 411 ✅ 2 💤 0 ❌

Results for commit 8e0024b.

@arthurpitman arthurpitman changed the title Feat/warn for undefined environments feat(config): Warn when undefined environments or groups are used in overrides May 9, 2025
@arthurpitman arthurpitman marked this pull request as ready for review May 9, 2025 07:29
@arthurpitman arthurpitman requested a review from a team as a code owner May 9, 2025 07:29
@arthurpitman arthurpitman force-pushed the feat/manifest-loads-all-environments branch 2 times, most recently from 8505894 to b19958e Compare May 12, 2025 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-e2e-test Manually trigger the E2E tests for reviewed PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant