Skip to content

5402: Document and validate the operator-facing configuration surface#411

Merged
turegjorup merged 6 commits into
feature/update-infrastructure-for-mono-repofrom
feature/5402-image-self-documenting
Apr 29, 2026
Merged

5402: Document and validate the operator-facing configuration surface#411
turegjorup merged 6 commits into
feature/update-infrastructure-for-mono-repofrom
feature/5402-image-self-documenting

Conversation

@turegjorup

@turegjorup turegjorup commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Annotates .env with per-variable descriptions sourced from the docker-server-v3 example. Values and Symfony-Flex recipe blocks are unchanged; only comments are added. With composer dump-env prod and .env.local overrides on the operator host, .env itself is the canonical example for the Symfony app surface.
  • Adds a CI check that enforces the documentation invariant.

The nginx and PHP-FPM runtime knobs are documented adjacent to the image build itself (Dockerfile ENV blocks and the nginx template), so duplicated example files for those surfaces are out of scope here.

Validation

scripts/check-env-coverage.sh enforces two invariants:

  1. Every %env(...)% read in config/ is declared in .env.
  2. Every variable in .env has a preceding description comment.

The script is wired into:

  • task coding-standards:env:check (and rolled up under task coding-standards:check).
  • A dedicated .github/workflows/env_coverage.yaml that runs on push: develop and on every PR, using the official go-task/setup-task@v2.

Test plan

  • On a fresh checkout of this branch, task coding-standards:env:check exits 0 with PASS: env coverage OK.
  • Removing the description comment above APP_ENV (or any other variable) makes the check fail with the offending variable name.
  • Adding a hypothetical %env(NEW_VAR)% reference in config/ without declaring NEW_VAR= in .env makes CI fail.
  • The new Env coverage workflow appears in the PR check list and passes on this PR.

Commits

  1. 5402: Document the operator-facing configuration surface
  2. 5402: Add CI check that enforces env coverage
  3. 5402: Narrow scope to .env documentation only

🤖 Generated with Claude Code

turegjorup and others added 2 commits April 28, 2026 13:51
The image carries three distinct config surfaces:

  - .env          — Symfony app config (consumed via %env(...)% in config/)
  - nginx env     — runtime template substitution into nginx.conf
  - php-fpm env   — runtime tuning consumed by the itkdev/php8.4-fpm base

Annotate .env with per-variable descriptions so it is the canonical,
self-documenting Symfony example, and add dedicated production-example
files for the nginx and php-fpm runtime surfaces. Variable names mirror
what the image and templates actually consume — no APP_* prefix
translation.

Validated by the env-coverage check from the consolidation plan: every
%env(...)% reference in config/ is declared in .env and every
${VAR} in the nginx template is declared in the nginx example.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
scripts/check-env-coverage.sh validates the documentation surface
introduced in the previous commit:
  1. Every %env(...)% read in config/ is declared in .env.
  2. Every variable in .env, the nginx example, and the PHP example
     has a preceding description.
  3. Every ${VAR} in the nginx template is declared in the nginx
     env.production.example.
  4. Every PHP_* env set in the API Dockerfile's production stage is
     declared in the PHP env.production.example.

Wired into the existing 'coding-standards:check' task and a dedicated
GitHub Actions workflow that runs on push to develop and on pull
requests, using the official go-task/setup-task action.

Also fills in five PHP_OPCACHE_* and PHP_PM_*_SPARE_SERVERS variable
descriptions that check (2) caught as missing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@turegjorup
turegjorup requested a review from tuj April 28, 2026 12:04
@turegjorup turegjorup self-assigned this Apr 28, 2026
turegjorup and others added 2 commits April 28, 2026 14:07
…r-mono-repo' into feature/5402-image-self-documenting

# Conflicts:
#	CHANGELOG.md
Drop the dedicated nginx and PHP-FPM env.production.example files and
the corresponding script checks. The operator-facing configuration
contract for those two surfaces is documented adjacent to the image
build (Dockerfile ENV blocks and the nginx template) rather than as
duplicated example files.

The .env / config/ coverage check remains: every %env(...)% read in
config/ is declared in .env, and every variable in .env has a
preceding description.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread .env Outdated
Comment thread .env Outdated
@@ -0,0 +1,51 @@
# PHP-FPM runtime environment for the os2display api service image.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

@@ -0,0 +1,23 @@
# nginx runtime environment for the os2display nginx image.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

turegjorup and others added 2 commits April 29, 2026 10:59
Co-authored-by: Troels Ugilt Jensen <6103205+tuj@users.noreply.github.com>
Co-authored-by: Troels Ugilt Jensen <6103205+tuj@users.noreply.github.com>
@turegjorup
turegjorup merged commit dc65882 into feature/update-infrastructure-for-mono-repo Apr 29, 2026
18 checks passed
@turegjorup
turegjorup deleted the feature/5402-image-self-documenting branch April 29, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants