Skip to content

Skip redirect validation for docset-excluded paths#3095

Merged
Mpdreamz merged 1 commit intomainfrom
fix/redirect-exlude-detection
Apr 14, 2026
Merged

Skip redirect validation for docset-excluded paths#3095
Mpdreamz merged 1 commit intomainfrom
fix/redirect-exlude-detection

Conversation

@Mpdreamz
Copy link
Copy Markdown
Member

Summary

docs-builder validate (redirect validation) required redirects.yml entries for every deleted or renamed Markdown file, without considering docset.yml exclude globs or folder-level TOC excludes. That caused false positives when paths were never published (for example Elasticsearch excluding generated Kibana ES|QL docs under reference/query-languages/esql/kibana/docs/**).

Changes

  • LocalChangeTrackingService.ValidateRedirects: Before checking redirects.yml, skip changes whose docset-relative path matches Configuration.IsExcluded (same logic as the Markdown pipeline: docset globs, FolderExcludedFiles, and ! include overrides).
  • Tests: ConfigurationFileExcludeTests covers the Elasticsearch-style glob and a path outside the excluded tree.

Testing

  • dotnet build
  • dotnet test tests/Elastic.Documentation.Configuration.Tests/

Made with Cursor

ValidateRedirects now uses Configuration.IsExcluded (docset globs, folder
TOC excludes, include overrides) so deleted or renamed Markdown under
excluded trees does not require redirects.yml entries.

Adds ConfigurationFileExcludeTests for Elasticsearch-style exclude globs.

Made-with: Cursor
@Mpdreamz Mpdreamz requested a review from a team as a code owner April 13, 2026 18:26
@Mpdreamz Mpdreamz requested a review from technige April 13, 2026 18:26
@coderabbitai coderabbitai bot added the fix label Apr 13, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e60c645-198a-4ace-88fa-42f5848adfde

📥 Commits

Reviewing files that changed from the base of the PR and between e82f624 and bfc971e.

📒 Files selected for processing (2)
  • src/authoring/Elastic.Documentation.Refactor/Tracking/LocalChangesService.cs
  • tests/Elastic.Documentation.Configuration.Tests/ConfigurationFileExcludeTests.cs

📝 Walkthrough

Walkthrough

The ValidateRedirects method in LocalChangesService was updated to skip redirect validation for deleted or renamed changes whose documentation-set-relative paths are excluded by the configuration's exclusion rules. A new test suite was added to ConfigurationFileExcludeTests to validate the ConfigurationFile.IsExcluded() method's behavior with glob patterns, including tests for matching nested paths within excluded directories and verifying non-matching paths outside the excluded trees.

Suggested labels

fix

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title concisely and accurately summarizes the main change: skipping redirect validation for paths excluded by docset configuration.
Description check ✅ Passed The description clearly explains the problem, solution, and testing approach, directly relating to the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/redirect-exlude-detection

Comment @coderabbitai help to get the list of available commands and usage tips.

@Mpdreamz Mpdreamz merged commit 43a5442 into main Apr 14, 2026
28 of 29 checks passed
@Mpdreamz Mpdreamz deleted the fix/redirect-exlude-detection branch April 14, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants