chore(docs): auto-replace 9 stale screenshots#17814
chore(docs): auto-replace 9 stale screenshots#17814github-actions[bot] wants to merge 6 commits into
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
| # 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ 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, |
There was a problem hiding this comment.
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.
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' |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 63a55d3. Configure here.
| console.log(`Committed: ${commitMsg}`); | ||
|
|
||
| // Push | ||
| execSync(`git push -u origin ${branchName}`, {cwd: repoRoot, stdio: 'pipe'}); |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 63a55d3. Configure here.


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
docs/product/issues/ownership-rules/img/project_settings_edit_ownership_rules.pngdocs/product/issues/ownership-rules/img/assigned_to_cog.pngdocs/product/issues/ownership-rules/img/issue_details_edit_ownership_rules.pngdocs/product/issues/ownership-rules/img/codeowners.pngdocs/product/issues/ownership-rules/img/link_stack_trace.pngdocs/product/issues/ownership-rules/img/external_team_mappings.pngdocs/product/issues/ownership-rules/img/external_user_mappings.pngdocs/product/issues/ownership-rules/img/suggested_assignees.pngdocs/product/issues/ownership-rules/img/auto-assign-issue-owner.pngReview Checklist
Notes
deterministic: truewith diff below the high threshold were auto-replaceddeterministic: falsewere sent to Linear for manual review