Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-root workspaces with two projects checked out to branches with open PRs either shows errors or misleading information #3490

Closed
dslatkin opened this issue Apr 25, 2022 · 3 comments · Fixed by #3982
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded

Comments

@dslatkin
Copy link

  • Extension version: 0.40.0
  • VSCode Version: 1.66.2
  • OS: Darwin arm64 21.4.0

Basically if you're working in multi-root workspace with at least two projects, each one on a branch with an open PR, and then switch one of those branches, the GitHub PR sidebar either breaks (shows errors when trying to submit review) or displays mismatched info (making it easy to leave a review/decision on a PR that you didn't mean to).

I have a minimal reproduction using public repositories that have test PRs open. I'm happy to add collaborators to these test repos if you don't want to recreate them yourself.

  1. Make sure the extension is installed
  2. Make a new directory, cd into it
  3. Clone the following two public repos:
  4. Create a file called workspace.code-workspace containing:
{
  "folders": [
    {
      "path": "./issue-vscode-github-1"
    },
    {
      "path": "./issue-vscode-github-2"
    }
  ]
}
  1. Use "Open workspace from file" from the command palette to open the workspace
  2. In source control, switch the first repo's branch to fix-on-1 with an open PR
  3. In source control, switch the second repo's branch to fix-on-2 with an open PR

This is where the issues start. In particular the “GitHub Pull Request” sidebar has two panels, “Changes in pull request” and “Active pull request” which get mismatched depending on which actions are taken next:

  • If you switch the second repo back to the main branch, the “Changes in pull request” incorrectly still includes changes for that branch, despite it not being checked out.
  • If you switch the first repo back to the main branch, it will no longer show up in the “Changes in pull request” panel but it is still shown in the “Active pull request” panel despite it not being checked out.

At this point, due to the mismatched PRs, it becomes easy to leave a review or submit decisions for the wrong PRs (this has happened to me on more than one occasion). If you try to leave a review or take action on a PR for a branch that’s no longer checked out, you’ll get an error like the following:

Submitting review failed. Submitting review failed, no pending review for current pull request: 1.

This issue may be related to #3437. The only way I've managed to fix this is to either close and relaunch VS Code or to reload the VS Code window using the command palette.

@alexr00 alexr00 self-assigned this May 3, 2022
@alexr00 alexr00 added the bug Issue identified by VS Code Team member as probable bug label May 3, 2022
@alexr00 alexr00 added this to the May 2022 milestone May 3, 2022
@alexr00 alexr00 modified the milestones: May 2022, June 2022 May 31, 2022
@alexr00
Copy link
Member

alexr00 commented Jun 3, 2022

There's some multi-repo support lacking in the "Changes in Pull Request #number" and "Active Pull Request (usually this view's title is the title of the PR)" views.

🪲 The "Changes in Pull Request" view will show all the PRs, but the title of the view will only mention 1 PR or mention a singular "Changes in Pull Request".
The title should be fixed simply say "Changes in Pull Requests" (plural).
🪲 The active PR view that lets you comment and exit review mode is very small and not suited to showing multiple PRs worth of options. It confusingly will only show info for one right now.
@daviddossett not sure if you're the right person to run this by, but the problem is that this view only has room for one pull request:

image
I don't think trying to cram more buttons into this view to enable it to support multiple PRs will make anything better. Instead, I would rather direct users to the full page review overview by showing a short message and then a list of the open PRs.

What do you think about this idea?

Example of the full page review overview:
image

@alexr00
Copy link
Member

alexr00 commented Sep 26, 2022

New behavior:

  • The Active PR view only shows when there is only 1 PR checked out.
  • When there are 2+ PRs checked out we hide that view. The side bar doesn't give use much space, and you can easily get to the full PR description with 1 click.

@roblourens
Copy link
Member

Noticed #4007 for a single folder, not sure if it's part of this or not

@roblourens roblourens added the verified Verification succeeded label Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants