Skip to content

feat(commands): add /test-pr — prepare an open PR for local human testing - #41

Merged
robercano-ghbot merged 1 commit into
mainfrom
feat/test-pr-command
Jul 3, 2026
Merged

feat(commands): add /test-pr — prepare an open PR for local human testing#41
robercano-ghbot merged 1 commit into
mainfrom
feat/test-pr-command

Conversation

@robercano-ghbot

Copy link
Copy Markdown
Collaborator

What

Adds a project-agnostic /test-pr <pr-number> command and its prepare-pr.sh helper.

Given a PR number it:

  1. resolves the PR's head branch and fetches the latest pushed commit;
  2. creates/refreshes a detached git worktree at humanTest.worktreeDir/pr-<n> (default .worktrees/pr-<n>) — isolated from the main checkout and from any agent worktree already on that branch;
  3. runs humanTest.prepare (install/build) inside it and prints humanTest.launch for the reviewer to run.

New .claude/gates.json convention (humanTest.prepare / launch / worktreeDir) makes it project-agnostic; example added to examples/ts-solidity-foundry/gates.json and documented in docs/USAGE.md.

Why

Reviewers testing bot PRs from their main working tree run code that does not contain the unmerged change, conclude "the fix doesn't work", and bounce the PR — a real loop we just hit. This gives a one-shot, stale-proof way to run the actual PR branch, at the exact pushed SHA, in isolation.

Notes

  • Idempotent: re-running on the same PR fast-forwards the worktree and rebuilds.
  • Never edits the PR, never touches main. Detached checkout avoids git's "branch already checked out" error.
  • Validated end-to-end against a real PR in a downstream project (reDeploy): worktree lands at the PR head SHA, deps build, studio dev server launches.

🤖 Generated with Claude Code

…ting

Adds a project-agnostic /test-pr <n> command + prepare-pr.sh helper that checks
out an open PR's head into an isolated, detached, ready-to-run worktree (deps
built via the new gates.json humanTest.prepare) and prints humanTest.launch.

Motivation: reviewers testing bot PRs from the main working tree run code that
does NOT contain the unmerged change, then report 'the fix doesn't work'. This
gives a one-shot, stale-proof way to run the actual PR branch in isolation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0193Wc7aqPQvNqVZjcndBaf6
@robercano-ghbot
robercano-ghbot merged commit f393cec into main Jul 3, 2026
6 checks passed
@robercano-ghbot
robercano-ghbot deleted the feat/test-pr-command branch July 3, 2026 15:07
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.

2 participants