Skip to content

fix(site): add missing OG image for /compute page#7940

Merged
ankur-arch merged 2 commits into
mainfrom
pages-patch
Jun 11, 2026
Merged

fix(site): add missing OG image for /compute page#7940
ankur-arch merged 2 commits into
mainfrom
pages-patch

Conversation

@ankur-arch

@ankur-arch ankur-arch commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Problem

The /compute page metadata references /og/og-compute.png, but that file was never committed to public/og/, so the OG image 404s in production (verified: https://www.prisma.io/og/og-compute.png returns 404). /postgres and /orm were checked as well — their static OG images exist and work correctly.

Fix

Reuse the designed meta image from the Launching Prisma Compute in Public Beta blog post (apps/blog/public/launching-prisma-compute-public-beta/imgs/meta.png) as apps/site/public/og/og-compute.png, served as a static file like the other product pages. It's 1200×630, matching the dimensions declared in the page metadata.

No code changes — the page already points at this URL.

🤖 Generated with Claude Code

The compute page metadata references /og/og-compute.png, but the file
was never committed, so the OG image 404s in production. Serve it from
a route handler that renders the image at build time, and extract the
OG template shared with the blog OG route into src/lib/og-image.tsx.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Jun 11, 2026 9:52am
docs Ready Ready Preview, Comment Jun 11, 2026 9:52am
eclipse Ready Ready Preview, Comment Jun 11, 2026 9:52am
site Ready Ready Preview, Comment Jun 11, 2026 9:52am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR consolidates OG image generation into a reusable library. A new og-image.tsx module exports createOGImageResponse, which handles React component rendering, Google font loading with caching, and ImageResponse creation. The existing image.png route is refactored to use this library, and a new og-compute.png route is added with Compute-specific messaging.

Changes

OG Image Library and Route Integration

Layer / File(s) Summary
OG image types and infrastructure setup
apps/site/src/lib/og-image.tsx
Module setup defines color/layout constants, the PrismaLogo SVG component, font configuration, a typed font cache, and the OGImageContent contract (badge/title/description/footer) that routes pass to the library.
OG image component, font loading, and export
apps/site/src/lib/og-image.tsx
PrismaOGImage renders badge/title/description/footer with responsive font sizing; loadGoogleFont and getFonts fetch and cache Google Fonts at runtime; createOGImageResponse awaits fonts and returns an ImageResponse configured for 1200x630 output.
OG image route handlers
apps/site/src/app/og/image.png/route.tsx, apps/site/src/app/og/og-compute.png/route.tsx
image.png/route refactored to delegate OG generation to createOGImageResponse (removing inline markup and font logic); og-compute.png/route newly added, calling createOGImageResponse with Compute-specific content (badge "Prisma Compute", Bun deployment title, Postgres description).

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically identifies the main change: adding the missing OG image route for the /compute page.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Replace the generated OG route with the designed meta image from the
launching-prisma-compute-public-beta blog post, served as a static
file from public/og/ like the other product pages.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@argos-ci

argos-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Jun 11, 2026, 10:04 AM

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/site/src/app/og/image.png/route.tsx`:
- Line 3: The route currently exports revalidate = false but isn’t opting into
static generation; update the OG image route by adding export const dynamic =
"force-static" (next to the existing export const revalidate) in
apps/site/src/app/og/image.png/route.tsx so the GET handler is forced to be
statically generated/cached—place the new export at the module top so Next.js
picks it up for this route.

In `@apps/site/src/lib/og-image.tsx`:
- Around line 146-155: In loadGoogleFont, add bounded timeouts and ok-checks for
both outbound fetches: use AbortSignal.timeout(...) when calling fetch for the
CSS URL and when fetching the resource URL, verify response.ok (or
response.status in the 200 range) before calling response.text() or
response.arrayBuffer(), and bail out (return null or throw a clear error)
immediately on non-2xx or aborted responses; update the calls in loadGoogleFont
in both route.tsx files so the CSS fetch uses the AbortSignal.timeout and checks
ok before extracting text, and the resource fetch does the same before calling
arrayBuffer().
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e8ce98dc-e4f8-4f18-8f4e-f747815372b6

📥 Commits

Reviewing files that changed from the base of the PR and between ce96f10 and 372ab51.

📒 Files selected for processing (3)
  • apps/site/src/app/og/image.png/route.tsx
  • apps/site/src/app/og/og-compute.png/route.tsx
  • apps/site/src/lib/og-image.tsx

Comment thread apps/site/src/app/og/image.png/route.tsx
Comment thread apps/site/src/lib/og-image.tsx Outdated
@ankur-arch ankur-arch merged commit 0ef6b0c into main Jun 11, 2026
13 checks passed
@ankur-arch ankur-arch deleted the pages-patch branch June 11, 2026 10:04
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