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

av stack swtich supports a branch or PR URL as arg #360

Merged
merged 6 commits into from
Jul 29, 2024

Conversation

Konboi
Copy link
Contributor

@Konboi Konboi commented Jul 10, 2024

Address: #325

Copy link
Contributor

aviator-app bot commented Jul 10, 2024

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

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.

@Konboi Konboi force-pushed the issue-325 branch 2 times, most recently from d8e68c9 to baad509 Compare July 10, 2024 10:58
@@ -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) {
Copy link
Contributor Author

@Konboi Konboi Jul 10, 2024

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??


var PULL_REQUEST_URL_REGEXP = regexp.MustCompile(`^/([^/]+)/([^/]+)/pull/(\d+)`)

func parsePullRequestURL(prURL string) (string, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Konboi Konboi marked this pull request as ready for review July 10, 2024 11:02
Copy link
Contributor

aviator-app bot commented Jul 10, 2024

FlexReview Summary

There is not enough data in the repository for FlexReview to determine suggested reviewers.

Detailed Breakdown Author’s expertise score for the modified files:
  • cmd/av/stack_switch.go (0.00)
  • internal/gh/pullrequest.go (0.00)

See full breakdown of the reviewers on the Aviator webapp.

Comment on lines 145 to 158
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),
})
Copy link
Contributor

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

PullRequest *PullRequest `json:"pullRequest,omitempty"`
. This shouldn't query GitHub.

Copy link
Contributor Author

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed 6f8cc4a

Copy link
Contributor

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.

@Konboi Konboi requested a review from draftcode July 29, 2024 08:53
@aviator-app aviator-app bot merged commit b365d49 into aviator-co:master Jul 29, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants