Skip to content

docs(snapshots): Correct ImageMetadata CLI-managed fields list#3277

Merged
runningcode merged 1 commit intomasterfrom
no/fix-snapshots-image-metadata-doc
Apr 23, 2026
Merged

docs(snapshots): Correct ImageMetadata CLI-managed fields list#3277
runningcode merged 1 commit intomasterfrom
no/fix-snapshots-image-metadata-doc

Conversation

@runningcode
Copy link
Copy Markdown
Contributor

Summary

  • The doc comment on ImageMetadata listed image_file_name as a CLI-managed override, but no such field is written by the CLI.
  • ImageMetadata::new only sets width and height; the Sentry backend derives image_file_name from the manifest map key, not from a metadata field.
  • Updates the comment to match reality.

🤖 Generated with Claude Code

The doc comment listed `image_file_name` as a CLI-managed override, but
no such field is written by the CLI. Only `width` and `height` are set
by `ImageMetadata::new`. The backend derives `image_file_name` from the
manifest map key, not from a metadata field.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@runningcode runningcode requested review from a team as code owners April 22, 2026 12:26
Copy link
Copy Markdown

@cameroncooke cameroncooke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I've confirmed image_file_name is not used. LGTM!

@cameroncooke
Copy link
Copy Markdown

Claude backs this up:

The sentry-cli pairs a sidecar JSON with an image purely by filename-stem match in the same directory — button.png loads button.json via image_path.with_extension("json"), so image_file_name is not needed (and can't be used) to match JSON to images (sentry-cli/src/commands/build/snapshots.rs). The server-side typed sidecar shape is ImageMetadata with display_name, group, content_hash, width, height plus extra = "allow" for arbitrary passthrough keys (manifest.py), but the CLI overwrites content_hash, width, and height before upload, which leaves only display_name and group as genuinely user-settable sidecar fields (confirmed by the JS fixture snapshot-image-metadata.ts); image_file_name is actually the key of the manifest images dict (the image's relative path), and the GET response explicitly rebuilds it from that key while stripping any image_file_name you smuggled through the sidecar's extras (preprod_artifact_snapshot.py, comparison_categorizer.py, and see the CLI's own note in snapshots.rs data types).

@runningcode runningcode merged commit 342be6c into master Apr 23, 2026
26 checks passed
@runningcode runningcode deleted the no/fix-snapshots-image-metadata-doc branch April 23, 2026 15:24
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.

4 participants