diff --git a/tools/azsdk-cli/Azure.Sdk.Tools.Cli/CHANGELOG.md b/tools/azsdk-cli/Azure.Sdk.Tools.Cli/CHANGELOG.md index 27996a6a38b..a5bb1ba042e 100644 --- a/tools/azsdk-cli/Azure.Sdk.Tools.Cli/CHANGELOG.md +++ b/tools/azsdk-cli/Azure.Sdk.Tools.Cli/CHANGELOG.md @@ -10,6 +10,8 @@ ### Bugs Fixed +- Fixed case insensitivity with ward ScanPaths in package validation readme tool + ### Other Changes ## 0.5.11 (2026-01-05) diff --git a/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Helpers/CommonLanguageHelpers.cs b/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Helpers/CommonLanguageHelpers.cs index b2acc646313..194c353d745 100644 --- a/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Helpers/CommonLanguageHelpers.cs +++ b/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Helpers/CommonLanguageHelpers.cs @@ -114,6 +114,13 @@ public async Task ValidateChangelog( var timeout = TimeSpan.FromMinutes(5); var processResult = await _processHelper.Run(new(command, args, timeout: timeout, workingDirectory: packagePath), ct); + if (processResult.ExitCode != 0) + { + _logger.LogWarning("Changelog validation failed. Exit Code: {ExitCode}, Output: {Output}", + processResult.ExitCode, processResult.Output); + return new PackageCheckResponse(processResult.ExitCode, processResult.Output, "Changelog validation failed."); + } + return new PackageCheckResponse(processResult); } catch (Exception ex) @@ -150,16 +157,31 @@ public async Task ValidateReadme( return new PackageCheckResponse(1, "", $"Doc settings file not found at expected location: {settingsPath}"); } + // TODO: investigate doc-warden code, this normalizes package path for Scan Paths + var normalizedPackagePath = Path.GetFullPath(packagePath); + // Ensure drive letter is uppercase on Windows for consistency + if (OperatingSystem.IsWindows() && normalizedPackagePath.Length >= 2) + { + normalizedPackagePath = char.ToUpperInvariant(normalizedPackagePath[0]) + normalizedPackagePath.Substring(1); + } + var command = "pwsh"; var args = new[] { "-File", scriptPath, "-SettingsPath", settingsPath, - "-ScanPaths", packagePath, + "-ScanPaths", normalizedPackagePath, }; var timeout = TimeSpan.FromMinutes(10); var processResult = await _processHelper.Run(new(command, args, timeout: timeout, workingDirectory: packagePath), ct); + if (processResult.ExitCode != 0) + { + _logger.LogWarning("Readme validation failed. Exit Code: {ExitCode}, Output: {Output}", + processResult.ExitCode, processResult.Output); + return new PackageCheckResponse(processResult.ExitCode, processResult.Output, "Readme validation failed."); + } + return new PackageCheckResponse(processResult); } catch (Exception ex) @@ -218,6 +240,13 @@ public async Task CheckSpelling( } } + if (processResult.ExitCode != 0) + { + _logger.LogWarning("Spelling check failed. Exit Code: {ExitCode}, Output: {Output}", + processResult.ExitCode, processResult.Output); + return new PackageCheckResponse(processResult.ExitCode, processResult.Output, "Spelling check failed."); + } + return new PackageCheckResponse(processResult); } catch (Exception ex)