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

Add CreatePullRequest() to github pkg and clients #1268

Merged
merged 2 commits into from
May 8, 2020

Conversation

puerco
Copy link
Member

@puerco puerco commented May 8, 2020

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 in github.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:

  1. The first one adds the implementation of the CreatePullRequest() func to the interface and the clients (the real one, fake, replay and record).
  2. The second commit adds another CreatePullRequest() function to the github package and it's corresponding tests in TestCreatePullRequest().

Does this PR introduce a user-facing change?

Add `CreatePullRequest()` to the github package

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 8, 2020
@k8s-ci-robot k8s-ci-robot added area/release-eng Issues or PRs related to the Release Engineering subproject sig/release Categorizes an issue or PR as relevant to SIG Release. labels May 8, 2020
@puerco puerco force-pushed the github-createpr branch 5 times, most recently from dffcaa8 to 3972f06 Compare May 8, 2020 04:42
Copy link
Member

@saschagrunert saschagrunert left a 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
Copy link
Member

@saschagrunert saschagrunert May 8, 2020

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:

Suggested change
return pr, err
return pr, errors.Wrap(err, "creating pull request")

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 8, 2020
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 8, 2020
@k8s-ci-robot k8s-ci-robot merged commit ebf963b into kubernetes:master May 8, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone May 8, 2020
@puerco puerco deleted the github-createpr branch May 8, 2020 16:36
@puerco
Copy link
Member Author

puerco commented May 15, 2020

Relates to #834

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/release-eng Issues or PRs related to the Release Engineering subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/release Categorizes an issue or PR as relevant to SIG Release. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants