-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Using the same job to run cancel workflow #9357
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
Conversation
--- **Motivation** After introducing the new cancel CI workflow, it takes a lot of job place which cause we have more and more CI in the queue. I saw how the apache/airflow uses, the apache/airflow run it as a step, so let's remove it into the separate workflows. It will reduce our CI job usage. Also, I test it in my own repo, it looks like working well. https://github.com/zymap/pulsar/actions?query=branch%3Atest-duplicate-ci'
eolivelli
left a comment
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.
great !
I left one comment PTAL
| - name: cancle previours runs | ||
| uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738 | ||
| with: | ||
| cancelMode: allDuplicates |
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.
Based on the documentation of apache/airflow-cancel-workflow-runs, I'd assume that this should be duplicates instead of allDuplicates.
Since duplicates is the default value, the cancelMode parameter can be omitted.
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.
some clarification: allDuplicates means "Cancels duplicate runs from all running workflows.". I don't think this makes sense for per-workflow cancellation. the default cancelMode duplicates means "Cancels duplicate runs from the same repo/branch as current run."
| with: | ||
| cancelMode: allDuplicates | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| sourceRunId: ${{ github.event.workflow_run.id }} |
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.
sourceRunId should be omitted when used in the same workflow which should be cancelled. Documentation says about sourceRunId: "Useful only in workflow_run triggered events."
.github/workflows/ci-cpp.yaml
Outdated
| cancelMode: allDuplicates | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| sourceRunId: ${{ github.event.workflow_run.id }} |
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.
previous comments apply to all cancelMode and sourceRunId parameters
|
Adding some description about the background: The workflow that creates these jobs was introduced by PR #9159 . This PR will bring back a solution which is similar to #8393, however using a more advanced Github Action implementation. |
|
@lhotari Thank you for the more information about this! |
lhotari
left a comment
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
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
Motivation
After introducing the new cancel CI workflow, it takes
a lot of job place which cause we have more and more CI
in the queue. I saw how the apache/airflow uses, the
apache/airflow run it as a step, so let's remove it into
the separate workflows. It will reduce our CI job usage.
Also, I test it in my own repo, it looks like working well.
https://github.com/zymap/pulsar/actions?query=branch%3Atest-duplicate-ci'