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

Unable to Comment on PR Diff View

Open thoward27 opened this issue 3 years ago • 9 comments

  • Extension version: v0.44.0
  • VSCode Version: 1.68.1
  • OS: MacOS Monterey

Steps to Reproduce:

  1. Checkout a Pull Request
  2. Try to leave a comment, there is no button to actually add a comment for me.

image

I cannot figure out why this is happening. I have tried

  • Reloading the VS Code window
  • Restarting VS Code
  • Restarting my computer
  • Disabling / Re-enabling the extension
  • Uninstalling / Re-installing the extension
  • Switching to the prerelease version
  • Changing log mode to debug

I do see some weird things in my extension logs...

[Debug 1656538671.164s] Failed to parse patch for outdated comments: Failed to execute git {
  "exitCode": 128,
  "gitCommand": "diff",
  "stdout": "",
  "stderr": "fatal: b9c0373d6fe5d64ddba74e9d7d7013bd4c394da5...f55bf421a858b9bdd4f0596fe7ee4727291938ce: no merge base\n"
}

I noticed that the git log only had a single commit, so I tried --unshallow on the branch, to see if that had any effect (no issues on this had been reported at the time of writing, so I was assuming this was a me issue). Once I unshallowed the branch, the error was replaced with messages like this

[Debug 1656538942.595s] GitContentFileSystemProvider> Getting repository (file:///Users/thomas/src/foo) content for commit b9c0373d6fe5d64ddba74e9d7d7013bd4c394da5 and path /Users/thomas/src/foo/lib/foo/foo.py

But, still no way to add comments from the IDE.

If this helps in any way, I am able to see existing comments made by other users in the PR, they do show up in the IDE, and work as expected; I can comment back, resolve and unresolve from the IDE.

thoward27 avatar Jun 29 '22 21:06 thoward27

Okay, additional updates here, still no luck getting comments to work in a local repository, but I did try to add comments using GitHub Repositories, the remote extension, which did work!

Thinking I might have something bad in my source dir, I went through that extension to clone my repo to a new location, tried adding comments there, but the gutter is gone again!

thoward27 avatar Jun 30 '22 14:06 thoward27

So, I just tried completely removing vscode (including removing folders described here, re-installing from the universal zip provided by microsoft, I then did not sign in, I just installed the Github extension and opened a PR, still no way to add comments! I really have no idea what to try next, and being able to review code in my IDE has become a core part of my day...

thoward27 avatar Jun 30 '22 14:06 thoward27

So, to restate the point I am at now, the shortest path to reproing my issue is

  1. Download VS Code
  2. Install GitHub Pull Requests
  3. Authenticate
  4. Open a local repository
  5. Checkout a pull request
  6. Try to add a comment, but there is no white gutter line to even click on!

image

thoward27 avatar Jun 30 '22 14:06 thoward27

@thoward27 I can't reproduce the issue, so I'm wondering if there might be something different about the PR you're viewing. Is it a public PR and if so can you share a link?

alexr00 avatar Jul 01 '22 09:07 alexr00

@alexr00 it is a private PR. I have checked several PRs across different repos, cloned repos into different locations, etc. I have not tried working with a public PR yet.

thoward27 avatar Jul 05 '22 14:07 thoward27

@thoward27 is the file you're looking a renamed? I just fixed a bug where you couldn't leave comments in renamed files and it hasn't been released yet.

alexr00 avatar Jul 05 '22 14:07 alexr00

Some certainly were, but others were often just smaller diffs, I tried dozens of files across the PRs I looked at to see if I could get the logs to give me something useful to no avail

thoward27 avatar Jul 05 '22 14:07 thoward27

Ok, thanks for helping to track this down. Your info above that already made comments do show is helpful. I'll add some more logging around the commenting ranges (the gutter you can click on to add comments), and we'll try to narrow it down from there.

alexr00 avatar Jul 05 '22 14:07 alexr00

@thoward27 the new logging is available from pre-release build v0.47.2022070709. You will need to enable debug logging with the setting githubPullRequests.logLevel. There may be repo specific data in the logs, so if you don't want to share all the logs then just lines with "ReviewCommentController" will be good.

alexr00 avatar Jul 07 '22 09:07 alexr00

Closing since we don't have logs. If you see the issue again please do ping the issue!

alexr00 avatar Dec 09 '22 12:12 alexr00