vscode-pull-request-github icon indicating copy to clipboard operation
vscode-pull-request-github copied to clipboard

SCM title menu Create Pull Request action is unavailable when in a Remote window

Open joyceerhl opened this issue 3 years ago • 1 comments

  • Extension version: v0.51.2022090109
  • VSCode Version: 1.71-insider
  • OS: Windows 11

Steps to Reproduce:

  1. Open a GitHub codespace and go to the SCM view
  2. :bug: the Create Pull Request button is not available. I have hit this in WSL and in a GitHub codespace so far so I suspect it is generic to all Remote-* windows in VS Code

From inspecting context keys, it looks like something is off with the scmProviderRootUri value in this when clause https://github.com/microsoft/vscode-pull-request-github/blob/57dd87743f1caa943ef5e65bfc0d6dcf101a0ee6/package.json#L1601-L1605

Its value is a vscode-remote URI but the github.reposNotInReviewMode has file URIs.

image image

joyceerhl avatar Sep 01 '22 21:09 joyceerhl

@lszomoru the issue appears to be that I am comparing the URI that the extension host understands (file://workspaces/vscode) with the URI that the renderer/local extension host understands (vscode-remote://codespaces...). I'm getting the file URI using the rootUri API from the git extension. That one should be a file URI ✅

The difficulty comes when comparing it to scmProviderRootUri. scmProviderRootUri is set in the renderer, and as such has a vscode-remote URI. Who is expected to be using this URI? Is it components running in the remote extension host or the renderer/local extension host?

If the answer is both, then I don't know how we can fix this.

alexr00 avatar Sep 02 '22 08:09 alexr00

This is a frequent papercut for me in Codespaces, my personal feeling is that scmProviderRootUri should transform outgoing URIs, i.e. vscode-remote should become file://, since non-resolver extensions like GHPRI should not need to know about vscode-remote. If we are worried about breaking existing consumers of this context key, could we consider introducing a new one @lszomoru?

joyceerhl avatar Oct 14 '22 18:10 joyceerhl

@lszomoru should scmProviderRootUri transform the URI or should a new context value be introduced?

alexr00 avatar Nov 07 '22 19:11 alexr00

@lszomoru would you consider adding another context value?

alexr00 avatar Dec 15 '23 14:12 alexr00

I am fine with transforming the URI, but I also want to hear from @joaomoreno as he has the full context of this particular context key.

lszomoru avatar Dec 19 '23 19:12 lszomoru

@lszomoru proposed that if I stored github.reposNotInReviewMode as a uri instead of a string this would just work. I've tested this out with the test resolver, and it seems to work great!

alexr00 avatar Dec 20 '23 14:12 alexr00

Mahmood amin ok

124maa avatar Dec 22 '23 08:12 124maa

Mahmood amin ok

124maa avatar Dec 22 '23 08:12 124maa