Skip to content

fix: align sourceFileVersions parsing with maxEmbeddedVersion#2194

Open
mesutoezdil wants to merge 1 commit into
kagent-dev:mainfrom
mesutoezdil:fix/migrate-source-file-versions-parsing
Open

fix: align sourceFileVersions parsing with maxEmbeddedVersion#2194
mesutoezdil wants to merge 1 commit into
kagent-dev:mainfrom
mesutoezdil:fix/migrate-source-file-versions-parsing

Conversation

@mesutoezdil

@mesutoezdil mesutoezdil commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

sourceFileVersions used strings.SplitN and skipped files without underscore, but maxEmbeddedVersion in runner.go uses fmt.Sscanf on any leading integer. this patch makes both consistent.

Copilot AI review requested due to automatic review settings July 9, 2026 16:37
@mesutoezdil mesutoezdil requested a review from a team as a code owner July 9, 2026 16:37
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jul 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns the CLI migration filename version parsing (sourceFileVersions) with the runtime embedded-migrations parsing (maxEmbeddedVersion) by accepting any .up.sql file whose filename begins with decimal digits, rather than requiring an underscore separator.

Changes:

  • Updated sourceFileVersions to parse versions using fmt.Sscanf(name, "%d", &v) to match maxEmbeddedVersion behavior.
  • Broadens recognized migration filenames from NNN_name.up.sql to any .up.sql filename with a leading integer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread go/core/pkg/cli/db/migrate/migrate.go
Comment thread go/core/pkg/cli/db/migrate/migrate.go
@mesutoezdil mesutoezdil force-pushed the fix/migrate-source-file-versions-parsing branch from 1ccb40d to 083df7e Compare July 9, 2026 16:44
@EItanya

EItanya commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@iplay88keys

Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
@mesutoezdil mesutoezdil force-pushed the fix/migrate-source-file-versions-parsing branch from 7a0c6d8 to e745a8c Compare July 10, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants