kbendick opened a new issue #2080:
URL: https://github.com/apache/iceberg/issues/2080


   I've noticed that when we open PRs, that the CI suite is run for all commits 
that are pushed after it's opened.
   
   It would be beneficial to add an action to cancel previous workflow runs 
when a new run begins. This would greatly reduce the burden on CI resources.
   
   There are actions that can be added, such as this one: 
https://github.com/marketplace/actions/cancel-previous-workflow-runs. This 
action can be set as a cron job or as an initial step in the workflow itself to 
immediately cancel ongoing previous runs when more code is pushed. 
Unfortunately for us, it's not possible for the action to immediately cancel 
runs when a PR uses a fork for a source branch, but the cron job option would 
still work. I've included the documentation about it from the linked action.
   
   ```
   Additionally this action can be placed as an early step in your workflow 
(e.g. after checkout),
   so that it can abort the other previously running jobs immediately, in case 
most resources are tied up.
   Unfortunately this approach is a no-op when a pull request uses a fork for a 
source branch.
   This is because the GITHUB_TOKEN provided to runs with a fork source branch 
specifies read-only permissions
   for security reasons. Write permissions are required to be able to cancel a 
job. Therefore, it's a good idea to
   only rely on this approach as a fallback in-addition to the previously 
described scheduling model.
   ```
   
   We should at least consider adding the cron job to cancel stale workflow 
runs, as their results aren't going to be that useful anyway and this could 
greatly reduce the burden on CI. This should likely be done across all of the 
Apache repos that use Github actions for expensive (long running) tasks, given 
that we all share the same set of limited resources.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to