Skip to content

feat(BA-7343): backfill missing idle_checkers.target_session_types - #13726

Open
seedspirit wants to merge 3 commits into
mainfrom
feat/BA-7343
Open

feat(BA-7343): backfill missing idle_checkers.target_session_types#13726
seedspirit wants to merge 3 commits into
mainfrom
feat/BA-7343

Conversation

@seedspirit

@seedspirit seedspirit commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 26.7.0 released migration d3f8a1c45e9b without target_session_types; feat(BA-6581): wire IdleCheckerRepository into idle-check reconciler source #12398 later added the column by editing that migration in place, so databases migrated in that window never received it and the idle-check queries fail with UndefinedColumnError.
  • Adds a single idempotent repair migration (f2d658cac56b) at the chain head: ADD COLUMN IF NOT EXISTS ... NOT NULL DEFAULT '{}' followed by DROP DEFAULT, so it is a no-op on databases that already have the column.
  • Pre-existing rows are backfilled with an empty array so checkers created before the column existed stay inert until an admin assigns target types.

26.8 does not take a schema repair; it unregisters the idle-check reconciler stages instead (#13734, BA-7344). A 26.7.x database upgrading through 26.8 to a main-based release is still covered — this migration sits on the main chain it will pass through.

Test plan

  • Repair path: cloned schema without the column + a legacy row at c8d51e7a3b62upgrade head restores the column, backfills {}, NOT NULL without default (matches the model)
  • No-op path: re-applying on a column-present DB passes without touching data
  • downgrade -1upgrade head round trip
  • Single alembic head (f2d658cac56b)

Resolves BA-7343

🤖 Generated with Claude Code

26.7.0 released migration d3f8a1c45e9b without target_session_types; the
column was later added by editing that migration in place (#12398), so
databases migrated on 26.7.x never received it and 26.8.x fails the
idle_check_judgment lifecycle with UndefinedColumnError.

Add an idempotent repair migration (f2d658cac56b) inserted right after
b93d1c47af52 so the same revision id can back onto 26.8, plus a duplicate
(8dc37d4bbf38) on the main head for databases tracking main. Pre-existing
rows are backfilled with an empty array so checkers created before the
column existed stay inert until an admin assigns target types.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@seedspirit
seedspirit requested a review from a team as a code owner August 12, 2026 09:00
Copilot AI balanced review requested due to automatic review settings August 12, 2026 09:00
@github-actions github-actions Bot added size:M 30~100 LoC comp:manager Related to Manager component require:db-migration Automatically set when alembic migrations are added or updated labels Aug 12, 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

Adds an idempotent Alembic repair for missing idle_checkers.target_session_types columns across release and main migration chains.

Changes:

  • Backfills missing columns with an empty array.
  • Adds a main-branch duplicate migration for already-upgraded databases.
  • Reparents the next migration to preserve a linear chain.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
f2d658cac56b_ensure_idle_checkers_target_session_types.py Adds the backportable repair migration.
8dc37d4bbf38_ensure_idle_checkers_target_session_types_dup.py Repairs databases already tracking main.
857c4d02c4b9_rekey_domain_rbac_rows_to_domain_uuid.py Inserts the repair into the migration chain.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

The mid-chain insertion existed only so 26.8 could share the same
revision id; with the 26.8 backport replaced by stage unregistration
(BA-7344, #13734), a single idempotent migration at the main head covers
every upgrade path, including 26.7.x databases moving through 26.8.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jopemachine

Copy link
Copy Markdown
Member

CI is failing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:manager Related to Manager component require:db-migration Automatically set when alembic migrations are added or updated size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants