fix(infra): report which environment variable pins a setting - #1084
Merged
Conversation
The Infrastructure page inferred an environment pin from "running value != saved value". That mismatch is also exactly what a save looks like before the server is restarted, so a stock stack with no variable set anywhere still told the operator a variable was pinning the setting — and never said which one. The Engine card had no notice at all, so a pinned engine silently reverted after a restart and read as "nothing was saved". load-env now snapshots the keys present immediately before data/.env.generated is merged, i.e. everything supplied by the container environment or a project .env. Both outrank the saved file for good, so both are pins. This is a second snapshot rather than a reuse of recordOsEnvKeys: that one answers "may this win over the file being written?" for the save guard, where only a host value counts, while a project .env pins the dashboard just as hard. Because clearBlankEnv runs first, a blank compose forward is already gone and correctly does not register as a pin. /infra/status reports the pinned subset of the four editable selection keys. The page now names the variable when a setting is pinned, says a restart is pending when it is not, and applies the same notice to the Engine card.
rmyndharis
force-pushed
the
fix/name-the-pinning-env-var
branch
from
August 6, 2026 02:38
6a3077d to
1bb1da7
Compare
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.
The Infrastructure page decided a setting was pinned by an environment variable by comparing the running value against the saved file. That mismatch is also exactly what a save looks like before the server is restarted, so a stock stack with no variable set anywhere still told the operator that a variable was pinning the setting — and never said which one. The Engine card had no notice at all, so a pinned engine silently reverted after a restart and read as "nothing was saved", which is how it was reported in #1082.
Change
load-envsnapshots the keys present immediately beforedata/.env.generatedis merged — everything supplied by the container environment or a project.env. Both load withoverride: falseand outrank the saved file permanently, so both are pins.This is a second snapshot rather than a reuse of
recordOsEnvKeys. That one answers "may this value win over the file being written?" for the save-config guard, where only a host value counts. This one answers "can the dashboard change this at all?", and there a project.envpins just as hard. Verified: with a pinning.envand no container variable at all, only the new snapshot reports it.Because
clearBlankEnvruns before the snapshot, a blank compose forward (- KEY=${KEY:-}with nothing set) is already deleted and correctly does not register as a pin — so the bundled compose keeps behaving exactly as before./infra/statusreports the pinned subset of the four editable selection keys. The page then names the variable when a setting is pinned, says a restart is pending when it is not, and applies the same notice to the Engine card.envPinnedis optional on the client type so a dashboard served by an older gateway degrades to the previous behaviour rather than breaking.Verification
Unit tests cover the snapshot (a shadowing layer counts, a blank forward does not, and a real value that merely repeats the default does) and the controller wiring (only editable selection keys are reported, never unrelated variables like
PATH).Beyond the suites, the built app was run against four configurations and
/infra/statusinspected each time:envPinned[]ENGINE_TYPE=,REDIS_ENABLED=)[], and the saved values applyREDIS_ENABLED=truein the environment["REDIS_ENABLED"].envwithENGINE_TYPE["ENGINE_TYPE"]The first two are the cases that previously produced a false pin notice.
Both new strings are translated across all twelve locales;
i18n:checkpasses, including placeholder parity for the new{{name}}token.Refs #1082.