Skip to content

Commit a28c44f

Browse files
authored
Merge pull request #13587 from Kobzol/ci-remove-bors
Switch CI from bors to merge queue
2 parents ab560d8 + 843ef1b commit a28c44f

File tree

6 files changed

+75
-129
lines changed

6 files changed

+75
-129
lines changed

.github/workflows/clippy_dev.yml

+17-33
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
name: Clippy Dev Test
22

33
on:
4-
push:
5-
branches:
6-
- auto
7-
- try
4+
merge_group:
85
pull_request:
9-
# Only run on paths, that get checked by the clippy_dev tool
10-
paths:
11-
- 'CHANGELOG.md'
12-
- 'README.md'
13-
- '**.stderr'
14-
- '**.rs'
156

167
env:
178
RUST_BACKTRACE: 1
@@ -47,28 +38,21 @@ jobs:
4738
cargo check
4839
git reset --hard HEAD
4940
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())
41+
conclusion_dev:
42+
needs: [ clippy_dev ]
43+
# We need to ensure this job does *not* get skipped if its dependencies fail,
44+
# because a skipped job is considered a success by GitHub. So we have to
45+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
46+
# when the workflow is canceled manually.
47+
#
48+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
49+
if: ${{ !cancelled() }}
6950
runs-on: ubuntu-latest
70-
needs: [clippy_dev]
71-
7251
steps:
73-
- name: Mark the job as a failure
74-
run: exit 1
52+
# Manually check the status of all dependencies. `if: failure()` does not work.
53+
- name: Conclusion
54+
run: |
55+
# Print the dependent jobs to see them in the CI log
56+
jq -C <<< '${{ toJson(needs) }}'
57+
# Check if all jobs that we depend on (in the needs array) were successful.
58+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

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

+18-33
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

+22-18
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
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:
16-
# Don't run Clippy tests, when only text files were modified
17-
paths-ignore:
18-
- 'COPYRIGHT'
19-
- 'LICENSE-*'
20-
- '**.md'
21-
- '**.txt'
225

236
env:
247
RUST_BACKTRACE: 1
@@ -35,7 +18,7 @@ concurrency:
3518

3619
jobs:
3720
base:
38-
# NOTE: If you modify this job, make sure you copy the changes to clippy_bors.yml
21+
# NOTE: If you modify this job, make sure you copy the changes to clippy_mq.yml
3922
runs-on: ubuntu-latest
4023

4124
steps:
@@ -73,3 +56,24 @@ jobs:
7356
run: .github/driver.sh
7457
env:
7558
OS: ${{ runner.os }}
59+
60+
# We need to have the "conclusion" job also on PR CI, to make it possible
61+
# to add PRs to a merge queue.
62+
conclusion:
63+
needs: [ base ]
64+
# We need to ensure this job does *not* get skipped if its dependencies fail,
65+
# because a skipped job is considered a success by GitHub. So we have to
66+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
67+
# when the workflow is canceled manually.
68+
#
69+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
70+
if: ${{ !cancelled() }}
71+
runs-on: ubuntu-latest
72+
steps:
73+
# Manually check the status of all dependencies. `if: failure()` does not work.
74+
- name: Conclusion
75+
run: |
76+
# Print the dependent jobs to see them in the CI log
77+
jq -C <<< '${{ toJson(needs) }}'
78+
# Check if all jobs that we depend on (in the needs array) were successful.
79+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

.github/workflows/remark.yml

+17-29
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
name: Remark
22

33
on:
4-
push:
5-
branches:
6-
- auto
7-
- try
4+
merge_group:
85
pull_request:
9-
paths:
10-
- '**.md'
116

127
jobs:
138
remark:
@@ -45,28 +40,21 @@ jobs:
4540
- name: Build mdbook
4641
run: mdbook build book
4742

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())
43+
conclusion_remark:
44+
needs: [ remark ]
45+
# We need to ensure this job does *not* get skipped if its dependencies fail,
46+
# because a skipped job is considered a success by GitHub. So we have to
47+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
48+
# when the workflow is canceled manually.
49+
#
50+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
51+
if: ${{ !cancelled() }}
6752
runs-on: ubuntu-latest
68-
needs: [remark]
69-
7053
steps:
71-
- name: Mark the job as a failure
72-
run: exit 1
54+
# Manually check the status of all dependencies. `if: failure()` does not work.
55+
- name: Conclusion
56+
run: |
57+
# Print the dependent jobs to see them in the CI log
58+
jq -C <<< '${{ toJson(needs) }}'
59+
# Check if all jobs that we depend on (in the needs array) were successful.
60+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

CONTRIBUTING.md

+1-15
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

-1
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)