Repository navigation
fix(docs): keep screenshots versioned docs still link - #7694
Conversation
The docs sync prunes every image in static/img/android/docs/ that no current page references. Frozen Docusaurus snapshots under versioned_docs/ link the same files, so a screenshot dropped from the app breaks the site build: meshtastic/meshtastic#2728 fails on three images the 2.7 snapshot still uses. Skip pruning any image a versioned_docs/ page links.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: meshtastic/Meshtastic-Android/.coderabbit.yaml
- Review profile: CHILL
- Plan: Advanced
- Run ID:
17432aba-283f-4673-9360-6275e83fa460
📒 Files selected for processing: 1
scripts/sync-android-docs.js
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
A link such as /img/android/docs/old.webp?v=2 was recorded as old.webp?v=2, so it never matched the file and the image was pruned anyway. Strip any ?query or #fragment before taking the basename.
Fixes #7695
The docs sync deletes every screenshot in
static/img/android/docs/that no current page references, but the frozen Docusaurus snapshots underversioned_docs/link the same files. When the app drops a screenshot, the site build fails: meshtastic/meshtastic#2728 is red becausenodes_node_list.webp,settings_password_field.webpandfirmware_disclaimer.webpwere pruned while the 2.7 snapshot still uses them.🐛 Bug Fixes
sync-android-docs.jsscansversioned_docs/**/*.md(x)for/img/android/docs/links and skips pruning those images, logging each one it keeps. Current pages are unaffected: an image stays only as a file, never as a link.Testing Performed
The script has no automated tests. Both scripts were run against a fresh checkout of
meshtastic/meshtasticmasterwith--convert-webp, sourcing docs from this branch:versioned_docs/version-2.7links: the three in docs: sync latest Android app documentation meshtastic#2728 and alsoconnections_empty_state.webp./img/android/docs/image thatversioned_docs/links still existed afterwards.The docs-site build was not run.
The docs repo's sync workflow runs this script from the latest Android release, so this fix takes effect on the first sync after it ships in a release.
Summary by CodeRabbit