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

Added support for AWS CodeArtifact #1660

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

austoonz
Copy link

@austoonz austoonz commented Jun 4, 2024

PR Summary

Adds support for AWS CodeArtifact NuGet v3 repositories. Resolves #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
Copy link
Author

austoonz commented Jun 4, 2024

@microsoft-github-policy-service agree

@austoonz
Copy link
Author

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.

@alerickson
Copy link
Member

/azp run PowerShell.PSResourceGet

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@alerickson
Copy link
Member

/azp run PowerShell.PSResourceGet

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@alerickson
Copy link
Member

/azp run PowerShell.PSResourceGet

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@SydneyhSmith SydneyhSmith reopened this Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for AWS CodeArtifact
3 participants