feat: testing GHCR workflow, VPS compose, bootstrap_testing_server co…#98
Conversation
…mmand Add PR/manual workflow pushing only testing-* image tags so test VPS pulls stay separate from production :latest/:sha-*. - docker-compose.yml and docker-compose.testing.yml use BLOGIT_TESTING_IMAGE_TAG - Document testing vs production image vars in .env.example and test-server plan - bootstrap_testing_server management command + bootstrap-testing-server.sh - Note in release-production not to add testing tags there Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR establishes a complete testing deployment infrastructure. It adds a GitHub Actions workflow to build and push ephemeral Docker images for PRs, a Django bootstrap command to initialize test databases, a bash deployment script, configuration files, comprehensive documentation, and unit tests. The testing images are strictly separated from production via distinct tags and compose files. ChangesTesting Deployment Infrastructure
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/build-testing-images.yml:
- Around line 17-20: The workflow currently sets workflow-level permissions
including "packages: write"; change the global permissions block to only grant
"contents: read" (remove or set "packages: read/none") and add a job-level
permissions block for the build-and-push job that includes "packages: write".
Specifically, update the top-level permissions mapping (the "permissions:"
block) to remove "packages: write" and then add a "permissions:" subsection
under the "build-and-push" job (or its job definition) granting "packages:
write" so only that job can publish packages; apply the same change for the
repeated permissions blocks referenced around lines 57-113.
In `@blog/management/commands/bootstrap_testing_server.py`:
- Around line 67-69: The code currently raises SystemExit when FIXTURE_PATH is
missing; replace that with raising Django's CommandError so the management
framework can catch and handle it. Specifically, in the block that calls
self.stderr.write(f"Fixture missing: {FIXTURE_PATH}") change the subsequent
raise SystemExit(1) to raise CommandError with a descriptive message (e.g.,
including FIXTURE_PATH) so call_command("bootstrap_testing_server") and tests
receive a clean CommandError; CommandError is already imported so no additional
imports are needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: fed020e0-7bb9-497c-a09b-c34ad1046384
📒 Files selected for processing (9)
.env.example.github/workflows/build-testing-images.yml.github/workflows/release-production.ymlblog/management/commands/bootstrap_testing_server.pydocker-compose.testing.ymldocker-compose.ymldocs/deployment/test-server-deployment-plan.mdscripts/bootstrap-testing-server.shtests/unit/test_bootstrap_testing_site_command.py
- build-testing-images: workflow permissions contents read only; packages: write on build-and-push (with contents: read for checkout) - bootstrap_testing_server: CommandError instead of SystemExit when fixture absent - test: missing fixture raises CommandError Co-authored-by: Cursor <cursoragent@cursor.com>
- build-testing-images: short sticky PR comment with tags + bootstrap one-liner - bootstrap-testing-server.sh: first arg is BLOGIT_TESTING_IMAGE_TAG Co-authored-by: Cursor <cursoragent@cursor.com>
|
Testing image tag: bash ./bootstrap-testing-server.sh testing-pr-98 |
Drop duplicate test-VPS stack; align docs and .env.example with docker-compose.testing.yml + .env.testing. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@blog/management/commands/bootstrap_testing_server.py`:
- Around line 25-27: Add a hard environment safety gate at the start of the
management command (e.g., in Command.handle) to prevent accidental runs: refuse
to proceed unless a trusted condition is met — for example settings.DEBUG is
True OR an explicit env var like BOOTSTRAP_TESTING_SERVER_ALLOW="1" is set OR a
required --force flag is passed; if the check fails, print a clear message and
exit without flushing DB or creating the test superuser. Apply this guard around
the code paths that call flush/recreate users and reference the TEST_USERNAME,
TEST_EMAIL, TEST_PASSWORD constants so the destructive sections are protected;
ensure the check is unconditional (hard gate) and documented in the command help
text.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 90ca9fc8-6da5-415c-a2ab-36ededfaffb9
📒 Files selected for processing (7)
.env.example.github/workflows/build-testing-images.ymlREADME.mdblog/management/commands/bootstrap_testing_server.pydocs/deployment/test-server-deployment-plan.mdscripts/bootstrap-testing-server.shtests/unit/test_bootstrap_testing_site_command.py
✅ Files skipped from review due to trivial changes (2)
- README.md
- .env.example
🚧 Files skipped from review as they are similar to previous changes (2)
- scripts/bootstrap-testing-server.sh
- .github/workflows/build-testing-images.yml
Read TESTING_BOOTSTRAP_SUPERUSER_* from env via settings (defaults unchanged). Document in .env.example and test-server deployment plan; add override_settings test. Co-authored-by: Cursor <cursoragent@cursor.com>
…mmand
Add PR/manual workflow pushing only testing-* image tags so test VPS pulls stay separate from production :latest/:sha-*.
Summary by CodeRabbit
Release Notes
New Features
Chores