Skip to content

Move package ID length validation into pack - #7884

Merged
zivkan merged 2 commits into
devfrom
dev-zivkan-package-id-validation-f62
Nov 13, 2026
Merged

zivkan merged 2 commits into
devfrom
dev-zivkan-package-id-validation-f62

Conversation

@zivkan

@zivkan zivkan commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Bug

Fixes: #7844

Description

#7844 introduced a regression that blocks packages with IDs longer than 100 characters. This change fixes the regression while maintaining the length limit when packing packages.

The root cause was confusing and inconsistent PackageIdValidator API behavior: ValidatePackageId enforced the length limit while other validation methods generally did not. This change moves the length check to pack and documents the validator's behavior, making it less likely that future changes will unintentionally block existing packages with long IDs.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

Allow PackageIdValidator to accept IDs longer than 100 characters for backwards compatibility, while enforcing the limit during pack operations. Document the behavior and add tests.

Co-authored-by: Copilot App <[email protected]>
@zivkan
zivkan marked this pull request as ready for review November 12, 2026 21:47
@zivkan
zivkan requested a review from a team as a code owner November 12, 2026 21:47
@zivkan
zivkan requested review from jebriede and jeffkl November 12, 2026 21:47
Preserve and obsolete the existing length-checking API. Add an overload that enforces the length limit only when restricted-set validation is enabled, and update callers, documentation, and tests.

Co-authored-by: Copilot App <[email protected]>
@zivkan
zivkan merged commit f837378 into dev Nov 13, 2026
17 of 18 checks passed
@zivkan
zivkan deleted the dev-zivkan-package-id-validation-f62 branch November 13, 2026 20:47
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.

3 participants