make removed URL check aware of docs/redirects.txt#612
Conversation
|
@SecondSkoll I think you were the principal author behind this script, so I'd like to defer this one to you. |
SecondSkoll
left a comment
There was a problem hiding this comment.
Checked and validated against my own docs, works just fine.
Note: The old check was broken by the introduction of rerediraffe.
|
@jahn-junior While this might not fit our ultimate goals for rerediraffe, this fixes a broken workflow. If the script were moved to an external file, would that be a satisfactory stop-gap? |
No complaints from me. I haven't had time to look at the Python in detail, but it seems simple enough. |
SecondSkoll
left a comment
There was a problem hiding this comment.
Could you please move the Python script in the "Compare URLs" step to /docs/_dev/, and then then call it in the workflow?
Description
This PR updates the
check-removed-urls.ymlGitHub workflow to prevent false positives when a documentation page is intentionally removed or renamed, but a proper redirect has already been configured indocs/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
workflow_callInputs: decoupled the base reference variables so this workflow can be cleanly reused by other pipelines.findandsedpipeline to parse built HTML structures safely and output clean, predictable path formats.docs/redirects.txtusing the nativecsvmodule and checks all structural markdown possibilities (page.md,page/index.md, or directory-level paths) before flagging a URL as missing.Testing Instructions
docs/redirects.txt, the workflow should fail and list the unhandled URL.docs/redirects.txt, the workflow should print a green checkmark (✅ Ignored) and pass successfully.Checklist
redirects.txtCHANGELOG.mdwith relevant non-documentation file changes?