fix: match migration finding with netlify/build#8191
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe changes refine migration discovery logic in Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
📊 Benchmark resultsComparing with cb924d4
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/commands/database/db-status.ts (1)
76-97: Remove comments that restate the control flow.These comments describe the adjacent loop/setup without adding extra intent; the variable names already make the two phases clear. As per coding guidelines,
**/*.{ts,tsx,js,jsx}: Never write comments on what the code does; make the code clean and self-explanatory instead.Proposed cleanup
- // First pass is to extract migration names const migrationNames: string[] = [] @@ - // Second pass to parse version and create migration entries const migrations: MigrationEntry[] = []🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/commands/database/db-status.ts` around lines 76 - 97, Remove the redundant explanatory comments around the two-pass migration discovery logic: delete the comments "// First pass is to extract migration names" and "// Second pass to parse version and create migration entries" (the code using entries, migrationNames, MIGRATION_NAME_PATTERN, fileExistsAsync, join and the migrations: MigrationEntry[] declaration is already self-descriptive). Keep the loops and variable names intact; no functional changes, just remove those two comments so the code adheres to the guideline of avoiding comments that restate control flow.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/commands/database/db-status.ts`:
- Around line 76-97: Remove the redundant explanatory comments around the
two-pass migration discovery logic: delete the comments "// First pass is to
extract migration names" and "// Second pass to parse version and create
migration entries" (the code using entries, migrationNames,
MIGRATION_NAME_PATTERN, fileExistsAsync, join and the migrations:
MigrationEntry[] declaration is already self-descriptive). Keep the loops and
variable names intact; no functional changes, just remove those two comments so
the code adheres to the guideline of avoiding comments that restate control
flow.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 16dc2a69-964a-434f-98d4-aa9991808417
📒 Files selected for processing (2)
src/commands/database/db-status.tstests/unit/commands/database/db-status.test.ts
🤖 I have created a release *beep* *boop* --- ## [25.3.0](v25.2.0...v25.3.0) (2026-04-22) ### Features * add deprecation messaging for legacy Netlify DB extension ([#8141](#8141)) ([cb924d4](cb924d4)) ### Bug Fixes * match migration finding with netlify/build ([#8191](#8191)) ([e2e8267](e2e8267)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: token-generator-app[bot] <82042599+token-generator-app[bot]@users.noreply.github.com>
🎉 Thanks for submitting a pull request! 🎉
Summary
This updates logic of finding migration files with how https://github.com/netlify/build/blob/main/packages/build/src/plugins_core/db_setup/migrations.ts behaves
It:
migration.sqlfile.sqlfiles (that are not nested in directory)It does NOT point out validation errors - https://github.com/netlify/build/blob/main/packages/build/src/plugins_core/db_setup/validation.ts
This probably should be done as follow up (or maybe block this change to have it included)
For us to review and ship your PR efficiently, please perform the following steps:
passes our tests.
A picture of a cute animal (not mandatory, but encouraged)