feat(BA-3704): apply RBAC Creator pattern to Artifact Registry#9263
Draft
feat(BA-3704): apply RBAC Creator pattern to Artifact Registry#9263
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR applies the RBAC Creator pattern to the Artifact Registry domain and introduces a new batch creation utility for entities with per-entity scope references.
Changes:
- Added
execute_rbac_entity_creators()function to support batch creation of multiple entities where each can have its own primary and additional scope references (unlikeexecute_rbac_bulk_entity_creatorwhich shares a single scope) - Fixed error messages in entity creator functions from "Purger only supports..." to "Entity creator only supports..."
- Added
ArtifactRegistryCreatorSpecimplementing the CreatorSpec pattern for artifact registries - Added
create_artifact_registry()methods to bothArtifactRegistryRepositoryandArtifactRegistryDBSourceusing the RBAC entity creator pattern - Refactored test file to use fixtures for better test organization and added comprehensive tests for the new batch creator function
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/ai/backend/manager/repositories/base/rbac/entity_creator.py |
Added new execute_rbac_entity_creators() function for batch creation with per-entity scopes; corrected error messages from "Purger" to "Entity creator" |
tests/unit/manager/repositories/base/rbac/test_entity_creator.py |
Refactored tests to use fixtures; added comprehensive test coverage for execute_rbac_entity_creators including empty list, same scope, different scopes, and additional scopes scenarios; added composite PK rejection tests |
src/ai/backend/manager/repositories/artifact_registry/creators.py |
New file defining ArtifactRegistryCreatorSpec following the CreatorSpec pattern |
src/ai/backend/manager/repositories/artifact_registry/repository.py |
Added create_artifact_registry() method with resilience policy |
src/ai/backend/manager/repositories/artifact_registry/db_source/db_source.py |
Added create_artifact_registry() method using execute_rbac_entity_creator |
changes/9255.enhance.md |
Added changelog entry for the new batch creator function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
458e09c to
e3a3528
Compare
1c9e407 to
e3f2f97
Compare
jopemachine
reviewed
Feb 26, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
e3f2f97 to
dbf9c96
Compare
jopemachine
approved these changes
Feb 27, 2026
Member
Author
|
Changed to draft since Artifact Registries can be mapped to domain/project N:N |
HyeockJinKim
approved these changes
Feb 27, 2026
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.
Summary
ArtifactRegistryCreatorSpec(CreatorSpec[ArtifactRegistryRow])with fields:name,registry_id,typecreate_artifact_registry()method toArtifactRegistryDBSourceusingRBACEntityCreator+execute_rbac_entity_creatorcreate_artifact_registry()method toArtifactRegistryRepositorywith resilience policy🤖 Generated with Claude Code