CI Feature-Flag Matrix: Test and Add a Flag
How ImgCompress tests its runtime settings like DISABLE_LOGO and MAX_UPLOAD_SIZE_MB in CI, and how to add a new environment flag step by step.
How ImgCompress tests its runtime settings like DISABLE_LOGO and MAX_UPLOAD_SIZE_MB in CI, and how to add a new environment flag step by step.
Every runtime setting is tested in the real Docker image, once per combination, so a flag can never silently stop working.
Runtime flags are environment variables that self-hosters set in docker-compose.yml (all of them: Configuration reference). The matrix covers:
| Flag | Default | Effect |
|---|---|---|
DISABLE_LOGO | false | Hides the mascot for a minimal UI. |
DISABLE_STORAGE_MANAGEMENT | false | Hides the storage panel. |
MAX_UPLOAD_SIZE_MB | 40960 (40 GB) | Largest file a user can upload. |
DEV_MODE | false | Developer tools, not for end users. |
The feature-flags job in .github/workflows/ci-auto-merge.yml starts the built image once per matrix entry, with different values. Then Playwright checks the UI and the server:
featureFlagsRuntime_Test.spec.ts: logo and storage panel match the flags.uploadLimitRuntime_Test.spec.ts: a 5 MB limit is shown and enforced. It skips itself when the limit is large.Each entry has a readable name, e.g. logo HIDDEN | storage SHOWN, and uploads its screenshots as an artifact.
textenv var ─► backend/image_converter/config/loader.py ─► /config/runtime.json ─► web UI (overrides app.json) (served by Flask) (fetch on load)
bashmake feature-flags
This builds the image once and runs the specs for every combination in scripts/runFeatureFlagsDockerE2E.sh. Needs Docker and pnpm.
backend/image_converter/config/app.json._OVERRIDES in config/loader.py (on/off flags), or read it like MAX_UPLOAD_SIZE_MB for values. Bad values must fail at startup with a clear message.tests/unit/.serve_runtime_config() in presentation/web/static_routes.py./config/runtime.json, like DISABLE_LOGO in frontend/src/app/page.tsx./config/runtime.json and checks the UI.test-feature-flags-matrix with the value, a scenario and a label, and pass it to docker run with -e. Add the combination to scripts/runFeatureFlagsDockerE2E.sh too.docker-compose.yml, the compose files in docker/compose/, the README and the installation guide.actionlint before you push.Each entry is a full app start. Test a new flag against the defaults, and only combine flags that affect each other.