.NET validation checks updates - add next steps and update code checks invocation#14499
Merged
m-redding merged 13 commits intoAzure:mainfrom Mar 31, 2026
Merged
.NET validation checks updates - add next steps and update code checks invocation#14499m-redding merged 13 commits intoAzure:mainfrom
m-redding merged 13 commits intoAzure:mainfrom
Conversation
Ensure every .NET validation check provides actionable next-steps guidance when failures occur and auto-fix cannot be applied. Changes: - DotNetLanguageService.Checks.cs: Added NextSteps to CheckGeneratedCode, CheckAotCompat, and VerifyDotnetVersion failure paths - CommonLanguageHelpers.cs: Added NextSteps to ValidateChangelog, ValidateReadme, and CheckSpelling failure paths (both fix-on and fix-off) - PackageCheckTool.cs: Added NextSteps fallback to all individual run methods (Spelling, Snippets, Lint, Format, GeneratedCode, AotCompat, Samples) with conditional guidance based on --fix flag - DotNetLanguageSpecificChecksTests.cs: Added NextSteps assertions to existing failure test cases Two-layer pattern: language service layer sets NextSteps that bubble up to RunAllChecks aggregation, PackageCheckTool individual run methods provide fallback NextSteps when running checks individually. Fixes Azure#14338 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Normalize RunChangelogValidation, RunDependencyCheck, and RunReadmeValidation
to use the fallback guard pattern (result.NextSteps is not { Count: > 0 })
consistent with all other Run* methods.
- Use fallback NextSteps instead of unconditionally overwriting service-layer values
- Remove unnecessary new PackageCheckResponse creation in RunChangelogValidation
- Remove success-path NextSteps (no other method sets them on success)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Azure#14690 PR Azure#14690 covers CommonLanguageHelpers more thoroughly (including script-not-found, config-not-found, and exception paths). Removing these changes to avoid merge conflicts. This PR now focuses on .NET-specific checks and PackageCheckTool fallbacks only. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PackageCheckTool fallback NextSteps and pattern fixes will be addressed separately during end-to-end testing/fixing pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… NextSteps Leverage the -SkipDiffValidation flag added in Azure/azure-sdk-for-net#57422 so CodeChecks runs in prepare-PR mode (reports changed files instead of failing on diffs). On failure, parse 'error : ' prefixed lines from the script output and surface them as NextSteps, since the script already provides actionable guidance. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Link to Azure SDK AOT compatibility guide for resolving warnings. Make it clear that opting out should be an absolute last resort. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When error lines are extracted from CodeChecks.ps1 output, prepend a message explaining that the script output contains specific instructions for each error. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
m-redding
commented
Mar 30, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the azsdk-cli .NET package validation checks to provide actionable NextSteps on failure, and adjusts the CodeChecks invocation to use an updated argument set (including skipping diff validation) to better align with the intended workflow.
Changes:
- Add
NextStepsto.NETgenerated-code, AOT compatibility, anddotnet --list-sdks/SDK version validation failure paths. - Update the CodeChecks script invocation arguments to include
-SkipDiffValidation. - Extend existing .NET checks unit tests to assert
NextStepsare populated for key failure scenarios.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tools/azsdk-cli/Azure.Sdk.Tools.Cli/Services/Languages/DotNetLanguageService.Checks.cs | Adds NextSteps guidance for several .NET check failure paths and updates CodeChecks script arguments. |
| tools/azsdk-cli/Azure.Sdk.Tools.Cli.Tests/Services/Languages/DotNetLanguageSpecificChecksTests.cs | Adds assertions ensuring NextSteps are present in failure responses. |
Populate NextSteps with actionable guidance when the CodeChecks.ps1 script is not found, advising users to verify they are in an azure-sdk-for-net repo clone and how to restore the missing script. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Populate NextSteps with actionable guidance for changelog, readme, and spelling validation failures. Covers script-not-found, validation failure, config-missing, and unhandled exception paths in ValidateChangelog, ValidateReadme, CheckSpelling, and ValidatePackageAndDiscoverRepoAsync. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This reverts commit 7973158.
benbp
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #14338
Description
Ensures .NET-specific validation checks provide actionable next-steps guidance when failures occur and auto-fix cannot be applied.
Changes
Out of scope
Architecture
Two-layer NextSteps pattern:
esult.NextSteps is not { Count: > 0 })