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

CI: cancel in-progress workflow runs after a push #112955

Merged
merged 2 commits into from
Jun 26, 2023

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Jun 23, 2023

Experimenting with the concurrency attribute.

r? @Mark-Simulacrum

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Jun 23, 2023
@Kobzol
Copy link
Contributor Author

Kobzol commented Jun 23, 2023

Looks like it works. https://github.com/rust-lang/rust/actions/runs/5354873599/jobs/9712454947?pr=112955 was cancelled after the push of c579865.

@Kobzol Kobzol force-pushed the ci-pr-cancel-workflows branch from c579865 to 3c2b8b0 Compare June 23, 2023 09:26
@Kobzol Kobzol marked this pull request as ready for review June 23, 2023 09:26
@klensy
Copy link
Contributor

klensy commented Jun 23, 2023

rust-lang/simpleinfra#303 shouldn't cancel-outdated-build work similarly?

@Kobzol
Copy link
Contributor Author

Kobzol commented Jun 23, 2023

Oh, thanks, I didn't notice. Well, it doesn't seem to work currently.

@klensy
Copy link
Contributor

klensy commented Jun 23, 2023

Except that currently there idea that failling mingw-check-tidy should't fail other PR jobs.

@Kobzol
Copy link
Contributor Author

Kobzol commented Jun 23, 2023

@bors try

@bors
Copy link
Contributor

bors commented Jun 23, 2023

⌛ Trying commit fcfa036ad401722f60a1e6178d186a1ca988a32d with merge fa12c2abed4b7027ba6136d4208bf010f02a9913...

@rust-log-analyzer

This comment has been minimized.

@Kobzol Kobzol force-pushed the ci-pr-cancel-workflows branch from fcfa036 to 1f6e054 Compare June 23, 2023 11:18
@Kobzol Kobzol force-pushed the ci-pr-cancel-workflows branch from 1f6e054 to e8973ea Compare June 25, 2023 14:01
@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 25, 2023

📌 Commit e8973ea has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 25, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 26, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#111326 (Add support for NetBSD/aarch64-be (big-endian arm64).)
 - rust-lang#112559 (Add esp-idf missing targets)
 - rust-lang#112840 (doc: loongarch: Update maintainers)
 - rust-lang#112955 (CI: cancel in-progress workflow runs after a push)
 - rust-lang#112979 (Rewrite most diagnostics as translatable within resolve/imports)
 - rust-lang#113034 (Switch some more Steps to `builder.msg`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5d9935a into rust-lang:master Jun 26, 2023
@rustbot rustbot added this to the 1.72.0 milestone Jun 26, 2023
@Kobzol Kobzol deleted the ci-pr-cancel-workflows branch June 26, 2023 12:56
@@ -30,10 +30,11 @@ permissions:
defaults:
run:
shell: bash
concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
Copy link
Member

Choose a reason for hiding this comment

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

Does this cancel parallel try builds? Right now we allow infinite concurrent try builds, and IMO we should continue to do so.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already discussed here. I hope it shouldn't cancel try builds, because they should have different SHAs.

Copy link
Member

Choose a reason for hiding this comment

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

github.ref is not the commit SHA, it's refs/heads/trying.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then that's bad, I will investigate and fix. Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it cancels parallel try builds, dammit. Sorry for that, I will send a PR with a fix soon.

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 29, 2023
…lbini

CI: do not cancel concurrent builds on the same branch

Do not cancel concurrent builds on the same branch (outside of PRs).

Instead, only cancel them if the builds have the same commit SHA.

From the [documentation](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context):
> The commit SHA that triggered the workflow. The value of this commit SHA depends on the event that triggered the workflow. For more information, see "[Events that trigger workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows)." For example, ffac537e6cbbf934b08745a378932722df287a53.

Fixes: rust-lang#112955 (comment)

r? `@pietroalbini`
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jul 2, 2023
CI: do not cancel concurrent builds on the same branch

Do not cancel concurrent builds on the same branch (outside of PRs).

Instead, only cancel them if the builds have the same commit SHA.

From the [documentation](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context):
> The commit SHA that triggered the workflow. The value of this commit SHA depends on the event that triggered the workflow. For more information, see "[Events that trigger workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows)." For example, ffac537e6cbbf934b08745a378932722df287a53.

Fixes: rust-lang/rust#112955 (comment)

r? `@pietroalbini`
bors added a commit to rust-lang/rust-clippy that referenced this pull request Mar 14, 2024
CI: replace `cancel-outdated-builds` with `concurrency` group

This is the last remaining [usage](https://github.com/search?q=org%3Arust-lang%20cancel-outdated-builds&type=code) of the [cancel-outdated-builds](https://github.com/rust-lang/simpleinfra/tree/master/github-actions/cancel-outdated-builds) CI action. Which means that if we remove its usage, we can remove the code of the action :)

This action was replaced in `rust-lang/rust` with the native Github Actions `concurrency` group [last year](rust-lang/rust#112955).

Note that unlike `rust-lang/rust`, which explicitly allows parallel try builds, `clippy` did not allow them, as all steps of the `clippy_bors.yaml` workflow used the `cancel-outdated-builds` action, regardless of the branch. So the new `concurrency` group mirrors that, which makes it a bit simpler than on `rust-lang/rust`.

r? `@Mark-Simulacrum`
bors added a commit to rust-lang/rust-clippy that referenced this pull request Mar 14, 2024
CI: replace `cancel-outdated-builds` with `concurrency` group

This is the last remaining [usage](https://github.com/search?q=org%3Arust-lang%20cancel-outdated-builds&type=code) of the [cancel-outdated-builds](https://github.com/rust-lang/simpleinfra/tree/master/github-actions/cancel-outdated-builds) CI action. Which means that if we remove its usage, we can remove the code of the action :)

This action was replaced in `rust-lang/rust` with the native Github Actions `concurrency` group [last year](rust-lang/rust#112955).

Note that unlike `rust-lang/rust`, which explicitly allows parallel try builds, `clippy` did not allow them, as all steps of the `clippy_bors.yaml` workflow used the `cancel-outdated-builds` action, regardless of the branch. So the new `concurrency` group mirrors that, which makes it a bit simpler than on `rust-lang/rust`.

changelog: none

r? `@Mark-Simulacrum`
lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Apr 7, 2024
CI: do not cancel concurrent builds on the same branch

Do not cancel concurrent builds on the same branch (outside of PRs).

Instead, only cancel them if the builds have the same commit SHA.

From the [documentation](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context):
> The commit SHA that triggered the workflow. The value of this commit SHA depends on the event that triggered the workflow. For more information, see "[Events that trigger workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows)." For example, ffac537e6cbbf934b08745a378932722df287a53.

Fixes: rust-lang/rust#112955 (comment)

r? `@pietroalbini`
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
CI: do not cancel concurrent builds on the same branch

Do not cancel concurrent builds on the same branch (outside of PRs).

Instead, only cancel them if the builds have the same commit SHA.

From the [documentation](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context):
> The commit SHA that triggered the workflow. The value of this commit SHA depends on the event that triggered the workflow. For more information, see "[Events that trigger workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows)." For example, ffac537e6cbbf934b08745a378932722df287a53.

Fixes: rust-lang/rust#112955 (comment)

r? `@pietroalbini`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants