From fd8bd85e84fb146515b734942a84cfa66f6e081c Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Fri, 11 Oct 2019 09:06:59 +0300 Subject: [PATCH 1/7] Separate RC from VERSION --- RELEASING/README.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/RELEASING/README.md b/RELEASING/README.md index cc2cced59c00..eaf2d467b467 100644 --- a/RELEASING/README.md +++ b/RELEASING/README.md @@ -59,19 +59,25 @@ Now let's craft a source release ```bash # Assuming these commands are executed from the root of the repo export REPO_DIR=$(pwd) - # Set VERSION to the release being prepared (rc1 for first vote on version) - export VERSION=0.34.1rc1 - export RELEASE=apache-superset-incubating-${VERSION} - export RELEASE_TARBALL=${RELEASE}-source.tar.gz + # Set VERSION to the release being prepared + export VERSION=0.34.1 + # Set RC to the release candindate number. 1 indicates rc1 i.e. + # first vote on version (0.34.1rc1 in example below) + export RC=1 + + # create fully qualified ids + export VERSION_RC=${VERSION}rc${RC} + export RELEASE=apache-superset-incubating-${VERSION_RC} + export RELEASE_TARBALL=${RELEASE_RC}-source.tar.gz # Let's create a git tag - git tag -f ${VERSION} + git tag -f ${VERSION_RC} # Create the target folder - mkdir -p ~/svn/superset_dev/${VERSION}/ + mkdir -p ~/svn/superset_dev/${VERSION_RC}/ git archive \ - --format=tar.gz ${VERSION} \ - --prefix="${RELEASE}/" \ + --format=tar.gz ${VERSION_RC} \ + --prefix="${RELEASE_RC}/" \ -o ~/svn/superset_dev/${VERSION}/${RELEASE_TARBALL} cd ~/svn/superset_dev/${VERSION}/ @@ -85,7 +91,7 @@ Now let's ship this RC into svn's dev folder ```bash cd ~/svn/superset_dev/ svn add ${VERSION} - svn commit -m "${VERSION}" + svn commit -m "Release ${VERSION}" ``` Now you're ready to start the VOTE thread. From 7376a48f9aca5c4bf217285c6ba009e1f399581b Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Sun, 13 Oct 2019 21:23:06 +0300 Subject: [PATCH 2/7] Fix pypi_push.sh and refine instructions --- RELEASING/README.md | 73 ++++++++++++++++++++++++++++++++++----------- pypi_push.sh | 5 ++-- 2 files changed, 57 insertions(+), 21 deletions(-) diff --git a/RELEASING/README.md b/RELEASING/README.md index eaf2d467b467..806595219fb2 100644 --- a/RELEASING/README.md +++ b/RELEASING/README.md @@ -53,23 +53,60 @@ need to be done at every release. svn commit -m "Add PGP keys of new Superset committer" ``` -## Crafting tarball and signatures +## 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: -Now let's craft a source release ```bash - # Assuming these commands are executed from the root of the repo - export REPO_DIR=$(pwd) - # Set VERSION to the release being prepared - export VERSION=0.34.1 - # Set RC to the release candindate number. 1 indicates rc1 i.e. - # first vote on version (0.34.1rc1 in example below) - export RC=1 + # Set VERSION to the release being prepared, e.g. 0.34.1. + export VERSION=XX.YY.ZZ + # Set RC to the release candindate number. Replacing QQ below with 1 + # indicates rc1 i.e. first vote on version above (0.34.1rc1) + export RC=QQ +``` + +Then you can generate other derived environment variables that are used +throughout the release process: - # create fully qualified ids +```bash export VERSION_RC=${VERSION}rc${RC} - export RELEASE=apache-superset-incubating-${VERSION_RC} - export RELEASE_TARBALL=${RELEASE_RC}-source.tar.gz + export RELEASE=apache-superset-incubating-${VERSION} + export RELEASE_RC=apache-superset-incubating-${VERSION_RC} + export RELEASE_TARBALL=${RELEASE}-source.tar.gz + export RELEASE_RC_TARBALL=${RELEASE_RC}-source.tar.gz +``` + +## Preparing the release candidate + +The first step of preparing an Apache Release is packaging a release candidate +to be voted on. Start by going to the root of the repo and making sure the +prerequisites are in order: +```bash + # Go to the root directory of the repo, e.g. `~/src/incubator-superset` + cd ~/src/incubator-superset/ + export REPO_DIR=$(pwd) + # make sure you're on the correct branch (e.g. 0.34) + git branch +``` + +Make sure the version number under `superset/assets/package.json` corresponds +to `VERSION` above (`0.34.1` in example above), and has been committed to the +branch. + +```bash + grep $(VERSION) superset/assets/package.json +``` + +### Crafting tarball and signatures + +Now let's craft a source release +```bash # Let's create a git tag git tag -f ${VERSION_RC} @@ -84,28 +121,28 @@ Now let's craft a source release ${REPO_DIR}/scripts/sign.sh ${RELEASE}-source.tar.gz ``` -## Shipping to SVN +### Shipping to SVN Now let's ship this RC into svn's dev folder ```bash cd ~/svn/superset_dev/ - svn add ${VERSION} + svn add ${VERSION_RC} svn commit -m "Release ${VERSION}" ``` Now you're ready to start the VOTE thread. -## Validating a release +### Validating a release https://www.apache.org/info/verification.html ## Publishing a successful release -Upon a successful vote, you'll have to copy the folder into the non-"dev/" -folder. +Upon a successful vote (community AND IPMC), you'll have to copy the folder +into the non-"dev/" folder. ```bash - cp -r ~/svn/superset_dev/${VERSION}/ ~/svn/superset/${VERSION}/ + cp -r ~/svn/superset_dev/${VERSION_RC}/ ~/svn/superset/${VERSION}/ cd ~/svn/superset/ svn add ${VERSION} svn commit -m "${VERSION}" diff --git a/pypi_push.sh b/pypi_push.sh index a259f7c22b0b..0e8447cf2f60 100755 --- a/pypi_push.sh +++ b/pypi_push.sh @@ -17,8 +17,7 @@ # first bump up package.json manually, commit and tag rm superset/assets/dist/* cd superset/assets/ -npm run build +npm ci && npm run build cd ../.. python setup.py sdist -echo "RUN: twine upload dist/superset-{VERSION}.tar.gz" - +echo "RUN: twine upload dist/apache-superset-{VERSION}.tar.gz" From dae2d1f20a0505cf3d39df9b94300ae34e994a74 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Sat, 19 Oct 2019 08:29:15 +0300 Subject: [PATCH 3/7] Add SUPERSET_ prefix to env variables --- RELEASING/README.md | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/RELEASING/README.md b/RELEASING/README.md index 806595219fb2..98aee0cecbc2 100644 --- a/RELEASING/README.md +++ b/RELEASING/README.md @@ -63,22 +63,22 @@ work on a new phase of the release process to make sure you aren't releasing the wrong files/using wrong names: ```bash - # Set VERSION to the release being prepared, e.g. 0.34.1. - export VERSION=XX.YY.ZZ + # Set SUPERSET_VERSION to the release being prepared, e.g. 0.34.1. + export SUPERSET_VERSION=XX.YY.ZZ # Set RC to the release candindate number. Replacing QQ below with 1 # indicates rc1 i.e. first vote on version above (0.34.1rc1) - export RC=QQ + export SUPERSET_RC=QQ ``` Then you can generate other derived environment variables that are used throughout the release process: ```bash - export VERSION_RC=${VERSION}rc${RC} - export RELEASE=apache-superset-incubating-${VERSION} - export RELEASE_RC=apache-superset-incubating-${VERSION_RC} - export RELEASE_TARBALL=${RELEASE}-source.tar.gz - export RELEASE_RC_TARBALL=${RELEASE_RC}-source.tar.gz + export SUPERSET_VERSION_RC=${SUPERSET_VERSION}rc${SUPERSET_RC} + export SUPERSET_RELEASE=apache-superset-incubating-${SUPERSET_VERSION} + export SUPERSET_RELEASE_RC=apache-superset-incubating-${SUPERSET_VERSION_RC} + export SUPERSET_RELEASE_TARBALL=${SUPERSET_RELEASE}-source.tar.gz + export SUPERSET_RELEASE_RC_TARBALL=${SUPERSET_RELEASE_RC}-source.tar.gz ``` ## Preparing the release candidate @@ -90,7 +90,7 @@ prerequisites are in order: ```bash # Go to the root directory of the repo, e.g. `~/src/incubator-superset` cd ~/src/incubator-superset/ - export REPO_DIR=$(pwd) + export SUPERSET_REPO_DIR=$(pwd) # make sure you're on the correct branch (e.g. 0.34) git branch ``` @@ -100,22 +100,27 @@ to `VERSION` above (`0.34.1` in example above), and has been committed to the branch. ```bash - grep $(VERSION) superset/assets/package.json + grep ${SUPERSET_VERSION} superset/assets/package.json ``` +If nothing shows up, either the version isn't correctly set in `package.json`, +or the environment variable is misconfigured. + ### Crafting tarball and signatures Now let's craft a source release ```bash # Let's create a git tag - git tag -f ${VERSION_RC} + git tag -f ${SUPERSET_VERSION_RC} # Create the target folder - mkdir -p ~/svn/superset_dev/${VERSION_RC}/ + mkdir -p ~/svn/superset_dev/${SUPERSET_VERSION_RC}/ git archive \ - --format=tar.gz ${VERSION_RC} \ - --prefix="${RELEASE_RC}/" \ - -o ~/svn/superset_dev/${VERSION}/${RELEASE_TARBALL} + --format=tar.gz ${SUPERSET_VERSION_RC} \ + --prefix="${SUPERSET_RELEASE}/" \ + -o /tmp/${SUPERSET_VERSION_RC}/${SUPERSET_RELEASE_RC_TARBALL} + + -o ~/svn/superset_dev/${SUPERSET_VERSION_RC}/${SUPERSET_RELEASE_TARBALL} cd ~/svn/superset_dev/${VERSION}/ ${REPO_DIR}/scripts/sign.sh ${RELEASE}-source.tar.gz From 6ce6a59f39dc3e1758168cf8acf22859a2fdd064 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Tue, 22 Oct 2019 23:23:50 +0300 Subject: [PATCH 4/7] Finalize release instructions --- RELEASING/README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/RELEASING/README.md b/RELEASING/README.md index 98aee0cecbc2..f91fe547fd76 100644 --- a/RELEASING/README.md +++ b/RELEASING/README.md @@ -117,13 +117,11 @@ Now let's craft a source release mkdir -p ~/svn/superset_dev/${SUPERSET_VERSION_RC}/ git archive \ --format=tar.gz ${SUPERSET_VERSION_RC} \ - --prefix="${SUPERSET_RELEASE}/" \ - -o /tmp/${SUPERSET_VERSION_RC}/${SUPERSET_RELEASE_RC_TARBALL} + --prefix="${SUPERSET_RELEASE_RC}/" \ + -o ~/svn/superset_dev/${SUPERSET_VERSION_RC}/${SUPERSET_RELEASE_RC_TARBALL} - -o ~/svn/superset_dev/${SUPERSET_VERSION_RC}/${SUPERSET_RELEASE_TARBALL} - - cd ~/svn/superset_dev/${VERSION}/ - ${REPO_DIR}/scripts/sign.sh ${RELEASE}-source.tar.gz + cd ~/svn/superset_dev/${SUPERSET_VERSION_RC}/ + ${SUPERSET_REPO_DIR}/scripts/sign.sh ${SUPERSET_RELEASE_RC}-source.tar.gz ``` ### Shipping to SVN @@ -132,8 +130,8 @@ Now let's ship this RC into svn's dev folder ```bash cd ~/svn/superset_dev/ - svn add ${VERSION_RC} - svn commit -m "Release ${VERSION}" + svn add ${SUPERSET_VERSION_RC} + svn commit -m "Release ${SUPERSET_VERSION_RC}" ``` Now you're ready to start the VOTE thread. @@ -147,10 +145,12 @@ https://www.apache.org/info/verification.html Upon a successful vote (community AND IPMC), you'll have to copy the folder into the non-"dev/" folder. ```bash - cp -r ~/svn/superset_dev/${VERSION_RC}/ ~/svn/superset/${VERSION}/ + cp -r ~/svn/superset_dev/${SUPERSET_VERSION_RC}/ ~/svn/superset/${SUPERSET_VERSION}/ cd ~/svn/superset/ - svn add ${VERSION} - svn commit -m "${VERSION}" + # 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}" ``` Now you can announce the release on the mailing list, make sure to use the From e3282ba26bfe8d1ee547ea8f8658e3265866b71f Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Tue, 22 Oct 2019 23:26:22 +0300 Subject: [PATCH 5/7] Change one-off to First Time Only --- RELEASING/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASING/README.md b/RELEASING/README.md index f91fe547fd76..b27aacd6048e 100644 --- a/RELEASING/README.md +++ b/RELEASING/README.md @@ -27,7 +27,7 @@ synchronous communications, we tend to use the `#apache-releases` channel on the Superset Slack. People crafting releases and those interested in partaking in the process should join the channel. -## Release setup +## Release setup (First Time Only) First you need to setup a few things. This is a one-off and doesn't need to be done at every release. From 89903988709146ec72cf5d53372a6c76c28e0f0c Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Tue, 22 Oct 2019 23:37:48 +0300 Subject: [PATCH 6/7] Add tagging of final version --- RELEASING/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/RELEASING/README.md b/RELEASING/README.md index b27aacd6048e..62d0c230e3d5 100644 --- a/RELEASING/README.md +++ b/RELEASING/README.md @@ -153,6 +153,16 @@ into the non-"dev/" folder. 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} +``` + Now you can announce the release on the mailing list, make sure to use the proper template From 40ce74337f9677f9ac46dd616bf8ca6ef09ca714 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Wed, 23 Oct 2019 07:44:34 +0300 Subject: [PATCH 7/7] Convert some remaining env variables and add a check step to pypi deploy --- RELEASING/README.md | 7 +++---- pypi_push.sh | 7 +++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/RELEASING/README.md b/RELEASING/README.md index 62d0c230e3d5..1e08df4f1cbd 100644 --- a/RELEASING/README.md +++ b/RELEASING/README.md @@ -96,7 +96,7 @@ prerequisites are in order: ``` Make sure the version number under `superset/assets/package.json` corresponds -to `VERSION` above (`0.34.1` in example above), and has been committed to the +to `SUPERSET_VERSION` above (`0.34.1` in example above), and has been committed to the branch. ```bash @@ -178,11 +178,10 @@ section for the new release. To make a working build given a tarball ```bash # Building a docker from a tarball -VERSION=0.33.0rc2 && \ -docker build -t apache-superset:$VERSION -f Dockerfile.from_tarball . --build-arg VERSION=$VERSION +docker build -t apache-superset:${SUPERSET_VERSION_RC} -f Dockerfile.from_tarball . --build-arg VERSION=${SUPERSET_VERSION_RC} # testing the resulting docker -docker run -p 5001:8088 apache-superset:$VERSION +docker run -p 5001:8088 apache-superset:${SUPERSET_VERSION_RC} # you should be able to access localhost:5001 on your browser # login using admin/admin ``` diff --git a/pypi_push.sh b/pypi_push.sh index 0e8447cf2f60..98daab44216b 100755 --- a/pypi_push.sh +++ b/pypi_push.sh @@ -14,10 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# first bump up package.json manually, commit and tag +# Make sure you've followed the instructions on `RELEASING/README.md` +# and are on the correct branch +cd ${SUPERSET_REPO_DIR} +git branch rm superset/assets/dist/* cd superset/assets/ npm ci && npm run build cd ../.. python setup.py sdist -echo "RUN: twine upload dist/apache-superset-{VERSION}.tar.gz" +echo "RUN: twine upload dist/apache-superset-{SUPERSET_VERSION}.tar.gz"