Added support for AWS CodeArtifact
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
- [x] PR has a meaningful title
- Use the present tense and imperative mood when describing your changes
- [x] Summarized changes
- [x] Make sure all
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header - [x] This PR is ready to merge and is not Work in Progress.
- If the PR is work in progress, please add the prefix
WIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.
- If the PR is work in progress, please add the prefix
- Breaking changes
- [x] None
- OR
- [ ] Documentation needed
- [ ] Issue filed:
- User-facing changes
- [ ] Not Applicable
- OR
- [x] Documentation needed
- [ ] Issue filed:
- Testing - New and feature
- [x] N/A or can only be tested interactively
- OR
- [x] Make sure you've added a new test if existing tests do not effectively test the code changed
- Tooling
- [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
- OR
- [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary.
**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
@microsoft-github-policy-service agree
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.
/azp run PowerShell.PSResourceGet
Azure Pipelines successfully started running 1 pipeline(s).
/azp run PowerShell.PSResourceGet
Azure Pipelines successfully started running 1 pipeline(s).
/azp run PowerShell.PSResourceGet
Azure Pipelines successfully started running 1 pipeline(s).
/azp run PowerShell.PSResourceGet
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.