Skip to content

chore: skip heroku release target conditionally#4419

Open
cemreinanc wants to merge 2 commits intomainfrom
chore/skip-heroku-release-phase-conditionally
Open

chore: skip heroku release target conditionally#4419
cemreinanc wants to merge 2 commits intomainfrom
chore/skip-heroku-release-phase-conditionally

Conversation

@cemreinanc
Copy link
Contributor

@cemreinanc cemreinanc commented Feb 25, 2026

Heroku builds randomly fail on release step.
"Lost connection with release dyno. Please retry previous command." -- kind of errors,
and we cant redeploy same image twice, we're forced to change image to redeploy

We already check for awaiting migrations in the deployment steps,

  • we can remove release target if there is no migrations pending. As this container only run migration command.
  • This should minimize random deployment failing surface, while speeding up deployments if there is no pending migrations.

(tested on dev and skipping release target didn't cause any problems)

Summary by CodeRabbit

  • Chores
    • Improved production deployment process with intelligent database migration detection that conditionally adjusts deployment targets, enabling more reliable and seamless application updates
    • Refined Docker build system with enhanced image tag configuration for improved consistency and predictability in containerized application builds

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f8ac136 and 6e0cafc.

📒 Files selected for processing (2)
  • .github/workflows/deploy_production.yml
  • .github/workflows/docker_build.yml

📝 Walkthrough

Walkthrough

This PR modifies GitHub Actions workflows to enhance deployment safety and Docker image tagging. A new step conditionally adjusts Heroku deployment targets based on migration detection, skipping the "release" target when no migrations exist. Docker build also explicitly defaults latest tag enablement to false when undefined.

Changes

Cohort / File(s) Summary
Production Deployment Targets
.github/workflows/deploy_production.yml
Adds a "Determine deploy targets" step that conditionally removes the "release" target when migrations are absent, using needs.check-migrations.outputs.has_migrations to guide the logic. Updates downstream "Deploy to Heroku" step to consume computed targets instead of raw build output.
Docker Build Tag Configuration
.github/workflows/docker_build.yml
Explicitly defaults latest tag enablement to false when input is undefined by changing enable=${{ inputs.include_latest_tag }} to `enable=${{ inputs.include_latest_tag

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • hlbmtc
  • elisescu
  • ncarazon

Poem

🐰 A rabbit hops through deployment flows,
With migrations checked and targets set,
No "release" when no schemas grow,
Just truthful tags—no regret!
Smart conditions pave the way,
For safer deploys, hooray hooray! 🚀

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: conditionally skipping the Heroku release target based on migration status.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/skip-heroku-release-phase-conditionally

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 and usage tips.

@github-actions
Copy link
Contributor

🚀 Preview Environment

Your preview environment is ready!

Resource Details
🌐 Preview URL https://metaculus-pr-4419-chore-skip-heroku-release-phas-preview.mtcl.cc
📦 Docker Image ghcr.io/metaculus/metaculus:chore-skip-heroku-release-phase-conditionally-6e0cafc
🗄️ PostgreSQL NeonDB branch preview/pr-4419-chore-skip-heroku-release-phas
Redis Fly Redis mtc-redis-pr-4419-chore-skip-heroku-release-phas

Details

  • Commit: c2df678ead3b7309abb53ad8af9886c41c88c668
  • Branch: chore/skip-heroku-release-phase-conditionally
  • Fly App: metaculus-pr-4419-chore-skip-heroku-release-phas

ℹ️ Preview Environment Info

Isolation:

  • PostgreSQL and Redis are fully isolated from production
  • Each PR gets its own database branch and Redis instance
  • Changes pushed to this PR will trigger a new deployment

Limitations:

  • Background workers and cron jobs are not deployed in preview environments
  • If you need to test background jobs, use Heroku staging environments

Cleanup:

  • This preview will be automatically destroyed when the PR is closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant