Skip to content

make removed URL check aware of docs/redirects.txt#612

Open
rajannpatel wants to merge 2 commits into
canonical:mainfrom
rajannpatel:check-removed-urls
Open

make removed URL check aware of docs/redirects.txt#612
rajannpatel wants to merge 2 commits into
canonical:mainfrom
rajannpatel:check-removed-urls

Conversation

@rajannpatel

@rajannpatel rajannpatel commented Jun 18, 2026

Copy link
Copy Markdown

Description

This PR updates the check-removed-urls.yml GitHub workflow to prevent false positives when a documentation page is intentionally removed or renamed, but a proper redirect has already been configured in docs/redirects.txt.

Previously, the workflow performed a strict text diff on the built HTML output. If a URL disappeared, the check failed immediately, completely unaware that a redirect existed.

Key Changes

  • Added workflow_call Inputs: decoupled the base reference variables so this workflow can be cleanly reused by other pipelines.
  • Path Normalization: Streamlined the find and sed pipeline to parse built HTML structures safely and output clean, predictable path formats.
  • Redirect-Aware Validation: Replaced the Bash loop with an inline Python verification script. It parses docs/redirects.txt using the native csv module and checks all structural markdown possibilities (page.md, page/index.md, or directory-level paths) before flagging a URL as missing.

Testing Instructions

  1. If a PR removes a page without adding it to docs/redirects.txt, the workflow should fail and list the unhandled URL.
  2. If a PR removes a page and correctly logs the source path in docs/redirects.txt, the workflow should print a green checkmark (✅ Ignored) and pass successfully.

Checklist

  • Tested changes against private/public fork contexts
  • Handled empty lines and comment blocks inside redirects.txt
  • Validated fallback behavior for reusable workflow triggers
  • Have you updated CHANGELOG.md with relevant non-documentation file changes?
  • Have you updated the documentation for this change?

@rajannpatel rajannpatel changed the title ci: make removed URL check aware of docs/redirects.txt make removed URL check aware of docs/redirects.txt Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant