Repository navigation
refactor: deploy.sh goes, each task runs through its own tool, and the Mongo backup is a compose service - #455
Merged
Merged
Conversation
…e Mongo backup is a compose service Compose starts and stops the stack with its own profiles and flags, pre-commit runs the lint and type checks (bandit added, with the same command as CI), and npm run generate:api builds the client. The spec export becomes backend/scripts/export_openapi.py. The nightly Mongo backup, a host cron on production only, is now the mongo-backup service: mongodump from the mongo image every 24 hours into the mongo_backups volume, 14 days kept, the same locally and in production. CI selects the test config with BACKEND_CONFIG in .env instead of copying it over config.toml.
HardMax71
enabled auto-merge (squash)
October 23, 2026 18:07
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
6 of 17 tasks
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.



Summary
deploy.sh was 410 lines and 10 commands, and eight of them only wrapped a compose, uv or npm call that those tools run with their own flags. Two names for every task, plus a production-only piece: the nightly Mongo backup ran from a host cron that no local stack ever ran.
Changes
deploy.sh goes. The stack runs with
docker composeand its profiles,pre-commit run --all-filesruns the lint and type checks (bandit added with CI's command), and the spec export moves tobackend/scripts/export_openapi.py. CI picks the test config withBACKEND_CONFIG=config.test.tomlin .env instead of copying it over config.toml.The backup is now the
mongo-backupservice on the mongo image: mongodump into themongo_backupsvolume at start and every 24 hours, 14 days kept, the same locally and in production. The old 5G free-space check goes with the script. I tried nfrastack/db-backup 5.0.5 first, but its own restore can't parse its MongoDB dumps.Warning
After the release, production's /etc/cron.d/integr8scode-backup still calls deploy.sh and has to be removed.
Type of Change
Test Plan
cd backend && uv run pytest tests/unit)cd frontend && npm run test)docker compose exec -T backend sh -c 'uv sync --group test --no-dev --frozen --no-install-project --no-build && pytest tests/e2e')cd frontend && npm run test:e2e)uv run python -m scripts.export_openapiin backend/, thennpm run generate:apiin frontend/), never edited by handValidation: the export writes the committed spec byte for byte. Locally a document with a 64-bit integer, a date and a unique index survived dump, drop and restore; mongo-backup idles at 16 MiB.
mkdocs build --strict, actionlint, the backend pre-commit hooks anddocker compose configwithBACKEND_CONFIGpass.Checklist
pre-commit run --all-filesand all checks passSummary by cubic
Removes
deploy.sh(410 lines, 10 commands), whose subcommands each only wrapped a compose, uv, or npm call, and runs every task through the tool that owns it:docker composewith its profiles for the stack,pre-commit run --all-filesfor the lint and type checks (bandit added to match CI), andbackend/scripts/export_openapi.pyfor the API spec export. The nightly Mongo backup, previously a production-only host cron, becomes themongo-backupcompose service: it dumps from the mongo image into themongo_backupsvolume at startup and every 24 hours, keeps 14 days, and runs the same locally and in production. CI selects the test config viaBACKEND_CONFIG=config.test.tomlin.envinstead of copying it overconfig.toml.Migration
/etc/cron.d/integr8scode-backupstill callsdeploy.shand must be removed after the release.Written for commit 9055e43. Summary will update on new commits.