Add migration to track invalid ABM token state#48560
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
There was a problem hiding this comment.
Pull request overview
Adds a MySQL table migration to track whether an ABM token has been marked invalid, supporting ABM error handling/state tracking in the server datastore.
Changes:
- Add
token_invalidcolumn toabm_tokenswith aNOT NULLdefault of0. - Add a migration test that verifies the column exists and has the expected schema/default.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| server/datastore/mysql/migrations/tables/20260701135344_AddTokenInvalidToABMTokens.go | Adds the token_invalid column to abm_tokens. |
| server/datastore/mysql/migrations/tables/20260701135344_AddTokenInvalidToABMTokens_test.go | Migration test validating the new column’s presence and default. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
WalkthroughThis pull request adds a new MySQL migration that introduces a Changes
Sequence Diagram(s)sequenceDiagram
participant TestUp_20260701152227
participant Up_20260701152227
participant abm_tokens_table
TestUp_20260701152227->>Up_20260701152227: run migration
Up_20260701152227->>abm_tokens_table: ALTER TABLE ADD COLUMN token_invalid
TestUp_20260701152227->>abm_tokens_table: query information_schema.COLUMNS
abm_tokens_table-->>TestUp_20260701152227: column metadata and default
TestUp_20260701152227->>abm_tokens_table: query token_invalid for existing row
abm_tokens_table-->>TestUp_20260701152227: 0
Related issues: Suggested labels: Suggested reviewers: 🐰 A column hops into the table's row, 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
`@server/datastore/mysql/migrations/tables/20260701135344_AddTokenInvalidToABMTokens_test.go`:
- Around line 14-19: The default-value check in the abm_tokens migration test is
being skipped because no row exists before the SELECT in the test. Update the
test around the QueryRow/assertion block to first insert a valid abm_tokens
record (using the required columns for the schema at this migration point), then
query that row and assert token_invalid is 0. Keep the fix localized to the
existing test function so the default is actually exercised.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 36bb3223-bbec-4d6c-829b-873dc7fc3581
📒 Files selected for processing (2)
server/datastore/mysql/migrations/tables/20260701135344_AddTokenInvalidToABMTokens.goserver/datastore/mysql/migrations/tables/20260701135344_AddTokenInvalidToABMTokens_test.go
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #48560 +/- ##
==========================================
+ Coverage 67.99% 68.02% +0.03%
==========================================
Files 3678 3679 +1
Lines 233791 233794 +3
Branches 12305 12453 +148
==========================================
+ Hits 158968 159046 +78
+ Misses 60496 60438 -58
+ Partials 14327 14310 -17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
Related issue: Resolves #47698
Checklist for submitter
If some of the following don't apply, delete the relevant line.
Testing
Added/updated automated tests
QA'd all new/changed functionality manually
Database migrations
Summary by CodeRabbit
New Features
Tests