PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

Added support for AWS CodeArtifact

Open austoonz opened this issue 1 year ago • 10 comments

PR Summary

Adds support for AWS CodeArtifact NuGet v3 repositories. Resolves https://github.com/PowerShell/PSResourceGet/issues/1650.

PR Context

AWS CodeArtifact supports NuGet v3 feeds. This adds the features supported by AWS CodeArtifact to the PSResourceGet module.

PR Checklist

**Testing

This is both. I've added a unit test to ensure the fast-fail code path is not hit. I have also used this interactively. Examples below against a repository in my AWS account.

# Showing the resource repository
# NOTE: My AWS AccountId has been changed...
PS>Get-PSResourceRepository -Name AWSCodeArtifact | Select-Object -Property Name, Uri

Name            Uri
----            ---
AWSCodeArtifact https://psrepo-123456789012.d.codeartifact.us-west-2.amazonaws.com/nuget/psrepo/v3/index.json

# Showing `-Name '*'` works
PS>Find-PSResource -Credential $credential -Repository 'AWSCodeArtifact' -Name '*' | Select-Object -Property Name, Repository

Name                   Repository
----                   ----------
AWS.Tools.CodeArtifact AWSCodeArtifact
AWS.Tools.Common       AWSCodeArtifact
AWS.Tools.EC2          AWSCodeArtifact
AWS.Tools.S3           AWSCodeArtifact
Convert                AWSCodeArtifact
FastPing               AWSCodeArtifact
FileSystemHelpers      AWSCodeArtifact

# Showing `-Name 'Prefix*'` works
PS>Find-PSResource -Credential $credential -Repository 'AWSCodeArtifact' -Name 'AWS.Tools.*' | Select-Object -Property Name, Repository

Name                   Repository
----                   ----------
AWS.Tools.CodeArtifact AWSCodeArtifact
AWS.Tools.Common       AWSCodeArtifact
AWS.Tools.EC2          AWSCodeArtifact
AWS.Tools.S3           AWSCodeArtifact

austoonz avatar Jun 04 '24 16:06 austoonz

@microsoft-github-policy-service agree

austoonz avatar Jun 04 '24 18:06 austoonz

I've found an issue in the GetVersionedPackageEntriesFromSearchQueryResource() method with CodeArtifact, with the initialCount value that's returned. This value is not necessarily accurate for the entire data set, and the default to retrieving 100 records at a time also doesn't work as intended.

In my clone I've changed the query logic to continue querying until no data is returned. I wanted to run that idea past those here given I don't have other NuGet v3 feeds to test against. Example commit.

austoonz avatar Jun 14 '24 20:06 austoonz

/azp run PowerShell.PSResourceGet

alerickson avatar Aug 08 '24 00:08 alerickson

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 08 '24 00:08 azure-pipelines[bot]

/azp run PowerShell.PSResourceGet

alerickson avatar Sep 10 '24 22:09 alerickson

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Sep 10 '24 22:09 azure-pipelines[bot]

/azp run PowerShell.PSResourceGet

alerickson avatar Sep 11 '24 18:09 alerickson

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Sep 11 '24 18:09 azure-pipelines[bot]

/azp run PowerShell.PSResourceGet

alerickson avatar Jul 16 '25 19:07 alerickson

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

azure-pipelines[bot] avatar Jul 16 '25 19:07 azure-pipelines[bot]