Organize dirty work: codex/dependency-reproducibility - #1329
Conversation
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in:27 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (17)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:331e355f36
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const signed = await supabase.storage | ||
| .from(env.SUPABASE_IMAGE_BUCKET) | ||
| .createSignedUrl(image.storage_path, signedUrlTtlSeconds); | ||
| .createSignedUrl(image.storage_path, signedUrlTtlSeconds, { transform }); |
There was a problem hiding this comment.
Preserve no-transform signed URL calls
When w is omitted—as it is for every existing SignedImage caller—this now passes { transform: undefined } as a third argument. The existing private-access route tests at lines 1117, 1147, and 1176 assert the established two-argument call, so the required unit suite fails for ordinary image requests. Only supply the options argument when a transform exists, or deliberately update and test the changed contract.
Useful? React with 👍 / 👎.
| const { searchParams } = new URL(request.url); | ||
| const widthParam = searchParams.get("w"); | ||
| const transform = widthParam | ||
| ? { width: parseInt(widthParam, 10), resize: "contain" as const } | ||
| : undefined; |
There was a problem hiding this comment.
Reject invalid image transform widths
For requests such as ?w=abc, ?w=-1, or an extremely large width, parseInt produces NaN, a negative value, or an unbounded resize request and forwards it to storage. This can turn malformed client input into a provider error/500 and permits unnecessary transformation work; validate w as a bounded positive integer and return a 4xx response before calling storage.
Useful? React with 👍 / 👎.
| thumbnail = false, | ||
| placeholderBase64, |
There was a problem hiding this comment.
Wire optimized previews into image callers
For every normal document or evidence image, both new props remain at these defaults: the repository's SignedImage callers pass neither thumbnail nor placeholderBase64, and document-detail.ts deletes image metadata without projecting placeholder_base64. Consequently no caller requests ?w=400 or renders the generated LQIP, while ingestion still pays to generate and store it; project the placeholder into the image payload and enable thumbnails at the preview call sites.
Useful? React with 👍 / 👎.
BigSimmo
commented
Jul 28, 2026
@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. After fixing or dispositioning a thread, reply in that thread with as the first line, followed by a concise summary; that marker authorizes the workflow to close that exact thread. If human input or new authorization is required, do not use the marker and leave the thread open with the blocker. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:331e355f36
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const signed = await supabase.storage | ||
| .from(env.SUPABASE_IMAGE_BUCKET) | ||
| .createSignedUrl(image.storage_path, signedUrlTtlSeconds); | ||
| .createSignedUrl(image.storage_path, signedUrlTtlSeconds, { transform }); |
There was a problem hiding this comment.
Update signed-URL assertions for the options argument
For every existing request without ?w, this now records a third { transform: undefined } argument on the storage mock, while the ownership/public cases in tests/private-access-routes.test.ts lines 1117, 1147, and 1176 still require exact two-argument calls. Those focused tests will therefore fail and block the required unit gate. Either omit the options argument when no transform is requested or update the assertions and add a transformed-request case; npm test -- tests/private-access-routes.test.ts is the smallest proof.
Useful? React with 👍 / 👎.
CI triageCI failed on this PR. Automated classification of the 4 failed job(s):
Compared with main CI run #6289 (success). Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:039d719e76
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .toBuffer(); | ||
| placeholderBase64 = `data:image/webp;base64,${placeholderBuffer.toString("base64")}`; | ||
| } catch (e) { | ||
| console.warn(`Failed to generate placeholder for ${image.path}`, e); |
There was a problem hiding this comment.
Sanitize placeholder-generation errors before logging
When Sharp rejects a malformed or unsupported extracted image, this logs both the full temporary image path and the raw exception, including its stack, bypassing the worker's established safeErrorLogDetails redaction used for other ingestion failures. This can expose filesystem details in production worker logs; log a generic message with safeErrorLogDetails(e) instead, and extend tests/worker-safe-logging.test.ts to reject raw placeholder errors.
Useful? React with 👍 / 👎.
| console.log(`Optimized: ${file}`); | ||
| } catch (err) { | ||
| console.error(`Failed to optimize ${file}:`, err); |
There was a problem hiding this comment.
Propagate image optimization failures
When any PNG is corrupt, unreadable, or unsupported by one encoder, this catch logs the error but lets the command continue to print Successfully generated variants and exit 0, potentially leaving only one of the WebP/AVIF outputs. Automation or a developer therefore cannot distinguish a complete optimization from partial failure; collect failures and set a nonzero exit code, with a corrupt-PNG fixture as the smallest proof.
Useful? React with 👍 / 👎.
This PR organizes local dirty work for branch codex/dependency-reproducibility.