Skip to content

Add StackBlitz-powered bug reproduction workflow - #8809

Open
joshblack wants to merge 2 commits into
mainfrom
copilot/stackblitz-bug-reproductions
Open

joshblack wants to merge 2 commits into
mainfrom
copilot/stackblitz-bug-reproductions

Conversation

@joshblack

@joshblack joshblack commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Adds an agentic workflow for newly opened bugs and issues subsequently labeled bug. It submits a minimal example through StackBlitz's HTML form interface, verifies the reported behavior and a one-variable control in the preview, and posts only useful, evidence-backed findings. Screenshots are included only when the issue and its comments do not already contain media.

StackBlitz-generated projects are not persisted without an account, so a trusted safe-output job preserves the verified files on an isolated reproductions/bug-ISSUE-RUN branch and generates a commit-pinned StackBlitz GitHub-import link. No StackBlitz SDK, API credentials, or account is used. Publication is gated on successful threat detection, rechecks the issue, and never changes main.

Live StackBlitz verification was blocked by this session's browser network policy; the workflow's hosted form/preview flow still needs a first-run check. The starter and form were exercised locally.

Changelog

New

  • Bug reproduction workflow and generated lockfile, with bounded investigation and guarded publication.
  • Runnable examples/stackblitz starter, form generator, publication helpers, focused regression tests, and contributor guidance.

Changed

  • Bug reports link to the new StackBlitz starter alongside CodeSandbox.
  • CI runs reproduction-tooling tests before the React 19 manifest rewrite; root TypeScript permits native .ts imports.

Removed

Rollout strategy

  • No rollout required — Infrastructure, examples, and contributor tooling only; no published package behavior changes.

Testing & Reviewing

Review the form-only StackBlitz flow and isolated publication boundary. For the first hosted run, check a reproducible public bug, an issue with existing media, and an inconclusive report: expect a durable reproduction link, no duplicate screenshot, and no speculative comment respectively.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@joshblack
joshblack requested a review from a team as a code owner November 20, 2026 04:48
@joshblack
joshblack requested review from tay1orjones and a balanced review from Copilot November 20, 2026 04:48
@changeset-bot

changeset-bot Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 98a2434

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@joshblack joshblack added the skip changeset This change does not need a changelog label Nov 20, 2026 — with Copilot SWE Agent

Copilot AI 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.

🟡 Changes recommended

The media check misses reference-style Markdown images with extensionless URLs, causing a supplied screenshot to be published even when the report already contains an image.

1 open issue
What changed in this PR

Adds a StackBlitz-based workflow for reproducing public Primer React bugs and preserving verified examples without changing published packages.

Changes:

  • Adds bounded browser investigation and guarded publication of commit-pinned reproductions.
  • Provides a runnable starter, form-generation and publication helpers, and regression tests.
  • Integrates tooling tests into CI and documents the workflow for contributors.
File Description
tsconfig.json Allows native .ts imports in tooling.
script/​publish-bug-reproduction.ts Validates and publishes reproduction files and comments.
script/​publish-bug-reproduction.test.mts Tests publication guards, limits, and media handling.
script/​create-stackblitz-reproduction.ts Generates submission forms and reproduction bundles.
script/​create-stackblitz-reproduction.test.mts Tests form contents, escaping, and validation.
package.json Adds the reproduction-tooling test command.
package-lock.json Records the starter workspace and dependencies.
examples/​stackblitz/​vite.config.ts Configures Vite with React support.
examples/​stackblitz/​tsconfig.json Configures starter TypeScript checks.
examples/​stackblitz/​src/​main.tsx Initializes React with Primer providers.
examples/​stackblitz/​src/​App.tsx Supplies a minimal Primer example.
examples/​stackblitz/​package.json Pins starter dependencies and defines commands.
examples/​stackblitz/​index.html Provides the starter HTML entry point.
contributor-docs/​bug-reproductions.md Documents reproduction and publication behavior.
.github/​workflows/​reproduce-bug.md Defines investigation instructions and publication safeguards.
.github/​workflows/​reproduce-bug.lock.yml Adds the compiled agentic workflow.
.github/​workflows/​ci.yml Runs tooling tests before the React 19 rewrite.
.github/​ISSUE_TEMPLATE/​bug_report.yml Links reporters to the StackBlitz starter.

Review effort: Balanced

return {status: 'skipped'}
}
const hasMedia = [issue.body, ...comments.map(comment => comment.body)].some(text =>
/!\[[^\]]*\]\(|<(?:img|video)\b|https?:\/\/[^\s)>]*(?:user-attachments\/|assets\/|\.(?:png|jpe?g|gif|webp|mp4|webm|mov)(?:[?#\s)]|$))/i.test(

@joshblack joshblack left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@copilot add support for workflow_dispatch on a specific issue for debugging. This manual dispatch should also have a checkbox to enable every behavior (e.g. comments, opening a PR, etc) instead of just a dry-run. Let's also make update the bug template to set the issue type to bug and update the corresponding events.

Do not put the bug-reproductions.md file in contributor-docs, instead turn it into a skill. Let's have a bug skill with a reproduction section. It should also detail how to capture this in an issue comment or description with stackblitz through the shared script.

For stackblitz itself, can we just put the form in the issue comment or no? Making a whole html page is strange for this use-case

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copilot AI commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

@copilot add support for workflow_dispatch on a specific issue for debugging. This manual dispatch should also have a checkbox to enable every behavior (e.g. comments, opening a PR, etc) instead of ju...

Added issue-specific workflow_dispatch with a default-off publish checkbox that gates configured safe-output writes; checked runs enable the existing reproduction branch and issue comment behavior (there is no PR creation path). The bug form now sets issue type Bug, the workflow handles reopen events and Bug types, and the guide now lives in .agents/skills/bug/SKILL.md. An executable POST form cannot be hosted in an issue comment or description, so the skill documents generating it with the shared script and linking to a durable, commit-pinned StackBlitz import. Commit: 98a2434.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changeset This change does not need a changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants