fix(migrations): merge split migration heads - #559
Merged
Conversation
PR #541 merged with its migration (cd057b1ef056) still parented on 29952e6a4b1b, forked before 4aac177b2327 landed — leaving main with two alembic heads. Every CI job and deploy running 'alembic upgrade head' fails with 'Multiple head revisions'. This empty merge revision joins the two lines back into a single head. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
abdulrafey1
added a commit
that referenced
this pull request
Jul 27, 2026
Main gained the b5bf23a5f00e merge revision (#559); this in-flight migration forked from 4aac177b2327 in parallel, which would split heads again the moment main is merged in. Repointing down_revision to the merge revision keeps the lineage linear, per the split-heads guidance in CLAUDE.md for unmerged branches. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
abdulrafey1
added a commit
that referenced
this pull request
Jul 31, 2026
* refactor(core): reshape permission checks around granted-role-id subqueries Splits the scope-chain matching from the assignee matching so a second assignee source (group role assignments, issue #519) can reuse the same scope clause. Behaviour-preserving: checks now test role_id IN (granted role ids) instead of joining role_assignment directly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(core): add group tables for bulk role grants A group is a flat named set of users; group_role_assignment carries (role, scope, scope_object_id) grants that every active member inherits (issue #519). Membership rows carry a source column ('manual') so future rule-driven membership can own its rows without a schema change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(core): resolve permissions through group role assignments can()/has_role() now hold when the role is granted to a group the user actively belongs to, matched against the same scope chain as direct assignments (issue #519). has_role() counting group grants keeps is_admin accurate for admin-via-group. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(core): add group engine functions Group CRUD, membership, and group-role-grant management mirroring the role engine: idempotent race-safe writes, soft-deleted membership/assignment history, delete refused while active role assignments exist (GroupInUse). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(migrations): repoint group tables migration to merged head Main gained the b5bf23a5f00e merge revision (#559); this in-flight migration forked from 4aac177b2327 in parallel, which would split heads again the moment main is merged in. Repointing down_revision to the merge revision keeps the lineage linear, per the split-heads guidance in CLAUDE.md for unmerged branches. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(core): address group engine review feedback - translate the unique-name IntegrityError into GroupAlreadyExists in create_group and update_group so a concurrent create/rename surfaces as a domain conflict (409) instead of a raw IntegrityError (500) - delete group memberships and assignments in bulk (two statements) instead of one DELETE per loaded row in delete_group - rename GroupNotFound.group to GroupNotFound.name so the group exceptions share one attribute name - update the stale "Revises:" docstring header in the group tables migration left behind by the down_revision repoint Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Restores a single alembic head on
main: PR #541 merged with its migrationcd057b1ef056still parented on29952e6a4b1b(its branch forked before4aac177b2327landed), so main now carries two heads and everyalembic upgrade head— CI playwright jobs,make migrations, fresh deploys — fails with "Multiple head revisions are present".Changes
b5bf23a5f00ejoining heads4aac177b2327+cd057b1ef056How to Test
uv run alembic heads— exactly one head (b5bf23a5f00e (head)).alembic upgrade headwalks both branches and finishes at the mergepoint (verified against a scratch database before pushing).Notes
4aac177b2327; the merge revision joins the lines, so they need this merged into their branches (or a rebase) for CI to green — no lineage edits needed on their migrations.CLAUDE.md: a branch that adds a migration must repoint itsdown_revisionto the new tip before merging when main's lineage has moved — that step was missed on fix(plugins): google drive connect 500s on postgresql #541.This PR description was written with the assistance of an LLM (Claude).