-
Notifications
You must be signed in to change notification settings - Fork 128
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
Guard Task execution via changed files #1558
Guard Task execution via changed files #1558
Conversation
Any further ideas welcome! |
99c8c2e
to
94435f2
Compare
94435f2
to
7b269b1
Compare
We don't seem to allow CEL expressions in
|
3fa0fe7
to
e646f15
Compare
e646f15
to
4ee07c0
Compare
It does seem too limiting without |
I was going to create a script that gets the list of changed files and evaluates some gitignore-style conditions in one step to enable skipping e2e-tests. It would avoid the result size limit problems and be more flexible than the default I can put together a PR for it eventually |
I agree, the alternative, as you pointed out is to not build a generic solution but a specific one, which would mean moving the logic into the I do think the first iteration could be to look at the top level directories, that might be good enough. There could be a middle ground, e.g. provide a set of expressions (in CEL or something else) and when those evaluate as
I think that kind of logic should go to the e2e harness, e.g. using |
4ee07c0
to
66a6ffc
Compare
badf619
to
658bf74
Compare
658bf74
to
fba20b0
Compare
This version evaluates expressions over all files in a PR using OPA/Rego. The |
I like this 👍 |
.tekton/pull-request.yaml
Outdated
- tasks := strings.any_prefix_match(input, "task/") | ||
- tasks_pipelines := strings.any_prefix_match(input, ["task/", "pipelines/"]) | ||
- e2e_tests := strings.any_prefix_match(input, ["task/", "pipelines/"]) | ||
- check_partner_tasks := strings.any_prefix_match(input, "partners/") |
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.
IMO all of these should also trigger on .tekton/
and hack/
- a step should run if the step definition changes (or if the script that implements the step changes).
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.
(could also get more specific with it, but .tekton/
and hack/
would be good enough for me)
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.
Very true, added...
33a3841
to
d00accf
Compare
The new Task in `.tekton/tasks/task-switchboard.yaml` produces a list of bindings that evaluate to true for a particular pull request as an array result. Given this result guards can be done, e.g. using when expressions to limit when a Task on the Pipeline needs to run. This way we can skip expensive Tasks that are unrelated to the change done in the pull request. Similar to work in konflux-ci#1188 and konflux-ci#524, with the distinction that the PipelineRun is executed, only potentially not in full.
d00accf
to
76e4986
Compare
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 🌮
The new Task in
.tekton/tasks/changed-dirs.yaml
produces a list of changed directories for a particular pull request as an array result. Given this result guards can be done, e.g. using CEL expressions to limit when a Task on the Pipeline needs to run.This way we can skip expensive Tasks that are unrelated to the change done in the pull request.
Similar to work in #1188 and #524, with the distinction that the PipelineRun is executed, only potentially not in full.