This repository was archived by the owner on Jun 21, 2023. It is now read-only.
[spike] Infer PR associated with current branch#1719
Closed
jcansdale wants to merge 10 commits intogithub:masterfrom
jcansdale:fixes/1591-infer-active-PR
Closed
[spike] Infer PR associated with current branch#1719jcansdale wants to merge 10 commits intogithub:masterfrom jcansdale:fixes/1591-infer-active-PR
jcansdale wants to merge 10 commits intogithub:masterfrom
jcansdale:fixes/1591-infer-active-PR
Conversation
Search PRs in current and parent repo for one that targets the current branch name and owner.
BranchModel is always constructed using a local branch so IsRemote is never true (it is passed repo.Head not repo.Remote.Head).
LocalBranchModel represents the local branch of a LocalRepositoryModel.
ILocalBranch includes extra information that is available when a branch is from a local repository.
We're only interested in PRs that target the parent (upstream) or owner (current) repo.
Collaborator
Author
|
We're planning to warn the user with a call-out notification (see #2026) rather than having alternative logic to choose the default remote when "origin" isn't defined. This will make it obvious what's going on and avoid any magic. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a spike to experiment with infering the PR associated with the current branch.
What this PR does
TODO
Use
associatedPullRequestsproperty ofref.Findings
There can be multiple PRs that use the same branch as their HEAD. We could up with a conservative strategy that minimizes false positives but that still works in most cases?
For example, say a user creates a PR using their
masterbranch. They probably won't want this PR associated with theirmasterbranch forever!There are attributes associated with a PR that we could take into account to infer when a PR is likely stale and shouldn't be automatically associated with the current branch. For example:
Fixes #1591