Skip to content

refactor: deploy.sh goes, each task runs through its own tool, and the Mongo backup is a compose service - #455

Merged
HardMax71 merged 1 commit into
mainfrom
max/drop-deploy-sh
Oct 23, 2026
Merged

HardMax71 merged 1 commit into
mainfrom
max/drop-deploy-sh

Conversation

@HardMax71

@HardMax71 HardMax71 commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

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 compose and its profiles, pre-commit run --all-files runs the lint and type checks (bandit added with CI's command), and the spec export moves to backend/scripts/export_openapi.py. CI picks the test config with BACKEND_CONFIG=config.test.toml in .env instead of copying it over config.toml.

The backup is now the mongo-backup service on the mongo image: mongodump into the mongo_backups volume 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

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD or tooling changes

Test Plan

  • Backend unit tests pass (cd backend && uv run pytest tests/unit)
  • Frontend unit tests pass (cd frontend && npm run test)
  • Backend E2E tests pass (docker compose exec -T backend sh -c 'uv sync --group test --no-dev --frozen --no-install-project --no-build && pytest tests/e2e')
  • Frontend E2E tests pass (cd frontend && npm run test:e2e)
  • API spec and client regenerated if routes or schemas changed (uv run python -m scripts.export_openapi in backend/, then npm run generate:api in frontend/), never edited by hand
  • Manual testing performed

Validation: 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 and docker compose config with BACKEND_CONFIG pass.

Checklist

  • My code follows the project's style guidelines
  • I have run pre-commit run --all-files and all checks pass
  • I have added tests that prove my fix/feature works
  • I have updated documentation if needed
  • My changes don't introduce new warnings

Summary 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 compose with its profiles for the stack, pre-commit run --all-files for the lint and type checks (bandit added to match CI), and backend/scripts/export_openapi.py for the API spec export. The nightly Mongo backup, previously a production-only host cron, becomes the mongo-backup compose service: it dumps from the mongo image into the mongo_backups volume at startup and every 24 hours, keeps 14 days, and runs the same locally and in production. CI selects the test config via BACKEND_CONFIG=config.test.toml in .env instead of copying it over config.toml.

Migration

  • Production's /etc/cron.d/integr8scode-backup still calls deploy.sh and must be removed after the release.
  • The old backup script's 5 GB free-space check is gone.

Written for commit 9055e43. Summary will update on new commits.

View guided diff Turn on auto-fix

…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
HardMax71 enabled auto-merge (squash) October 23, 2026 18:07
@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ca7b12c4-54d9-4678-9aee-3f172602b938
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added documentation Improvements or additions to documentation area: deploy Compose, images, release workflow, production host area: ci GitHub workflows, test infrastructure, repo tooling labels Oct 23, 2026
@sonarqubecloud

Copy link
Copy Markdown

@codecov-commenter

codecov-commenter commented Oct 23, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Flag Coverage Δ
backend-e2e 82.04% <ø> (ø)
backend-unit 77.87% <ø> (ø)
frontend-unit 92.25% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Backend 94.73% <ø> (ø)
Frontend 92.25% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@HardMax71
HardMax71 merged commit f71d4d7 into main Oct 23, 2026
39 of 41 checks passed
@HardMax71
HardMax71 deleted the max/drop-deploy-sh branch October 23, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci GitHub workflows, test infrastructure, repo tooling area: deploy Compose, images, release workflow, production host documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants