Skip to content

Commit 2e3df82

Browse files
committed
A more comprehensive release procedure.
The old release procedure did not mention explicitly some necessary steps and generally required a lot of thinking. The new version is an attempt to create a procedure which can be followed from top to bottom without too much thinking.
1 parent a9b50f3 commit 2e3df82

File tree

2 files changed

+126
-45
lines changed

2 files changed

+126
-45
lines changed

Diff for: release_checklist.md

+112-45
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,114 @@
1-
# Checklist for building Jsonnet releases
2-
3-
## Are jsonnet & go-jsonnet in sync?
4-
1) Check out master from both
5-
1) Check go-jsonnet/cpp-jsonnet submodule is HEAD of jsonnet tree, if not:
6-
1) Inside cpp-jsonnet:
7-
1) `git checkout master`
8-
1) `git pull`
9-
1) `cd ..`
10-
1) `git checkout -b release`
11-
1) `git commit -a -m 'update cpp-jsonnet'`
12-
1) `./tests.sh` # Have to commit before running this, or it resets the submodule
13-
14-
## Is HEAD ready?
15-
1) Checkout master
16-
1) `make test`
17-
1) `bazel test ...:all`
18-
1) `mkdir build ; cd build ; cmake .. ; make ; make test`
19-
1) modify `include/libjsonnet.h` to bump the version number but add `-pre1`
20-
1)
1+
# Jsonnet Release Checklist
2+
3+
## Preparation
4+
5+
Before doing the release, make sure that the project is in good state:
6+
7+
* Triage issues – make sure that all issues are labelled.
8+
* Check for release-blocking bugs. All bugs which results in a wrong result of the evaluation are release-blocking.
9+
* Go through the open PRs – consider merging any outstanding ones. Do not merge big changes right before the release.
10+
* Sync google/go-jsonnet and google/jsonnet
11+
1) Check out master from both
12+
1) Check go-jsonnet/cpp-jsonnet submodule is HEAD of jsonnet tree, if not:
13+
1) Inside cpp-jsonnet:
14+
1) `git checkout master`
15+
1) `git pull`
16+
1) `cd ..`
17+
1) `git checkout -b release`
18+
1) Update the standard library: `go run cmd/dumpstdlibast/dumpstdlibast.go cpp-jsonnet/stdlib/std.jsonnet > astgen/stdast.go`
19+
1) `./tests.sh`
20+
1) Fix any failing tests.
21+
1) Send a PR with the updated version, so that all the CI tests are run
22+
* Check that CI is green.
23+
* Make sure that the project can be built and the tests pass using all build systems.
24+
* C++:
25+
1) `make test`
26+
1) `bazel test ...:all`
27+
1) `mkdir build ; cd build ; cmake .. ; make ; make test`
28+
* Go:
29+
1) `./tests.sh`
30+
2) `bazel test //:go_default_test`
31+
* Make sure the Python bindings work (build and run tests locally).
32+
* Go through the commits since the last release and prepare the release notes.
33+
* The release notes should have separate sections for the language changes and
34+
changes specific to each implementation.
35+
* Make sure that the stdlib documentation is complete. Check the release notes for any
36+
additions or changes to stdlib and make sure they are reflected in the documentation.
37+
* Make sure that you can build the website locally.
38+
* `make doc/js/libjsonnet.js`
39+
* `tools/scripts/serve_docs.sh`
40+
* Check that it works in two different browsers. Make sure that live evaluation
41+
in the tutorial works.
42+
43+
All the above points apply to both google/jsonnet and google/go-jsonnet.
44+
45+
## Make a final decision to release
46+
47+
A this point you should be confident that the project is ready for the release.
48+
Some of subsequent steps leave project are hard to reverse and/or leave the project in
49+
an inconsistent state, so proceed only if you have time to complete the release process
50+
in one sitting and fix any unexpected problems.
51+
52+
## Release the C++ version
53+
54+
* Modify `include/libjsonnet.h` to bump the version number but add `-pre1` suffix.
55+
* Update `test_cmd` golden file version numbers:
56+
```
57+
./tools/scripts/replace_test_cmd_version.sh <NEW_VERSION>-pre1
2158
```
22-
find test_cmd -name '*.cpp' -o -name '*.golang' -o -name '*.stdout' -o -name '*.stderr' -o -name 'stdout' -o -name 'stderr' | \
23-
xargs sed -i 's/ v0[.][0-9.]*/ NEW_VERSION_GOES_HERE/g'
59+
* Upload and test the pre-release Python package.
60+
1) `python setup.py build sdist`
61+
1) `twine upload dist/whatever.tar.gz` (Needs credentials on pypi)
62+
1) ON ANOTHER MACHINE AND CHECK THAT THE VERSION IS CORRECT AND IT ACTUALLY IS BUILDING THINGS IN THE LOG: `sudo pip install jsonnet --pre --upgrade`
63+
1) `python`
64+
1) `import _jsonnet`
65+
1) `_jsonnet.evaluate_snippet('foo', '1+1')`
66+
* Remove -pre from version in `include/libjsonnet.h`.
67+
* Update version in `cpp/CMakeLists.txt`.
68+
* Update `test_cmd` golden file version numbers:
2469
```
25-
1) Check if any changes to the documentation are necessary by checking commits since previous release (especially stdlib additions).
26-
1) In stdlib documentation replace any "Available in upcoming release." with "Available since NEW_VERSION_GOES_HERE".
27-
1) `python setup.py build sdist`
28-
1) `twine upload dist/whatever.tar.gz` (Needs credentials on pypi)
29-
1) ON ANOTHER MACHINE AND CHECK THAT THE VERSION IS CORRECT AND IT ACTUALLY IS BUILDING THINGS IN THE LOG: `sudo pip install jsonnet --pre --upgrade`
30-
1) `python`
31-
1) `import _jsonnet`
32-
1) `_jsonnet.evaluate_snippet('foo', '1+1')`
33-
1) Checkout go-jsonnet master
34-
1) update cpp-jsonnet commit
35-
1) `./tests`
36-
37-
## Do release
38-
1) Remove -pre from version in `include/libjsonnet.h`
39-
1) Update version in `CMakeLists.txt`
40-
1) Update `test_cmd` golden file version numbers
41-
1) run test again!
42-
1) commit and push
43-
1) Make release in github, write release notes by checking commits since previous release
44-
1) `python setup.py build sdist`
45-
1) `twine upload dist/whatever.tar.gz` (the version without the -pre)
46-
1) Post to Jsonnet Google Group
47-
1) Update the live version of the website
70+
./tools/scripts/replace_test_cmd_version.sh <NEW_VERSION>
71+
```
72+
* In stdlib documentation replace any "Available in upcoming release." with "Available since NEW_VERSION_GOES_HERE".
73+
* Send a PR and wait for CI to be green before merging.
74+
* Create a release on Github. Put the previously prepared release notes there.
75+
* Upload the Python package.
76+
1) `python setup.py build sdist`
77+
1) `twine upload dist/whatever.tar.gz` (the version without the -pre)
78+
79+
## Release the Go version
80+
81+
* Sync with the (freshly-released) C++ version.
82+
* At this point the C++ tests will not pass due to a different version in test_cmd tests.
83+
* Modify `vm.go` to bump the version number, but add `-pre1` suffix.
84+
* Upload and test the pre-release Python package.
85+
1) `python setup.py build sdist`
86+
1) `twine upload dist/whatever.tar.gz` (Needs credentials on pypi)
87+
1) ON ANOTHER MACHINE AND CHECK THAT THE VERSION IS CORRECT AND IT ACTUALLY IS BUILDING THINGS IN THE LOG: `sudo pip install gojsonnet --pre --upgrade`
88+
1) `python`
89+
1) `import _gojsonnet`
90+
1) `_gojsonnet.evaluate_snippet('foo', '1+1')`
91+
* Remove the `-pre1` from version in `vm.go`. Now the tests should pass again.
92+
* Send a PR and wait for CI to be green before merging.
93+
* Create a release on Github. Link to the C++ release in the description.
94+
* Upload the Python package.
95+
1) `python setup.py build sdist`
96+
1) `twine upload dist/whatever.tar.gz` (the version without the -pre)
97+
98+
## Update the website
99+
100+
In google/jsonnet:
101+
* `make doc/js/libjsonnet.js`
102+
* `tools/scripts/serve_docs.sh`
103+
* Check that the local version works in two different browsers. Make sure that live evaluation in the tutorial works.
104+
* `tools/scripts/push_docs.sh`
105+
* Check that the public works in two different browsers. Make sure that you are getting the new version (and not an old cached version). Make sure that live evaluation in the tutorial works.
106+
107+
## Make the announcement
108+
109+
* Send an email to the mailing list.
110+
* Announce the new release on Slack.
111+
112+
## After the release
113+
114+
It's a good time to merge big PRs.

Diff for: tools/scripts/replace_test_cmd_version.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
if [ "$#" != 1 ]; then
6+
echo "Usage: $0 <NEW_VERSION>"
7+
fi
8+
9+
NEW_VERSION="$1"
10+
11+
set -x
12+
13+
find test_cmd -name '*.cpp' -o -name '*.golang' -o -name '*.stdout' -o -name '*.stderr' | \
14+
xargs sed -i 's/ v0[.][0-9.]*\(-pre[0-9]*\)\{0,1\}/ '"$NEW_VERSION"'/g'

0 commit comments

Comments
 (0)