Skip to content

Commit 42e8c1a

Browse files
committed
Update the instructions on setting up bors
1 parent cf0e6d7 commit 42e8c1a

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

src/infra/docs/bors.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ failed are re-approved again on their own.
2121

2222
There are multiple steps needed to add a repository to our Bors instance:
2323

24-
1. The [@bors] GitHub account needs to be granted write access to the
25-
repository.
26-
27-
2. Each CI provider needs to have a single GitHub Check Run to gate on. This is
24+
1. Each CI provider needs to have a single GitHub Check Run to gate on. This is
2825
not provided by default on GitHub Actions, but it can be simulated with
2926
these two jobs, which will generate a `bors build finished` check:
3027

@@ -51,23 +48,43 @@ There are multiple steps needed to add a repository to our Bors instance:
5148
Make sure to replace `[ALL, OTHER, JOBS]` with a list of all the jobs you
5249
want to gate on.
5350

54-
3. Add the repository name to the `permissions!` macro in the [team
51+
These jobs need to run on specific branches (`auto` and `try`) so it's necessary
52+
to add those branches to the list of branches tested by the CI provider. For GitHub
53+
Actions that looks like this:
54+
55+
```yaml
56+
on:
57+
push:
58+
branches: [
59+
master, # This is any branch you normally run CI on
60+
auto, # Added for bors
61+
try # Added for bors
62+
]
63+
```
64+
65+
2. Add the repository name to the bors permissions array in the [team
5566
repository][team-permissions.rs], and grant the `bors.REPOSITORY.review`
56-
permission to the right people.
67+
permission to the right teams or people. You can see an example of adding
68+
bors permissions to a team [here][bors-permission].
5769

5870
3. Add the repository to the `repositories` map in [the Terraform configuration
5971
file][tf-repos]. This will create a webhook and inject its secret key in the
6072
bors execution environment.
6173

6274
4. Add the repository to the [Bors configuration][bors-config], taking
63-
inspiration from other repositories.
75+
inspiration from other repositories. Note that the environment variables used
76+
in that config will be set automatically as long as you completed step 3 above.
77+
78+
5. Give it a test by commenting `@bors ping` in any PR. If you get a response back,
79+
you can then try to approve the PR with `@bors r+`.
6480

6581
[@bors]: https://github.com/bors
6682
[Homu]: https://github.com/rust-lang/homu
6783
[bors-config]: https://github.com/rust-lang/homu/blob/master/cfg.production.toml
6884
[bors.rust-lang.org]: https://bors.rust-lang.org
6985
[ecs]: ./ecs-service.md
7086
[rust-lang/homu]: https://github.com/rust-lang/homu
71-
[team-permissions.rs]: https://github.com/rust-lang/team/blob/master/src/permissions.rs
87+
[team-permissions.rs]: https://github.com/rust-lang/team/blob/52b4370214e1c8eabe483f3a26f22733d94b326f/config.toml#L18-L37
88+
[bors-permission]: https://github.com/rust-lang/team/blob/a1532ec2b08c9d40c0a2c7643ffe72de9671e265/teams/wg-compiler-performance.toml#L25-L26
7289
[tf-repos]: https://github.com/rust-lang/simpleinfra/blob/master/terraform/bors/_config.auto.tfvars
7390
[tf]: https://github.com/rust-lang/simpleinfra/tree/master/terraform/bors/

0 commit comments

Comments
 (0)