Repository navigation
Resolve migrations recursively from each configured path - #46
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
56ede4d to
3bf1192
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates FileSystemMigrationResolver to discover migrations by recursively walking each configured path, filtering to .sql files, skipping hidden directories (to avoid Kubernetes ConfigMap ..* duplicates), and failing loudly on misconfiguration via new typed errors.
Changes:
- Recursively enumerate migration directories and only resolve
.sqlfiles. - Skip hidden directories/files during enumeration to avoid duplicate resolution on certain filesystems (e.g., Kubernetes mounts).
- Introduce new resolver errors for missing paths and duplicate migration IDs; update and expand test coverage accordingly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
Sources/Crane/Resolution/FileSystem/FileSystemMigrationResolver.swift |
Switches to recursive enumeration, adds hidden/non-.sql filtering, and throws new typed errors for invalid paths and duplicate IDs. |
Tests/CraneTests/Resolution/FileSystem/FileSystemMigrationResolverTests.swift |
Updates existing tests for recursive behavior and adds new tests for missing paths, hidden dir skipping, non-.sql skipping, and duplicate ID detection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3bf1192 to
48b2cf3
Compare
|
❌ Benchmark comparison failed with error ❌ Summary`Throughput (# / s)` not found in both baselines, skipping it. One or more benchmarks, including `CraneBenchmarks:FileSystemMigrationResolver: Resolve recursively` was not found in one of the baselines.
New baseline 'pull_request' is BETTER than the 'main' baseline thresholds. Full Benchmark ComparisonComparing results between 'main' and 'pull_request'CraneBenchmarksFileSystemMigrationResolver: Read SQL Script metricsTime (wall clock): results within specified thresholds, fold down for details.
Time (total CPU): results within specified thresholds, fold down for details.
Throughput (# / s): results within specified thresholds, fold down for details.
Memory (resident peak): results within specified thresholds, fold down for details.
Malloc (total): results within specified thresholds, fold down for details.
FileSystemMigrationResolver: Resolve metricsTime (wall clock): results within specified thresholds, fold down for details.
Time (total CPU): results within specified thresholds, fold down for details.
Memory (resident peak): results within specified thresholds, fold down for details.
Malloc (total): results within specified thresholds, fold down for details.
|
aa81719 to
bfcb869
Compare
bfcb869 to
f47c102
Compare
FileSystemMigrationResolvernow walks each entry in paths recursively and filters to.sqlfiles, so nested layouts likemigrations/repeatable/work without listing every subfolder inpaths.Hidden directories are skipped — without that, Foundation's enumerator descends into the timestamped sibling directories Kubernetes maintains alongside ConfigMap volume mounts, surfacing every SQL file twice and tripping duplicate-ID detection (see Flyway #1807).
Two new typed errors fail loud on configuration mistakes:
pathDoesNotExistwhen a configured path is missing, andduplicateMigrationIDwhen the same id is resolved from overlapping paths — so paths: ["migrations", "migrations/nested"] is now a configuration error rather than producing silent duplicates.