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

fix(ci): prevent workflow cancellation due to multiple concurrent merges #3274

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

adi-yakovian-starkware
Copy link

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@adi-yakovian-starkware adi-yakovian-starkware force-pushed the adi/ci/fix-merges-concurrency branch 14 times, most recently from c5933d3 to 3a9d403 Compare January 13, 2025 22:13
@adi-yakovian-starkware adi-yakovian-starkware force-pushed the adi/ci/fix-merges-concurrency branch from 3a9d403 to 16bab6c Compare January 13, 2025 22:21
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 12 files at r1, all commit messages.
Reviewable status: 1 of 12 files reviewed, 2 unresolved discussions (waiting on @adi-yakovian-starkware and @alon-dotan-starkware)


.github/workflows/blockifier_ci.yml line 42 at r1 (raw file):

# On PR events, cancel existing CI runs on this same PR for this workflow.
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}

where is the job identifier now?
if it's not part of the concurrency group then the entire workflow will be cancelled even if only one job is re-run

Code quote:

github.job

.github/workflows/blockifier_ci.yml line 46 at r1 (raw file):

    ${{ github.workflow }}-
    ${{ github.ref }}-
    ${{ github.event_name == 'pull_request' && 'PR' || github.sha }}

what does this do, exactly?

Code quote:

${{ github.event_name == 'pull_request' && 'PR' || github.sha }}

Copy link
Author

@adi-yakovian-starkware adi-yakovian-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 12 files reviewed, 2 unresolved discussions (waiting on @alon-dotan-starkware and @dorimedini-starkware)


.github/workflows/blockifier_ci.yml line 42 at r1 (raw file):

Previously, dorimedini-starkware wrote…

where is the job identifier now?
if it's not part of the concurrency group then the entire workflow will be cancelled even if only one job is re-run

The job identifier didn't mean anything, as the concurrency block is defined in the workflow context and not per job.
I we'd like to use the job identifier for real, then we need to copy the concurrency block to each relevant job.
It makes sense to me, but I think it should be done in a different PR as such change is somewhat unrelated.


.github/workflows/blockifier_ci.yml line 46 at r1 (raw file):

Previously, dorimedini-starkware wrote…

what does this do, exactly?

if the event is PR, then it is equal to the string PR and otherwise it equals the tip commit sha.
Examples from yesterday's runs:

  1. A concurrency group of this PR: Blockifier-CI-2-refs/pull/3274/merge-PR.
  2. A concurrency group for this branch (push event): Blockifier-CI-2-refs/heads/adi/ci/fix-merges-concurrency-3a9d403c4a5c56349f03080c8048ec1e513d2aaa.

This means that all runs that are triggered by a PR event belong to the same group, so a PR re-run cancels an in-progress run.
However, each push event necessarily belongs to a new concurrency group, as its commit is unique.

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 11 of 12 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @alon-dotan-starkware)

@adi-yakovian-starkware adi-yakovian-starkware merged commit b307553 into main-v0.13.4 Jan 16, 2025
23 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants