fix #2446 update release docs and commands (#2448)

* update release docs and commands

* update doc on release-test install
This commit is contained in:
Ben MR
2021-09-29 15:06:35 +00:00
committed by GitHub
parent f4986c9c7d
commit 5163e35e1f
2 changed files with 23 additions and 28 deletions
+7 -7
View File
@@ -121,24 +121,24 @@ bump-version:
# Create new version to commit to main # Create new version to commit to main
.PHONY: create-release-candidate .PHONY: create-release-candidate
create-release-candidate: dev-env bump-version clean-lite gen-package-lock create-release-candidate: bump-version clean-lite gen-package-lock
@echo "Version bumped part:$(PART) and client built. Ready to commit and push" @echo "Version bumped part:$(PART) and client built. Ready to commit and push"
# Bump the release candidate version if needed (i.e. the previous release candidate had errors). # Bump the release candidate version if needed (i.e. the previous release candidate had errors).
.PHONY: recreate-release-candidate .PHONY: recreate-release-candidate
recreate-release-candidate: dev-env bump-release-candidate clean-lite gen-package-lock recreate-release-candidate: bump-release-candidate clean-lite gen-package-lock
@echo "Version bumped part:$(PART) and client built. Ready to commit and push" @echo "Version bumped part:$(PART) and client built. Ready to commit and push"
# Build dist and release to Test PyPI # Build dist and release to Test PyPI
.PHONY: release-candidate-to-test-pypi .PHONY: release-candidate-to-test-pypi
release-candidate-to-test-pypi: dev-env pydist twine release-candidate-to-test-pypi: pydist twine
@echo "Dist built and uploaded to test.pypi.org" @echo "Dist built and uploaded to test.pypi.org"
@echo "Test the install:" @echo "Test the install:"
@echo " make install-release-test" @echo " make install-release-test"
# Build final dist (gets rid of the rc tag) and release final candidate to TestPyPI # Build final dist (gets rid of the rc tag) and release final candidate to TestPyPI
.PHONY: release-final-to-test-pypi .PHONY: release-final-to-test-pypi
release-final-to-test-pypi: dev-env bump-release clean-lite gen-package-lock pydist twine release-final-to-test-pypi: bump-release clean-lite gen-package-lock pydist twine
@echo "Final release dist built and uploaded to test.pypi.org" @echo "Final release dist built and uploaded to test.pypi.org"
@echo "Test the install:" @echo "Test the install:"
@echo " make install-release-test" @echo " make install-release-test"
@@ -148,9 +148,9 @@ release-final: twine-prod
@echo "Release uploaded to pypi.org" @echo "Release uploaded to pypi.org"
# DANGER: releases directly to prod # DANGER: releases directly to prod
# use this if you accidently burned a test release version number, # use this if you accidentally burned a test release version number,
.PHONY: release-directly-to-prod .PHONY: release-directly-to-prod
release-directly-to-prod: dev-env pydist twine-prod release-directly-to-prod: pydist twine-prod
@echo "Dist built and uploaded to pypi.org" @echo "Dist built and uploaded to pypi.org"
@echo "Test the install:" @echo "Test the install:"
@echo " make install-release" @echo " make install-release"
@@ -200,7 +200,7 @@ install-dev: uninstall
# install from test.pypi to test your release # install from test.pypi to test your release
.PHONY: install-release-test .PHONY: install-release-test
install-release-test: uninstall install-release-test: uninstall
pip install --no-cache-dir --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple cellxgene pip install --no-cache-dir --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple cellxgene==$(VERSION)
@echo "Installed cellxgene from test.pypi.org, now run and smoke test" @echo "Installed cellxgene from test.pypi.org, now run and smoke test"
# install from pypi to test your release # install from pypi to test your release
+16 -21
View File
@@ -19,41 +19,36 @@ Note all release tags pushed to GitHub MUST follow semantic versioning.
## Releasing a Major or Minor Version of cellxgene ## Releasing a Major or Minor Version of cellxgene
Please scroll down the section below for how to release a patch version. Follow these steps to create a major or minor release. Please scroll down the section below for how to release a patch version. Follow these steps to create a major or minor release.
Steps must be run from the project directory and in a virtual env with all the dev deps (requirements-dev.txt)
1. Preparation: 1. In preparation, decide on whether this is a major, minor, or patch release, and determine the release version number, using [semantic versioning](https://semver.org/) (e.g., `0.2.9` -> `0.3.0` is minor version bump).
- python3.6 environment, and a cellxgene clone 2. Create a release branch from latest main, eg, `release-version-0.16.0`
- Define the release version number, using [semantic versioning](https://semver.org/), and specifying all three digits (e.g., 0.3.0) 3. In the release branch, run `make create-release-candidate PART=[major | minor | patch]`. This will bump the version and create a release *candidate* version (e.g. `0.3.0-rc.0`).
- Write the release title and release notes and add to [release notes document](https://docs.google.com/document/d/1KnHwkYfhyWO5H8BDcMu7y3ogjvq5Yi4OwpmZ8DB6w0Y/edit) 4. Commit changes, push the new branch to origin and open a `DO NOT MERGE` draft PR, which will run tests on your branch. We will use this PR later
2. Create a release branch, eg, `release-version-0.16.0`
3. In the release branch, run `make create-release-candidate PART=[major | minor | patch]` where you choose major/minor/patch depending on which part of the version is being bumped (e.g., `0.2.9` -> `0.3.0` is minor version bump). This will bump the version and create a release *candidate* version (i.e. `0.3.0-rc.0`).
4. Push the new branch to origin and open a `DO NOT MERGE` PR, this will run tests on your branch.
5. Upload the release candidate to Test PyPI by running the command `make release-candidate-to-test-pypi`. (Make sure you are registered for PyPI and Test PyPI and you have write access to the cellxgene PyPI package for both). 5. Upload the release candidate to Test PyPI by running the command `make release-candidate-to-test-pypi`. (Make sure you are registered for PyPI and Test PyPI and you have write access to the cellxgene PyPI package for both).
6. Verify the release candidate in a fresh virtual environment by running `make install-release-test` which installs the cellxgene build you just uploaded the Test PyPI. 6. Verify the release candidate in a fresh virtual environment by running `make install-release-test` which installs the cellxgene build you just uploaded to Test PyPI. The PM should do this too.
7. If you find errors with the release candidate, run `make recreate-release-candidate` to increment the release candidate version (i.e. `0.3.0-rc.0` -> `0.3.0-rc.1`). Then go back to Steps 5 and 6 to re-upload and re-test the new release candidate. 7. If you find errors with the release candidate, fix them in main, rebase, and run `make recreate-release-candidate` to increment the release candidate version (i.e. `0.3.0-rc.0` -> `0.3.0-rc.1`). Then go back to Steps 5 and 6 to re-upload and re-test the new release candidate.
8. If everything looks good, push the release to Test PyPI without the release candidate tag by running the command `make release-final-to-test-pypi` (i.e. `0.3.0-rc.1` -> `0.3.0`). 8. If everything looks good, push the release to Test PyPI without the release candidate tag by running the command `make release-final-to-test-pypi` (i.e. `0.3.0-rc.1` -> `0.3.0`).
- **NOTE:** Once you push the final release version to Test PyPI, you cannot ever re-upload the build again. If you need to make changes to the build, you will have to "burn" the version number and bump the part again and go back to step 1 with a brand new version number. For example, if you upload `0.3.0` to Test PyPI and realize there's a bug, you will have to create a new version `0.4.0` and there will be no `0.3.0` version of cellxgene. This is why testing the release candidate is very important. - **NOTE:** Once you push the final release version to Test PyPI, you cannot ever re-upload the build again. If you need to make changes to the build, you will have to "burn" the version number and bump the part again and go back to step 1 with a brand new version number. For example, if you upload `0.3.0` to Test PyPI and realize there's a bug, you will have to create a new version `0.4.0` and there will be no `0.3.0` version of cellxgene. This is why testing the release candidate is very important.
9. Create a PR for the release and conduct a PR review. 9. Publish the open draft PR for the release and conduct a PR review.
10. Merge to the `main` branch. 10. Merge to the `main` branch.
11. Publish to PyPI (prod) (assuming you that you have registered for PyPI, and that you have write access to the cellxgene pypi package) by running `make release-final`. 11. Publish to PyPI (prod) (assuming you that you have registered for PyPI, and that you have write access to the cellxgene pypi package) by running `make release-final`.
12. Test the installation in a fresh virtual environment by running `pip install --no-cache-dir cellxgene`. 12. Test the installation in a fresh virtual environment by running `pip install --no-cache-dir cellxgene`.
13. Create Github release using the version number and release notes ([instructions](https://help.github.com/articles/creating-releases/)): 13. Create Github release using the version number and release notes ([instructions](https://help.github.com/articles/creating-releases/)):
- Draft new release - Draft new release
- Type version name matching release version number from (1) - Type version name matching release version number from (1)
- Select `main` as release branch (ensure you merged the release PR) - Select `main` as release branch (ensure you merged the release PR)
- Create new tag with same name as the release
- Type title `Release {version num}` - Type title `Release {version num}`
- [optional] Check pre-release if this release is not ready for production - Check pre-release
- Publish Release - Ping the PM so they can add release notes, and get them to publish the release
The optional steps are for testing purposes, and are recommended for publishing any major releases, and any releases that significantly change the packaging (e.g. new bundled files, new dependencies, etc.)
### Releasing a Patch Version of cellxgene (special case) ### Releasing a Patch Version of cellxgene (special case)
To make a bugfix release (a point release/patch release) when there are already other changes in `main` we need to do a modified version of our release process. The difference is that instead of using `main` we are going make our release branch off of the tag for the release we want to patch. We cherrypick the commits that we want to include in the patch. Then instead of merging to `main`, we create the release directly off of the branch. To make a bugfix release (a point release/patch release) when there are already other changes in `main` we need to do a modified version of our release process. The difference is that instead of using `main` we are going make our release branch off of the tag for the release we want to patch. We cherrypick the commits that we want to include in the patch. Then instead of merging to `main`, we create the release directly off of the branch.
1. (same as above) Preparation: 1. Determine the patch release number e.g. `0.9.1`
- python3.6 environment, and a cellxgene clone
- Define the release version number, using [semantic versioning](https://semver.org/), and specifying all three digits (e.g., 0.3.2) (for this you will update the last digit to represent a bugfix change).
- Write the release title and release notes and add to [release notes document](https://docs.google.com/document/d/1KnHwkYfhyWO5H8BDcMu7y3ogjvq5Yi4OwpmZ8DB6w0Y/edit)
2. Create a release branch off of the tag for the release you want to update. 2. Create a release branch off of the tag for the release you want to update.
- Checkout the tag for the release you want to fix. For example, if we are fixing 0.9.0: `git checkout 0.9.0`. - Checkout the tag for the release you want to fix. For example, if we are fixing 0.9.0: `git checkout 0.9.0`.
- Create a branch from that tag. `git branch release-version-0.9.1` - Create a branch from that tag. `git branch release-version-0.9.1`
@@ -62,7 +57,7 @@ To make a bugfix release (a point release/patch release) when there are already
- We **WILL NOT** merge this branch back into `main` as these commits should already exist in `main`. - We **WILL NOT** merge this branch back into `main` as these commits should already exist in `main`.
4. In the release branch (i.e. `release-version-0.9.1`), run `make create-release-candidate PART=patch` to bump the patch version and create the first release candidate (i.e. `0.9.1-rc.0`). 4. In the release branch (i.e. `release-version-0.9.1`), run `make create-release-candidate PART=patch` to bump the patch version and create the first release candidate (i.e. `0.9.1-rc.0`).
5. Run `make release-candidate-to-test-pypi` to upload the release candidate to Test PyPI. 5. Run `make release-candidate-to-test-pypi` to upload the release candidate to Test PyPI.
6. Verify the release candidate in a fresh virtual environment by running `make install-release-test` which installs the cellxgene build you just uploaded the Test PyPI. 6. Verify the release candidate in a fresh virtual environment by running `make install-release-test VERSION=x` which installs the cellxgene build you just uploaded the Test PyPI (replace x with the full version str).
7. If you find errors with the release candidate, run `make recreate-release-candidate` to increment the release candidate version (i.e. `0.9.1-rc.0` -> `0.9.1-rc.1`). Then go back to Steps 5 and 6 to re-upload and re-test the new release candidate. 7. If you find errors with the release candidate, run `make recreate-release-candidate` to increment the release candidate version (i.e. `0.9.1-rc.0` -> `0.9.1-rc.1`). Then go back to Steps 5 and 6 to re-upload and re-test the new release candidate.
8. If everything looks good, push the final version of the release to Test PyPI without the release candidate tag by running the command `make release-final-to-test-pypi` (i.e. `0.9.1-rc.1` -> `0.9.1`). 8. If everything looks good, push the final version of the release to Test PyPI without the release candidate tag by running the command `make release-final-to-test-pypi` (i.e. `0.9.1-rc.1` -> `0.9.1`).
- **NOTE:** Once you push the final release version to Test PyPI, you cannot ever re-upload the build again. If you need to make changes to the build, you will have to "burn" the version number and bump the part again and go back to step 1 with a brand new version number. For example, if you upload `0.9.1` to Test PyPI and realize there's a bug, you will have to create a new version `0.9.2` and there will be no `0.9.1` version of cellxgene. This is why testing the release candidate is very important. - **NOTE:** Once you push the final release version to Test PyPI, you cannot ever re-upload the build again. If you need to make changes to the build, you will have to "burn" the version number and bump the part again and go back to step 1 with a brand new version number. For example, if you upload `0.9.1` to Test PyPI and realize there's a bug, you will have to create a new version `0.9.2` and there will be no `0.9.1` version of cellxgene. This is why testing the release candidate is very important.