Skip to content

Move source min publish age validation to dotnet nuget options - #7730

Merged
zivkan merged 2 commits into
devfrom
dev-zivkan-source-age-option-validators
Oct 6, 2026
Merged

zivkan merged 2 commits into
devfrom
dev-zivkan-source-age-option-validators

Conversation

@zivkan

@zivkan zivkan commented Sep 22, 2026

Copy link
Copy Markdown
Member

Bug

Follow up on: #7724

Description

The previous PR added validation into the "command runner", causing input errors to output like this:
image

I think we should instead use System.CommandLine's validators feature, which will allow the error to be output like this:
image

(it shows the rest of the command help, but I cut it out of the screenshot because it's not important to the point I want to make).

The line in red is sent to stderr, while the usage help is sent to stdout. This is consistent with all other input errors, such as trying to do --min-publish-age-hours seventy-two, or --invalid-option, or anything else that causes System.CommandLine input validation to fail.

As part of this PR, I ported 2 Dotnet.Integration.Tests to unit tests (with a small change to allow custom actions/callbacks to be used for testing), allowing the 2 integration tests to be replaced with 10 unit tests that complete much, much more quickly.

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. N/A

@zivkan
zivkan requested a review from a team as a code owner September 22, 2026 01:12
Nigusu-Allehu
Nigusu-Allehu previously approved these changes Sep 22, 2026

@Nigusu-Allehu Nigusu-Allehu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. No blockers

donnie-msft
donnie-msft previously approved these changes Sep 22, 2026

@donnie-msft donnie-msft left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some food for thought.

@Nigusu-Allehu Nigusu-Allehu added the Merge next release PRs that should not be merged until the dev branch targets the next release label Sep 22, 2026
@zivkan
zivkan dismissed stale reviews from donnie-msft and Nigusu-Allehu via 4ff808f September 23, 2026 01:45
donnie-msft
donnie-msft previously approved these changes Sep 24, 2026
@zivkan
zivkan force-pushed the dev-zivkan-source-age-option-validators branch from 4ff808f to 5bcbd37 Compare September 25, 2026 22:37
@dotnet-policy-service dotnet-policy-service Bot added the Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed label Oct 6, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has no activity for 7 days. It will be closed if no further activity occurs within another 15 days of this comment, unless it has a "Status:Do not auto close" label. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch.

@zivkan
zivkan merged commit 5df2690 into dev Oct 6, 2026
18 checks passed
@zivkan
zivkan deleted the dev-zivkan-source-age-option-validators branch October 6, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merge next release PRs that should not be merged until the dev branch targets the next release Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants