fix(dev): bootstrap config.json + secrets and unblock test container#323
Open
KrishnaSuravarapu wants to merge 1 commit into
Open
fix(dev): bootstrap config.json + secrets and unblock test container#323KrishnaSuravarapu wants to merge 1 commit into
KrishnaSuravarapu wants to merge 1 commit into
Conversation
Local `make dev` / `make build` / `make test` were failing on a fresh checkout for two reasons, both stemming from gitignored files that CI creates but local bootstrap did not: - dev/web container crashed with `FileNotFoundError: 'config.json'`. The Dockerfile bakes config.json, but the `.:/srv/code/dev` bind mount shadows it with the host dir, which has no config.json locally. - test container aborted with a pylama PluginValidationError: pylama's pytest11 plugin uses `pytest_collect_file(path, ...)`, an argument removed in pytest 9. CI worked around it with `-p no:pylama`, but the Docker/Makefile pytest invocations never got the same fix. Changes: - scripts/bootstrap_secrets.sh: create secrets/*.env from samples, idempotently and with consistent MYSQL_ROOT_PASSWORD across files. Honors MYSQL_ROOT_PASSWORD / APP_TOKEN env overrides for deterministic (e.g. CI) runs before falling back to reuse-existing, then random. - Makefile: add idempotent `setup_config` target that materializes config.json from its sample; wire it (plus setup_secrets) into setup, setup_mounts, dev, and build. - pytest.ini: add `-p no:pylama` to addopts so the fix applies to every pytest invocation (test container CMD + `make test`), not just CI. Standalone `python -m pylama` linting is unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
On a fresh checkout, local
make dev/make build/make testfail with two errors — both caused by gitignored files that CI creates but local bootstrap didn't:dev(web)FileNotFoundError: 'config.json'config.json, but the.:/srv/code/devbind mount (docker-compose.yml:15) shadows it with the host dir, which has no localconfig.json.testpluggy PluginValidationError: Plugin 'pylama'pylama's pytest11 plugin usespytest_collect_file(path, ...), an arg removed in pytest 9. CI worked around it with-p no:pylama; the Docker/Makefile pytest invocations never got the fix.Changes
scripts/bootstrap_secrets.sh(new) — idempotently createssecrets/*.envfrom samples with a consistentMYSQL_ROOT_PASSWORDacross files. HonorsMYSQL_ROOT_PASSWORD/APP_TOKENenv overrides for deterministic runs (e.g. CI/debugging) before falling back to reuse-existing, then random.Makefile— new idempotentsetup_configtarget that materializesconfig.jsonfrom its sample; wired (withsetup_secrets) intosetup,setup_mounts,dev, andbuild.pytest.ini— added-p no:pylamatoaddoptsso the fix applies to every pytest invocation (test-containerCMD+make test), not just CI. Standalonepython -m pylamalinting is unaffected.Verification
make setup_configcreatesconfig.json, and is a no-op on re-run (idempotent).devcontainer boots past config load and serves —HTTP 302on http://localhost:8000 (redirect to auth).python -m pytest --coinside the container collects 115 tests with noPluginValidationError.Notes / follow-up
config.jsonstays gitignored — only bootstrapped locally..github/workflows/unit-tests.ymlcan now drop its inline-p no:pylama(redundant withpytest.ini) — left in place for now as belt-and-suspenders; happy to remove if preferred.🤖 Generated with Claude Code