Skip to content

Request: Add Public Function for Finding Referrers and Filtering by Artifact Type #657

@nathan-joslin

Description

@nathan-joslin

User Story

As a user of oras-go I would like to discover referrers of a manifest and filter by ArtifactType. I have a GraphStorage which only gives me access to Predecessors. I'd like to take advantage of the referrers API for optimization.

Limits of Current Functionality

The FilterArtifactType option for ExtendedCopyGraph provides this filtering, but the condition of copying limits its use.

As the GraphStorage I have is originally a registry.Repository, I have the option of elevating my GraphStorage to a registry.Repository giving me access to repository.Referrers. However, this has a side effect on my unit tests which use a memory.Store; a PredecessorFinder not a registry.ReferrerLister.

The implementation of func (opts *ExendedCopyGraphOptions) FilterArtifactType(regex) provides a "fallback" mechanism, where a non registry.ReferrerLister uses Predecessors instead, which seems useful to both the memory.Store in my unit tests as well as my GraphStorage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions