Skip to content

feat(screenshots): migrate to new service and delete on push#189

Open
jomifepe wants to merge 6 commits into
mainfrom
jp/acl-provider
Open

feat(screenshots): migrate to new service and delete on push#189
jomifepe wants to merge 6 commits into
mainfrom
jp/acl-provider

Conversation

@jomifepe
Copy link
Copy Markdown
Contributor

@jomifepe jomifepe commented May 26, 2026

Summary

  • Replace the legacy ACL provider with the Obelix screenshot service for variation screenshot uploads (slice add-variation, slice edit-variation)
  • Use presigned POST credentials from GET /screenshot/presigned-url and align S3 keys with the new service: {repo}/shared-slices/{sliceId}/{variationId}/{sha1}{ext} (SHA1 digest, dot-separated extension)
  • Call POST /screenshot/delete during prismic push when remote slices are removed, matching editor behavior (failures are logged as warnings so the slice delete still completes)
  • Improve custom type deletion on push with clearer errors when associated documents block deletion, including links to the type builder and filtered document list

Closes #145

Test plan

  • CI passes
  • E2E: slice-add-variation and slice-edit-variation screenshot uploads
  • E2E: push.serial.test.ts — push deletes a remote slice and cleans up its screenshot files (uses test/fixtures/slice-screenshot.png)
  • Manual smoke test with --screenshot on a local PNG

Made with Cursor


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.


Note

Medium Risk
Swaps presigned-upload and storage-key logic (new host and SHA1 keys) and adds best-effort screenshot deletion during push, which could leave orphaned files if the delete API fails.

Overview
Slice variation screenshot uploads now use the internal screenshot service (api.internal…/screenshot/) instead of acl-provider: presigned POST credentials come from presigned-url, and object keys use a SHA1 content hash (replacing MD5) under {repo}/shared-slices/{sliceId}/{variationId}/….

prismic push calls deleteScreenshots after each remote slice removal (failures are logged as warnings so the slice delete still completes). Serial E2E coverage uploads a screenshot, pushes a local slice delete with --force, and asserts both the slice and its screenshot keys are gone.

Reviewed by Cursor Bugbot for commit 221666d. Bugbot is set up for automated code reviews on this repo. Configure here.

@jomifepe jomifepe self-assigned this May 26, 2026
@jomifepe jomifepe changed the title Migrate slice screenshot upload to Obelix screenshot service feat: migrate acl-provider to screenshot service May 26, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f6edcbd. Configure here.

Comment thread src/clients/custom-types.ts Outdated
jomifepe and others added 2 commits May 26, 2026 11:14
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

const extension = SUPPORTED_IMAGE_MIME_TYPES[type];
const digest = createHash("md5")
const digest = createHash("sha1")
Copy link
Copy Markdown
Contributor Author

@jomifepe jomifepe May 26, 2026

Choose a reason for hiding this comment

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

This is to match Type Builder (md5 is not native to web), not critical, but not harmful.

@jomifepe jomifepe changed the title feat: migrate acl-provider to screenshot service feat: migrate to screenshot service and delete on push May 27, 2026
@jomifepe jomifepe changed the title feat: migrate to screenshot service and delete on push feat(slice-screenshots): migrate to new service and delete on push May 27, 2026
@jomifepe jomifepe changed the title feat(slice-screenshots): migrate to new service and delete on push feat(screenshots): migrate to new service and delete on push May 27, 2026
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.

Migrate slice screenshot upload from ACL provider to Obelix screenshot service

1 participant