fixing test cases - #3639
fixing test cases#3639
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds a dropped-tables allowlist and expanded dropped-column ignores to the migration snapshot comparer, updates migration test assertions for ChangesMigration robustness and snapshot handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ 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)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Comment |
|
|
🧪 Test Suite AvailableThis PR can be tested by a repository admin. |
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 @.github/workflows/scripts/run-migration-tests.sh:
- Around line 27-28: The script currently skips fetching git tags which lets
get_previous_versions() operate on an incomplete tag set and default to latest;
restore deterministic behavior by re-enabling the tags fetch (uncomment or add
back the git fetch --tags step in run-migration-tests.sh) so all repository tags
are available before get_previous_versions() runs, ensuring migration version
selection is based on the full tag list.
🪄 Autofix (Beta)
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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2ca717b2-3fa8-44f7-88a3-24d8c5ddcc1a
📒 Files selected for processing (4)
.github/workflows/scripts/run-migration-tests.shframework/configstore/encryption_test.goframework/configstore/migrations.goframework/configstore/migrations_test.go
Confidence Score: 5/5The migration chain is safe to merge: the drop is idempotent (errors are logged and swallowed), the preceding backfill migration preserves alignment data on upgrading DBs, and test coverage confirms the expected post-migration schema. The logic is straightforward — a drop migration with swallowed errors, a backfill guard before the drop, and updated tests that confirm the schema state. The only issues found are two inaccurate doc comments in migrations.go that do not affect runtime behaviour. framework/configstore/migrations.go — two inaccurate doc comments (IF EXISTS claim and VK-only scope) worth correcting before the next reader touches these functions. Important Files Changed
Reviews (3): Last reviewed commit: "fixing test cases" | Re-trigger Greptile |
d94da9b to
2badd60
Compare
2badd60 to
dc01d18
Compare

Summary
Removes the
calendar_alignedcolumn fromgovernance_budgetsandgovernance_rate_limits, consolidating calendar alignment as a virtual-key-level and team-level setting. Budget and rate-limit reset logic now derives the calendar alignment value from the owning VK or team at reset time rather than storing it redundantly on each budget/rate-limit row.Changes
migrationDropLegacyCalendarAlignedColumnsto dropcalendar_alignedfromgovernance_budgetsandgovernance_rate_limits, with migration test assertions updated to confirm the columns are absent post-migration and present only ongovernance_virtual_keysandgovernance_teams.migrationRefreshConfigHashAfterMCPExternalServerURLRemovalto use an explicit, schema-derived column projection instead ofSELECT *when fetchingconfig_clientrows. This prevents PostgreSQL'scached plan must not change result typeerror (SQLSTATE 0A000) that occurs when earlier migrations in the same run add and drop columns, causing a cachedSELECT *plan to drift from the current schema.calendar_alignedbeing intentionally dropped fromgovernance_budgetsandgovernance_rate_limits, with an updated comment explaining the full column history.TempTokento the encryption test store setup to satisfy schema requirements.git fetch --tagsin the migration test runner script.Type of change
Affected areas
How to test
After running migrations on a fresh database, confirm:
governance_budgetsdoes not have acalendar_alignedcolumngovernance_rate_limitsdoes not have acalendar_alignedcolumngovernance_virtual_keyshas acalendar_alignedcolumngovernance_teamshas acalendar_alignedcolumnBreaking changes
The
calendar_alignedcolumn is removed fromgovernance_budgetsandgovernance_rate_limits. Any code or queries readingcalendar_aligneddirectly from those tables must be updated to derive the value from the owning virtual key or team instead.Security considerations
None.
Checklist
docs/contributing/README.mdand followed the guidelines