fix(docs): fail the build on a product image with a rooted path - #1431
Conversation
A target starting with / passed through before the image check, so a page showing /images/x.png shipped a link nothing serves. A site path stays a valid link; as an image it is now the same build error as any other file that is not under images/.
|
Change classification: normal — platform or application code changed. A normal change carries a documented automated review on this pull request before merge, in place of a second human approver. The |
|
@claude please review this PR |
|
Claude finished @jfrench9's task in 44s —— View job Review: fix(docs): fail the build on a product image with a rooted path
Verdict: LGTM. Small, correct, well-tested fix. The change ( if target.startswith(("http://", "https://", "mailto:", "#")):
return match.group(0)
# A site path is a fine link and a broken image: nothing serves it.
if target.startswith("/") and not bang:
return match.group(0)
if bang:
if target not in (media or {}):
...Previously
Tests ( No issues found. The PR body's own testing notes (36 tests passed, |
Summary
Follow-up to #1430, from its automated review. A product page image written with a rooted path, like
, skipped the image check and shipped a link nothing serves. It now fails the build like any other image that isn't a file under the site'simages/folder.Changes
robosystems/scripts/publish_docs.py:rewrite_product_linksstill passes a site path through untouched when it's a link ([pricing](/pricing)), but no longer when it's an image. A rooted image falls through to the existing check and is reported asimage must be a file under images/ that exists.tests/scripts/test_publish_docs.py: the missing-image test also covers a rooted image, and checks that a rooted link still passes.None of the published pages use a rooted image path, so the published output is unchanged.
Breaking Changes
None.
Testing
uv run pytest tests/scripts/test_publish_docs.py tests/scripts/test_product_docs.py: 36 passed.just docs-build: 54 pages, 63 files, no warnings or errors.just test-allunit suite was not run.Certification
🤖 Generated with Claude Code