Skip to content

Reduce CI compute time by cancelling obsolete workflow jobs #7672

Closed
@mtrezza

Description

@mtrezza

New Feature / Enhancement Checklist

Current Limitation

There are 2 perspectives when it comes to CI compute time optimization:

  • a) Reducing the individual workflow job time, e.g. reducing the timeouts in tests
  • b) Reducing the overall compute time, e.g. the total compute time consumed by the Parse Organization

Currently, (b) is the sum of all (a), but it don't have to be. The compute time (b) could be significantly reduced by cancelling any currently running workflow jobs (a) from previous commits when a new job started because of a new commit, on a per-branch basis. Looking at the workflow logs, I'd estimate a compute time reduction around 50-70%.

Feature / Enhancement Description

Add workflow job trigger to cancel any currently running jobs of previous commit of the same branch of the same workflow.

That should only apply to CI workflows to run tests, not to release-related workflows.

Example Use Case

  1. Open PR
  2. Make commit 1 -> workflow runs tests for commit 1
  3. Make commit 2 -> workflow runs tests for commit 2
  4. Cancel job for commit 1 as it's superseded by job for commit 2

Alternatives / Workarounds

  • Manually cancel the workflow run
  • Ignore and accept the wasted compute time

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:ciCI related issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions