-
Notifications
You must be signed in to change notification settings - Fork 502
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
Add CreatePullRequest() to github pkg and clients #1268
Conversation
dffcaa8
to
3972f06
Compare
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.
Nice, thank you!
/lgtm
|
||
pr, _, err := g.PullRequests.Create(ctx, owner, repo, newPullRequest) | ||
if err != nil { | ||
return pr, err |
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.
nit, to add more context to the error messages:
return pr, err | |
return pr, errors.Wrap(err, "creating pull request") |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: puerco, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Relates to #834 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR enables creating Pull Requests in a GItHub repository from the github pkg. It adds a
CreatePullRequest()
func and its corresponding implementation ingithub.Client
. It also adds noop functions in the replay and record packages to keep them compatible with the Client interface. Finally it adds some basic testing.Which issue(s) this PR fixes:
Special notes for your reviewer:
I've split the PR in two commits:
CreatePullRequest()
func to the interface and the clients (the real one, fake, replay and record).CreatePullRequest()
function to the github package and it's corresponding tests inTestCreatePullRequest()
.Does this PR introduce a user-facing change?