Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jcansdale
Copy link
Collaborator

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 February 20, 2019 23:31
@StanleyGoldman StanleyGoldman removed their request for review August 24, 2021 13:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant