Skip to content

feat(BA-3704): apply RBAC Creator pattern to Artifact Registry#9263

Draft
fregataa wants to merge 3 commits intomainfrom
feat/BA-3704-artifact-registry-rbac-creator
Draft

feat(BA-3704): apply RBAC Creator pattern to Artifact Registry#9263
fregataa wants to merge 3 commits intomainfrom
feat/BA-3704-artifact-registry-rbac-creator

Conversation

@fregataa
Copy link
Member

@fregataa fregataa commented Feb 23, 2026

Summary

  • Add ArtifactRegistryCreatorSpec(CreatorSpec[ArtifactRegistryRow]) with fields: name, registry_id, type
  • Add create_artifact_registry() method to ArtifactRegistryDBSource using RBACEntityCreator + execute_rbac_entity_creator
  • Add corresponding create_artifact_registry() method to ArtifactRegistryRepository with resilience policy

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings February 23, 2026 16:24
@github-actions github-actions bot added the size:XL 500~ LoC label Feb 23, 2026
@github-actions github-actions bot added the comp:manager Related to Manager component label Feb 23, 2026
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 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 (unlike execute_rbac_bulk_entity_creator which shares a single scope)
  • Fixed error messages in entity creator functions from "Purger only supports..." to "Entity creator only supports..."
  • Added ArtifactRegistryCreatorSpec implementing the CreatorSpec pattern for artifact registries
  • Added create_artifact_registry() methods to both ArtifactRegistryRepository and ArtifactRegistryDBSource using 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.

@fregataa fregataa force-pushed the feat/BA-3704-artifact-registry-rbac-creator branch from 458e09c to e3a3528 Compare February 23, 2026 16:34
@fregataa fregataa marked this pull request as draft February 25, 2026 15:47
@fregataa fregataa force-pushed the feat/BA-3704-artifact-registry-rbac-creator branch from 1c9e407 to e3f2f97 Compare February 25, 2026 16:14
@github-actions github-actions bot added size:M 30~100 LoC and removed size:XL 500~ LoC labels Feb 25, 2026
@fregataa fregataa marked this pull request as ready for review February 25, 2026 16:44
@fregataa fregataa requested a review from seedspirit February 26, 2026 08:27
fregataa and others added 3 commits February 26, 2026 17:27
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 feat/BA-3704-artifact-registry-rbac-creator branch from e3f2f97 to dbf9c96 Compare February 26, 2026 08:28
@fregataa fregataa requested a review from jopemachine February 26, 2026 15:19
@fregataa fregataa added this to the 26.3 milestone Feb 27, 2026
@fregataa fregataa marked this pull request as draft February 27, 2026 02:44
@fregataa
Copy link
Member Author

Changed to draft since Artifact Registries can be mapped to domain/project N:N

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.

4 participants