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

Denying auth causes GraphQL error to show in a notification #4778

Closed
meganrogge opened this issue Apr 26, 2023 · 13 comments · Fixed by #4788
Closed

Denying auth causes GraphQL error to show in a notification #4778

meganrogge opened this issue Apr 26, 2023 · 13 comments · Fixed by #4788
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@meganrogge
Copy link
Contributor

Testing #4764

I see that there's a message that this can take several minutes, but 🤔 what is taking that long?

team.reviewers.mov
@meganrogge
Copy link
Contributor Author

output:

2023-04-26 09:28:00.163 [info] Looking for git repository
2023-04-26 09:28:00.163 [info] Found 0 repositories during activation
2023-04-26 09:28:00.163 [info] Git repository found, initializing review manager and pr tree view.
2023-04-26 09:28:00.164 [info] Registering git provider
2023-04-26 09:29:11.508 [info] Looking for git repository
2023-04-26 09:29:11.508 [info] Found 0 repositories during activation
2023-04-26 09:29:11.508 [info] Git repository found, initializing review manager and pr tree view.
2023-04-26 09:29:11.511 [info] Registering git provider
2023-04-26 09:29:11.511 [info] Review> Validate state in progress
2023-04-26 09:29:11.511 [info] Review> Validating state...
2023-04-26 09:29:11.511 [info] Cannot updates repositories as git is uninitialized
2023-04-26 09:29:11.547 [info] Review> no matching pull request metadata found for current branch main
2023-04-26 09:29:11.547 [info] Review> No matching pull request metadata found on GitHub for current branch main
2023-04-26 09:29:11.928 [info] Repo state for file:///Users/meganrogge/vscode-pull-request-github changed.
2023-04-26 09:29:11.928 [info] Repo file:///Users/meganrogge/vscode-pull-request-github has already been setup.
2023-04-26 09:29:12.235 [info] Git initialization state changed: state=initialized
2023-04-26 09:29:12.235 [info] Review> Validate state in progress
2023-04-26 09:29:12.235 [info] Review> Validating state...
2023-04-26 09:29:12.261 [info] Found GitHub remote for folder /Users/meganrogge/vscode-pull-request-github
2023-04-26 09:29:12.808 [info] Review> no matching pull request metadata found for current branch main
2023-04-26 09:29:13.416 [info] Review> No matching pull request metadata found on GitHub for current branch main
2023-04-26 09:29:19.280 [info] Review> Validate state in progress
2023-04-26 09:29:19.281 [info] Review> Validating state...
2023-04-26 09:29:19.305 [info] Found GitHub remote for folder /Users/meganrogge/vscode-pull-request-github
2023-04-26 09:29:19.310 [info] Found GitHub remote for folder /Users/meganrogge/vscode-pull-request-github
2023-04-26 09:29:19.617 [info] Review> no matching pull request metadata found for current branch main
2023-04-26 09:29:20.497 [info] Review> No matching pull request metadata found on GitHub for current branch main
2023-04-26 09:29:23.680 [info] Review> Switch to Pull Request #3509 - start
2023-04-26 09:29:23.903 [info] PullRequestGitHelper> Branch pr/alexr00/3509 is from a fork. Create a remote first.
2023-04-26 09:29:23.903 [info] PullRequestGitHelper> create remote for https://github.com/alexr00/vscode-pull-request-github-1.
2023-04-26 09:29:26.101 [info] PullRequestGitHelper> associate pr/alexr00/3509 with Pull Request #3509
2023-04-26 09:29:26.691 [info] Review> Switch to Pull Request #3509 - done
2023-04-26 09:29:26.692 [info] Review> Validate state in progress
2023-04-26 09:29:26.692 [info] Review> Validating state...
2023-04-26 09:29:26.695 [info] Found GitHub remote for folder /Users/meganrogge/vscode-pull-request-github
2023-04-26 09:29:27.031 [info] Review> current branch pr/alexr00/3509 is associated with pull request #3509
2023-04-26 09:29:27.031 [info] Review> Resolving pull request
2023-04-26 09:29:27.739 [info] Review> Fetching pull request data
2023-04-26 09:29:27.739 [info] PullRequestTree> Adding PR #3509 to tree
2023-04-26 09:29:27.746 [info] Review> Register comments provider
2023-04-26 09:29:27.747 [info] Review> Display pull request status bar indicator and refresh pull request tree view.
2023-04-26 09:29:27.747 [info] Review> Using focus mode = true.
2023-04-26 09:29:27.747 [info] Review> State validation silent = true.
2023-04-26 09:29:27.747 [info] Review> PR show should show = false.
2023-04-26 09:29:28.077 [info] PullRequestTree> Creating file and commit nodes for PR #3509
2023-04-26 09:29:28.116 [info] PullRequestTree> Getting children for Files node
2023-04-26 09:29:28.494 [info] PullRequestTree> Review threads have changed, refreshing Files node
2023-04-26 09:29:28.495 [info] PullRequestTree> Review threads have changed, refreshing Commits node
2023-04-26 09:29:28.721 [info] PullRequestTree> Local files have changed, refreshing Files node
2023-04-26 09:29:28.743 [info] PullRequestTree> Getting children for Files node
2023-04-26 09:29:28.743 [info] PullRequestTree> Got all children for Files node
2023-04-26 09:29:28.795 [info] PullRequestTree> Getting children for Files node
2023-04-26 09:29:28.795 [info] PullRequestTree> Got all children for Files node
2023-04-26 09:29:29.344 [info] PullRequestTree> Comments have changed, refreshing Files node
2023-04-26 09:29:29.344 [info] PullRequestTree> Comments have changed, refreshing Commits node
2023-04-26 09:29:29.344 [info] PullRequestTree> Review threads have changed, refreshing Files node
2023-04-26 09:29:29.344 [info] PullRequestTree> Review threads have changed, refreshing Commits node
2023-04-26 09:29:29.353 [info] PullRequestTree> Getting children for Files node
2023-04-26 09:29:29.353 [info] PullRequestTree> Got all children for Files node
2023-04-26 09:29:29.551 [info] PullRequestTree> Getting children for Files node
2023-04-26 09:29:29.551 [info] PullRequestTree> Got all children for Files node
2023-04-26 09:29:29.887 [info] PullRequestTree> Review threads have changed, refreshing Files node
2023-04-26 09:29:29.887 [info] PullRequestTree> Review threads have changed, refreshing Commits node
2023-04-26 09:29:29.888 [info] PullRequestTree> Getting children for Files node
2023-04-26 09:29:29.888 [info] PullRequestTree> Got all children for Files node
2023-04-26 09:29:51.497 [info] Trying to use globalState for team reviewers.
2023-04-26 09:29:51.511 [info] Using globalState team reviewers for 2.

@meganrogge
Copy link
Contributor Author

also, now it looks like it's trying to authenticate me, but I already did that I believe

Screenshot 2023-04-26 at 9 33 28 AM

@meganrogge
Copy link
Contributor Author

I followed the steps you outlined, tried again, and now see this error. How do I tell github which token to use? It seems like it's using the wrong one

Screenshot 2023-04-26 at 9 34 51 AM

@meganrogge
Copy link
Contributor Author

I reloaded the window and it's working now

@alexr00
Copy link
Member

alexr00 commented Apr 27, 2023

I see that there's a message that this can take several minutes, but 🤔 what is taking that long?

It is painfully slow :(. Here's what's going on:

  1. We look at the org of the current repo. This is the current org. We already have this info.
  2. We get all the teams associated with the current org. There could be many of these, and we have to fetch them in pages of 100. This is the slow part.
  3. We filter these teams down to just ones that have access to the repo.

Obviously this is a very roundabout way to get the teams for the current repo. I've spoken with the GitHub folks about it and confirmed that this is the only way to get team repo reviewers right now. If they ever add API to just go directly from repo to teams without the slow org step I will move to it immediately.

@alexr00
Copy link
Member

alexr00 commented Apr 27, 2023

We do cache the team reviewers so you won't have to go through this again unless you want to refresh the team reviewers.

@alexr00
Copy link
Member

alexr00 commented Apr 27, 2023

I followed the steps you outlined, tried again, and now see this error. How do I tell github which token to use? It seems like it's using the wrong one

So the steps here were approximately:

  1. Go through testplan for the first time and start waiting for team reviewers to show.
  2. Cancel team reviewer quick pick
  3. Go through testplan again and see the error when you try to fetch team reviewers

Do I have that right?

@alexr00 alexr00 added the info-needed Issue requires more information from poster label Apr 27, 2023
@meganrogge
Copy link
Contributor Author

Yes, that's correct. And you're right -- now it is fast. Just the initial load of team reviewers was slow

@alexr00 alexr00 added bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release and removed info-needed Issue requires more information from poster labels Apr 28, 2023
@alexr00 alexr00 added this to the April 2023 milestone Apr 28, 2023
@alexr00 alexr00 changed the title painfully slow to get team reviewers Denying auth causes GraphQL error to show in a notification Apr 28, 2023
@alexr00
Copy link
Member

alexr00 commented Apr 28, 2023

To verify:

  1. Sign out of github in VS Code
  2. Start VS Code with a fresh user data dir
  3. Install the pre-release version of the extension
  4. Open a clone of a GitHub repo that has team reviewers (ex. this repo)
  5. Open the PR description of a PR
  6. Open the reviewer quick pick by clicking the gear next to reviewers
  7. Click the "teams" icon in the top right of the quick pick
  8. You will be prompted to auth again. Deny the auth request.
  9. Verify that you don't get any errors and that team reviewers do not load.

@roblourens
Copy link
Member

I think that auth details aren't stored in the user data dir? When I try this with a fresh users data dir, I don't get an auth request at step 7.

@alexr00
Copy link
Member

alexr00 commented May 2, 2023

@roblourens I was missing step 0 (sign out).

@alexr00 alexr00 removed the candidate Issue identified as probable candidate for fixing in the next release label May 2, 2023
@meganrogge meganrogge added the verified Verification succeeded label May 2, 2023
@meganrogge
Copy link
Contributor Author

I had to checkout the default branch before I could check out a PR 🤔 @alexr00

Screenshot 2023-05-02 at 5 53 02 AM

I also saw this error
Screenshot 2023-05-02 at 5 54 48 AM

@meganrogge
Copy link
Contributor Author

meganrogge commented May 2, 2023

The team reviewers loaded faster this time for me, but when I clicked the team reviewer button again, the progress bar was showing that something was taking quite awhile

team.mov

Logs:

2023-05-02 05:56:51.967 [info] PullRequestTree> Getting children for Files node
2023-05-02 05:56:51.967 [info] PullRequestTree> Got all children for Files node
2023-05-02 05:56:51.970 [info] No globalState for mentionable users.
2023-05-02 05:56:54.623 [info] Trying to use globalState for team reviewers.
2023-05-02 05:56:54.634 [info] No globalState for team reviewers.
2023-05-02 05:57:10.546 [info] Trying to use globalState for team reviewers.
2023-05-02 05:57:10.556 [info] No globalState for team reviewers.
2023-05-02 05:57:15.885 [info] Found GitHub remote for folder /Users/meganrogge/Repos/vscode-pull-request-github
2023-05-02 05:57:16.198 [info] Trying to use globalState for mentionable users.
2023-05-02 05:57:16.239 [info] Using globalState mentionable users for 2.
2023-05-02 05:57:17.665 [info] Found GitHub remote for folder /Users/meganrogge/Repos/vscode-pull-request-github
2023-05-02 05:57:17.967 [info] Trying to use globalState for mentionable users.
2023-05-02 05:57:18.004 [info] Using globalState mentionable users for 2.
2023-05-02 05:58:11.506 [info] Found GitHub remote for folder /Users/meganrogge/Repos/vscode-pull-request-github
2023-05-02 05:58:11.829 [info] Trying to use globalState for mentionable users.
2023-05-02 05:58:11.875 [info] Using globalState mentionable users for 2.

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