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

Change the interface of the PullRequest resource to be more granular. #1181

Merged
merged 1 commit into from
Aug 13, 2019

Conversation

dlorenc
Copy link
Contributor

@dlorenc dlorenc commented Aug 9, 2019

Changes

Currently the PullRequest resource produces one large json object representing the
entire PR. This works, but makes it harder to write simple programs to manipulate this
object.

This commit changes this interface to produce a set of files, each representing a part
of the initial pull request. This makes it easier for programs to do simple tasks like add
labels or comments.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

 The pullRequest resource type now outputs and expects files in a slightly different format. The new format can be found [here](TODO).

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Aug 9, 2019
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dlorenc

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

@tekton-robot tekton-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 9, 2019
@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/pullrequest-init/disk.go Do not exist 72.8%
cmd/pullrequest-init/github.go 83.5% 83.5% 0.0

@dlorenc dlorenc force-pushed the refgit branch 2 times, most recently from a4bb101 to 4cd45ae Compare August 9, 2019 18:40
@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/pullrequest-init/disk.go Do not exist 72.8%
cmd/pullrequest-init/github.go 83.5% 83.5% 0.0

@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/pullrequest-init/disk.go Do not exist 72.8%
cmd/pullrequest-init/github.go 83.5% 83.5% 0.0

@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/pullrequest-init/disk.go Do not exist 72.8%
cmd/pullrequest-init/github.go 83.5% 83.5% 0.0

@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/pullrequest-init/disk.go Do not exist 72.8%
cmd/pullrequest-init/github.go 83.5% 83.5% 0.0

@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/pullrequest-init/disk.go Do not exist 72.8%
cmd/pullrequest-init/github.go 83.5% 83.5% 0.0

Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

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

I like that we're breaking this up and making it more granular! I think the logic itself could be made even more granular if you're up for it.

I think there are a couple of doc changes that need to go along with this:

What do you think if we also included something in examples that maybe just read from a PR in a public repo?

cmd/pullrequest-init/disk_test.go Outdated Show resolved Hide resolved
cmd/pullrequest-init/disk_test.go Show resolved Hide resolved
cmd/pullrequest-init/disk_test.go Outdated Show resolved Hide resolved
@dlorenc
Copy link
Contributor Author

dlorenc commented Aug 13, 2019

What do you think if we also included something in examples that maybe just read from a PR in a public repo?

Yea, I'm going to add that one as a separate PR along with an integration test.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/pullrequest-init/disk.go Do not exist 74.8%
cmd/pullrequest-init/github.go 83.5% 83.5% 0.0

@dlorenc
Copy link
Contributor Author

dlorenc commented Aug 13, 2019

I think there are a couple of doc changes that need to go along with this:

Done!

@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/pullrequest-init/disk.go Do not exist 74.8%
cmd/pullrequest-init/github.go 83.5% 83.5% 0.0

The binary will look for GitHub credentials in the `$GITHUBTOKEN` environment
variable. This should generally be specified as a secret with the field name
`githubToken` in the `PullRequestResource` definition.
For information about the payloads written to disk, see the [resource documentation](../../docs.resources.md#pull-request-resource).
Copy link
Collaborator

Choose a reason for hiding this comment

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

wooooot

Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

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

im gonna assume my unit test rhetoric did not convince you XD

/lgtm
/meow space

"RawStatus": "/tmp/pr/github/status.json"
"Text": "comment body",
"Author": "author",
"ID": 202131633
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice updates!

@tekton-robot
Copy link
Collaborator

@bobcatfish: cat image

In response to this:

im gonna assume my unit test rhetoric did not convince you XD

/lgtm
/meow space

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 13, 2019
Currently the PullRequest resource produces one large json object representing the
entire PR. This works, but makes it harder to write simple programs to manipulate this
object.

This commit changes this interface to produce a set of files, each representing a part
of the initial pull request. This makes it easier for programs to do simple tasks like add
labels or comments.
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Aug 13, 2019
@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/pullrequest-init/disk.go Do not exist 74.8%
cmd/pullrequest-init/github.go 83.5% 83.5% 0.0

@bobcatfish
Copy link
Collaborator

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 13, 2019
@tekton-robot tekton-robot merged commit 5e95307 into tektoncd:master Aug 13, 2019
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. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants