Closed davimmt closed 1 year ago
Hi @davimmt, thanks for reaching out. Because this is a request for a change to a service, it would need to be directed towards the service team. I've reached out to the Code Artifact team to ask about this feature request, and I'll leave any updates in this issue. I'm also going to move it to our cross-SDK repository (https://github.com/aws/aws-sdk/). Thanks!
Ticket # for internal use : P98568505
Just some information about the use case: a few of our teams are migrating to AWS Code Artifact and the 'purger' pipeline outputs:
We have [58] packages in total.
.
.
.
Excluded a total of [194] packages versions from a total of [585] package versions.
This operantion took [16m 48s].
DRYRUN is set to [true], so nothing was deleted.
Hi @davimmt, thanks for your patience. The Code Artifact team is open to considering this feature request, but don't have a specific timeline for it currently. They did suggest using --sort-by PUBLISHED_TIME
as a potential workaround (see docs). Hope that helps!
This issue is now closed.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
That is very helpful, thank you so much. I have now removed the describe-package-version
for loop, and so far it works as expected with a good runtime.
Describe the feature
When we call the ListPackageVersions operation, it returns a list of PackageVersionSummary objects. This object is pretty much like the PackageVersionDescription, however with less attributes. I'd like to include the PackageVersionDescription
.packageVersion.publishedTime
to the PackageVersionSummary.versions
.Use Case
When writing scripts to clean/purge packages (manging a custom lifecycle for artifacts/packages), let's say we want to have only the 3 latests packages versions. In order to delete older versions, we have to loop through packages to get packages versions and then loop through packages versions (ListPackageVersions) to get the package versions details (PackageVersionDescription) and find the publishedTime in order to sort all packages. Problem is, this requires a API describe call to every and each version, and it takes a long time depending on how much versions you have for every single artifact package.
Proposed Solution
I propose to include the key
.packageVersion.publishedTime
from thePackageVersionDescription
to the objectPackageVersionSummary
(.versions.publishedTime
).Now, the
aws codeartifact list-package-versions
outputs as follows:And I can sort the packages by published time using:
Propose:
With this output, we could sort just by (sparing a lot of API calls):
Other Information
No response
Acknowledgements
CLI version used
aws-cli/2.12.6 Python/3.11.4 Linux/5.15.90.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off
Environment details (OS name and version, etc.)
Linux DM-0028 5.15.90.1-microsoft-standard-WSL2 aws/aws-cli#1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux