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

.github: Fix concurrency group comment triggers #16310

Merged

Conversation

pchaigno
Copy link
Member

The first commit fixes the concurrency groups to avoid random PR comments cancelling ongoing end-to-end tests. The second commit enables skipping the paths-filter job when possible. See commit descriptions for details.

Fixes: #16199.

Commit 7e953b9 (".github: Cancel outdated comment workflows") introduced
concurrency groups for workflows triggered by comments. In each
concurrency group, a single workflow can be running at any time, with
previous workflows cancelled when more recent are scheduled.

However, in the context of comment-triggered workflows, a workflow is
triggered for every single comment in the pull request. The actual tests
on the other hand are only triggered for specific comments. But even if
those comments don't contain a phrase that triggers the test (e.g.,
test-me-please or ci-gke), they will cancel previously-running workflows.

To fix this, we need to ensure that the concurrency group with comments
that trigger tests does not include any comments which don't trigger
tests. We can achieve that by appending the actual comment text to the
concurrency group name.

So for example, a comment with "test-me-please" on PR 12345 will trigger
a workflow which belong to concurrency group:

    ConformanceEKS (ci-eks) cilium#12345 test-me-please

If GKE tests are then triggered with ci-gke, the new workflow will
belong to a second concurrency group and won't cancel the first:

    ConformanceEKS (ci-eks) cilium#12345 ci-gke

That is probably okay since it will preserve most of the benefits of
concurrency groups without cancelling everything as soon as someone
posts a comment.

Fixes: 7e953b9 (".github: Cancel outdated comment workflows")
Signed-off-by: Paul Chaignon <paul@cilium.io>
@pchaigno pchaigno added kind/bug/CI This is a bug in the testing code. area/CI Continuous Integration testing issue or flake release-note/ci This PR makes changes to the CI. needs-backport/1.10 labels May 25, 2021
@pchaigno pchaigno requested review from a team as code owners May 25, 2021 21:33
@pchaigno pchaigno requested review from tklauser and aanm May 25, 2021 21:33
@pchaigno pchaigno changed the title Fix concurrency group comment triggers .github: Fix concurrency group comment triggers May 25, 2021
Commit 50df544 (".github: Skip unnecessary ci-xxx tests") introduced a
new job in each of the comment-triggered workflows (ConformanceXXX) to
inspect the code modified by pull requests and skip the end-to-end tests
when possible.

This commit copies the workflow conditions (i.e., scheduled on
cilium/cilium or specific trigger phrase in comment) from the second job
to the first in the workflow to ensure we also skip the new, first job
when possible.

As a consequence the first job won't run for every single comment posted
on pull request. Even though that first job is very quick (~3s), it can
quickly add up in busy hours. It also won't run in forks.

The dependence of the second job on the first (via 'needs') already
ensures the second job won't run if the first is skipped.

Signed-off-by: Paul Chaignon <paul@cilium.io>
@tklauser tklauser added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label May 26, 2021
@twpayne twpayne merged commit e6b5788 into cilium:master May 26, 2021
@pchaigno pchaigno deleted the fix-concurrency-group-comment-triggers branch May 26, 2021 09:55
@qmonnet
Copy link
Member

qmonnet commented May 26, 2021

Removing the label for backport, the relevant parts of the GitHub actions are not in 1.10.

@pchaigno
Copy link
Member Author

@qmonnet If they are not, I think they should be added. Maybe a PR is missing its needs-backport/1.10 label?

@qmonnet
Copy link
Member

qmonnet commented May 26, 2021

I can have a look at it tomorrow, and backport in a later PR if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/CI Continuous Integration testing issue or flake kind/bug/CI This is a bug in the testing code. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/ci This PR makes changes to the CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants