Skip to content

Commit

Permalink
[TEP-0128]: Scheduled Runs
Browse files Browse the repository at this point in the history
This commit splits TEP-0083 (scheduled and polling runs) into two TEPs,
one for scheduled runs and one for polling runs, and adds an implementation plan
for scheduled runs.
  • Loading branch information
lbernick committed Jan 23, 2023
1 parent d9b6038 commit 6de5c6a
Show file tree
Hide file tree
Showing 5 changed files with 404 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
status: proposed
title: Scheduled and Polling runs in Tekton
title: Polling runs in Tekton
creation-date: '2021-09-13'
last-updated: '2021-09-13'
authors:
- '@vdemeester'
- '@sm43'
---

# TEP-0083: Scheduled and Polling runs in Tekton
# TEP-0083: Polling runs in Tekton

<!-- toc -->
- [Summary](#summary)
Expand Down Expand Up @@ -53,9 +53,8 @@ updates.
[documentation style guide]: https://github.com/kubernetes/community/blob/master/contributors/guide/style-guide.md
-->

This TEP introduces an idea for a feature in triggers which allows user to
- Schedule a pipelinerun/taskrun at a certain time
- Setup a poll which looks for changes on a repository and triggers pipelinerun/taskrun.
This TEP introduces an idea for a feature in triggers which allows user to
setup a poll which looks for changes on a repository and triggers pipelinerun/taskrun.

## Motivation

Expand All @@ -68,19 +67,15 @@ demonstrate the interest in a TEP within the wider Tekton community.
[experience reports]: https://github.com/golang/go/wiki/ExperienceReports
-->

- To allow users to schedule a pipelinerun/taskrun at a certain time or at certain interval

Ex. I want to run a pipeline every day at 8 am. Currently, I can do this by setting up a cronjob, but having as a part of Trigger could be a good idea. So, Triggers can start a pipelinerun at the time mentioned by me.

- To allow users to use triggers without need to setup a webhook. Triggers could have a feature which allow user to setup a polling feature for a repository which would look for changes in repository and trigger a pipelinerun or taskrun.

This was briefly discussed on Issue [#1168](https://github.com/tektoncd/triggers/issues/1168) and [#480](https://github.com/tektoncd/triggers/issues/480).

This can be solved currently by a setting up a cronjob to check for changes but having as a part of triggers could enhance triggers.


Both of the feature could be use cases of conditional triggering where one is at certain time and other would at a certain time if an additional condition passes. They are
proposed together as the part implementation would be similar which would be discussed in design part in further iterations.
Both this feature and scheduled runs could be use cases of conditional triggering where one is at certain time
and other would run at a certain time if an additional condition passes.

### Goals

Expand All @@ -98,10 +93,6 @@ and make progress.

### Use Cases (optional)

(Scheduled Run)
- As a user, I want to run a pipeline everyday at a certain time. Currently, I can setup using a cronjob which would trigger the run but having this integrated with triggers would be nice. we would do without this feature would be : a cronjob + creating a PipelineRun or a cronjob and a http call to a trigger (to simulate a webhook event).

(Polling)
- As a user, I don't have permission to setup a webhook on a repository having a polling feature could be helpful to solve this issue. I can configure the polling feature to look for changes and trigger a pipeline.

- Due to restriction of company, users might not be able to expose eventlistener publicly so this could be an option which would look for changes at certain duration and trigger a Pipelinerun. [Reference.](https://github.com/tektoncd/triggers/issues/480#issuecomment-620605920)
Expand Down Expand Up @@ -316,7 +307,7 @@ It will be a quick reference for those looking for implementation of this TEP.
## References (optional)

- Polling a repository to detect changes and trigger a pipeline [#1168](https://github.com/tektoncd/triggers/issues/1168)
- Poll based change detection? [#480](https://github.com/tektoncd/triggers/issues/480)
- Poll based change detection? [#480](https://github.com/tektoncd/triggers/issues/480)


<!--
Expand Down
2 changes: 1 addition & 1 deletion teps/0095-common-repository-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Several projects and designs currently in-flight in the Tekton ecosystem
are related to or directly working with source repository-related information.
These include:

- [Scheduled and Polling Runs in Tekton](0083-scheduled-and-polling-runs-in-tekton.md)
- [Polling Runs in Tekton](0083-polling-runs-in-tekton.md)
- [Workflows](../working-groups.md#workflows)
- [Pipeline-as-Code](https://github.com/openshift-pipelines/pipelines-as-code)
- [Remote Resource Resolution](0060-remote-resource-resolution.md)
Expand Down
2 changes: 1 addition & 1 deletion teps/0098-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,6 @@ It will be a quick reference for those looking for implementation of this TEP.

- [TEP-0021: Results API](./0021-results-api.md)
- [TEP-0032: Tekton Notifications](./0032-tekton-notifications.md)
- [TEP-0083: Scheduled and polling runs](./0083-scheduled-and-polling-runs-in-tekton.md)
- [TEP-0083: Polling runs](./0083-polling-runs-in-tekton.md)
- [TEP-0095: Common repository configuration](./0095-common-repository-configuration.md)
- [TEP-0120: Canceling concurrent PipelineRuns](./0120-canceling-concurrent-pipelineruns.md)
Loading

0 comments on commit 6de5c6a

Please sign in to comment.