Skip to content

feat(cli): add pull request checkout command - #50

Merged
Blankeos merged 4 commits into
Blankeos:mainfrom
yan-ad:feat/pr-command
Sep 12, 2026
Merged

Blankeos merged 4 commits into
Blankeos:mainfrom
yan-ad:feat/pr-command

Conversation

@yan-ad

@yan-ad yan-ad commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add crabcode pr <number> to fetch and checkout GitHub pull requests as pr/<number>
  • configure fork remotes and upstream tracking for cross-repository pull requests
  • relaunch Crabcode after checkout and document the command

Validation

  • cargo fmt --check
  • cargo check
  • focused CLI and PR module tests
  • crabcode pr --help smoke test

Notes

The full suite currently has 6 unrelated failures in discovery, compaction, jobs, and UI; 1408 tests pass.


Review: yan-ad:feat/pr-commandBlankeos:main

Merge confidence: 4.5/5 — ready to merge based on targeted validation.

Reviewed candidate: 6345aae, including follow-up fixes in 6611919. Small feature scope; no migrations required. The reproduced checkout safety, missing fork ref, and repeat-launch problems are fixed. Remote alias/collision handling is now covered too.

Changes pushed

  • Removed unconditional forced checkout, retaining GitHub CLI safeguards for local edits and commits.
  • Fetch the fork branch before configuring its upstream.
  • Before adding a fork remote, preserve the already-resolved base repository with gh repo set-default. This prevents adding the fork from breaking subsequent interactive checkout through repository ambiguity.
  • Match fork remotes by repository identity, reusing existing aliases. If an owner-named remote points elsewhere, choose a nonconflicting name without changing the unrelated remote.
  • Added targeted regression coverage for safe arguments, missing refs, failed fetch/pin behavior, alias reuse, host identity, collision preservation, and pin-before-add ordering. No new dependencies.

Checks performed

  • cargo check --locked and cargo build --locked passed.
  • cargo fmt --check and git diff --check passed, including pre-commit validation.
  • 12 focused tests passed: 10 PR-module tests, CLI parsing, and root help.
  • Earlier binary crabcode pr --help smoke check passed.
  • Newly built candidate tested through a controlling pseudo-terminal in disposable /tmp repositories, without model prompts:
  • Earlier real-GitHub repeated-checkout check confirmed local commit HEAD preservation with the non-forced checkout arguments, which remain unchanged.

Remaining limits / regressions

  • No regression identified in the reviewed command paths. Full-suite results do not establish a clean base/candidate comparison; baseline classification remains inconclusive. The original Notes section's six failures/1,408 passes are historical author-reported results, not current independently verified totals.
  • Repositories already made ambiguous by older builds may still need a one-time gh repo set-default OWNER/REPO. The new code prevents creating that ambiguity; it deliberately does not guess the intended base in an already-ambiguous repository.
  • End-to-end smoke checks were on macOS with GitHub CLI 2.100.0; no cross-platform runtime guarantee.

Migrations

None. No database, configuration-file schema, credential, or dependency-format migration. The command intentionally changes checkout/remotes/upstream settings; the follow-up additionally records the confirmed GitHub default repository in local Git configuration before adding a remote. Git and authenticated gh remain required.

Merge checklist / confidence bumps

  • Fix the reproduced blockers and cover remote aliases/collisions.
  • Pass build, formatting, focused tests, and fresh/repeat/same-repo interactive launch checks: 4.5/5.
  • For 5/5 confidence: establish a repeatable full-suite base/candidate comparison with no unexplained new failures; supported-platform smoke checks provide further assurance.

No additional manual launch test is needed to reproduce the evidence above. The remaining full-suite comparison is extra assurance, not an identified blocker. Confidence scores are judgments, not guarantees.

@Blankeos

Copy link
Copy Markdown
Owner

Review: yan-ad:feat/pr-commandBlankeos:main

Merge confidence: 4/5 — small, isolated change; the two reproduced blockers are fixed in 6611919. One interactive setup caveat remains.

Follow-up changes

  • Removed unconditional gh pr checkout --force, preserving GitHub CLI's safeguards for local commits and uncommitted edits.
  • Fetch the fork's head branch into its remote-tracking ref before assigning upstream, fixing first-time fork checkout failures.
  • Added three regression tests: safe checkout arguments, fetching a missing fork ref, and preserving upstream configuration when fetch fails. No new dependencies.

Verified checks

Remaining caveats / regressions

  • Interactive repeat-checkout caveat: adding the fork remote leaves two remotes. In a fresh repository without a gh default, reopening failed with “No default remote repository has been set.” Running gh repo set-default Blankeos/crabcode in that disposable repository resolved it. This remains a usability issue, not data loss; do not treat repeat-launch validation as unconditional.
  • Non-blocking edge case: an existing contributor-named remote is trusted without verifying its URL. Remote identity/alias handling is recommended follow-up hardening.
  • No existing-app regression identified in this isolated diff, but the full suite was not independently rerun or compared with base. The six baseline failures mentioned above are author-reported, not independently confirmed by this review.

Migrations

None. No database, config, credential, or dependency format migration. Git and authenticated gh are required; checkout and remote/upstream configuration are intentional Git side effects.

Before merge / confidence bumps

  • Fix both reproduced blockers and pass focused regression checks: 4/5.
  • Resolve or explicitly document the default-repository requirement and verify a fresh fork can be reopened without an unexplained setup failure: 4.5/5. Other interactive launch smoke tests already passed.
  • Additionally cover remote identity/alias collisions and compare full-suite results against base with no unexplained new failures: 5/5.

Scores describe remaining risk and evidence, not a guarantee. The fixes above are pushed; review/manual instruction files were not included in the code commit.

@Blankeos Blankeos left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

lgtm

@Blankeos
Blankeos merged commit a4c6b7a into Blankeos:main Sep 12, 2026
6 checks passed
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