-
Notifications
You must be signed in to change notification settings - Fork 240
add next steps #11990
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
add next steps #11990
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -136,13 +136,15 @@ private async Task<CLICheckResponse> RunAllChecks(string packagePath, Cancellati | |
|
|
||
| var results = new List<CLICheckResponse>(); | ||
| var overallSuccess = true; | ||
| var failedChecks = new List<string>(); | ||
|
|
||
| // Run dependency check | ||
| var dependencyCheckResult = await languageChecks.AnalyzeDependenciesAsync(packagePath, ct); | ||
| results.Add(dependencyCheckResult); | ||
| if (dependencyCheckResult.ExitCode != 0) | ||
| { | ||
| overallSuccess = false; | ||
| failedChecks.Add("Dependency"); | ||
| } | ||
|
|
||
| // Run changelog validation | ||
|
|
@@ -151,6 +153,7 @@ private async Task<CLICheckResponse> RunAllChecks(string packagePath, Cancellati | |
| if (changelogValidationResult.ExitCode != 0) | ||
| { | ||
| overallSuccess = false; | ||
| failedChecks.Add("Changelog"); | ||
| } | ||
|
|
||
| // Run README validation | ||
|
|
@@ -159,6 +162,7 @@ private async Task<CLICheckResponse> RunAllChecks(string packagePath, Cancellati | |
| if (readmeValidationResult.ExitCode != 0) | ||
| { | ||
| overallSuccess = false; | ||
| failedChecks.Add("README"); | ||
| } | ||
|
|
||
| // Run spelling check | ||
|
|
@@ -167,6 +171,7 @@ private async Task<CLICheckResponse> RunAllChecks(string packagePath, Cancellati | |
| if (spellingCheckResult.ExitCode != 0) | ||
| { | ||
| overallSuccess = false; | ||
| failedChecks.Add("Spelling"); | ||
| } | ||
|
|
||
| if (!overallSuccess) | ||
|
|
@@ -176,10 +181,30 @@ private async Task<CLICheckResponse> RunAllChecks(string packagePath, Cancellati | |
|
|
||
| var message = overallSuccess ? "All checks completed successfully" : "Some checks failed"; | ||
| var combinedOutput = string.Join("\n", results.Select(r => r.CheckStatusDetails)); | ||
|
|
||
| // Generate comprehensive next steps for all checks | ||
| var nextSteps = new List<string>(); | ||
| if (overallSuccess) | ||
| { | ||
| nextSteps.Add("All package validation checks passed! Your package is ready for the next steps in the development process."); | ||
| nextSteps.Add("Consider running package release readiness checks if preparing for release."); | ||
| } | ||
| else | ||
| { | ||
| nextSteps.Add($"The following checks failed: {string.Join(", ", failedChecks)}"); | ||
| nextSteps.Add("Address the issues identified above before proceeding with package release."); | ||
| nextSteps.Add("Re-run the package checks after making corrections to verify all issues are resolved."); | ||
|
|
||
| // Add specific guidance from individual check failures | ||
| foreach (var result in results.Where(r => r.ExitCode != 0 && r.NextSteps?.Any() == true)) | ||
| { | ||
| nextSteps.AddRange(result.NextSteps); | ||
| } | ||
| } | ||
|
|
||
| return overallSuccess | ||
| ? new CLICheckResponse(0, combinedOutput) | ||
| : new CLICheckResponse(1, combinedOutput, message); | ||
| ? new CLICheckResponse(0, combinedOutput) { NextSteps = nextSteps } | ||
| : new CLICheckResponse(1, combinedOutput, message) { NextSteps = nextSteps }; | ||
| } | ||
|
|
||
| private async Task<CLICheckResponse> RunChangelogValidation(string packagePath, CancellationToken ct) | ||
|
|
@@ -191,7 +216,21 @@ private async Task<CLICheckResponse> RunChangelogValidation(string packagePath, | |
| if (result.ExitCode != 0) | ||
| { | ||
| SetFailure(1); | ||
| return new CLICheckResponse(result.ExitCode, result.CheckStatusDetails, "Changelog validation failed"); | ||
| result.NextSteps = new List<string> | ||
| { | ||
| "Review and update the CHANGELOG.md file to ensure it follows the proper format", | ||
| "Verify that unreleased changes are properly documented", | ||
| "Check that version numbers and release dates are correctly formatted", | ||
| "Refer to the Azure SDK changelog guidelines for proper formatting" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this point to the guidelines for the changelog? |
||
| }; | ||
| return new CLICheckResponse(result.ExitCode, result.CheckStatusDetails, "Changelog validation failed") { NextSteps = result.NextSteps }; | ||
| } | ||
| else | ||
| { | ||
| result.NextSteps = new List<string> | ||
| { | ||
| "Changelog validation passed - no action needed" | ||
| }; | ||
|
l0lawrence marked this conversation as resolved.
|
||
| } | ||
|
|
||
| return result; | ||
|
|
@@ -202,6 +241,25 @@ private async Task<CLICheckResponse> RunDependencyCheck(string packagePath, Canc | |
| logger.LogInformation("Running dependency check"); | ||
|
|
||
| var result = await languageChecks.AnalyzeDependenciesAsync(packagePath, ct); | ||
|
|
||
| if (result.ExitCode != 0) | ||
| { | ||
| result.NextSteps = new List<string> | ||
| { | ||
| "Review and update package dependencies to resolve conflicts", | ||
| "Ensure all dependencies meet Azure SDK guidelines", | ||
| "Check for outdated or vulnerable dependencies", | ||
| "Run language-specific dependency update commands (e.g., pip upgrade, npm update)" | ||
| }; | ||
| } | ||
| else | ||
| { | ||
| result.NextSteps = new List<string> | ||
| { | ||
| "Dependency check passed - all dependencies are properly configured" | ||
| }; | ||
|
l0lawrence marked this conversation as resolved.
|
||
| } | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
|
|
@@ -210,6 +268,25 @@ private async Task<CLICheckResponse> RunReadmeValidation(string packagePath, Can | |
| logger.LogInformation("Running README validation"); | ||
|
|
||
| var result = await languageChecks.ValidateReadmeAsync(packagePath, ct); | ||
|
|
||
| if (result.ExitCode != 0) | ||
| { | ||
| result.NextSteps = new List<string> | ||
| { | ||
| "Create or update the README.md file to include required sections", | ||
| "Ensure the README follows Azure SDK documentation standards", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as abouve about providing the link |
||
| "Include proper installation instructions, usage examples, and API documentation links", | ||
| "Verify that all code samples in the README are working and up-to-date" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does a |
||
| }; | ||
| } | ||
| else | ||
| { | ||
| result.NextSteps = new List<string> | ||
| { | ||
| "README validation passed - documentation is properly formatted" | ||
| }; | ||
|
l0lawrence marked this conversation as resolved.
|
||
| } | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
|
|
@@ -218,6 +295,25 @@ private async Task<CLICheckResponse> RunSpellingValidation(string packagePath, C | |
| logger.LogInformation("Running spelling validation"); | ||
|
|
||
| var result = await languageChecks.CheckSpellingAsync(packagePath, ct); | ||
|
|
||
| if (result.ExitCode != 0) | ||
| { | ||
| result.NextSteps = new List<string> | ||
| { | ||
| "Fix spelling errors identified in the package files", | ||
| "Add legitimate technical terms to the cspell dictionary if needed", | ||
| "Review comments, documentation, and variable names for typos", | ||
| "Run cspell locally to identify and fix spelling issues before committing" | ||
| }; | ||
| } | ||
| else | ||
| { | ||
| result.NextSteps = new List<string> | ||
| { | ||
| "Spelling check passed - no spelling errors found" | ||
| }; | ||
|
l0lawrence marked this conversation as resolved.
|
||
| } | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be always mandatory?