Skip to content

feat(BA-4866): extract RBACValidators injection to dependency layer#9630

Open
fregataa wants to merge 3 commits intomainfrom
feature/BA-4866-extract-rbac-validators-injection
Open

feat(BA-4866): extract RBACValidators injection to dependency layer#9630
fregataa wants to merge 3 commits intomainfrom
feature/BA-4866-extract-rbac-validators-injection

Conversation

@fregataa
Copy link
Member

@fregataa fregataa commented Mar 4, 2026

Summary

  • this work DOES NOT apply any validator to action processors.
  • Create Validators and RBACValidators dataclasses for structured validator injection
  • Wire validators through the DI layer (server.py, ProcessingComposer, ProcessorsDependency) into VFolderProcessors, following the same pattern as action_monitors
  • Validators are injected but not yet applied to individual action processors (follow-up task)

Test plan

  • pants fmt/fix/lint passed
  • pants check (mypy) passed
  • CI passes

Resolves BA-4866

Copilot AI review requested due to automatic review settings March 4, 2026 15:56
@github-actions github-actions bot added size:M 30~100 LoC comp:manager Related to Manager component labels Mar 4, 2026
fregataa added a commit that referenced this pull request Mar 4, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
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 introduces a structured “validators” injection path (not yet applied to individual action processors) and wires RBAC validator instances from the DI layer down into VFolderProcessors, mirroring the existing action_monitors injection approach.

Changes:

  • Add Validators / RBACValidators dataclasses for structured validator injection.
  • Thread validators through server.py and the processing DI (ProcessingComposerProcessorsDependencyProcessors.create()).
  • Extend VFolderProcessors construction to accept validators.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/ai/backend/manager/services/vfolder/processors/vfolder.py Accepts Validators in VFolderProcessors.__init__ (currently unused/dropped).
src/ai/backend/manager/services/processors.py Adds validators to ProcessorArgs and passes it into VFolderProcessors.
src/ai/backend/manager/server.py Constructs RBAC validators from permission_controller_repository and passes them into Processors.create().
src/ai/backend/manager/dependencies/processing/processors.py Extends ProcessorsProviderInput to carry validators into ProcessorArgs.
src/ai/backend/manager/dependencies/processing/composer.py Builds RBAC validators in the DI composer and passes them into ProcessorsDependency.
src/ai/backend/manager/actions/validators/rbac/init.py Adds RBACValidators container.
src/ai/backend/manager/actions/validators/init.py Adds top-level Validators container.

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

@github-actions github-actions bot added size:L 100~500 LoC and removed size:M 30~100 LoC labels Mar 4, 2026
@fregataa fregataa force-pushed the feature/BA-4866-extract-rbac-validators-injection branch from ad1cf8a to 2484743 Compare March 4, 2026 16:15
@fregataa fregataa added this to the 26.3 milestone Mar 4, 2026
@fregataa fregataa force-pushed the feature/BA-4866-extract-rbac-validators-injection branch 2 times, most recently from 31fb62e to 140c4a5 Compare March 4, 2026 17:28
@fregataa fregataa requested a review from a team March 4, 2026 17:35


@dataclass
class RBACValidators:
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure define dataclass in __init__.py. I think init.py should only be used for importing things to make importing more convenient. What do others think? @jopemachine @HyeockJinKim

Copy link
Member

Choose a reason for hiding this comment

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

I think it would be better to keep things like types.py in a separate file.

Copy link
Member Author

@fregataa fregataa Mar 5, 2026

Choose a reason for hiding this comment

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

types.py is not a good idea because usually types modules should be the one that other modules depend on, not the one that depends on other modules

@jopemachine
Copy link
Member

There are a large number of conflicts

@fregataa fregataa force-pushed the feature/BA-4866-extract-rbac-validators-injection branch from 140c4a5 to d93d596 Compare March 5, 2026 14:17
fregataa and others added 2 commits March 6, 2026 15:07
Create ActionValidators and RBACValidators dataclasses and inject them
through the DI layer (server.py, ProcessingComposer) into all
processor classes via Processors.create(), following the same pattern
as action_monitors. Validators are not yet applied to individual
action processors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fregataa fregataa force-pushed the feature/BA-4866-extract-rbac-validators-injection branch from d93d596 to 1796734 Compare March 6, 2026 06:11
@fregataa fregataa requested a review from a team March 6, 2026 06:14
…est files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants