feat(deploy): add CONFIG_LOCAL_DIR overlay for local-only config overrides#388
Open
ivangrynenko wants to merge 1 commit into
Open
feat(deploy): add CONFIG_LOCAL_DIR overlay for local-only config overrides#388ivangrynenko wants to merge 1 commit into
ivangrynenko wants to merge 1 commit into
Conversation
…rides Mirror the existing CONFIG_DEV_DIR pattern with a new optional CONFIG_LOCAL_DIR (default /app/config/local). Apply it as an additional `drush config:import --partial` step only when LAGOON_ENVIRONMENT_TYPE=local AND the directory contains importable YAML. Final overlay order: 1. config/default/ (always, full import) 2. config/dev/ (any non-production env, partial) 3. config/local/ (local env only, partial) - new This lets site projects place shield.settings.yml (and any other local-only overrides) under config/local/ to keep shield disabled on developers' machines without weakening it on public Lagoon dev/staging URLs. The new code path is fully opt-in: no-op when config/local/ is absent, never reached on remote Lagoon environments. Adds four bats test cases covering: - local env with all three dirs (asserts ordering and partial flag) - local env with no local dir (asserts no third import call) - development env with local dir present (regression guard for the local-only gate) - production env with local dir present (only default import runs)
6 tasks
|
Thanks for the contribution @ivangrynenko, I'll get this added to our internal backlog for review! Internal ticket: GOVCMS-14851 |
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 #387.
Summary
Adds an optional
CONFIG_LOCAL_DIR(default/app/config/local) overlay toscripts/deploy/govcms-config-import, applied viadrush config:import --partialonly whenLAGOON_ENVIRONMENT_TYPE=localAND the directory contains importable YAML.Overlay order:
default→dev(any non-prod) →local(local only).Lets site projects place
shield.settings.yml(and any other local-only overrides) underconfig/local/to disable shield on developers' machines without weakening it on public Lagoon dev/staging/branch URLs.Why this matters
Today every non-production environment shares the same
config/dev/overlay, so disabling shield for local also disables it on public dev URLs. This PR splits those concerns without changing existing behaviour for any environment that doesn't opt in.What changed
scripts/deploy/govcms-config-import: readCONFIG_LOCAL_DIR, append a gated--partialimport after the existing dev overlay. Header comment now documents the three-tier import order.tests/bats/deploy/govcms-config-import.bats: 4 new test cases (local+present, local+absent, development+present regression guard, production+present).tests/bats/deploy/fixtures/config/local/shield.settings.yml: new fixture matching the existingdevfixture pattern.What didn't change
scripts/govcms-deployordrupal/settings/*.config/local/is identical to today.Backward compatibility
Fully backward compatible. The new code path is only reached when both
LAGOON_ENVIRONMENT_TYPE=localandCONFIG_LOCAL_DIRcontains YAML — neither is true for any existing GovCMS production or remote non-production environment.Security notes
LAGOON_ENVIRONMENT_TYPE=local, set by the Lagoon local stack and not user-supplied at request time.config/dev/for developer convenience.drush config:import.Testing
All 13 tests pass (9 pre-existing + 4 new).
Manual verification on a Compose-based GovCMS local stack:
config/local/shield.settings.ymlwithshield_enable: false.govcms-deploywithLAGOON_ENVIRONMENT_TYPE=local.Adoption note for site projects
Once merged, a consuming GovCMS site project can:
config/local/in their project repo.drush config:export --destination=/app/config/local shield.settingson a local instance with shield disabled, or hand-write the YAML.config/local/shield.settings.yml.When their local stack sets
LAGOON_ENVIRONMENT_TYPE=local(default forpygmy/lando/Compose-based GovCMS local dev), the nextgovcms-deploywill disable shield. Public Lagoon dev/staging URLs remain shielded.Follow-ups
local.settings.phpcompanion in a future PR for settings overrides that shouldn't round-trip throughdrush cex.