6e27805ca7
* Move coding guideline and release docs to subdirectories * Strip down contributing md to link to new docs * Create main readme file to act as TOC * Getting started and testing docs from contributing.md * WP update testing checklist and docs for woocommerce/woocommerce-blocks#1285 * Update docs/contributors/smoke-testing.md Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com> * link to svn doc * Link to docs from readme * Resolve feedback * More consistent $ usage Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com> |
||
---|---|---|
.. | ||
readme.md | ||
wordpress-update-testing-checklist.md |
readme.md
Releases
This document outlines the process of releasing new versions of the blocks plugin.
Prerequisites - what you need to release WooCommerce Blocks
- You should be set up for development - for more info see this doc.
- Install & set up GitHub hub tools.
- Configure a GitHub token for release scripts to use.
- https://github.com/settings/tokens
- Select the following permissions:
admin:org
public_repo
read:user
- Ensure your token is available to scripts, e.g.
export GH_API_TOKEN={YOUR-TOKEN}
or similar.
- Get WPORG plugin svn commit access - ask a team member.
Outcome: You are equipped to ship a release!
Release process
Lead-up to release
Ensure release development is complete
- For major and minor releases, we use ZenHub.
- For patch releases, we use GitHub milestones - example.
- Ensure all issues/PRs intended for this release are merged, closed and linked to release.
- All PRs should have changelog entry, or
skip-changelog
tag. - Check with the team to confirm any outstanding or in progress work.
Note: changelog should be formatted like this in PR description. Note the preceding >
- this is required by changelog script.
### Changelog
> bug: Fix bug in Safari and other Webkit browsers that was causing the All Products block to show 0 results when resetting the sort value.
Outcome: Team is aware of release and in agreement about what fixes & features are included.
Ensure release branch includes all relevant fixes
- Make release branch (if needed).
- For major and minor releases, create branch:
release/X.X
. - For patch releases, the branch should already exist.
- For major and minor releases, create branch:
- Ensure your local checkout is updated to the tip of the release branch.
- For patch releases, cherry pick relevant PRs into the release branch:
- If PR is already labelled
status: cherry-picked 🍒
then continue to next PR. - Ideally, use GitHub Hub to cherry pick the PR -
hub am -3 {http://URL-TO-PR}
. - If there are serious conflicts or extensive differences between
master
and release branch, you may need to take more care:- Manually cherry pick individual commits using git -
git cherry-pick {COMMIT-HASH}
. - Or in some cases, manually craft a new PR with appropriate changes, targeting release branch.
- Manually cherry pick individual commits using git -
- Push the release branch to origin (so changes are in GitHub repo).
- Label the PR:
status: cherry-picked 🍒
.
- If PR is already labelled
Outcome: Release branch has all relevant changes merged & pushed.
Prepare release
Ensure release branch readme is up to date
- Run changelog script
$ npm run changelog
to get changelog txt for readme. Changelog content will be output to screen by script.- The above script will automatically generate changelog entries from a milestone (you will be asked about the milestone name in the script).
- If you want to pull changelog entries from a Zenhub release instead, use
$ npm run changelog:zenhub
and follow instructions.
- Add changelog section for release, e.g.
= 2.5.11 - 2020-01-20 =
. - Copy-paste the changelog content into
readme.txt
. - Make any other changes to readme as needed - e.g. support versions changing, new blocks.
- Push readme changes to release branch on origin repo.
- Note: you can push your readme changes directly to branch – no need for a PR & review process.
Outcome: Release branch has readme.txt
is updated with release details.
Build zip & smoke test
- Ensure you are on the tip of the release branch, e.g.
git pull origin release/2.5
- Update dependencies –
$ npm ci
. - Run a production build -
$ npm run build
. - Run package script to get a zip to test
$ npm run package-plugin
. - Smoke test built release zip:
- At least one other person should test the built zip - ask a teammate to help out.
- Test in a clean environment, e.g. Jurassic.Ninja site.
- Test existing WooCommerce Blocks content works correctly after update (no block validation errors).
- Test to confirm blocks are available and work correctly in oldest supported WordPress version (e.g. 5.0).
- Confidence check - check blocks are available and function.
- Test to confirm new features/fixes are working correctly.
- Smoke test – test a cross section of core functionality.
Outcome: Confident that source code is ready for release: intended fixes are working correctly, no release blockers or build issues.
Release!
Tag release on GitHub
- Prepare tagged release on github
$ npm run deploy
.- Note: the script automatically updates version numbers (commits on your behalf).
- Edit release, add changelog info to Github release notes.
- Check release repo tag is correct - checkout, smoke test/confidence check.
Outcomes: Version numbers updated in source code & developers can test tagged release.
Release to WPORG
- Run
$ npm run release
. This script clones a copy of the source code to your home folder, and outputs ansvn
command to push release up to WPORG. - Push release to WPORG using
svn
.- Run generated svn command to commit to WPORG svn repo.
- The command should look like this:
cd /Users/{YOU}/blocks-deployment/woo-gutenberg-products-block-svn && svn ci -m "Release 2.5.11, see readme.txt for changelog."
- The command should look like this:
- Commit should complete successfully with a message like
Committed revision 2231217.
.
- Run generated svn command to commit to WPORG svn repo.
- Confirm that the WPORG release is updated and correct:
- Changelog,
Version
&Last updated
on WPORG plugin page. - Confirm svn tag is correct, e.g. 2.5.11.
- Confirm WooCommerce.com plugin page is updated.
- Download zip and smoke test.
- Test updating plugin from previous version.
- Changelog,
Outcome: Customers can install/update via WPORG; WPORG plugin page is up to date.
After release
Update master
with release changes
- Ensure changelog is up to date on master.
- For major & minor releases, update version on master with dev suffix, e.g.
2.6-dev
.
Clean up release milestone / Zenhub
- For patch releases, close the milestone in GitHub.
- For major & minor releases - tbc
Appendix: Versions
We have major, minor and patch releases.
For example:
- version == 2.5.11
- 2 == major version; has breaking changes or major new features
- 5 == minor version; has new features
- 11 == patch, aka point / revision / fix; has bug fixes and improvements to existing features
- 2.0 is a major release
- 2.5 is a minor release
- 2.5.11 is a patch release
There are some differences to our release process for each kind of release - these are detailed in the steps above.
Appendix: updating a specific file on WPORG
Sometimes, we need to update a single file in WordPress.org without wanting to do a full release, for example, updating the readme.txt
versions or descriptions. In order to do that, refer to the Editing Existing Files section of the Subversion guide in developer.wordpress.org or follow these steps:
- Checkout the plugin repo:
$ svn co "http://plugins.svn.wordpress.org/woo-gutenberg-products-block/"
$ cd woo-gutenberg-products-block
-
Modify the files you want to change in
trunk
ortags/x.y.z
. -
Check your changes with:
$ svn stat
$ svn diff
- Commit the changes to the server:
$ svn ci -m "Updated readme.txt description"