fix(ci): fail the workflow when a Heroku release command fails - #27
Merged
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe CI/CD deploy job records the current Heroku release before deployment. It then polls for a newer release for up to 15 minutes and evaluates its status. Failed releases include available release output. ChangesHeroku release verification
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant HerokuAPI
participant HerokuRelease
GitHubActions->>HerokuAPI: Query current release
HerokuAPI-->>GitHubActions: Return release version
GitHubActions->>HerokuAPI: Push deployment
GitHubActions->>HerokuAPI: Poll for newer release
HerokuAPI-->>GitHubActions: Return release status
GitHubActions->>HerokuRelease: Read output when status is failed
HerokuRelease-->>GitHubActions: Return release output
✨ 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 |
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.
Partially addresses #15.
The bug
The deploy step is
git push --force ... HEAD:main. Heroku's git push exits 0 once the slug builds — therelease:command in theProcfile(pnpm db:migrate:deploy) runs afterwards, and Heroku does not promote the slug if it fails. That failure never reaches the push exit code.Result: six consecutive deploys (v231–v236, 29–30/07) reported green in GitHub Actions while none of them went live. Production served the v230 slug for two days. Nothing went red.
The fix
Two steps around the push:
succeeded.succeededpasses;failedfails the job and prints the release command output inline; a 15-minute timeout also fails.Verification
Both paths were exercised against the live Heroku API before committing:
v239 succeeded→ step exits 0.failed,output_stream_urlis present, and fetching it surfaces exactly the error that was invisible before:That test also caught a bug in this change: my first
Rangeheader usedorder=desc; max=1, which Heroku rejects with400 bad_request. Corrected tomax=1, order=desc.YAML parses, prettier clean. Merging this exercises the new step for real.
https://claude.ai/code/session_01J6uoj2LBZBMeEkfyx3Bvn8
Summary by CodeRabbit