Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Add pull request update #138

Closed
wants to merge 5 commits into from

Conversation

akihikokuroda
Copy link
Member

After the pull request is processed by the webhook,
the task specified in the webhook updates the
pull request with the pipeline run result.

The webhook updates the pull request after the pipeline execution when the github event is the pull request. The default task used to update the pull request is monitor-result-task and the comments added to the pull request are "OK" and "ERROR" based on the result of the pipelinerun.

The custom task can be set at the pulltask in the webhook. The comments can be set at pulltaskparam1 (for sccess) and pullraskparam2 (for failure) in the webhook.

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.

After the pull request is processed by the webhook,
the task specified in the webhook updates the
pull request with the pipeline run result.
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: akihikokuroda
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: alangreene

If they are not already assigned, you can assign the PR to them by writing /assign @alangreene in a comment when ready.

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 the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 8, 2019
Copy link
Member

@a-roberts a-roberts left a comment

Choose a reason for hiding this comment

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

Some questions and changes to be made here please 😄

webhooks-extension/pkg/endpoints/sink.go Outdated Show resolved Hide resolved
webhooks-extension/pkg/endpoints/sink.go Outdated Show resolved Hide resolved
webhooks-extension/pkg/endpoints/sink.go Outdated Show resolved Hide resolved
generatedPipelineRunName := fmt.Sprintf("%s-%s", webhook.Name, startTime)
generatedTaskRunName := generatedPipelineRunName

// Unique names are required so timestamp them.
Copy link
Member

Choose a reason for hiding this comment

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

There's loads of duplicated code here, do we want the branch name in as well (I recently added it for our generated PipelineRuns)? Can anything be extracted into methods to reduce duplication?

Copy link
Member Author

Choose a reason for hiding this comment

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

I looked through these 2 methods. They look similar but they have only a little duplication. I would like to keep them this way.

webhooks-extension/pkg/endpoints/sink.go Outdated Show resolved Hide resolved
webhooks-extension/pkg/endpoints/sink.go Outdated Show resolved Hide resolved
webhooks-extension/pkg/endpoints/sink.go Show resolved Hide resolved
resourcePointer := &pipelineResource
return resourcePointer
}

/* Create a new PipelineResource: this should be of type git or image
Copy link
Member

Choose a reason for hiding this comment

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

Hmm can this now go or should we be using it instead of definePipelineResource?

Copy link
Member Author

Choose a reason for hiding this comment

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

I remove this code.

webhooks-extension/pkg/endpoints/sink.go Show resolved Hide resolved
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@akihikokuroda
Copy link
Member Author

/retest

@akihikokuroda akihikokuroda mentioned this pull request Jul 17, 2019
2 tasks
@castlemilk
Copy link

could the params be changed to something like onsuccesscomment and onfailurecomment? would be a bit clearer for users

@akihikokuroda akihikokuroda deleted the pullrequest branch November 14, 2019 15:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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.

5 participants