Skip to content

fix(docker): report migrate failures from the entrypoint - #639

Merged
cristim merged 1 commit into
mainfrom
fix/entrypoint-migrate-exit-294
Oct 6, 2026
Merged

cristim merged 1 commit into
mainfrom
fix/entrypoint-migrate-exit-294

Conversation

@cristim

@cristim cristim commented Oct 6, 2026

Copy link
Copy Markdown
Member

Closes #294

Under set -eu a failing migrate up ended the shell before MIGRATE_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 prints Migration failed with exit code 7 and exits 7 (main prints nothing), exit 0 prints success and continues to start the server.

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.
@cristim cristim added priority/p2 Backlog-worthy impact/internal Team-internal only triaged Item has been triaged severity/high Significant harm urgency/this-quarter Within the quarter effort/xs Trivial / one-liner type/bug Defect labels Oct 6, 2026
@coderabbitai

coderabbitai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 1 billable file and costs up to $0.25.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

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.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: LeanerCloud/cloud-commitments-platform/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 4080dbd7-b70d-4e55-a64c-cf33f6e3bcbd
📥 Commits

Reviewing files that changed from the base of the PR and between 3413591 and 1415cbe.

📒 Files selected for processing (1)
  • scripts/entrypoint.sh
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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

Labels

effort/xs Trivial / one-liner impact/internal Team-internal only priority/p2 Backlog-worthy severity/high Significant harm triaged Item has been triaged type/bug Defect urgency/this-quarter Within the quarter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(docker): set -e makes the entrypoint's migrate exit-code branch unreachable

1 participant