Repository navigation
fix(docs): resolve broken doc links and add automated markdown link checker CI - #8437
rushikeshgarad2024-dev wants to merge 2 commits into
Conversation
…hecker CI - Fix broken relative links in GHOST_IN_THE_MACHINE.md template - Update broken bcos documentation URL in .github/actions/bcos-scan/README.md - Update Intel processor specs link in CPU_ANTIQUITY_SYSTEM.md - Add automated markdown link checker script tools/check_markdown_links.py - Add GitHub Actions CI workflow .github/workflows/link-checker.yml Resolves Scottcjn/rustchain-bounties#16248 Closes Scottcjn#7910, Scottcjn#7908, Scottcjn#7886, Scottcjn#7885, Scottcjn#7792
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
Cid-oe
left a comment
There was a problem hiding this comment.
Peer Code Review (Bounty #2782)
• Observation 1 (Shebang Placement): In tools/check_markdown_links.py, lines 1-3 configure stdout encoding before the shebang #!/usr/bin/env python3 on line 4. On POSIX environments when executed directly as a script (e.g. ./tools/check_markdown_links.py), the kernel requires the shebang to strictly occupy line 1; otherwise, it executes using the default shell (/bin/sh) and triggers syntax errors. Recommend moving #!/usr/bin/env python3 to line 1.
• Observation 2 (Directory Globbing & Performance): In check_markdown_links(), using list(ROOT.glob("*.md")) + list(ROOT.glob(".github/**/*.md")) + list(ROOT.glob("docs/**/*.md")) misses nested markdown files in subdirectories such as node/ or benches/. Consider using ROOT.rglob("*.md") while filtering out target/, .git/, and node_modules/.
• Observation 3 (CI Integration): Clean GitHub Actions integration in .github/workflows/link-checker.yml properly hooks into PRs and push events on main branches with zero external pip dependencies.
Scottcjn
left a comment
There was a problem hiding this comment.
Solid work, @rushikeshgarad2024-dev. The 3 dead links are fixed (rustchain.org/bcos/ really is 404). The checker is stdlib-only, passes on your branch (1,338 links / 239 files), and exits 1 when I injected a broken link. Three small fixes before merge:
- Add
permissions: contents: readto.github/workflows/link-checker.yml, so the workflow's token is least-privilege. - Move the shebang to line 1 of
tools/check_markdown_links.py(it's currently after code on line 4). - Ideally widen the scan from root/.github/docs (239 of 598 .md files) to
**/*.md, excluding vendored paths.
Note: the CI test job is red on every Rustchain PR right now for an unrelated reason (fixed in #8467), so that red check isn't on you. Once these are in: 5 RTC per #16248.
|
Review (2026-11-06): the three doc-link fixes are good. The new workflow and |
Move the shebang to line 1, grant contents: read, and scan every tracked markdown file with vendored trees excluded. Placeholder and template link targets are skipped.
|
All three review points are addressed in b9292af:
Local run: 1,793 links across 598 markdown files, all relative links resolve. |
|
This PR has been inactive for 21 days. It will be closed in 14 days unless updated. |
Summary of Changes
This pull request addresses broken links across documentation and introduces an automated Markdown link integrity check workflow to prevent future link regressions.
Resolved Issues & Fixes:
GHOST_IN_THE_MACHINE.md: Removed dead relative link placeholders to non-existent./evidence/paths in the template format..github/actions/bcos-scan/README.md: Updated deadhttps://rustchain.org/bcos/documentation URL to officialhttps://rustchain.org.CPU_ANTIQUITY_SYSTEM.md: Updated obsolete Intel processor spec link to active official documentation.tools/check_markdown_links.pyto scan all repository Markdown files for invalid relative link targets and anchors..github/workflows/link-checker.ymlto ensure continuous link validation on all pull requests and pushes.Closes #7910, #7908, #7886, #7885, #7792
Bounty: Scottcjn/rustchain-bounties#16248
Wallet Registration: Scottcjn/rustchain-bounties#16973 (GC5U46IS25KYFKNHDXEHR3KTQB3DVIBM4NW5BH4MVUE2G77STCJP4IHF)