Skip to content

refactor(BA-5046): migrate artifact registry action classes to RBAC base classes#9992

Merged
fregataa merged 3 commits into
mainfrom
feat/BA-5046-refactor-artifact-registry-actions-rbac
Mar 20, 2026
Merged

refactor(BA-5046): migrate artifact registry action classes to RBAC base classes#9992
fregataa merged 3 commits into
mainfrom
feat/BA-5046-refactor-artifact-registry-actions-rbac

Conversation

@fregataa
Copy link
Copy Markdown
Member

@fregataa fregataa commented Mar 12, 2026

Summary

  • Add ArtifactRegistryScopeAction, ArtifactRegistrySingleEntityAction and corresponding result RBAC base classes
  • Migrate 7 single-entity actions across HuggingFace, Reservoir, and Common registries (Get/Update/Delete + GetMeta)
  • Each implements target_element() returning RBACElementRef(ARTIFACT_REGISTRY, id)
  • Upgrade get/update/delete processors to SingleEntityActionProcessor
  • Keep create/list/search/batch-get actions as ArtifactRegistryAction

Test plan

  • pants fmt/lint/check pass on services/artifact_registry::
  • CI passes

Resolves BA-5046

Copilot AI review requested due to automatic review settings March 12, 2026 09:21
@github-actions github-actions Bot added the size:L 100~500 LoC label Mar 12, 2026
@github-actions github-actions Bot added the comp:manager Related to Manager component label Mar 12, 2026
fregataa added a commit that referenced this pull request 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

Migrates artifact registry single-entity action classes (Get/Update/Delete + GetMeta) from BaseAction/BaseActionResult to new RBAC-aware base classes (BaseSingleEntityAction/BaseSingleEntityActionResult), and upgrades the corresponding processors to SingleEntityActionProcessor.

Changes:

  • Introduces ArtifactRegistrySingleEntityAction, ArtifactRegistrySingleEntityActionResult, and scope-action base classes in actions/base.py
  • Migrates 7 action files (HuggingFace and Reservoir get/update/delete + common get_meta) to the new base classes with target_entity_id() and target_element() implementations
  • Updates processor type annotations and instantiations from ActionProcessor to SingleEntityActionProcessor

Reviewed changes

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

Show a summary per file
File Description
actions/base.py Adds new RBAC base classes for single-entity and scope actions
actions/huggingface/get.py Migrates to ArtifactRegistrySingleEntityAction
actions/huggingface/update.py Migrates to ArtifactRegistrySingleEntityAction
actions/huggingface/delete.py Migrates to ArtifactRegistrySingleEntityAction
actions/reservoir/get.py Migrates to ArtifactRegistrySingleEntityAction
actions/reservoir/update.py Migrates to ArtifactRegistrySingleEntityAction
actions/reservoir/delete.py Migrates to ArtifactRegistrySingleEntityAction
actions/common/get_meta.py Migrates to ArtifactRegistrySingleEntityAction
processors.py Upgrades to SingleEntityActionProcessor for single-entity actions

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

Comment thread src/ai/backend/manager/services/artifact_registry/actions/common/get_meta.py Outdated
fregataa and others added 2 commits March 20, 2026 13:21
@fregataa fregataa force-pushed the feat/BA-5046-refactor-artifact-registry-actions-rbac branch from 319a39d to 31a745f Compare March 20, 2026 04:22
@github-actions github-actions Bot added size:M 30~100 LoC and removed size:L 100~500 LoC labels Mar 20, 2026
…gistry_name are null

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:46

@override
def target_entity_id(self) -> str:
if self.registry_id:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think registry_name should not be included here

@fregataa fregataa merged commit 2c62d8a into main Mar 20, 2026
31 checks passed
@fregataa fregataa deleted the feat/BA-5046-refactor-artifact-registry-actions-rbac branch March 20, 2026 17:51
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