Fix docs hook link rewriting regression for non-sibling paths#710
Fix docs hook link rewriting regression for non-sibling paths#710github-actions[bot] wants to merge 2 commits intomainfrom
Conversation
Restrict README link rewrites in docs/hooks.py to markdown links that target sibling workflow README/directory paths, preserving broader relative links such as ../../docs/workflows/... Add regression tests for sibling rewrites and non-sibling preservation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughRefactored link-rewriting logic in docs/hooks.py by extracting targeted sibling workflow link transformations into a new helper function 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
Summary
This PR fixes issue #708 by tightening link rewriting in
docs/hooks.pyso only sibling workflow links are rewritten.What changed
_rewrite_sibling_workflow_links(readme: str)to rewrite only markdown links with these targets:../(workflow)/README.md->(workflow).md../(workflow)/->(workflow).md_generate_page(...)with this scoped rewrite helper.tests/test_docs_hooks.py:../../docs/workflows/detector-fixer-chaining.mdWhy
The previous regex-based rewrites could corrupt valid non-sibling relative links (for example producing malformed paths like
../docs.mdworkflows/...). This broke generated documentation links for workflow guidance.Validation
/tmp/gh-aw/agent/venv/bin/python -m pytest -q35 passedFixes #708.
What is this? | From workflow: Trigger Test Coverage Detector
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.