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

The value of -ProjectName erroneously fails validation if the collection/account contains over 100 projects #567

Open
sevaa opened this issue May 2, 2024 · 0 comments
Labels
bug when a bug has been identified or filed

Comments

@sevaa
Copy link
Contributor

sevaa commented May 2, 2024

Steps to reproduce

Create 101 projects in a collection. Remember which one was the last one created.

powershell -Command Add-VSTeamVariableGroup -ProjectName TheLastProject -Name Temp -Variables @{a="a"} -Type Vsts

The exact nature of the command doesn't matter, all commands with -ProjectName are affected.

This has to do with the way project list validation works - it calls Get-VSTeamProject, and that one has an implicit limit of 100 records. Can be overridden with the -Top parameter, but the cache logic doesn't do that.

There is a workaround: set the env variable TEAM_PROJECTCOUNT to a high number.

Expected behavior

I expected that the command would not error out. As long as it does, I'd expect an error message that points at the root cause.

Actual behavior?

I had the following actual outcome: error,

Add-VSTeamVariableGroup : Cannot validate argument on parameter 'ProjectName'. 'TheLastProject' is invalid

On Which OS have you tried it?

Windows

What was your server version?

other (specify)

Other server version

Azure DevOps Services 2022

Log output of used API

Billing                     : 5.1-preview.1
Build                       : 5.1
Core                        : 5.1
DistributedTask             : 6.0-preview
DistributedTaskReleased     : 5.1
ExtensionsManagement        : 6.0-preview
Git                         : 5.1
Graph                       : 6.0-preview
HierarchyQuery              : 5.1-preview
MemberEntitlementManagement : 6.0-preview
Packaging                   : 6.0-preview
Pipelines                   : 5.1-preview
Policy                      : 5.1
Processes                   : 6.0-preview
Release                     : 5.1
ServiceEndpoints            : 5.0-preview
TaskGroups                  : 6.0-preview
Tfvc                        : 5.1
VariableGroups              : 5.1-preview.1
Version                     : AzD
Wiki                        : 6.0
WorkItemTracking            : 6.0-preview.1

Log output of $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.4291
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.4291
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
@sevaa sevaa added the bug when a bug has been identified or filed label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug when a bug has been identified or filed
Projects
None yet
Development

No branches or pull requests

1 participant