Core compose: map PAUSE_ENABLED env for staged shard_core config overrides#183
Merged
Merged
Conversation
The controller (freeshard-controller#368) flips shard_core settings on a
subset of shards by writing an override into that shard's core .env on every
converge. For that to reach shard_core, the core-version docker-compose.yml
must map the consuming env var with a safe default.
Add FREESHARD_APPS__LIFECYCLE__PAUSE_ENABLED=${PAUSE_ENABLED:-false} to the
shard_core service. The :-false guard means a shard whose .env omits the
override keeps the default (fleet behavior identical); a shard whose .env sets
PAUSE_ENABLED=true resolves pause_enabled=true after recreate. The flag already
exists and is env-overridable, so no shard_core code change.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.
Closes #182.
What + why
The controller (freeshard-controller#368) rolls out the PAUSED+PAGED tier to a subset of shards by writing a per-shard override into that shard's core
.envon every converge. For that override to reachshard_core, the core-versiondocker-compose.ymlmust map the consuming env var with a safe default. Today the compose has no such mapping, so there is nothing for the controller override to feed into.This adds the first consumer mapping to the
shard_coreservice:- FREESHARD_APPS__LIFECYCLE__PAUSE_ENABLED=${PAUSE_ENABLED:-false}FREESHARD_prefix +__delimiter is the existing pydantic-settings convention; the flag (apps.lifecycle.pause_enabled) already exists and is env-overridable, so noshard_corecode change. The:-falseguard mirrorsDISABLE_SSLand avoids the empty-string boot-crash trap (an omitted or emptyPAUSE_ENABLEDbehaves as the defaultfalse).Not added to
.env.templateon purpose: this is controller-injected, not a self-hoster knob. Advertising it as a template var would invite manual edits the controller overwrites each converge.Acceptance criteria — verified
Proven directly (settings resolution +
docker compose configinterpolation):PAUSE_ENABLED→Settings().apps.lifecycle.pause_enabledisfalse(fleet behavior identical); compose renders"false".PAUSE_ENABLED=true→ resolvestrue; compose renders"true".Falsifiable: a wrong single-underscore name would resolve
falsein both cases (silent-fallback trap); thetruecase resolvingtrueproves the override lands.Out of scope
Controller-side override storage / injection / apply-config / operator UI — all in freeshard-controller#368.
Review panel
app_lifecycle.py:54), the env-var name shape matches pydantic-settings nesting, env precedence outranks theconfig.tomlpause_enabled = falsebaseline, the:-falseguard avoids the empty-string crash, and the.env.templateomission is correct. Advisory-only: theconfig.tomlbaseline is now redundant-but-harmless; no compose→settings test harness exists (matches the untestedDISABLE_SSLprecedent — out of scope).No specialist reviewers triggered: pure config mapping, no logic path, no secret/token/authz/DB/API/UX surface.
🤖 Generated with Claude Code