Skip to content

fix(build): rebuild when a migration file changes - #209

Merged
ryuzdev merged 1 commit into
mainfrom
fix/migrations-rerun-if-changed
Dec 1, 2026
Merged

ryuzdev merged 1 commit into
mainfrom
fix/migrations-rerun-if-changed

Conversation

@ryuzdev

@ryuzdev ryuzdev commented Dec 1, 2026

Copy link
Copy Markdown
Member

#208 (migration-only change) was released as outer:3a8dbbe but prod stayed at migration 7: sqlx::migrate! embeds crates/outer/migrations/ at compile time, cargo does not track that directory, and the release Dockerfile reuses a cached target dir, so the binary was not recompiled. Adds crates/outer/build.rs with cargo:rerun-if-changed=migrations (the sqlx-documented fix). Verified locally: touching only a migration file recompiles outer. fmt + clippy clean. After release, 0008 applies at boot.

- sqlx::migrate! embeds migrations/ at compile time but cargo doesn't track the directory, so the release builder's cached target reused a binary without 0008 (#208 released, prod stayed at migration 7).
- build.rs emits rerun-if-changed=migrations; verified: touching only a migration file recompiles outer.
@coderabbitai

coderabbitai Bot commented Dec 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b14a4683-e40e-464e-aebb-ad5593178e5f
Commits

Reviewing files that changed from the base of the PR and between 3a8dbbe and e234541.

Files selected for processing: 1

  • crates/outer/build.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@ryuzdev
ryuzdev merged commit 4633f4d into main Dec 1, 2026
5 checks passed
@ryuzdev
ryuzdev deleted the fix/migrations-rerun-if-changed branch December 1, 2026 07:00
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