From 1d6246e0779ca585ad44bfa12cea8ef6567e369c Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Mon, 31 Aug 2026 16:43:20 -0700 Subject: [PATCH 1/2] Fast follow up with CCR feedback --- .../src/RedirectionVerifier/DocfxConfiguration.cs | 15 ++++++++------- .../src/RedirectionVerifier/RedirectionHelpers.cs | 6 +++--- .../RedirectionVerifier.csproj | 1 - .../RedirectionVerifier/RedirectionsVerifier.cs | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/actions/docs-verifier/src/RedirectionVerifier/DocfxConfiguration.cs b/actions/docs-verifier/src/RedirectionVerifier/DocfxConfiguration.cs index 37c4b223..40bd9279 100644 --- a/actions/docs-verifier/src/RedirectionVerifier/DocfxConfiguration.cs +++ b/actions/docs-verifier/src/RedirectionVerifier/DocfxConfiguration.cs @@ -20,7 +20,8 @@ private IEnumerable GetDocfxContents() throw new InvalidOperationException("An object array 'contents' was expected to exist under 'build' in 'docfx.json'."); } - // TODO: repo name, or do the hard work of reading open publishing build config file, determining **ALL** `docfx.json`, and read them. + // TODO: repo name, or do the hard work of reading open publishing build + // config file, determining **ALL** `docfx.json` files, and reading them. return Build.Contents.Where(content => content.Source is null or "." or "docs"); } @@ -34,7 +35,7 @@ public IEnumerable GetMatchers(string? configDirectory = null) { var matcher = new Matcher(StringComparison.OrdinalIgnoreCase); - // Adjust the source path based on where docfx.json was found + // Adjust the source path based on where docfx.json was found. string effectiveSource = GetEffectiveSource(content.Source, configDirectory); if (content.Files is not null) @@ -53,7 +54,7 @@ public IEnumerable GetMatchers(string? configDirectory = null) { foreach (string excludePattern in content.Excludes) { - matcher.AddExclude(excludePattern); + matcher.AddExclude($"{effectiveSource}/excludePattern"); } } @@ -68,20 +69,20 @@ public IEnumerable GetMatchers(string? configDirectory = null) private static string GetEffectiveSource(string? source, string? configDirectory) { - // If no config directory (docfx.json at root), use source as-is + // If no config directory (docfx.json at root), use source as-is. if (string.IsNullOrEmpty(configDirectory)) { return source ?? "."; } - // If source is "." or null, it means the content is relative to where docfx.json is - // So we need to prepend the config directory + // If source is "." or null, it means the content is relative to where docfx.json is. + // So we need to prepend the config directory. if (source is null or ".") { return configDirectory; } - // Otherwise, combine config directory with the specified source + // Otherwise, combine config directory with the specified source. return $"{configDirectory}/{source}"; } } diff --git a/actions/docs-verifier/src/RedirectionVerifier/RedirectionHelpers.cs b/actions/docs-verifier/src/RedirectionVerifier/RedirectionHelpers.cs index 5f649106..b8dd2e44 100644 --- a/actions/docs-verifier/src/RedirectionVerifier/RedirectionHelpers.cs +++ b/actions/docs-verifier/src/RedirectionVerifier/RedirectionHelpers.cs @@ -13,14 +13,14 @@ public static class RedirectionHelpers public static async Task> GetRedirectionFileNames() { // If no redirection files are found in the OPS config, just use the default name. - ImmutableArray? redirectionFileNames = await GetRedirectionFilesAsync() ?? + ImmutableArray redirectionFileNames = await GetRedirectionFilesAsync() ?? [".openpublishing.redirection.json"]; - Console.WriteLine($"The following {redirectionFileNames.Value.Length} redirection files are registered:"); + Console.WriteLine($"The following {redirectionFileNames.Length} redirection files are registered:"); foreach (string filename in redirectionFileNames) { Console.WriteLine(filename); } - return redirectionFileNames.Value; + return redirectionFileNames; } } diff --git a/actions/docs-verifier/src/RedirectionVerifier/RedirectionVerifier.csproj b/actions/docs-verifier/src/RedirectionVerifier/RedirectionVerifier.csproj index 43d07a7f..113d5aff 100644 --- a/actions/docs-verifier/src/RedirectionVerifier/RedirectionVerifier.csproj +++ b/actions/docs-verifier/src/RedirectionVerifier/RedirectionVerifier.csproj @@ -6,7 +6,6 @@ - diff --git a/actions/docs-verifier/src/RedirectionVerifier/RedirectionsVerifier.cs b/actions/docs-verifier/src/RedirectionVerifier/RedirectionsVerifier.cs index 511332ae..8d36e462 100644 --- a/actions/docs-verifier/src/RedirectionVerifier/RedirectionsVerifier.cs +++ b/actions/docs-verifier/src/RedirectionVerifier/RedirectionsVerifier.cs @@ -3,8 +3,8 @@ public static class RedirectionsVerifier { /// - /// Verifies a redirection for the given source path, - /// and write logs (using GitHub-specific syntax) to a text writer. + /// Verifies a redirection for the given source path + /// and writes logs (using GitHub-specific syntax) to a text writer. /// /// for a valid redirection; otherwise. public static async Task WriteResultsAsync( @@ -34,7 +34,7 @@ public static async Task WriteResultsAsync( } // TODO: Verify file existence if it starts with "/". - // Will this require setting the docset as an env variable?. + // Will this require setting the docset as an env variable? return true; } } From 246460d4ec8322d236bb412bcbd0effbc4a64362 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Mon, 31 Aug 2026 17:45:01 -0700 Subject: [PATCH 2/2] Fix exclude pattern in DocfxConfiguration --- .../docs-verifier/src/RedirectionVerifier/DocfxConfiguration.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/docs-verifier/src/RedirectionVerifier/DocfxConfiguration.cs b/actions/docs-verifier/src/RedirectionVerifier/DocfxConfiguration.cs index 40bd9279..fb060592 100644 --- a/actions/docs-verifier/src/RedirectionVerifier/DocfxConfiguration.cs +++ b/actions/docs-verifier/src/RedirectionVerifier/DocfxConfiguration.cs @@ -54,7 +54,7 @@ public IEnumerable GetMatchers(string? configDirectory = null) { foreach (string excludePattern in content.Excludes) { - matcher.AddExclude($"{effectiveSource}/excludePattern"); + matcher.AddExclude($"{effectiveSource}/{excludePattern}"); } }