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

Unable to queue more than a single run in a concurrency group #2227

Closed
jgreat opened this issue Oct 25, 2022 · 1 comment
Closed

Unable to queue more than a single run in a concurrency group #2227

jgreat opened this issue Oct 25, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@jgreat
Copy link

jgreat commented Oct 25, 2022

Describe the bug
Yes this is a duplicate of closed #1523

Github Actions will cancel intermediate runs when additional triggers happen. This happens even with concurrency.cancel-in-progress: false.

  • Push number 1 will trigger a ci.yaml workflow and start a run.
  • Push number 2 will queue a run.
  • Push number 3 will cancel push number 2 and then queue a run for the commit on 3.

This is probably fine for a usual use case of grouping runs by ${{ github.workflow }}-${{ github.ref }}, but isn't the desired behavior if you want to use other identifiers to limit your concurrent runs.

Use case:

I want to limit concurrency by github.actor so dependabot doesn't blow up our self-hosted runners. Dependabot automation cannot be depended on (see what I did there) to honor the set scheduling when synchronizing existing PRs. This consumes all of our self-hosted runner resources.

Limitations faced:

Desired logic:

  • Limit to one concurrent process on master and release/*.
  • Limit other events, PRs and other branches, by actor (user or dependabot).
  • Cancel in progress if master or release/*, but keep queue for PRs and other actors.

To Reproduce

Example concurrency block:

concurrency:
  # Limit to one concurrent process on master and release/*.
  # Limit other events, PRs and other branches, by actor (user or dependabot).
  group: ${{ github.workflow }}-${{ ( github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/') ) && github.ref || github.actor }}
  # Cancel in progress if master or release/*, but keep queue for PRs and other actors.
  cancel-in-progress: ${{ ( github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/') )}}

Runs showing canceled intermediate:
image

Push 2 now shows:

Canceling since a higher priority waiting request for 'CI-jgreat' exists

The concurrency group of CI-jgreat makes sense based on the group logic 👍

Expected behavior

3 queued jobs that would run one after the other. If I wanted to skip an intermediate job I would manually cancel that job. These jobs may be queued up across multiple PRs or branches.

Runner Version and Platform

Version of your runner? - v2.298.2

OS of the machine running the runner? OSX/Windows/Linux/... - Linux Ubuntu 20.04

@jgreat jgreat added the bug Something isn't working label Oct 25, 2022
@nikola-jokic
Copy link
Contributor

Hey @jgreat,

Thank you for raising this issue, but as described in the comment on the issue, the runner does not know anything about the concurrency. The runner receives events from the server and does what it was told to do. Please, post this issue on the GitHub Community Support Forum. The forum is actively monitored, and it will help route this issue to the correct team.

And since this change does not affect the runner, and since we are trying to keep issues related to the runner here, I will close this issue. However, it would be best if you post this issue there ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants