Skip to content

Conversation

@dmjb
Copy link
Member

@dmjb dmjb commented Nov 25, 2025

This mirrors the previous PR which provided a file backed implementation. This will be wired in a future PR.

Note that I changed the DB schema to match the existing sync status structure to simplify implementation. I also added a uniqueness constraint since we now assume that there is only one row in registry_sync per registry.

This mirrors the previous PR which provided a file backed implementation. This will be wired in a future PR. Note that I changed the DB schema to match the existing sync status structure to simplify implementation. I also added a uniqueness constraint since we now assume that there is only one row in registry_sync per registry.
@dmjb dmjb marked this pull request as ready for review November 25, 2025 19:04
fnames, err := fs.Glob(migrationsFS, "migrations/*.up.sql")
require.NoError(t, err)

// Test each migration individually: apply, rollback, re-apply
Copy link
Member Author

Choose a reason for hiding this comment

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

This test was broken. The problem only appeared when we had more than one migration.

@dmjb dmjb marked this pull request as draft November 25, 2025 19:05
@dmjb dmjb marked this pull request as ready for review November 26, 2025 09:06

// Set hash fields if present
if dbSync.LastSyncHash != nil {
syncStatus.LastSyncHash = *dbSync.LastSyncHash
Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should eventually get rid of the hashing, but I want to keep it now to minimize changes.

@codecov-commenter
Copy link

codecov-commenter commented Nov 26, 2025

Codecov Report

❌ Patch coverage is 22.53968% with 244 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.18%. Comparing base (b78ee5a) to head (7124e1f).

Files with missing lines Patch % Lines
internal/sync/state/db.go 33.33% 134 Missing ⚠️
internal/db/sqlc/sync.sql.go 6.15% 61 Missing ⚠️
internal/db/sqlc/registry.sql.go 0.00% 49 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@ ## main #191 +/- ## ========================================== - Coverage 66.58% 63.18% -3.41%  ========================================== Files 60 61 +1 Lines 3765 4080 +315 ========================================== + Hits 2507 2578 +71  - Misses 1101 1345 +244  Partials 157 157 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants