Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support filtering predecessors by artifact type on ExtendedCopy #201

Closed
Wwwsylvia opened this issue Jun 27, 2022 · 7 comments
Closed

Support filtering predecessors by artifact type on ExtendedCopy #201

Wwwsylvia opened this issue Jun 27, 2022 · 7 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Wwwsylvia
Copy link
Member

Wwwsylvia commented Jun 27, 2022

When using ExtendedCopy, clients may want to filter predecessors of a node by their artifact type. Specifically,

  • Include predecessors whose artifact type matches a given regex
  • Exclude predecessors whose artifact type matches a given regex

To support this, we can provide some utility methods that configure the FindPredecessors option for clients.

Original issue: #29

@Wwwsylvia Wwwsylvia added this to the v2.0.0-rc.1 milestone Jun 27, 2022
@Wwwsylvia Wwwsylvia added the enhancement New feature or request label Jun 27, 2022
@Wwwsylvia
Copy link
Member Author

@wangxiaoxuan273 Could you help with this?

@wangxiaoxuan273
Copy link
Contributor

Sure. Please assign this to me.

@shizhMSFT
Copy link
Contributor

Scenario: oras-project/oras#307

@wangxiaoxuan273
Copy link
Contributor

wangxiaoxuan273 commented Jul 27, 2022

There are several things we need to clarify:

  1. ArtifactType is only supported by remote.repository and Referrers(). ExtendedCopyOptions only works on OCIDescriptors which does not support ArtifactType. Given this fact, what should be the scope of this requirement? Should the filtering only work on remote.repository? And if so, where should we check the source type? And what should be the functions' behavior on non-repository source?

@wangxiaoxuan273
Copy link
Contributor

wangxiaoxuan273 commented Jul 27, 2022

  1. Should we support both inclusion and exclusion?
  2. Should we support regex?

@shizhMSFT @Wwwsylvia

@shizhMSFT
Copy link
Contributor

shizhMSFT commented Jul 27, 2022

There are several things we need to clarify:

  1. ArtifactType is only supported by remote.repository and Referrers(). ExtendedCopyOptions only works on OCIDescriptors which does not support ArtifactType. Given this fact, what should be the scope of this requirement? Should the filtering only work on remote.repository? And if so, where should we check the source type? And what should be the functions' behavior on non-repository source?

It is clear if the Target implements Referrers().

The question is how we can filter without referrer API for generic Targets. The solution is as simple as

  1. Get the predecessors of a certain node
  2. For each predecessor, check if it is an artifact manifest type. If so, read it and check its artifact type.
  1. Should we support both inclusion and exclusion?

Yes. That's intersection.

  1. Should we support regex?

Why not 😃

@shizhMSFT
Copy link
Contributor

Resolved by #258

Repository owner moved this from PR review to Done in ORAS-Planning Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants