README.md 11.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->
A
Alek Storm 已提交
19

20
# Apache Releases
A
Alek Storm 已提交
21

22 23
Until things settle and we create scripts that streamline this,
you'll probably want to run these commands manually and understand what
24
they do prior to doing so.
A
Alek Storm 已提交
25

26 27
For coordinating on releases, on operational topics that require more
synchronous communications, we recommend using the `#apache-releases` channel
28 29 30
on the Superset Slack. People crafting releases and those interested in
partaking in the process should join the channel.

31
## Release setup (First Time Only)
32

33 34
First you need to setup a few things. This is a one-off and doesn't
need to be done at every release.
A
Alek Storm 已提交
35 36

```bash
37
    # Create PGP Key, and use your @apache.org email address
38
    gpg --gen-key
39

40
    # Checkout ASF dist repo
41 42 43

    svn checkout https://dist.apache.org/repos/dist/dev/incubator/superset/ ~/svn/superset_dev

44
    svn checkout https://dist.apache.org/repos/dist/release/incubator/superset/ ~/svn/superset
45
    cd ~/svn/superset
46 47


48
    # Add your GPG pub key to KEYS file. Replace "Maxime Beauchemin" with your name
49 50
    export SUPERSET_PGP_FULLNAME="Maxime Beauchemin"
    (gpg --list-sigs "${SUPERSET_PGP_FULLNAME}" && gpg --armor --export "${SUPERSET_PGP_FULLNAME}" ) >> KEYS
51 52


53 54
    # Commit the changes
    svn commit -m "Add PGP keys of new Superset committer"
A
Alek Storm 已提交
55 56
```

57 58 59 60 61 62 63 64 65
## Setting up the release environment (do every time)

As the vote process takes a minimum of 72h (community vote) + 72h (IPMC) vote,
often stretching over several weeks calendar time if votes don't pass, chances are
the same terminal session won't be used for crafting the release candidate and the
final release. Therefore, it's a good idea to do the following every time you
work on a new phase of the release process to make sure you aren't releasing
the wrong files/using wrong names. There's a script to help you set correctly all the
necessary environment variables. Change your current directory to `superset/RELEASING`
66
and execute the `set_release_env.sh` script with the relevant parameters:
67

68
Usage (BASH):
69
```bash
70 71 72 73 74 75 76 77 78 79
    . set_release_env.sh <SUPERSET_RC_VERSION> <PGP_KEY_FULLNAME>
```

Usage (ZSH):
```bash
    source set_release_env.sh <SUPERSET_RC_VERSION> <PGP_KEY_FULLNAME>
```

Example:
```bash
80
    source set_release_env.sh 0.38.0rc1 myid@apache.org
81 82
```

83
The script will output the exported variables. Here's example for 0.38.0rc1:
84 85 86

```
    Set Release env variables
87
    SUPERSET_VERSION=0.38.0
88
    SUPERSET_RC=1
89
    SUPERSET_GITHUB_BRANCH=0.38
90
    SUPERSET_PGP_FULLNAME=myid@apache.org
91 92 93 94 95 96
    SUPERSET_VERSION_RC=0.38.0rc1
    SUPERSET_RELEASE=apache-superset-incubating-0.38.0
    SUPERSET_RELEASE_RC=apache-superset-incubating-0.38.0rc1
    SUPERSET_RELEASE_TARBALL=apache-superset-incubating-0.38.0-source.tar.gz
    SUPERSET_RELEASE_RC_TARBALL=apache-superset-incubating-0.38.0rc1-source.tar.gz
    SUPERSET_TMP_ASF_SITE_PATH=/tmp/incubator-superset-site-0.38.0
97 98
```

99 100
## Crafting a source release

101
When crafting a new minor or major release we create
102
a branch named with the release MAJOR.MINOR version (on this example 0.37).
103
This new branch will hold all PATCH and release candidates
104 105 106
that belong to the MAJOR.MINOR version.

The MAJOR.MINOR branch is normally a "cut" from a specific point in time from the master branch.
107
Then (if needed) apply all cherries that will make the PATCH.
108

109 110 111 112 113 114 115
```bash
git checkout -b $SUPERSET_GITHUB_BRANCH
git push upstream $SUPERSET_GITHUB_BRANCH
```

Next, update the `CHANGELOG.md` with all the changes that are included in the release.
Make sure the branch has been pushed to `upstream` to ensure the changelog generator
116
can pick up changes since the previous release.
117

118
Example:
119
```bash
120
python changelog.py --previous_version 0.37 --current_version 0.38 changelog
121 122
```

123 124
The script will checkout both branches and compare all the PR's, copy the output and paste it on the `CHANGELOG.md`

125 126 127 128 129
Then, in `UPDATING.md`, a file that contains a list of notifications around
deprecations and upgrading-related topics,
make sure to move the content now under the `Next Version` section under a new
section for the new release.

130
Finally bump the version number on `superset-frontend/package.json` (replace with whichever version is being released excluding the RC version):
131

132
```json
133
    "version": "0.38.0"
134
```
135

136 137 138 139 140 141 142 143 144 145
Commit the change with the version number, then git tag the version with the release candidate and push to the branch:

```
    # add changed files and commit
    git add ...
    git commit ...
    # push new tag
    git tag ${SUPERSET_VERSION_RC}
    git push upstream ${SUPERSET_VERSION_RC}
```
146

147 148 149
## Preparing the release candidate

The first step of preparing an Apache Release is packaging a release candidate
150
to be voted on. Make sure you have correctly prepared and tagged the ready to ship
151
release on Superset's repo (MAJOR.MINOR branch), the following script will clone
152
the tag and create a signed source tarball from it:
153 154

```bash
155
    # make_tarball will use the previously set environment variables
156 157
    # you can override by passing arguments: make_tarball.sh <SUPERSET_VERSION> <SUPERSET_VERSION_RC> "<PGP_KEY_FULLNAME>"
    ./make_tarball.sh
158
```
159

160
Note that `make_tarball.sh`:
161

162 163
- By default assumes you have already executed an SVN checkout to `$HOME/svn/superset_dev`.
This can be overriden by setting `SUPERSET_SVN_DEV_PATH` environment var to a different svn dev directory
164 165
- Will refuse to craft a new release candidate if a release already exists on your local svn dev directory
- Will check `package.json` version number and fails if it's not correctly set
166

167
### Build and test the created source tarball
168

169
To build and run the **local copy** of the recently created tarball:
170
```bash
171 172 173 174
    # Build and run a release candidate tarball
    ./test_run_tarball.sh local
    # you should be able to access localhost:5001 on your browser
    # login using admin/admin
175 176
```

177
### Shipping to SVN
178

179
Now let's ship this RC into svn's dev folder
180 181

```bash
182
    cd ~/svn/superset_dev/
183 184
    svn add ${SUPERSET_VERSION_RC}
    svn commit -m "Release ${SUPERSET_VERSION_RC}"
185 186
```

187
### Build and test from SVN source tarball
188

189
To build and run the recently created tarball **from SVN**:
190
```bash
191 192 193 194
    # Build and run a release candidate tarball
    ./test_run_tarball.sh
    # you should be able to access localhost:5001 on your browser
    # login using admin/admin
195 196
```

197 198 199 200 201
### Voting
Now you're ready to start the [VOTE] thread. Here's an example of a
previous release vote thread:
https://lists.apache.org/thread.html/e60f080ebdda26896214f7d3d5be1ccadfab95d48fbe813252762879@<dev.superset.apache.org>

202 203 204
To easily send a voting request to Superset community, still on the `superset/RELEASING` directory:

```bash
205
    # Note: use Superset's virtualenv
206 207 208 209
    (venv)$ python send_email.py vote_pmc
```

The script will interactively ask for extra information so it can authenticate on the Apache Email Relay.
210
The release version and release candidate number are fetched from the previously set environment variables.
211 212 213 214 215 216 217

```bash
    Sender email (ex: user@apache.org): your_apache_email@apache.org
    Apache username: your_apache_user
    Apache password: your_apache_password
```

218 219 220 221
Once 3+ binding votes (by PMC members) have been cast and at
least 72 hours have past, you can post a [RESULT] thread:
https://lists.apache.org/thread.html/50a6b134d66b86b237d5d7bc89df1b567246d125a71394d78b45f9a8@%3Cdev.superset.apache.org%3E

222 223 224
To easily send the result email, still on the `superset/RELEASING` directory:

```bash
225
    # Note: use Superset's virtualenv
226 227 228 229
    (venv)$ python send_email.py result_pmc
```

The script will interactively ask for extra information needed to fill out the email template. Based on the
230
voting description, it will generate a passing, non passing or non conclusive email.
231 232 233 234 235 236 237 238 239 240 241
here's an example:

```bash
    Sender email (ex: user@apache.org): your_apache_email@apache.org
    Apache username: your_apache_user
    Apache password: your_apache_password
    A List of people with +1 binding vote (ex: Max,Grace,Krist): Daniel,Alan,Max,Grace
    A List of people with +1 non binding vote (ex: Ville): Ville
    A List of people with -1 vote (ex: John):
```

242 243 244
Following the result thread, yet another [VOTE] thread should be
started at general@incubator.apache.org.

245 246 247
To easily send the voting request to Apache community, still on the `superset/RELEASING` directory:

```bash
248
    # Note: use Superset's virtualenv
249 250 251
    (venv)$ python send_email.py vote_ipmc
```

252 253
Once 3+ binding votes (by IPMC members) have been cast and at
least 72 hours have past, you can post a [RESULT] thread
254

255
To easily send the result email, still on the `superset/RELEASING` directory:
256

257
```bash
258
    # Note: use Superset's virtualenv
259 260 261 262
    (venv)$ python send_email.py result_ipmc
```

Again, the script will interactively ask for extra information needed to fill out the email template. Based on the
263
voting description, it will generate a passing, non passing or non conclusive email.
264 265 266 267 268 269 270 271 272
here's an example:

```bash
    Sender email (ex: user@apache.org): your_apache_email@apache.org
    Apache username: your_apache_user
    Apache password: your_apache_password
    A List of people with +1 binding vote (ex: Alan, Justin): Alan,Jeff,
    A List of people with +1 non binding vote (ex: Ville):
    A List of people with -1 vote (ex: John):
273 274
```

275

276
### Validating a release
277 278 279 280 281

https://www.apache.org/info/verification.html

## Publishing a successful release

282 283
Upon a successful vote (community AND IPMC), you'll have to copy the folder
into the non-"dev/" folder.
284
```bash
285
    cp -r ~/svn/superset_dev/${SUPERSET_VERSION_RC}/ ~/svn/superset/${SUPERSET_VERSION}/
286
    cd ~/svn/superset/
287 288 289 290 291 292 293 294 295 296 297 298 299 300
    # Rename the RC (0.34.1rc1) to the actual version being released (0.34.1)
    for f in ${SUPERSET_VERSION}/*; do mv "$f" "${f/${SUPERSET_VERSION_RC}/${SUPERSET_VERSION}}"; done
    svn add ${SUPERSET_VERSION}
    svn commit -m "Release ${SUPERSET_VERSION}"
```

Then tag the final release:
```bash
    # Go to the root directory of the repo, e.g. `~/src/incubator-superset`
    cd ~/src/incubator-superset/
    # make sure you're on the correct branch (e.g. 0.34)
    git branch
    # Create the release tag
    git tag -f ${SUPERSET_VERSION}
301 302
```

303 304 305 306
### Update CHANGELOG and UPDATING on superset

Now that we have a final Apache source release we need to open a pull request on Superset
with the changes on `CHANGELOG.md` and `UPDATING.md`.
307

308
### Publishing a Convenience Release to PyPI
309

310
Using the final release tarball, unpack it and run `./pypi_push.sh`.
311
This script will build the Javascript bundle and echo the twine command
312
allowing you to publish to PyPI. You may need to ask a fellow committer to grant
313 314 315 316
you access to it if you don't have access already. Make sure to create
an account first if you don't have one, and reference your username
while requesting access to push packages.

317
### Announcing
318

319 320 321
Once it's all done, an [ANNOUNCE] thread announcing the release to the dev@ mailing list is the final step.

```bash
322
    # Note use Superset's virtualenv
323 324 325
    (venv)$ python send_email.py announce
```

326 327 328 329 330 331
### Github Release

Finally, so the Github UI reflects the latest release, you should create a release from the
tag corresponding with the new version. Go to https://github.com/apache/incubator-superset/tags,
click the 3-dot icon and select `Create Release`, paste the content of the ANNOUNCE thread in the
release notes, and publish the new release.