Skip to content

Commit d93010f

Browse files
authored
doc: update Mathlib PR workflow for fork-based contributions (#777)
This PR updates the tags_and_branches documentation to reflect that: - PRs to Mathlib should now be made from forks (no need to ask for write access) - The special branches (`lean-pr-testing-NNNN`, `nightly-testing`, `bump/v4*`) live at `leanprover-community/mathlib4-nightly-testing` - Contributors who need regular write access to these branches can ask in the nightly-testing Zulip channel to join the `nightly-testing` GitHub team 🤖 Prepared with Claude Code
1 parent 81f85b6 commit d93010f

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

templates/contribute/tags_and_branches.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ Mathlib.
1313
please rebase your PR onto the `nightly-with-mathlib` branch. This will enable combined CI with Mathlib.
1414

1515
* If you are making a pull request to `leanprover-community/mathlib4`,
16-
please ask for "write" access to the repository via the [zulip chat](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/github.20permission), and push your branch to that repo.
17-
This will enable Mathlib's `.olean` cache to include your pull request.
16+
please make it from a fork. Mathlib's `.olean` cache now works with PRs from forks.
1817

1918
## Tags and branches
2019

@@ -100,12 +99,12 @@ Mathlib.
10099

101100
* Everything said above about Batteries applies to Mathlib, except:
102101
* Development occurs on `master`.
103-
* All PRs to Mathlib should be made from branches of the Mathlib repository itself.
104-
* This is required for Mathlib's `.olean` caching mechanism.
105-
* Please ask on the [zulip chat](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/github.20permission) for "write" permission to Mathlib.
106-
Please write a sentence about your background and plans.
107-
* The `nightly-testing-*` tags and `bump/v4*` branches are write protected,
108-
so may only be modified via PRs, maintainers, or the relevant bots.
102+
* PRs to Mathlib should be made from forks. Mathlib's `.olean` cache now works with PRs from forks.
103+
* The `lean-pr-testing-NNNN`, `nightly-testing`, `nightly-testing-*` tags, and `bump/v4*` branches
104+
all live at `leanprover-community/mathlib4-nightly-testing`, which is a fork of mathlib4.
105+
If you will regularly need write access to these branches, you can ask in the
106+
[nightly-testing channel](https://leanprover.zulipchat.com/#narrow/stream/428973-nightly-testing)
107+
on Zulip to be added to the `nightly-testing` GitHub team.
109108
* Note that the `nightly-testing` branch of Mathlib may use the `nightly-testing` branch of Batteries as required.
110109
* Similarly a `bump/v4.X.0` branch of Mathlib may use the `bump/v4.X.0` branch of Batteries as required.
111110
* Branches `lean-pr-testing-NNNN` are automatically created for any Lean PR that passes CI,
@@ -119,18 +118,18 @@ Every month there is a new Lean release,
119118
and Mathlib aims to migrate to the new Lean release as soon as possible.
120119
To make this process as smooth as possible, we follow the following procedure:
121120

122-
* The `nightly-testing` branch of Mathlib uses the nightly toolchain releases of Lean.
121+
* The `nightly-testing` branch lives at `leanprover-community/mathlib4-nightly-testing` and uses nightly toolchain releases of Lean.
123122
In other words, the `lean-toolchain` file on that branch contains something like `leanprover/lean4:nightly-2024-09-26`.
124123
- This branch is not guaranteed to build without errors.
125-
- Change to this branch are not reviewed by the Mathlib maintainer team.
126-
- This branch is not protected: anybody can push fixes to it.
124+
- Changes to this branch are not reviewed by the Mathlib maintainer team.
125+
- This branch is not protected: members of the `nightly-testing` GitHub team can push fixes to it.
127126
- The purpose of this branch is to adapt Mathlib to changes in the nightly toolchain releases of Lean.
128127
- Typically, a PR `#NNNN` to Lean core will be accompanied by adaptations to Mathlib in a branch `lean-pr-testing-NNNN`.
129128
Once the Lean core PR lands in a nightly toolchain, the Mathlib branch `lean-pr-testing-NNNN` can be merged into `nightly-testing`.
130129
Often one needs to fix merge conflicts in `lean-toolchain`, `lakefile.lean`, and/or `lake-manifest.json`.
131130
- If CI fails on this branch, then it posts a message to ["nightly-testing > Mathlib status updates"](https://leanprover.zulipchat.com/#narrow/stream/428973-nightly-testing/topic/Mathlib.20status.20updates) on Zulip, indicating the failure.
132131
- If CI passes on this branch, then a message is posted to the same thread, indicating success, and giving instructions to create a PR to review the adaptations. (See below.)
133-
* The `bump/v4.X.Y` branches of Mathlib also use nightly toolchain releases of Lean.
132+
* The `bump/v4.X.Y` branches also live at `leanprover-community/mathlib4-nightly-testing` and use nightly toolchain releases of Lean.
134133
- This branch should always build without errors.
135134
- Changes to this branch are reviewed by the Mathlib maintainer team.
136135
- This branch is protected: only Mathlib maintainers and certain bots can push to it.
@@ -152,8 +151,8 @@ To make this process as smooth as possible, we follow the following procedure:
152151
* For this to work, you will need to rebase your PR onto the `nightly-with-mathlib` branch.
153152
The `nightly-with-mathlib` branch points to the latest nightly lean release which passes mathlib CI,
154153
and for which a `nightly-testing-YYYY-MM-DD` tag exists on Mathlib (and possibly Batteries).
155-
* The bot will create a `lean-pr-testing-NNNN` branch at Mathlib from the `nightly-testing-YYYY-MM-DD` tag,
156-
or push an empty commit to it if it already exists.
154+
* The bot will create a `lean-pr-testing-NNNN` branch at `leanprover-community/mathlib4-nightly-testing`
155+
from the `nightly-testing-YYYY-MM-DD` tag, or push an empty commit to it if it already exists.
157156
* Subsequent CI results from that Mathlib branch will be reported back to the Lean PR
158157
in the form of comments.
159158
* If your PR does not branch off a nightly release for which Mathlib builds, a bot will comment on your

0 commit comments

Comments
 (0)