-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 GitHub status updates to Pull Request CRD. #995
Conversation
/retest |
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.
Looks good to me, question though : right now it's up to the user to write github status or not right (with this PR) ? Do we envision some "automation" around that ?
Yup! Great question, I'd love to source more ideas around this. The straight-forward answer would be to provide a runner binary that would wrap test execution and transform status codes and stdout/stderr to the pull request object. Is there any work being done around passing state between TaskRuns (e.g. for conditional execution or something similar)? |
@wlynch yeah we need to think about that, as I think I remember talking about notification as a first-class citizen in Tekton maybe ? (and most likely write on a design docs).
@dibyom ^^ 👼 |
@wlynch yes, the condition container will have access to some read only metadata. Right now, this is just the pipeline run including the status fields. We could expose this to task runs as well? Or do you need to write additional metadata that needs to be exposed? |
@dibyom Don't need to write more data, but it would be useful to expose it to TaskRuns to have a binary look for this information and automatically prep PR output as a response. Can you link me to that data and how TaskRuns can access it? |
Yeah, I think the automated use-cases for this would fit into something around either "notification" or "conditional execution". With the conditional execution approach, a pipeline would have a Task that runs on either success or failure and writes the status to Github/Gitlab. |
This could be implemented with the CloudEventPipelineResource as well.
The advantages of using a separate Task/TaskRun are:
|
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.
Thank you for this, nice work!
I tried out the code and integrated it in the demo I did last week and it works nicely.
ActionRequired StatusCode = "action_required" | ||
) | ||
|
||
// TODO: Add getters to make types nil-safe. |
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.
Are you planning this for a follow-up PR?
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.
Yup! Didn't want to include this in this change since it's going to be a lot of boilerplate 😭
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.
/retest |
WIP but its a file ( Its exposed to conditional pods at the moment and not regular taskruns. I opened #1016 to track that. |
/assign @imjasonh |
/lgtm |
/approve |
/retest |
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.
There is a binary checked in cmd/pullrequest-init/pullrequest-init
. Is that intentional?
Good catch! Removed. |
This adds support for the GitHub Status API (https://developer.github.com/v3/repos/statuses/). This accompanies tektoncd#778 and tektoncd#895 to complete initial Pull Request support support for GitHub OAuth.
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afrittoli, dlorenc, vdemeester, wlynch 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 |
This adds support for the GitHub Status API
(https://developer.github.com/v3/repos/statuses/).
This accompanies #778 and #895 to complete initial Pull Request support
support for GitHub OAuth.
Changes
Adds GitHub status fetching and updates to Pull Request CRD.
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