Repository navigation
fix(docker): report migrate failures from the entrypoint - #639
Merged
Merged
Conversation
The migrate call ran under set -e, so a non-zero exit ended the shell before MIGRATE_EXIT_CODE was assigned and the failure diagnostic never printed. Capture the status with || so the diagnostic runs, and drop the exit-code-1 no-change tolerance: golang-migrate v4.19.1 exits 0 on no change, so exit 1 is a real failure that the old branch would have swallowed.
Contributor
|
Warning Review limit reached
This review includes 1 billable file and costs up to $0.25.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 4 minutes for your next included review. View limit detailsLimit details: You’ve used the included review currently available. Your 68 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (1)
Comment |
8 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.
Closes #294
Under
set -eua failingmigrate upended the shell beforeMIGRATE_EXIT_CODE=$?ran, so the diagnostic and the exit-code-1 branch were unreachable. The status is now captured with|| MIGRATE_EXIT_CODE=$?, and the exit-1 "no change" tolerance is removed because golang-migrate v4.19.1 exits 0 on no change.Checks: shellcheck clean. Ran the script with a stub
migrate: exit 7 printsMigration failed with exit code 7and exits 7 (main prints nothing), exit 0 prints success and continues to start the server.