fix: PR review workflow improvements#1223
fix: PR review workflow improvements#1223yashdev9274 wants to merge 11 commits intogeneralaction:mainfrom
Conversation
…ponents - Updated Task interface to include a new 'creating' status. - Modified RightSidebar, TaskItem, and TaskTerminalPanel components to handle the new status. - Enhanced TaskItem to display a Creating... message when the task is in the 'creating' state. - Implemented optimistic UI updates in taskCreationService for immediate feedback during task creation.
- Implemented `getPullRequestDiff` and `getPullRequestBaseDiff` methods in GitHubService to retrieve diffs for pull requests. - Added IPC handlers for `github:getPullRequestDiff` and `github:getPullRequestBaseDiff` to facilitate communication between renderer and main processes. - Enhanced the preload script to expose new API methods for fetching file content from specific branches and pull request diffs. - Updated UI components to support displaying pull request diffs and improved handling of file changes in the context of PR reviews. - Introduced `OpenPrsSection` component to list open pull requests and allow users to create worktrees for review.
…ponents - Updated Task interface to include a new 'creating' status. - Modified RightSidebar, TaskItem, and TaskTerminalPanel components to handle the new status. - Enhanced TaskItem to display a Creating... message when the task is in the 'creating' state. - Implemented optimistic UI updates in taskCreationService for immediate feedback during task creation.
- Implemented `getPullRequestDiff` and `getPullRequestBaseDiff` methods in GitHubService to retrieve diffs for pull requests. - Added IPC handlers for `github:getPullRequestDiff` and `github:getPullRequestBaseDiff` to facilitate communication between renderer and main processes. - Enhanced the preload script to expose new API methods for fetching file content from specific branches and pull request diffs. - Updated UI components to support displaying pull request diffs and improved handling of file changes in the context of PR reviews. - Introduced `OpenPrsSection` component to list open pull requests and allow users to create worktrees for review.
|
Someone is attempting to deploy a commit to the General Action Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR implements PR review workflow improvements by adding new UI components and backend services to view and review GitHub pull requests directly within the application. Major Changes:
Issues Found:
Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| src/main/ipc/githubIpc.ts | Added PR diff retrieval methods and database integration for PR tasks. Command injection risk exists with unescaped branch names in shell commands. |
| src/renderer/components/AllChangesDiffModal.tsx | New modal component for viewing all file changes with Monaco diff editor. Includes large file detection and proper cleanup. |
| src/renderer/components/ChangesDiffModal.tsx | New modal for viewing individual file diffs with inline comment support and save functionality. |
| src/renderer/components/FileChangesPanel.tsx | Added PR review mode with diff parsing and display. Integrates new diff modals and handles PR-specific UI states. |
| src/renderer/components/OpenPrsSection.tsx | New component for displaying open PRs with worktree creation. Contains debug console.log statements and missing cleanup on unmount. |
| src/renderer/lib/taskCreationService.ts | Implemented optimistic UI updates for task creation. Tasks show immediately with 'creating' status before worktree creation completes. |
Sequence Diagram
sequenceDiagram
participant User
participant OpenPrsSection
participant GitHubIPC
participant GitHubService
participant Database
participant FileChangesPanel
participant DiffModal
User->>OpenPrsSection: Click "Review PR"
OpenPrsSection->>GitHubIPC: githubCreatePullRequestWorktree()
GitHubIPC->>GitHubService: ensurePullRequestBranch()
GitHubService-->>GitHubIPC: Branch created
GitHubIPC->>Database: saveTask(taskInfo)
GitHubIPC-->>OpenPrsSection: {task, worktree}
OpenPrsSection->>User: Open task in UI
User->>FileChangesPanel: View task with prNumber
FileChangesPanel->>GitHubIPC: githubGetPullRequestBaseDiff()
GitHubIPC->>GitHubService: getPullRequestDetails()
GitHubService-->>GitHubIPC: {baseRefName, headRefName}
GitHubIPC->>GitHubIPC: execSync git diff
GitHubIPC-->>FileChangesPanel: {diff, baseBranch, headBranch}
FileChangesPanel->>FileChangesPanel: parseDiffToFileChanges()
FileChangesPanel-->>User: Display PR diff files
User->>DiffModal: Click "View Full PR Diff"
DiffModal->>DiffModal: Load Monaco editor with diffs
DiffModal-->>User: Show interactive diff view
Last reviewed commit: b20865f
| console.log('Review PR result:', result); | ||
|
|
||
| if (result.success && result.task) { | ||
| console.log('Calling onOpenTask with:', result.task); |
There was a problem hiding this comment.
Remove debug console.log statements before merging to production
| console.log('Review PR result:', result); | |
| if (result.success && result.task) { | |
| console.log('Calling onOpenTask with:', result.task); | |
| if (result.success && result.task) { | |
| const taskWithPr = { |
| description: `${errorMessage}. Opening PR on GitHub instead.`, | ||
| variant: 'destructive', | ||
| }); | ||
| console.log('Falling back to GitHub, success:', result.success, 'error:', result.error); |
There was a problem hiding this comment.
Remove debug console.log statement
| console.log('Falling back to GitHub, success:', result.success, 'error:', result.error); | |
| window.electronAPI.openExternal(pr.url); |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
|
||
| useEffect(() => { | ||
| console.log('PR Review Check:', { resolvedPrNumber, safeTaskPath }); | ||
| if (resolvedPrNumber && safeTaskPath) { | ||
| setIsLoadingPrDiff(true); | ||
| window.electronAPI | ||
| .githubGetPullRequestBaseDiff({ | ||
| worktreePath: safeTaskPath, | ||
| prNumber: resolvedPrNumber, |
There was a problem hiding this comment.
Remove debug console.log statements
| useEffect(() => { | |
| console.log('PR Review Check:', { resolvedPrNumber, safeTaskPath }); | |
| if (resolvedPrNumber && safeTaskPath) { | |
| setIsLoadingPrDiff(true); | |
| window.electronAPI | |
| .githubGetPullRequestBaseDiff({ | |
| worktreePath: safeTaskPath, | |
| prNumber: resolvedPrNumber, | |
| if (resolvedPrNumber && safeTaskPath) { | |
| setIsLoadingPrDiff(true); | |
| window.electronAPI | |
| .githubGetPullRequestBaseDiff({ |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
hey @arnestrickmann @rabanspiegel fix this #1184 |
|
guys @arnestrickmann @rabanspiegel any update on my PR ?? |
|
we'll get to reviewing today! @yashdev9274 -- thank you for this! |
sure 👍🏻 |
|
going through some bigger changes first, will update you as soon as i review your PR. |
|
Hi @yashdev9274, thanks again for opening this pr and for picking this issue. A user that requested this feature also let us know that it would make sense to be able to filter through the PRs as, for example, their team has 140 open PRs. It would also make sense if, per default, we only render like the latest 10 and then enable the user to 1) search 2) filter and 3) expand the initially rendered amount of PRs. |
|
@yashdev9274 hey, what do you think? |
yes, sorry i missed it, i was looking at #1228 also is there any slack grp other than discord, which i can join so that i don't miss the updates !? |
|
@yashdev9274 hey, thanks for the message, we only have the discord server for now for communication with contributors. What is your discord handle? then i can set up a shared chat with you, my co founder and me |
Fixes for PR review workflow