Skip to content

Latest commit

 

History

History
174 lines (123 loc) · 8.8 KB

RELEASE.md

File metadata and controls

174 lines (123 loc) · 8.8 KB

Release procedure

A step by step checklist for cutting a new release.

Note: This guide uses hub to sync branches more easily, but it can be substituted with switching to the master/release branch and running git pull upstream <BRANCH-NAME>.

Preliminaries

  1. Check that no release steps need updating
  2. Ensure all issues/PRs linked to Github milestone are closed or moved to next release
  3. Check git status and git diff for any untracked local changes and handle as needed
  4. Sync from upstream repo, push to origin and clean up old branches: git fetch --all, then hub sync/git pull upstream, then git push origin, and finally git branch -d <BRANCH> and git push -d <REMOTE> <BRANCH> for any branches
  5. Create a new branch prepare-release-XYZ and push to upstream: git switch -c prepare-release-XYZ then git push -u upstream prepare-release-XYZ

Update pinned dependencies

  1. Check MANIFEST.in and setup.cfg to ensure they are up to date and all data files are included
  2. Check each dependency for new upper bound version and examine changelogs for breaking changes
  3. Commit and push if changes made to run regen deps on Linux machine (RPi), and open PR against base branch
  4. On RPi, activate env and run python -X dev tools/generate_requirements_files.py build to update build deps
  5. Run python -m pip install --upgrade -r requirements-build.txt to install updated build deps
  6. Run python -X dev tools/generate_requirements_files.py to update all reqs files
  7. Run pip install --upgrade -r requirements-dev.txt install updated dev deps
  8. Run pip install -e . to ensure package install is up to date
  9. Run pip check to verify environment integrity
  10. Run python -bb -X dev -W error -m pytest --run-online and fix any issues
  11. Run pre-commit run --all-files and fix any issues
  12. Sync back changes to dev machine and fixup prior commit
  13. Push and test on PR and git reset --hard on Pi

Update pre-commit hooks

  1. Address any outstanding trivial tweaks with hooks
  2. Run pre-commit autoupdate to update hooks
  3. Manually check additional_dependencies for updates and update as needed
  4. Check hook/dep changelogs and add/update any new settings
  5. Run pre-commit run --all-files and fix any issues
  6. Run python -bb -X dev -W error -m pytest --run-online and fix any issues
  7. Commit changes, push & test on PR

Build and test on RPi/production machine

  1. Pull latest changes from release branch down to RPi
  2. Activate the existing dev virtual environment: e.g. source env/bin/activate
  3. Delete existing dist/ if present: rm -rfd dist
  4. Build source and wheel distributions: python -bb -X dev -W error -m build
  5. Check with twine: twine check --strict dist/*
  6. Create a fresh, clean virtual environment, e.g. deactivate then python3 -m venv clean-env
  7. Activate the new environment, e.g. source clean-env/bin/activate
  8. Install/upgrade core install deps in new environment: python -m pip install --upgrade pip setuptools wheel
  9. Install the build in the new environment: pip install dist/submanager-X.Y.Z.dev0-py3-none-any.whl[test]
  10. Check the env with pip: pip check
  11. Test the installed version: python -bb -X dev -W error -m pytest --run-online
  12. Fix any bugs, commit, push and retest

Transition new version to production on RPi

  1. Disable and stop production service: systemctl --user disable submanager then systemctl --user stop submanager
  2. Activate production venv (e.g. source env/bin/activate)
  3. Upgrade core install deps python -m pip install --upgrade pip setuptools wheel
  4. Install/upgrade pinned deps from requirements file: pip install --upgrade -r requirements.txt
  5. Install package from built wheel: pip install dist/submanager-X.Y.Z.dev0-py3-none-any.whl
  6. Ensure config/state dir names, locations and structure is up to date
  7. Sync static config and praw.ini from dev machine
  8. Update local dynamic config as needed
  9. Validate config with python -b -X dev -m submanager validate-config
  10. Start running and verify nominal performance: python -b -X dev -m submanager start
  11. Install service with python -bb -X dev -W error -m submanager install-service
  12. Enable and start service, wait 30 seconds and verify status, journalctl log output and on sub

Update documentation and finish release PR

  1. Skim README.md, CONTRIBUTING.md and RELEASE.md to ensure they are up to date and render correctly on Github, and commit any changes
  2. Update ROADMAP.md to remove current release and add plans for next release(s), commit and verify rendering
  3. Add CHANGELOG.md entries for current version, commit and verify rendering
  4. Update version in submanager/__init__.py and SECURITY.md to release version and commit as "Release Sub Manager version X.Y.Z"
  5. Check hub sync and git status one more time, and then push to the PR and wait for checks to pass

Rebuild and upload to PyPI on RPi/production machine

  1. Repeat steps 0 through 4 (inclusive) in "Build and test on RPi" section to rebuild release version
  2. Install built wheel in dev environment: pip install dist/submanager-X.Y.Z.dev0-py3-none-any.whl[lint,test]
  3. Verify version is correct: submanager --version
  4. Run basic tests one last time: python -bb -X dev -W error -m pytest
  5. Merge PR and wait for checks to pass
  6. Upload to live PyPI: twine upload dist/*

Re-install production release on Pi

  1. Check for any errors in service, and then disable and stop
  2. Activate production environment, e.g. source env/bin/activate
  3. Install release version from PyPI: pip install --upgrade submanager
  4. Verify version is correct: submanager --version
  5. Enable and restart service, wait 30 seconds and verify no errors occur with status and journalctl

Finalize release

  1. Close Github milestone

  2. Switch to master/release branch and sync: git switch master/git switch X.Y.Z then hub sync

  3. Tag release: git tag -a vX.Y.Z -m "Sub Manager version X.Y.Z"

  4. Push tags: git push upstream --tags

  5. Create a Github release from the tag and with the version's changelog, plus any important notices up top

  6. Increment __init__.__version__ to next release and re-add dev0 (or dev<N+1>, if a pre-release)

  7. If a release from master, i.e. new major or minor version, create release branch to maintain it:

    git switch -c X.Y.x
    git push -u origin X.Y.x
    git push upstream X.Y.z
    git switch master
  8. Commit change to master / release branch with message: "Begin development of version X.Y.x"

  9. If from master, push master & staging: git push upstream master git push upstream staging If from a release branch: git push upstream X.Y.x git push upstream staging-release

  10. Update your fork's master branch: git push origin master

  11. Open a Github milestone as needed for the next release

Cleanup on the RPi/production machine

  1. Switch and re-pull master in the dev env: git switch master then git pull upstream master
  2. Re-install dev build; with the dev env activated, run: pip install -e .[lint,test]
  3. Verify version with submanager --version
  4. Remove clean test environment (test-env) and dist/ on RPi
  5. Delete any other old services, config files, dirs and environments on RPi

Cleanup locally

  1. Ensure everything is synced: hub sync
  2. Re-install dev build locally: pip install -e .[lint,test]
  3. Verify version with submanager --version
  4. Delete the prepare release branch locally: git branch -d prepare-release-XYZ
  5. Delete the branch on the remote: git branch -d upstream prepare-release-XYZ