Hi guys,
We had a lot of issues with the last release (3.8.7.6.1) that cause us to rethink our development process and quality control. I feel that it has been my responsibility for not putting together a clear guideline sooner, which leads to a lot of confusion regarding the branches, how to commit, and how to ensure quality control.
Better late than never. I'd like to post my suggestions about how the development process should be from now on (3.8.9).
Current State
Google Code vs. Github
Currently we're using Google Code as the primary project management platform. We also have a mirror on github (http://github.com/instinct/wp-e-commerce). However, Google Code is the only place where issue tickets are monitored and commits go in. If you like git and github, feel free to fork the instinct wpec github above. If you are not familiar with git or github, just ignore it. Until further instructed, everything important takes place in Google Code.
Branches
Currently we have a few branches that are actively maintained:
- trunk: This is where 4.0 development resides. New features and bug fixes can go into this branch.
- branch-3.8.7: This is where 3.8.7-dev resides. Because the spec is already frozen for 3.8.7, only bug fixes can go in.
- branch-3.8.8: This is where 3.8.8-dev resides. Because the spec is already frozen for 3.8.8, only bug fixes can go in.
- branch-3.8: This is where 3.8-dev resides. This is the bleeding-edge development snapshot of the 3.8 branch (currently for 3.8.9 development). Both new features as well as bug fix can be committed to this branch.
Why the hell are there so many branches?
To answer this, we need to understand about backward-compatibility, major and minor releases.
Release Cycle and Frozen State
Backward-compatibility means themes or plugins that depend on the previous major release don't have to change their code to accomodate for architectural changes in the new major release.
Major release: Releases that contain new features, enhancements, bug fixes or architectural changes. Major releases are allowed to break backward-compatibility, however we try to minimize that as much as we can.
Examples: the upcoming WPEC 3.8.8 is a major release that contains various enhancements in UI. The upcoming WPEC 4.0 is also a major release that contains fundamental architectural changes related to theme engine and payment gateways.
Minor release: Releases that only contain bug fixes introduced in previous major release. Examples: WPEC 3.8.7.1 contains the same feature set as 3.8.7, but it has some more bug fixes in it.
Mini release: Releases that fixes bugs introduced in minor release. Examples: WPEC 3.8.7.6.1 fixes the PHP warnings introduced in WPEC 3.8.7.6.
Tiny micro release: Let's pray to God that we'll never get to this.
In short, the major release is the only one where we can include new features in. For each major release, there should be a planning phase of what features do we introduce into that major release, what features should we spin off as a separate plugin, and what architectural aspects should we refactor. This can be called the spec.
When the spec is decided, we get down to code and testing. During this process, of course we can add to or remove things from the spec, but we should try to minimize that. When the features are all implemented, it's time to freeze it.
Freeze means we're not allowing any new features to creep in any more. As soon as a release goes into frozen state, the feature set is firmly decided, the major bugs have been fixed. From then on, we should strictly only commit patches for new bugs introduced by the release itself (called regressions). The point is to ensure that the release gets more and more stable by not introducing big changes that could potentially lead to new bugs.
This explains why every time we freeze for a beta release, we need to create a separate SVN branch. The purpose is to decouple the frozen state from the "bleeding-edge" state. For example, as soon as 3.8.8-beta is announced, I created a separate branch for 3.8.8 where from that point on, only bug fixes should be committed to that branch, where as the original branch-3.8 is now reserved for bleeding edge development (3.8.9). All bug fixes that are committed to frozen branches (3.8.8, 3.8.7) should also be committed to bleeding edge branches (3.8, trunk).
Commit Privilege, Code Review and Quality Control
Currently, the following members are actively contributing to WPEC (not in any particular order):
- Dan Milward
- Michelle Allen
- Justin Sainton
- Ben Huson
- Lee Willis
- James Collins
- Cameron Grant
- Jeff Ghazally
Let me know if I left out any names. These are the members with commit privileges.
Our previous release (3.8.7.6) shows that we need to enforce a stricter code review and quality control. As a result, I would like to propose the following rule:
You can only commit a patch if:
- There's already a ticket for that particular issue on Google Code. If there is not any, create one first, and upload your patch there. Don't jump the gun and commit it right away.
- The patch that is being considered for committing must be approved by at least 3 of the core committers. By "approve" I mean it must have been reviewed for code quality, as well as tested thoroughly by the core committers. You can't just say "yeah it looks good", but you have to test it yourself.
- The ticket is marked with the label Workflow-Commit.
There can be exception to this rule. If we're developing a new feature that consists of multiple small commits (like the work I'm doing with theme engine), here's the process:
- Create a ticket on Google Code
- Create a separate branch for your development. You can either use Google Code, or you can fork http://github.com/instinct/wp-e-commerce and work on your own fork.
- When you're done with the development, post a comment on your ticket, link to your branch, and ask for code review and testing.
- Again, at least 3 of the core committers should be consulted and approve of the changes you made.
- After you get the approval, now you can merge your branch to the main release branch.
I know this would complicate and potentially slow down development a bit, but it is extremely important that every single line of code is accounted for. We can't risk the embarrassment like 3.8.7.6.2 any more.
If you're not a core committer (i.e. not in the list of names above), you're very welcome to review the code, test and put your comments in the issue tickets.
One thing to note when reviewing code and approving patches: For the one reviewing code: don't be an asshole, but be very critical and constructive, and question everything. For the one requesting code review, don't take it personally and don't think of getting revenge on the person critiquing you.
Communicating With Our Beloved Users
It's also important that we communicate our plans for each release to the public. After all we're doing all of these things for them. Their businesses depend on our software.
Each time we decide on a spec for a new release, we should publish it somewhere (preferably our blog), get some feedback and answer the users' concerns.
For every release, as Amanda suggested, we should only tag the release and announce at the beginning of the day, and preferably at the beginning of the week. The purpose is to always be available when someone needs help. After a release is announced, at least one member of the core team should be always present and reply to users during the first 12-hour. If there's an urgent issue, we need to put together a fix, send the reporters a zip file containing the fix, put the link on the announcement, and work on releasing the bug fix release the following day.
One more important thing. Instead of mainly communicating new releases via blog, we should start offering users the choice of receiving announcements via email.
Any suggestion?
Do you have any suggestion regarding this guideline? Any question or confusion? Anything else that we need to address? Feel free to comment!