Skip to content

refactor(BA-5069): Apply RBAC Creator pattern to Kernel#10013

Merged
jopemachine merged 3 commits into
mainfrom
feat/BA-5069
Mar 23, 2026
Merged

refactor(BA-5069): Apply RBAC Creator pattern to Kernel#10013
jopemachine merged 3 commits into
mainfrom
feat/BA-5069

Conversation

@fregataa
Copy link
Copy Markdown
Member

@fregataa fregataa commented Mar 12, 2026

Summary

  • Add KernelRowCreatorSpec in session/creators.py following the same wrap-pre-built-row pattern as SessionRowCreatorSpec
  • Replace db_sess.add_all(kernels) + flush() with RBACBulkEntityCreator + execute_rbac_bulk_entity_creator in enqueue_session()
  • Scope association links each kernel to its parent SESSION

Test plan

  • pants lint passes
  • CI validation

Resolves BA-5069

- Add KernelRowCreatorSpec in session/creators.py
- Replace raw KernelRow construction with RBACBulkEntityCreator in scheduler
- Scope association: Kernel → SESSION (parent scope)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 12, 2026 15:50
@github-actions github-actions Bot added size:M 30~100 LoC comp:manager Related to Manager component labels Mar 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors session enqueueing to create KernelRow records via the RBAC creator pattern, aligning kernel creation with the existing RBAC-scoped session creation flow and associating kernels to their parent session scope.

Changes:

  • Add KernelRowCreatorSpec to wrap pre-built KernelRow instances for creator-based inserts.
  • Replace direct db_sess.add_all(kernels) + flush() with RBACBulkEntityCreator + execute_rbac_bulk_entity_creator in enqueue_session().
  • Create RBAC scope associations that link each kernel to its parent SESSION.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/ai/backend/manager/repositories/session/creators.py Adds KernelRowCreatorSpec to support creator-based insertion of pre-built KernelRows.
src/ai/backend/manager/repositories/scheduler/db_source/db_source.py Switches kernel insertion during enqueue_session() to RBAC bulk creation and associates kernels to the session scope.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fregataa fregataa added this to the 26.4 milestone Mar 20, 2026
@fregataa fregataa requested a review from a team March 20, 2026 04:02
@jopemachine jopemachine enabled auto-merge (squash) March 23, 2026 05:52
@jopemachine jopemachine merged commit 574c93c into main Mar 23, 2026
30 checks passed
@jopemachine jopemachine deleted the feat/BA-5069 branch March 23, 2026 07:40
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 size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants