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

feat: skip CI when the PR is in draft #952

Merged
merged 3 commits into from
May 13, 2024
Merged

feat: skip CI when the PR is in draft #952

merged 3 commits into from
May 13, 2024

Conversation

psturc
Copy link
Member

@psturc psturc commented Apr 19, 2024

Why

To reduce the load on the prod cluster, let's skip running CI when the PR is WIP (draft)

Notes

  • It is still possible to trigger CI test by commenting /test or /retest even when PR is WIP
  • Since PaC currently does not support event ready_for_review, after converting a PR to "Ready for review" it's required to add a test comment (as mentioned above) to trigger CI

@psturc
Copy link
Member Author

psturc commented Apr 19, 2024

Verification done in this PR:

When the PR is WIP, the Red Hat Konflux / build-definitions-pull-request check is present, but no PR is triggered in tekton-ci namespace
Screenshot 2024-04-19 at 12 39 46

Log from the PaC controller:

{"level":"info","ts":"2024-04-19T10:36:33.454Z","logger":"pipelinesascode","caller":"matcher/annotation_matcher.go:133","msg":"matching pipelineruns to event: URL=https://github.com/redhat-appstudio/build-definitions, target-branch=refs/heads/skip-ci-for-draft-prs, source-branch=refs/heads/skip-ci-for-draft-prs, target-event=push","provider":"github","event-id":"afc93e08-fe38-11ee-85a5-8a60f1cb6ada","event-sha":"7797cc20c8586c04c592197ad3884439c6388433","event-type":"push","namespace":"tekton-ci"}
{"level":"warn","ts":"2024-04-19T10:36:33.505Z","logger":"pipelinesascode","caller":"matcher/annotation_matcher.go:176","msg":"CEL expression is not matching , skipping","provider":"github","event-id":"afc93e08-fe38-11ee-85a5-8a60f1cb6ada","event-sha":"7797cc20c8586c04c592197ad3884439c6388433","event-type":"push","namespace":"tekton-ci"}

(note the message "CEL expression is not matching , skipping"), which is expected with this change

@psturc psturc marked this pull request as ready for review April 19, 2024 10:52
@psturc psturc marked this pull request as draft April 19, 2024 11:12
@psturc psturc force-pushed the skip-ci-for-draft-prs branch from 3a1075a to 958af38 Compare April 19, 2024 11:18
@psturc psturc marked this pull request as ready for review April 19, 2024 11:19
@psturc psturc marked this pull request as draft April 19, 2024 11:23
@psturc psturc marked this pull request as ready for review April 19, 2024 11:27
@psturc psturc marked this pull request as draft April 19, 2024 11:31
@psturc psturc force-pushed the skip-ci-for-draft-prs branch from 958af38 to a899b7e Compare April 19, 2024 11:32
@psturc psturc marked this pull request as ready for review April 19, 2024 11:33
@psturc psturc force-pushed the skip-ci-for-draft-prs branch from a899b7e to 39adf50 Compare April 19, 2024 11:54
@psturc psturc marked this pull request as draft April 19, 2024 12:45
@psturc
Copy link
Member Author

psturc commented Apr 19, 2024

/test

@psturc psturc marked this pull request as ready for review April 19, 2024 12:49
@psturc
Copy link
Member Author

psturc commented Apr 19, 2024

/test

@psturc psturc force-pushed the skip-ci-for-draft-prs branch from 12ae0a0 to 89283cd Compare April 19, 2024 12:50
@psturc psturc requested a review from ralphbean April 19, 2024 12:57
.tekton/pull-request.yaml Outdated Show resolved Hide resolved
.tekton/pull-request.yaml Outdated Show resolved Hide resolved
@psturc
Copy link
Member Author

psturc commented Apr 19, 2024

subprocess exited with status 127
error building at STEP "RUN curl -L https://github.com/enterprise-contract/ec-cli/releases/download/snapshot/ec_linux_amd64 -o /usr/bin/ec && chmod +x /usr/bin/ec && ec version": exit status 127
time="2024-04-19T15:15:00Z" level=error msg="exit status 127"

/retest

@psturc psturc force-pushed the skip-ci-for-draft-prs branch 2 times, most recently from b09fbb0 to 6a790a8 Compare April 26, 2024 14:19
@psturc psturc force-pushed the skip-ci-for-draft-prs branch from 6a790a8 to 8b297c2 Compare May 13, 2024 08:39
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@psturc psturc added this pull request to the merge queue May 13, 2024
Merged via the queue into main with commit 0557cb7 May 13, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants