Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe migrator now creates and reuses a Goose provider. It detects pending migrations by checking legacy and Goose tables, then querying Goose migration status. Integration tests cover four database states. ChangesMigration status detection
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Sequence Diagram(s)sequenceDiagram
participant Migrator
participant PostgreSQL
participant GooseProvider
Migrator->>PostgreSQL: Check legacy and Goose migration tables
PostgreSQL-->>Migrator: Return table presence
Migrator->>GooseProvider: Query pending migrations
GooseProvider-->>Migrator: Return migration status
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmd/api/src/test/integration/database.go`:
- Around line 165-167: Update the NewMigrator error branch in the database setup
flow to close both db and pool before returning the wrapped error, ensuring test
resources are released when migrator creation fails.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 18bd117c-825a-4627-a064-0c296ef13bf1
📒 Files selected for processing (5)
cmd/api/src/database/db.gocmd/api/src/database/migration/goose.gocmd/api/src/database/migration/goose_migration_integration_test.gocmd/api/src/database/migration/migration.gocmd/api/src/test/integration/database.go
💤 Files with no reviewable changes (1)
- cmd/api/src/database/db.go
🚧 Files skipped from review as they are similar to previous changes (1)
- cmd/api/src/database/migration/goose.go
mistahj67
left a comment
There was a problem hiding this comment.
Code LGTM and tested locally, no issues. 🚀
Description
Adding a helper function to the Goose migration suite that checks if the database is using the
goose_db_versiontable to track migrations or has any pending migrations.Motivation and Context
Partially resolves BED-9123
We need to use this helper function in BHE.
How Has This Been Tested?
Integration tests added.
Screenshots (optional):
Types of changes
Checklist:
Summary by CodeRabbit
New Features
Tests