feat(BA-4866): extract RBACValidators injection to dependency layer#9630
feat(BA-4866): extract RBACValidators injection to dependency layer#9630
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
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/RBACValidatorsdataclasses for structured validator injection. - Thread
validatorsthroughserver.pyand the processing DI (ProcessingComposer→ProcessorsDependency→Processors.create()). - Extend
VFolderProcessorsconstruction 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.
ad1cf8a to
2484743
Compare
31fb62e to
140c4a5
Compare
|
|
||
|
|
||
| @dataclass | ||
| class RBACValidators: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
I think it would be better to keep things like types.py in a separate file.
There was a problem hiding this comment.
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
|
There are a large number of conflicts |
140c4a5 to
d93d596
Compare
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>
d93d596 to
1796734
Compare
…est files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
ValidatorsandRBACValidatorsdataclasses for structured validator injectionserver.py,ProcessingComposer,ProcessorsDependency) intoVFolderProcessors, following the same pattern asaction_monitorsTest plan
pants fmt/fix/lintpassedpants check(mypy) passedResolves BA-4866