Skip to content

Surface GitHub PR checks in the sidebar - #111

Open
sambitcreate wants to merge 4 commits into
mainfrom
feature/github-pr-checks-sidebar
Open

Surface GitHub PR checks in the sidebar#111
sambitcreate wants to merge 4 commits into
mainfrom
feature/github-pr-checks-sidebar

Conversation

@sambitcreate

Copy link
Copy Markdown
Owner

Summary

  • add a bounded GitHub CLI-backed current-branch PR/check status service
  • expose workspace-scoped PR/check status over IPC and React Query
  • show PR/check badges and details in expanded workspace sidebar rows with safe external links
  • refresh PR status after branch switch, commit, or push

Verification

  • npm run type-check
  • npm run lint
  • npm run test:sidebar
  • npm run test:settings-design
  • npx tsx --test main/services/github-pull-request.test.ts main/services/subagents/subagent-phase3-contract.test.ts
  • npm test

Review

  • Reviewed each implementation phase with three opencode-go/deepseek-v4.1-flash subagents and remediated blocking findings.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ℹ️ No critical issues — minor suggestions inline.

Reviewed changes

Reviewed the full 14-file diff at 245de6eb: the new GitHub PR/check service, its workspace-scoped IPC surface, and the sidebar badge.

  • New gh-backed PR status servicemain/services/github-pull-request.ts shells out to gh pr view --json … with a resolved binary, Git-routing-stripped environment, 15s timeout, and bounded output, then normalizes checks and redacts renderer-facing errors.
  • Workspace-scoped IPCgit:pullRequestStatus resolves the workspace through withOptionalWorkspaceOperation, short-circuits non-repos and remote-less repos, and passes the operation signal into the service.
  • Sidebar badge and popoverWorkspacePullRequestBadge, rendered only while a workspace is explicitly expanded, polls every 30s, shows the check rollup, and opens PR/check URLs through the existing main-window external-open handler.
  • Refresh wiring — branch switch, commit, and push invalidate gitPullRequestStatus; main/renderer types and the sidebar and phase-3 contract tests were extended, and the new service test is registered in test and test:coverage.

ℹ️ Nitpicks

  • publicCommandMessage (main/services/github-pull-request.ts:124-134) redacts only the exact cwd/home and a fixed query-param list, so absolute paths outside the workspace (including the Command failed: /opt/homebrew/bin/gh … prefix execFile builds) and param names like private_token reach the popover verbatim. Low severity since the string is only shown locally, but parsing URLs and redacting absolute paths generally would match what the redaction test implies.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using DeepSeek Flash𝕏

Comment thread main/services/github-pull-request.ts Outdated

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

Reviewed the delta since the prior pullfrog review (245de6eb164bcb66): a redaction-hardening commit for the GitHub CLI error path and its test.

  • Hardened CLI error redactionpublicCommandMessage now masks multi-segment absolute paths via redactAbsolutePaths (covering the Command failed: /opt/homebrew/bin/gh … prefix execFile builds) and redacts private_token alongside the existing query-param list.
  • Extended the redaction test — the service test now feeds a realistic Command failed: … message and asserts the binary path, workspace path, and private_token value never reach the renderer-facing message.

The earlier publicCommandMessage nitpick is addressed. The previously flagged queued-rerun ordering in shouldReplaceCheck is unchanged and its review thread remains open, so this is not an approval.

Pullfrog  | Fix it ➔View workflow run | Using DeepSeek Flash𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

Reviewed the delta since the prior pullfrog review (164bcb66b5d4a90): the queued-rerun ordering fix in check dedupe and its test.

  • Fixed order-dependent queued-rerun selectionshouldReplaceCheck now evaluates the zero-timestamp pending/action-required case in both directions before comparing timestamps, so a queued rerun beats a superseded completed failure regardless of rollup position.
  • Pinned both rollup orders in the test — the rerun test now feeds the same completed/queued pair in both orders and asserts pending either way.

The prior review's shouldReplaceCheck thread is addressed and resolved. Verification this run: npx tsx --test main/services/github-pull-request.test.ts (15 pass), npx tsc --noEmit, and npx eslint on both changed files all pass.

Pullfrog  | View workflow run | Using DeepSeek Flash𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

Reviewed the delta since the prior pullfrog review (b5d4a904e9200f8): a check-rollup behavior fix plus GitHub CLI environment isolation, with matching tests.

  • Cancelled checks now count as failingrollupGitHubChecksState returns failing when any check is cancelled, so a cancelled-only rollup no longer falls through to the "Checks did not run" default; the test pins both the cancelled-only and success-plus-cancelled rollups.
  • Stripped GH_HOST and GH_REPO from the CLI environmentgithubCliEnvironment now deletes both so an inherited value cannot redirect gh pr view to a different host or repository; the env test asserts they are removed while GH_TOKEN is preserved.

All prior pullfrog threads are resolved, and verification this run passes: npx tsx --test main/services/github-pull-request.test.ts (15), npx tsc --noEmit, and npx eslint on both changed files.

Pullfrog  | View workflow run | Using DeepSeek Flash𝕏

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.

1 participant