Skip to content

Commit 0a3704d

Browse files
authored
docs: split out release steps into separate doc (bazel-contrib#2615)
Move the steps for releasing into a separate doc. The release steps are specific to releases, which only maintainers do. This frees up space in the developing docs for more general tips, tricks, and guidance for others. Along the way... * Remove the text about the core rules being part of Bazel * Put the CLA text first -- if CLAs aren't signed _before_ code is given, it can result is large headaches. * Move some more internal dev steps out of contributing docs.
1 parent e509b7c commit 0a3704d

File tree

3 files changed

+91
-114
lines changed

3 files changed

+91
-114
lines changed

CONTRIBUTING.md

+15-46
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
We'd love to accept your patches and contributions to this project. There are
44
just a few small guidelines you need to follow.
55

6+
## Contributor License Agreement
7+
8+
First, the most important step: signing the Contributor License Agreement. We
9+
cannot look at any of your code unless one is signed.
10+
11+
Contributions to this project must be accompanied by a Contributor License
12+
Agreement. You (or your employer) retain the copyright to your contribution,
13+
this simply gives us permission to use and redistribute your contributions as
14+
part of the project. Head over to <https://cla.developers.google.com/> to see
15+
your current agreements on file or to sign a new one.
16+
17+
You generally only need to submit a CLA once, so if you've already submitted one
18+
(even if it was for a different project), you probably don't need to do it
19+
again.
20+
621
## Getting started
722

823
Before we can work on the code, we need to get a copy of it and setup some
@@ -65,15 +80,6 @@ and setup. Subsequent runs will be faster, but there are many tests, and some of
6580
them are slow. If you're working on a particular area of code, you can run just
6681
the tests in those directories instead, which can speed up your edit-run cycle.
6782

68-
## Updating tool dependencies
69-
70-
It's suggested to routinely update the tool versions within our repo - some of the
71-
tools are using requirement files compiled by `uv` and others use other means. In order
72-
to have everything self-documented, we have a special target -
73-
`//private:requirements.update`, which uses `rules_multirun` to run in sequence all
74-
of the requirement updating scripts in one go. This can be done once per release as
75-
we prepare for releases.
76-
7783
## Formatting
7884

7985
Starlark files should be formatted by
@@ -99,18 +105,6 @@ $ buildifier --lint=fix --warnings=native-py -warnings=all WORKSPACE
99105

100106
Replace the argument "WORKSPACE" with the file that you are linting.
101107

102-
## Contributor License Agreement
103-
104-
Contributions to this project must be accompanied by a Contributor License
105-
Agreement. You (or your employer) retain the copyright to your contribution,
106-
this simply gives us permission to use and redistribute your contributions as
107-
part of the project. Head over to <https://cla.developers.google.com/> to see
108-
your current agreements on file or to sign a new one.
109-
110-
You generally only need to submit a CLA once, so if you've already submitted one
111-
(even if it was for a different project), you probably don't need to do it
112-
again.
113-
114108
## Code reviews
115109

116110
All submissions, including submissions by project members, require review. We
@@ -198,31 +192,6 @@ merged:
198192
`compile_pip_requirements` update target, which is usually in the same directory.
199193
e.g. `bazel run //docs:requirements.update`
200194

201-
## Core rules
202-
203-
The bulk of this repo is owned and maintained by the Bazel Python community.
204-
However, since the core Python rules (`py_binary` and friends) are still
205-
bundled with Bazel itself, the Bazel team retains ownership of their stubs in
206-
this repository. This will be the case at least until the Python rules are
207-
fully migrated to Starlark code.
208-
209-
Practically, this means that a Bazel team member should approve any PR
210-
concerning the core Python logic. This includes everything under the `python/`
211-
directory except for `pip.bzl` and `requirements.txt`.
212-
213-
Issues should be triaged as follows:
214-
215-
- Anything concerning the way Bazel implements the core Python rules should be
216-
filed under [bazelbuild/bazel](https://github.com/bazelbuild/bazel), using
217-
the label `team-Rules-python`.
218-
219-
- If the issue specifically concerns the rules_python stubs, it should be filed
220-
here in this repository and use the label `core-rules`.
221-
222-
- Anything else, such as feature requests not related to existing core rules
223-
functionality, should also be filed in this repository but without the
224-
`core-rules` label.
225-
226195
(breaking-changes)=
227196
## Breaking Changes
228197

DEVELOPING.md

+8-68
Original file line numberDiff line numberDiff line change
@@ -17,71 +17,11 @@
1717
# bazel run //tools/private/update_deps:update_coverage_deps 7.6.1
1818
```
1919

20-
## Releasing
21-
22-
Start from a clean checkout at `main`.
23-
24-
Before running through the release it's good to run the build and the tests locally, and make sure CI is passing. You can
25-
also test-drive the commit in an existing Bazel workspace to sanity check functionality.
26-
27-
### Releasing from HEAD
28-
29-
#### Steps
30-
1. [Determine the next semantic version number](#determining-semantic-version).
31-
1. Update CHANGELOG.md: replace the `v0-0-0` and `0.0.0` with `X.Y.0`.
32-
1. Replace `VERSION_NEXT_*` strings with `X.Y.0`.
33-
1. Send these changes for review and get them merged.
34-
1. Create a branch for the new release, named `release/X.Y`
35-
```
36-
git branch --no-track release/X.Y upstream/main && git push upstream release/X.Y
37-
```
38-
1. Create a tag and push:
39-
```
40-
git tag X.Y.0 upstream/release/X.Y && git push upstream --tags
41-
```
42-
**NOTE:** Pushing the tag will trigger release automation.
43-
1. Release automation will create a GitHub release and BCR pull request.
44-
45-
#### Determining Semantic Version
46-
47-
**rules_python** uses [semantic version](https://semver.org), so releases with
48-
API changes and new features bump the minor, and those with only bug fixes and
49-
other minor changes bump the patch digit.
50-
51-
To find if there were any features added or incompatible changes made, review
52-
[CHANGELOG.md](CHANGELOG.md) and the commit history. This can be done using
53-
github by going to the url:
54-
`https://github.com/bazelbuild/rules_python/compare/<VERSION>...main`.
55-
56-
### Patch release with cherry picks
57-
58-
If a patch release from head would contain changes that aren't appropriate for
59-
a patch release, then the patch release needs to be based on the original
60-
release tag and the patch changes cherry-picked into it.
61-
62-
In this example, release `0.37.0` is being patched to create release `0.37.1`.
63-
The fix being included is commit `deadbeef`.
64-
65-
1. `git checkout release/0.37`
66-
1. `git cherry-pick -x deadbeef`
67-
1. Fix merge conflicts, if any.
68-
1. `git cherry-pick --continue` (if applicable)
69-
1. `git push upstream`
70-
71-
If multiple commits need to be applied, repeat the `git cherry-pick` step for
72-
each.
73-
74-
Once the release branch is in the desired state, use `git tag` to tag it, as
75-
done with a release from head. Release automation will do the rest.
76-
77-
#### After release creation in Github
78-
79-
1. Announce the release in the #python channel in the Bazel slack (bazelbuild.slack.com).
80-
81-
## Secrets
82-
83-
### PyPI user rules-python
84-
85-
Part of the release process uploads packages to PyPI as the user `rules-python`.
86-
This account is managed by Google; contact [email protected] if
87-
something needs to be done with the PyPI account.
20+
## Updating tool dependencies
21+
22+
It's suggested to routinely update the tool versions within our repo - some of the
23+
tools are using requirement files compiled by `uv` and others use other means. In order
24+
to have everything self-documented, we have a special target -
25+
`//private:requirements.update`, which uses `rules_multirun` to run in sequence all
26+
of the requirement updating scripts in one go. This can be done once per release as
27+
we prepare for releases.

RELEASING.md

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Releasing
2+
3+
Start from a clean checkout at `main`.
4+
5+
Before running through the release it's good to run the build and the tests locally, and make sure CI is passing. You can
6+
also test-drive the commit in an existing Bazel workspace to sanity check functionality.
7+
8+
## Releasing from HEAD
9+
10+
### Steps
11+
1. [Determine the next semantic version number](#determining-semantic-version).
12+
1. Update CHANGELOG.md: replace the `v0-0-0` and `0.0.0` with `X.Y.0`.
13+
1. Replace `VERSION_NEXT_*` strings with `X.Y.0`.
14+
1. Send these changes for review and get them merged.
15+
1. Create a branch for the new release, named `release/X.Y`
16+
```
17+
git branch --no-track release/X.Y upstream/main && git push upstream release/X.Y
18+
```
19+
1. Create a tag and push:
20+
```
21+
git tag X.Y.0 upstream/release/X.Y && git push upstream --tags
22+
```
23+
**NOTE:** Pushing the tag will trigger release automation.
24+
1. Release automation will create a GitHub release and BCR pull request.
25+
26+
### Determining Semantic Version
27+
28+
**rules_python** uses [semantic version](https://semver.org), so releases with
29+
API changes and new features bump the minor, and those with only bug fixes and
30+
other minor changes bump the patch digit.
31+
32+
To find if there were any features added or incompatible changes made, review
33+
[CHANGELOG.md](CHANGELOG.md) and the commit history. This can be done using
34+
github by going to the url:
35+
`https://github.com/bazelbuild/rules_python/compare/<VERSION>...main`.
36+
37+
## Patch release with cherry picks
38+
39+
If a patch release from head would contain changes that aren't appropriate for
40+
a patch release, then the patch release needs to be based on the original
41+
release tag and the patch changes cherry-picked into it.
42+
43+
In this example, release `0.37.0` is being patched to create release `0.37.1`.
44+
The fix being included is commit `deadbeef`.
45+
46+
1. `git checkout release/0.37`
47+
1. `git cherry-pick -x deadbeef`
48+
1. Fix merge conflicts, if any.
49+
1. `git cherry-pick --continue` (if applicable)
50+
1. `git push upstream`
51+
52+
If multiple commits need to be applied, repeat the `git cherry-pick` step for
53+
each.
54+
55+
Once the release branch is in the desired state, use `git tag` to tag it, as
56+
done with a release from head. Release automation will do the rest.
57+
58+
### After release creation in Github
59+
60+
1. Announce the release in the #python channel in the Bazel slack (bazelbuild.slack.com).
61+
62+
## Secrets
63+
64+
### PyPI user rules-python
65+
66+
Part of the release process uploads packages to PyPI as the user `rules-python`.
67+
This account is managed by Google; contact [email protected] if
68+
something needs to be done with the PyPI account.

0 commit comments

Comments
 (0)