Skip to content

Commit 3338611

Browse files
committed
Switch CI from bors to merge queue
1 parent 5873cb9 commit 3338611

File tree

6 files changed

+54
-115
lines changed

6 files changed

+54
-115
lines changed

.github/workflows/clippy_dev.yml

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: Clippy Dev Test
22

33
on:
4-
push:
5-
branches:
6-
- auto
7-
- try
4+
merge_group:
85
pull_request:
96
# Only run on paths, that get checked by the clippy_dev tool
107
paths:
@@ -47,28 +44,21 @@ jobs:
4744
cargo check
4845
git reset --hard HEAD
4946
50-
# These jobs doesn't actually test anything, but they're only used to tell
51-
# bors the build completed, as there is no practical way to detect when a
52-
# workflow is successful listening to webhooks only.
53-
#
54-
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
55-
56-
end-success:
57-
name: bors dev test finished
58-
if: github.event.pusher.name == 'bors' && success()
59-
runs-on: ubuntu-latest
60-
needs: [clippy_dev]
61-
62-
steps:
63-
- name: Mark the job as successful
64-
run: exit 0
65-
66-
end-failure:
67-
name: bors dev test finished
68-
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
47+
conclusion_dev:
48+
needs: [ clippy_dev ]
49+
# We need to ensure this job does *not* get skipped if its dependencies fail,
50+
# because a skipped job is considered a success by GitHub. So we have to
51+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
52+
# when the workflow is canceled manually.
53+
#
54+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
55+
if: ${{ !cancelled() }}
6956
runs-on: ubuntu-latest
70-
needs: [clippy_dev]
71-
7257
steps:
73-
- name: Mark the job as a failure
74-
run: exit 1
58+
# Manually check the status of all dependencies. `if: failure()` does not work.
59+
- name: Conclusion
60+
run: |
61+
# Print the dependent jobs to see them in the CI log
62+
jq -C <<< '${{ toJson(needs) }}'
63+
# Check if all jobs that we depend on (in the needs array) were successful.
64+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

.github/workflows/clippy_bors.yml renamed to .github/workflows/clippy_mq.yml

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
name: Clippy Test (bors)
1+
name: Clippy Test (merge queue)
22

33
on:
4-
push:
5-
branches:
6-
- auto
7-
- try
4+
merge_group:
85

96
env:
107
RUST_BACKTRACE: 1
@@ -13,11 +10,6 @@ env:
1310
CARGO_INCREMENTAL: 0
1411
RUSTFLAGS: -D warnings
1512

16-
concurrency:
17-
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
18-
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
19-
cancel-in-progress: true
20-
2113
defaults:
2214
run:
2315
shell: bash
@@ -218,28 +210,21 @@ jobs:
218210
env:
219211
INTEGRATION: ${{ matrix.integration }}
220212

221-
# These jobs doesn't actually test anything, but they're only used to tell
222-
# bors the build completed, as there is no practical way to detect when a
223-
# workflow is successful listening to webhooks only.
224-
#
225-
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
226-
227-
end-success:
228-
name: bors test finished
229-
if: github.event.pusher.name == 'bors' && success()
213+
conclusion:
214+
needs: [ changelog, base, metadata_collection, integration_build, integration ]
215+
# We need to ensure this job does *not* get skipped if its dependencies fail,
216+
# because a skipped job is considered a success by GitHub. So we have to
217+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
218+
# when the workflow is canceled manually.
219+
#
220+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
221+
if: ${{ !cancelled() }}
230222
runs-on: ubuntu-latest
231-
needs: [changelog, base, metadata_collection, integration_build, integration]
232-
233-
steps:
234-
- name: Mark the job as successful
235-
run: exit 0
236-
237-
end-failure:
238-
name: bors test finished
239-
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
240-
runs-on: ubuntu-latest
241-
needs: [changelog, base, metadata_collection, integration_build, integration]
242-
243223
steps:
244-
- name: Mark the job as a failure
245-
run: exit 1
224+
# Manually check the status of all dependencies. `if: failure()` does not work.
225+
- name: Conclusion
226+
run: |
227+
# Print the dependent jobs to see them in the CI log
228+
jq -C <<< '${{ toJson(needs) }}'
229+
# Check if all jobs that we depend on (in the needs array) were successful.
230+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

.github/workflows/clippy.yml renamed to .github/workflows/clippy_pr.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
name: Clippy Test
22

33
on:
4-
push:
5-
# Ignore bors branches, since they are covered by `clippy_bors.yml`
6-
branches-ignore:
7-
- auto
8-
- try
9-
# Don't run Clippy tests, when only text files were modified
10-
paths-ignore:
11-
- 'COPYRIGHT'
12-
- 'LICENSE-*'
13-
- '**.md'
14-
- '**.txt'
154
pull_request:
165
# Don't run Clippy tests, when only text files were modified
176
paths-ignore:
@@ -35,7 +24,7 @@ concurrency:
3524

3625
jobs:
3726
base:
38-
# NOTE: If you modify this job, make sure you copy the changes to clippy_bors.yml
27+
# NOTE: If you modify this job, make sure you copy the changes to clippy_mq.yml
3928
runs-on: ubuntu-latest
4029

4130
steps:

.github/workflows/remark.yml

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: Remark
22

33
on:
4-
push:
5-
branches:
6-
- auto
7-
- try
4+
merge_group:
85
pull_request:
96
paths:
107
- '**.md'
@@ -45,28 +42,21 @@ jobs:
4542
- name: Build mdbook
4643
run: mdbook build book
4744

48-
# These jobs doesn't actually test anything, but they're only used to tell
49-
# bors the build completed, as there is no practical way to detect when a
50-
# workflow is successful listening to webhooks only.
51-
#
52-
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
53-
54-
end-success:
55-
name: bors remark test finished
56-
if: github.event.pusher.name == 'bors' && success()
57-
runs-on: ubuntu-latest
58-
needs: [remark]
59-
60-
steps:
61-
- name: Mark the job as successful
62-
run: exit 0
63-
64-
end-failure:
65-
name: bors remark test finished
66-
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
45+
conclusion_remark:
46+
needs: [ remark ]
47+
# We need to ensure this job does *not* get skipped if its dependencies fail,
48+
# because a skipped job is considered a success by GitHub. So we have to
49+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
50+
# when the workflow is canceled manually.
51+
#
52+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
53+
if: ${{ !cancelled() }}
6754
runs-on: ubuntu-latest
68-
needs: [remark]
69-
7055
steps:
71-
- name: Mark the job as a failure
72-
run: exit 1
56+
# Manually check the status of all dependencies. `if: failure()` does not work.
57+
- name: Conclusion
58+
run: |
59+
# Print the dependent jobs to see them in the CI log
60+
jq -C <<< '${{ toJson(needs) }}'
61+
# Check if all jobs that we depend on (in the needs array) were successful.
62+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

CONTRIBUTING.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ All contributors are expected to follow the [Rust Code of Conduct].
2121
- [Rust Analyzer](#rust-analyzer)
2222
- [How Clippy works](#how-clippy-works)
2323
- [Issue and PR triage](#issue-and-pr-triage)
24-
- [Bors and Homu](#bors-and-homu)
2524
- [Contributions](#contributions)
2625
- [License](#license)
2726

@@ -213,26 +212,13 @@ We have prioritization labels and a sync-blocker label, which are described belo
213212
Or rather: before the sync this should be addressed,
214213
e.g. by removing a lint again, so it doesn't hit beta/stable.
215214

216-
## Bors and Homu
217-
218-
We use a bot powered by [Homu][homu] to help automate testing and landing of pull
219-
requests in Clippy. The bot's username is @bors.
220-
221-
You can find the Clippy bors queue [here][homu_queue].
222-
223-
If you have @bors permissions, you can find an overview of the available
224-
commands [here][homu_instructions].
225-
226215
[triage]: https://forge.rust-lang.org/release/triage-procedure.html
227216
[l-crash]: https://github.com/rust-lang/rust-clippy/labels/L-crash
228217
[l-bug]: https://github.com/rust-lang/rust-clippy/labels/L-bug
229218
[p-low]: https://github.com/rust-lang/rust-clippy/labels/P-low
230219
[p-medium]: https://github.com/rust-lang/rust-clippy/labels/P-medium
231220
[p-high]: https://github.com/rust-lang/rust-clippy/labels/P-high
232221
[l-sync-blocker]: https://github.com/rust-lang/rust-clippy/labels/L-sync-blocker
233-
[homu]: https://github.com/rust-lang/homu
234-
[homu_instructions]: https://bors.rust-lang.org/
235-
[homu_queue]: https://bors.rust-lang.org/queue/clippy
236222

237223
## Contributions
238224

@@ -244,7 +230,7 @@ All PRs should include a `changelog` entry with a short comment explaining the c
244230
"what do you believe is important from an outsider's perspective?" Often, PRs are only related to a single property of a
245231
lint, and then it's good to mention that one. Otherwise, it's better to include too much detail than too little.
246232

247-
Clippy's [changelog] is created from these comments. Every release, someone gets all commits from bors with a
233+
Clippy's [changelog] is created from these comments. Every release, someone gets all merge commits with a
248234
`changelog: XYZ` entry and combines them into the changelog. This is a manual process.
249235

250236
Examples:

book/src/development/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ book](../lints.md).
5353
> - IDE setup
5454
> - High level overview on how Clippy works
5555
> - Triage procedure
56-
> - Bors and Homu
5756
5857
[ast]: https://rustc-dev-guide.rust-lang.org/syntax-intro.html
5958
[hir]: https://rustc-dev-guide.rust-lang.org/hir.html

0 commit comments

Comments
 (0)