Skip to content

chore(docs): auto-replace 9 stale screenshots#17814

Open
github-actions[bot] wants to merge 6 commits into
masterfrom
docs/auto-screenshot-update-2026-05-19
Open

chore(docs): auto-replace 9 stale screenshots#17814
github-actions[bot] wants to merge 6 commits into
masterfrom
docs/auto-screenshot-update-2026-05-19

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Automated Screenshot Replacement

This PR was generated by the screenshot pipeline. It replaces 9 stale screenshots with fresh captures from the Sentry UI.

Replaced Screenshots

Asset Path Diff %
docs/product/issues/ownership-rules/img/project_settings_edit_ownership_rules.png 2.44%
docs/product/issues/ownership-rules/img/assigned_to_cog.png 6.48%
docs/product/issues/ownership-rules/img/issue_details_edit_ownership_rules.png 4.41%
docs/product/issues/ownership-rules/img/codeowners.png 8.12%
docs/product/issues/ownership-rules/img/link_stack_trace.png 28.51%
docs/product/issues/ownership-rules/img/external_team_mappings.png 5.97%
docs/product/issues/ownership-rules/img/external_user_mappings.png 5.40%
docs/product/issues/ownership-rules/img/suggested_assignees.png 5.18%
docs/product/issues/ownership-rules/img/auto-assign-issue-owner.png 6.49%

Review Checklist

  • Spot-check a few screenshots to verify they look correct
  • Verify no annotated screenshots were accidentally replaced
  • Check that alt text is still appropriate for the new captures

Notes

  • All screenshots were captured from the Sentry staging environment
  • Images were optimized before committing
  • Only screenshots marked as deterministic: true with diff below the high threshold were auto-replaced
  • Screenshots with diff above 50% or marked deterministic: false were sent to Linear for manual review

Shannon Anahata and others added 6 commits May 15, 2026 12:06
Adds a Playwright-based pipeline to detect, capture, diff, and replace
stale documentation screenshots. Includes:

Pipeline scripts:
- Inventory crawler that scans MDX files for image/Arcade references
- Screenshot capturer using Playwright against demo.sentry.io
- Pixel-level diffing with configurable thresholds
- Auto-replacer that commits changes and opens PRs
- Linear issue creator for items needing manual review

Frontmatter-based URL mapping:
- Adds sentry_ui_url to 72 MDX files linking docs to their Sentry UI pages
- URLs travel with the file, surviving directory reorganizations
- GitHub Actions workflow auto-adds the field on new PRs

Tooling:
- Auto-mapper infers URLs from doc paths + Sentry route structure
- Image optimizer compresses PNGs before committing
- Auth helper using Playwright storage state
- Lint script to catch missing sentry_ui_url

CI/CD:
- Weekly screenshot pipeline workflow (GitHub Actions)
- PR workflow to auto-inject sentry_ui_url on new docs

Validated with first live capture against demo.sentry.io.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

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

Project Deployment Actions Updated (UTC)
sentry-docs Error Error May 19, 2026 10:26pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
develop-docs Ignored Ignored Preview May 19, 2026 10:26pm

Request Review

Comment on lines +1 to +10
# Screenshot URL Mapping
#
# Maps each screenshot to the Sentry UI page it depicts.
# The capture script uses this to navigate and screenshot the correct page.
#
# Fields:
# asset_path: Path to the image file relative to repo root
# ui_page_url: Full Sentry URL. Use {org} as placeholder for the org slug.
# element_selector: CSS selector for element screenshot; null for full viewport.
# viewport: { width, height } for the browser viewport.
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.

Bug: The screenshot pipeline defaults to deterministic: true for unconfigured screenshots, causing potentially non-deterministic page captures to be auto-replaced without review.
Severity: MEDIUM

Suggested Fix

Change the default for the deterministic property to false in capture-and-diff.ts (line 107). This would ensure that any screenshot not explicitly marked as deterministic in screenshot-map.yaml will require manual review if changes are detected, preventing unsafe auto-replacements.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: scripts/screenshot-pipeline/config/screenshot-map.yaml#L1-L10

Potential issue: The screenshot pipeline defaults the `deterministic` property to `true`
for screenshots sourced from frontmatter when no explicit configuration exists in
`screenshot-map.yaml`. Since the map is empty, any screenshot with a detected change
between 1% and 50% is classified for `auto_replace` by the `classifyDiff` function. This
can cause screenshots of non-deterministic pages (e.g., those with dynamic user data or
timestamps) to be automatically updated in the repository without human review,
potentially leading to misleading documentation.

Also affects:

  • scripts/screenshot-pipeline/src/capture-and-diff.ts:97~97

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Contributor

@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 3 potential issues.

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 63a55d3. Configure here.

last_modified: lastModified,
is_stale: isStale,
ui_page_url: mapEntry?.ui_page_url ?? null,
element_selector: mapEntry?.element_selector ?? null,
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.

Include images ignore doc URL

Medium Severity

When screenshots are referenced via Include, inventory entries set ui_page_url only from screenshot-map.yaml, not from the parent MDX sentry_ui_url. Those assets can be treated as unmapped or captured against the wrong page.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 63a55d3. Configure here.

git config user.email "github-actions[bot]@users.noreply.github.com"

# Only commit the MDX files that were changed (not pipeline output)
git add 'docs/**/*.mdx' 'docs/**/*.md'
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.

PR workflow commits unrelated docs

High Severity

The frontmatter workflow injects URLs from a broad docs/product crawl, then stages every docs/**/*.mdx change. A PR that touches one page can get unrelated sentry_ui_url commits pushed to the contributor’s branch.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 63a55d3. Configure here.

console.log(`Committed: ${commitMsg}`);

// Push
execSync(`git push -u origin ${branchName}`, {cwd: repoRoot, stdio: 'pipe'});
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.

Same-day branch creation fails

Medium Severity

auto-replace.ts always runs git checkout -b docs/auto-screenshot-update-{date}. A second pipeline run the same day fails if that branch already exists on the remote, leaving replacements uncommitted.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 63a55d3. Configure here.

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.

0 participants