Skip to content

fix(media): run thumbnail regeneration tests in CI and cap rebuild pixels - #9198

Merged
johnmatthewtennant merged 6 commits into
mainfrom
jtennant/simone/thumb-regen-followup
Nov 12, 2026
Merged

johnmatthewtennant merged 6 commits into
mainfrom
jtennant/simone/thumb-regen-followup

Conversation

@johnmatthewtennant

@johnmatthewtennant johnmatthewtennant commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two gaps in the thumbnail regeneration from #9174:

  • Its MinIO tests never ran in CI. api::media::tests::postgres_tests::external_infra_minio_tests is excluded from the PostgreSQL lane, which skips external_infra* modules, and the backend integration job's only media MinIO step selects the admin tests. A sibling step now runs them against the same Postgres and MinIO.
  • Rebuilding a thumbnail skipped the 25 MP pixel cap. Upload validation rejects images over 25 megapixels before they reach the decoder. A thumbnail rebuilt from a stored original goes straight to generate_image_metadata_sync, so that cap didn't apply. The check is now a shared check_image_pixels that upload validation and thumbnail generation both run before decoding. On a rebuild, an oversized original gets the same 404 as any other regeneration failure.

Related issue

Follow-up to #9174, from its review.

Testing

  • missing_thumbnail_is_not_regenerated_when_unsafe now stores a valid 5001x5000 PNG as an image original without thumbnails and requests one through the media route. On main the relay rebuilds and serves it; with this change the request is a 404 and no thumbnail is written.
  • The new CI step runs both external_infra_minio_tests cases one at a time, since they share the fixture image's storage keys.

🤖 Generated with Claude Code

johnmatthewtennant and others added 6 commits November 6, 2026 15:21
The external_infra_minio_tests in api::media are excluded from the PostgreSQL lane and no MinIO step selected them, so they never ran in CI.

Co-authored-by: Simone <0828be588d5c9c4d092c5b1cf01761d5aef63d6b104807fd8e8284d517dd1a99@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <[email protected]>
Thumbnails rebuilt from a stored original skip upload validation, so the decoder could see an image over the upload-time pixel cap. Thumbnail generation now runs the same check before decoding.

Co-authored-by: Simone <0828be588d5c9c4d092c5b1cf01761d5aef63d6b104807fd8e8284d517dd1a99@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <[email protected]>
A missing thumbnail of a stored 5001x5000 original stays a 404 and
writes nothing.

Signed-off-by: John Tennant <[email protected]>
Co-authored-by: Simone <0828be588d5c9c4d092c5b1cf01761d5aef63d6b104807fd8e8284d517dd1a99@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
They share one fixture image's storage keys, and nextest runs each in
its own process, where their in-process lock can't order them.

Signed-off-by: John Tennant <[email protected]>
Co-authored-by: Simone <0828be588d5c9c4d092c5b1cf01761d5aef63d6b104807fd8e8284d517dd1a99@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Overwriting the shared fixture image's original broke the hash-at-key
invariant for any test reading it concurrently. The non-image case
shares the same helper.

Signed-off-by: John Tennant <[email protected]>
Co-authored-by: Simone <0828be588d5c9c4d092c5b1cf01761d5aef63d6b104807fd8e8284d517dd1a99@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
No CI lane runs buzz-media's thumbnail unit tests, while the relay MinIO
case covers the same cap through the media route and now runs in CI.

Signed-off-by: John Tennant <[email protected]>
Co-authored-by: Simone <0828be588d5c9c4d092c5b1cf01761d5aef63d6b104807fd8e8284d517dd1a99@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@johnmatthewtennant
johnmatthewtennant force-pushed the jtennant/simone/thumb-regen-followup branch from 7dba887 to bae11ca Compare November 6, 2026 20:21
@johnmatthewtennant
johnmatthewtennant marked this pull request as ready for review November 6, 2026 20:59
@johnmatthewtennant
johnmatthewtennant requested a review from a team as a code owner November 6, 2026 20:59
@github-actions github-actions Bot added the codex-security-review-current The posted Codex security review matches its recorded range. label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Note: This is an automated, security-focused review generated by Codex.
Use it as a supplement to human review; false positives are possible.

Scope

  • Exact PR diff: 597a8d1970301ffbd089194d3f849da9d9b21489...bae11caf0b3d298e7abc9487d1a0376488b9f39f
  • Model: gpt-6.1-sol

💡 Click "edited" above to see earlier reviews for this PR.


Review Summary

Overall Risk: NONE

No concrete security, correctness, or reliability issues found in the authorized PR range. The shared thumbnail generator now applies the existing pixel limit before decoding stored originals.

Findings

No concrete security, correctness, or reliability findings were identified.

Notes

  • Review used read-only source and history inspection. Builds and tests were not executed, as instructed.

Generated by Codex Security Review |
Requested by: @johnmatthewtennant |
Workflow run

@kazemek21 kazemek21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Kyle reviewed this PR and the Nexus review-tracker notes. Approved.

Posted by Codex (gpt-6.1-sol) on behalf of kylez

@johnmatthewtennant
johnmatthewtennant merged commit 432df8a into main Nov 12, 2026
108 checks passed
@johnmatthewtennant
johnmatthewtennant deleted the jtennant/simone/thumb-regen-followup branch November 12, 2026 22:01
ravarora2 added a commit that referenced this pull request Nov 12, 2026
…small

* origin/main:
  perf(acp): reduce observer CPU and lock overhead (#9381)
  ci: fix main — stale RunCause call sites and Playwright on ubuntu-26.04 (#9418)
  fix(mobile): keep shortcut taps and the member picker from wedging (#9388)
  fix(mobile/ios): close notification code blocks only at line-ending fences (#9349)
  fix(media): run thumbnail regeneration tests in CI and cap rebuild pixels (#9198)
  fix(mobile): never show emoji shortcodes in reaction pills (#9411)
  fix(mobile): isolate channel header scroll rebuilds (#9400)

Signed-off-by: Ravneet Arora <[email protected]>

This branch was previously deployed

1 inactive deployment
codex-review — bae11caf Deployed Nov 6, 2026 by johnmatthewtennant via Run Codex Security Review #13645
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex-security-review-current The posted Codex security review matches its recorded range.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants