X Tutup
The Wayback Machine - https://web.archive.org/web/20200725053250/https://github.com/github/VisualStudio/pull/2161
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

[spike] Automatically detect the PR branch the user is on #2161

Open
wants to merge 1 commit into
base: master
from

Conversation

@jcansdale
Copy link
Collaborator

jcansdale commented Jan 8, 2019

The PR associated with the current branch is only highlighted when the user created or opened the PR using GitHub for Visual Studio. This isn't very helpful for users who are new to the extension.

What this PR does

This spike attempts to look up the PR associated with the current branch if the branch hasn't already been tagged. It uses the simple approach of matching refs/heads/<name> references with refs/pull/xxx/head references. This approach has worked well for https://github.com/jcansdale/GitPullRequest.

Challenges

There are issues with spam PRs, where an external user creates a PR from an existing branch in the target repository. For example, a user might create a PR from the master branch in a repository. The owner of the repository is likely to close the spam PR, but won't delete the master branch! Unfortunately the above approach can detect deleted branches but no closed PRs.

Todo

Implement this using the GraphQL API so we can detect and ignore closed PRs.

This implementation uses ListReferences rather than a GitHub API.
@StanleyGoldman StanleyGoldman self-requested a review Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.
X Tutup