Expose migration state in operator health#378
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
More reviews will be available in 3 minutes and 17 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughДобавлен новый эндпоинт ChangesMigration State: Backend to Health UI
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Code Review
This pull request implements live database migration status tracking in the operator console's health page, replacing the previous mock gap. It introduces the /api/migrations endpoint on the backend to retrieve the current migration state from the database, and updates the frontend to display these metrics. Feedback on the changes highlights a logical issue in health.vue where the UI incorrectly falls back to a 'not loaded' message when the migration state is live but dirty_supported is not false.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
@coderabbitai review incremental |
|
@codex review |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Get PR details
gh pr view 378 --repo thebtf/engram --json title,body,baseRefName,headRefName,files
echo "=== PR DIFF ==="
gh pr diff 378 --repo thebtf/engramLength of output: 23445
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@apps/operator-console/scripts/seam-contract.test.mjs`:
- Line 368: The regex pattern in the assert.match call for mockOperatorApiSource
uses a greedy quantifier in the pattern matching the migration case block. The
`[\s\S]*` is matching too much content and can span across adjacent case blocks,
potentially missing regressions in the specific `/api/migrations` endpoint
handler. Change the greedy quantifier `[\s\S]*` to non-greedy `[\s\S]*?` in the
regex pattern to ensure it matches the minimum necessary content and properly
validates only the migrations case block without extending into neighboring case
statements.
In `@internal/db/gorm/migration_state.go`:
- Around line 35-46: The issue is that the query in the migration state function
sorts migration IDs lexicographically using Order("id ASC") and takes the last
one, but this does not reflect the actual order in which migrations were applied
since gormigrate registers migrations in a different order than their ID values
suggest. To fix this, replace the Order("id ASC") clause with ordering by a
timestamp or sequence field that tracks the actual application order of
migrations (such as created_at or a similar field in the migrations table that
gormigrate maintains). This ensures that the current variable correctly captures
the last applied migration rather than the lexicographically last ID. If the
migrations table schema is unclear, check the gormigrate documentation or the
actual migrations table structure to determine which field properly tracks
application order.
🪄 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: aaa023aa-4f69-452b-adfa-5883c4b133ee
📒 Files selected for processing (12)
apps/operator-console/PARITY.jsonapps/operator-console/composables/useOperatorHealthSettings.tsapps/operator-console/i18n/locales/en.jsonapps/operator-console/i18n/locales/ru.jsonapps/operator-console/i18n/locales/zh.jsonapps/operator-console/pages/health.vueapps/operator-console/scripts/mock-operator-api.mjsapps/operator-console/scripts/seam-contract.test.mjsinternal/db/gorm/migration_state.gointernal/worker/handlers_system.gointernal/worker/handlers_system_test.gointernal/worker/service.go
Summary
Verification
Notes
Summary by CodeRabbit
Примечания к выпуску
New Features
Improvements