arcade-services icon indicating copy to clipboard operation
arcade-services copied to clipboard

Add darc get-asset support for filtering by build/commit digest

Open MichaelSimons opened this issue 2 years ago • 6 comments

Usage Scenario:

I have asset A from a particular build that I can lookup with get-asset. I know that same build produced asset B as well. How can I use darc to find the version of asset B from the same build?

Today, the only way I know how to do this is to lookup asset B without a filter and then search the results/output locally. This is inconvenient especially when the build in requestion exceeds the default age range. get-assets can be extremely slow in this scenario. What I would like is an option that lets me apply a filter on the build or commit digest.

MichaelSimons avatar Jun 01 '23 13:06 MichaelSimons

cc @mmitche

MichaelSimons avatar Jun 01 '23 13:06 MichaelSimons

+1 to this

mmitche avatar Jun 01 '23 16:06 mmitche

I have asset A from a particular build that I can lookup with get-asset. I know that same build produced asset B as well. How can I use darc to find the version of asset B from the same build?

I don't follow - wouldn't asset A and B from the same build have the same version?

However, I think I understand the ask, it would be these new options:

darc get-asset --build [ID] # Something like SELECT asset WHERE build_id = [ID]

and

darc get-asset --commit [ID]] # Something like SELECT asset JOIN builds ON build_id WHERE builds.commit = [ID]

(I don't know the exact SQL schema yet but I imagine something like this)

premun avatar Jun 27 '23 16:06 premun

I have a PR for half of this - the build ID is already implemented on the server side - https://github.com/dotnet/arcade-services/pull/2722

The SHA filter will be more complicated

premun avatar Jun 28 '23 09:06 premun

I don't follow - wouldn't asset A and B from the same build have the same version?

No - several repos have multiple versioning schemes for their assets. For example command-line-api versions things differently based on if they are a shipping or non-shipping asset.

MichaelSimons avatar Jun 28 '23 14:06 MichaelSimons

This fell through the cracks but starting Wednesday, it should be possible to do darc get-asset --build 202035

premun avatar Jan 08 '24 17:01 premun