Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -151,6 +153,7 @@ private async Task<CLICheckResponse> RunAllChecks(string packagePath, Cancellati
if (changelogValidationResult.ExitCode != 0)
{
overallSuccess = false;
failedChecks.Add("Changelog");
}

// Run README validation
Expand All @@ -159,6 +162,7 @@ private async Task<CLICheckResponse> RunAllChecks(string packagePath, Cancellati
if (readmeValidationResult.ExitCode != 0)
{
overallSuccess = false;
failedChecks.Add("README");
}

// Run spelling check
Expand All @@ -167,6 +171,7 @@ private async Task<CLICheckResponse> RunAllChecks(string packagePath, Cancellati
if (spellingCheckResult.ExitCode != 0)
{
overallSuccess = false;
failedChecks.Add("Spelling");
}

if (!overallSuccess)
Expand All @@ -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.");
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.

shouldn't this be always mandatory?

}
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)
Expand All @@ -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"
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.

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"
};
Comment thread
l0lawrence marked this conversation as resolved.
}

return result;
Expand All @@ -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"
};
Comment thread
l0lawrence marked this conversation as resolved.
}

return result;
}

Expand All @@ -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",
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.

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"
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.

what does a sample working means?

};
}
else
{
result.NextSteps = new List<string>
{
"README validation passed - documentation is properly formatted"
};
Comment thread
l0lawrence marked this conversation as resolved.
}

return result;
}

Expand All @@ -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"
};
Comment thread
l0lawrence marked this conversation as resolved.
}

return result;
}

Expand Down
Loading