Skip to content

fix(confluence): say why an image is not in the bundle, as rw serve does - #1341

Merged
yumike merged 1 commit into
mainfrom
fix/confluence-misspelled-image-hint
Oct 29, 2026
Merged

yumike merged 1 commit into
mainfrom
fix/confluence-misspelled-image-hint

Conversation

@yumike

@yumike yumike commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up from the case-sensitive paths spec's "Later" list (#1326 review).

rw confluence render dropped a missing, too large or wrong-case image from the bundle with the generic "attachment '…' is not in the bundle; upload it to the page yourself", because ImageNames::image_src used read_file(...).ok(). When that read fails, it now asks Storage::find_file why and the render warns with MissingFile's Display, the same text rw serve prints:

warning: image `docs/img/Logo.PNG` not found; the file on disk is `docs/img/logo.png`
  • The reason is keyed by the attachment name the page references (the basename rule moved from ConfluenceBackend::image into attachment_filename, shared by both), so an image in a dropped title H1 still warns about nothing. Two missing files with one basename each get their own warning.
  • The generic warning stays where it fits: --out - and a markdown file outside the project (no bundle storage), a resolver refusal (outside the project, unsupported type) that already warned on its own, and a read that failed while find_file finds the file.
  • --strict fails on the new warnings, as on the old one.
  • docs/confluence.md describes both warnings. No CHANGELOG entry: image bundling is unreleased, and its existing entry links the docs.

Validation

  • New unit tests in rw-confluence renderer.rs: missing images via MockStorage (every OS), and a misspelled image via a small Storage stub returning MissingFile::Misspelled (every OS).
  • New CLI tests: render_strict_fails_on_a_missing_image (every OS) and render_strict_fails_on_a_misspelled_image, which probes the temp dir's case sensitivity and expects the hint on macOS/Windows, plain "not found" on Linux. Both pass --strict and assert exit 1.
  • Updated expectations: render_does_not_bundle_a_file_storage_refuses (escape/env symlinks now "not found", the huge file "is larger than 32 MiB") and render_leaves_images_it_cannot_bundle_to_the_publisher (the missing image).
  • make test, make lint, make format pass on macOS (case-insensitive APFS).

🤖 Generated with Claude Code

A missing, too large or wrong-case image warned only that the attachment
is not in the bundle. The render now asks storage why, as rw serve does,
and a wrong-case path names the file on disk. Without a bundle, or for a
markdown file outside the project, the generic warning stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codspeed

codspeed Bot commented Oct 29, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 2 untouched benchmarks
⏩ 11 skipped benchmarks1


Comparing fix/confluence-misspelled-image-hint (00eba7b) with main (7b7c250)2

Open in CodSpeed

Footnotes

  1. 11 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (508d6bc) during the generation of this report, so 7b7c250 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@yumike
yumike merged commit e648dac into main Oct 29, 2026
30 checks passed
@yumike
yumike deleted the fix/confluence-misspelled-image-hint branch October 29, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant