Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add Source URL Validation to Package Sources page - #6730

#6730
Merged
donnie-msft merged 8 commits into
devNuGet/NuGet.Client:devfrom
dev-donnie-msft-usxSourceValNuGet/NuGet.Client:dev-donnie-msft-usxSourceValCopy head branch name to clipboard
Aug 20, 2025
Merged

Add Source URL Validation to Package Sources page#6730
donnie-msft merged 8 commits into
devNuGet/NuGet.Client:devfrom
dev-donnie-msft-usxSourceValNuGet/NuGet.Client:dev-donnie-msft-usxSourceValCopy head branch name to clipboard

Conversation

@donnie-msft

@donnie-msft donnie-msft commented Aug 19, 2025

Copy link
Copy Markdown
Contributor

Bug

Fixes: NuGet/Home#14359
Fixes: https://github.com/NuGet/Client.Engineering/issues/3385

Description

Implements the Unified Settings validation API IExternalSettingValidator for array item settings on the Package Sources page.

Pressing "Save" with an invalid source would result in a permanent error on the Package Sources page, resolved only by VS Restart.
Now, a blocking error message is shown on the dialog:

Example 1:
image

Example 2:
image

Change details

  • Reworded the "invalid source" error string to be a little more explicit about what types of paths would work in the source field
  • Added a "Try" version of the validator method to return a boolean instead of throwing.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests Tested manually and this code is invoking an already tested Validator class. Let me know if anyone feels another test would be useful.
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc. Documentation refresh of VS Options pages with Unified Settings Home#14039

@donnie-msft
donnie-msft requested a review from a team as a code owner August 19, 2025 21:41
@donnie-msft
donnie-msft requested review from nkolev92 and zivkan August 19, 2025 21:41
@Nigusu-Allehu
Nigusu-Allehu self-requested a review August 19, 2025 23:14
zivkan
zivkan previously approved these changes Aug 20, 2025
@donnie-msft
donnie-msft merged commit cd1b6d7 into dev Aug 20, 2025
17 of 18 checks passed
@donnie-msft
donnie-msft deleted the dev-donnie-msft-usxSourceVal branch August 20, 2025 06:59
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.

Improve validation of NuGet's settings in Visual Studio Options

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.