-
Notifications
You must be signed in to change notification settings - Fork 23
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
av stack swtich
supports a branch or PR URL as arg
#360
Conversation
Current Aviator status
This PR was merged using Aviator.
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
d8e68c9
to
baad509
Compare
and checkout directly when branch is already set
internal/gh/pullrequest.go
Outdated
@@ -80,6 +80,22 @@ func (c *Client) PullRequest(ctx context.Context, id string) (*PullRequest, erro | |||
return &query.Node.PullRequest, nil | |||
} | |||
|
|||
func (c *Client) GetPullRequest(ctx context.Context, opts PullRequestOpts) (*PullRequest, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This original(?) method was deleted by #61
So, I restored it as GetPullRequest
. Are there any good names? or Is there any way to get PR information used by PR number??
cmd/av/stack_switch.go
Outdated
|
||
var PULL_REQUEST_URL_REGEXP = regexp.MustCompile(`^/([^/]+)/([^/]+)/pull/(\d+)`) | ||
|
||
func parsePullRequestURL(prURL string) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlexReview SummaryThere is not enough data in the repository for FlexReview to determine suggested reviewers. Detailed BreakdownAuthor’s expertise score for the modified files:
See full breakdown of the reviewers on the Aviator webapp. |
cmd/av/stack_switch.go
Outdated
client, err := getGitHubClient() | ||
if err != nil { | ||
return "", errors.Wrap(err, "failed to get GitHub client") | ||
} | ||
|
||
prID, err := strconv.Atoi(m[3]) | ||
if err != nil { | ||
return "", errors.Wrap(err, "failed to parse pull request ID") | ||
} | ||
pr, err := client.GetPullRequest(context.Background(), gh.PullRequestOpts{ | ||
Owner: m[1], | ||
Repo: m[2], | ||
Number: int64(prID), | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can find the branch based on
Line 22 in d74f1e1
PullRequest *PullRequest `json:"pullRequest,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that this AllBranches method also holds remote branch information locally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed 6f8cc4a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The local metadata DB should keep those PR info.
Address: #325