Skip to content

Commit 7db82b7

Browse files
rf-hunterowens
authored andcommitted
Update branching process
This commit modifies the branching mechanics in the release guidelines in order to simplify the process of maintaining and contributing to MDS. The most notable changes are: * `dev` is now the target for almost all PRs, whether the changes they contain are breaking or non-breaking. Maintainers are responsible for backporting non-breaking changes from `dev` to the latest release branch after merging the PR. * Instead of merging changes into `master` and rebasing `dev`, `master` is reset to point to the latest release as part of the release process. Rebasing and merging between branches (other than PRs) are no longer part of the process at all. These changes are intended to be relatively lightweight and aimed at smoothing out pain points with the current workflow; at some point we might want to consider [more significant changes] like organizing the overall directory structure by version. [more significant changes]: #288 (comment)
1 parent d399ee7 commit 7db82b7

1 file changed

Lines changed: 77 additions & 40 deletions

File tree

ReleaseGuidelines.md

Lines changed: 77 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ MDS operates on a six-week release cycle for both major updates (0.x) and patche
5959

6060
**week 1 - proposals**
6161

62-
Contributors submit proposals for inclusion in the release cycle in the form of pull requests and issues tagged. If known, note what release you intended a proposal for in its description. Maintainers will tag appropriate pull requests and issues with the Milestone for the upcoming release. Proposals should come with enough explanation to allow all stakeholders to understand intent and implementation strategy. |
62+
Contributors submit proposals for inclusion in the release cycle in the form of pull requests and issues tagged. If known, note what release you intended a proposal for in its description. Maintainers will tag appropriate pull requests and issues with the Milestone for the upcoming release. Proposals should come with enough explanation to allow all stakeholders to understand intent and implementation strategy.
6363

6464
**weeks 2-4 - consensus building, refinement, and implementation**
6565

@@ -69,14 +69,14 @@ Contributors will provide feedback on proposals. Where possible, discussion will
6969

7070
The week will start with an in-person/web conference work session for all contributors to review and discuss current proposals. Goal is to achieve consensus where possible, or to clearly articulate areas of disagreement where not. Minor changes may be accepted at this stage if they bring contributors to consensus.
7171

72-
At the conclusion of week 5, release partner will review all items for which consensus was not reached and provide a recommended release plan to maintainers for approval. Any remaining approved pull requests to `dev` are merged or the release branch as necessary.
72+
At the conclusion of week 5, the release partner will review all items for which consensus was not reached and provide a recommended release plan to maintainers for approval. Any remaining approved pull requests will be merged, and a maintainer or release partner will open a pull request containing release notes for the proposed release.
7373

7474
**week 6 - release**
7575

76-
Documentation will be updated, a release branch will be created if necessary, changes will be merged into `master`, and new version will be formally released.
76+
Documentation will be updated, release notes will be merged, a tag will be created and `master` updated to point to it, and the new version will be formally released. See [Release Checklist](#release-checklist) for details about the release process.
7777

7878
### Communication and Workflow
79-
The release annoncements and process schedule will be communicated via [`mds-announce`][mds-announce] Google Group. People wishing to stay informed should join the group for updates. Timing of web conference and in person work sessions will be communicated via mds-announce as well.
79+
The release announcements and process schedule will be communicated via [`mds-announce`][mds-announce] Google Group. People wishing to stay informed should join the group for updates. Timing of web conference and in person work sessions will be communicated via mds-announce as well.
8080

8181
The following best practices are intended to create clarity around each release cycle:
8282

@@ -90,39 +90,72 @@ The following best practices are intended to create clarity around each release
9090

9191
## Branch Mechanics
9292

93-
Aside from using `git tags` as mentioned earlier, here we outline a branching strategy to handle ongoing maintenance changes in parallel with features for new releases.
93+
The branching strategy we describe here is intended to handle ongoing maintenance changes in parallel with features for new releases.
9494

9595
### Primary branches
9696

9797
At a high-level, there are two primary branches:
9898

99-
* [`master`][mds-master] represents the current stable release (i.e. the most recent tag) of MDS. Development work generally *does not* happen here, but is rather merged from elsewhere.
99+
* [`master`][mds-master] represents the latest release of MDS. It's only updated as part of the release process, and no pull requests should be based on or target it.
100100

101-
* [`dev`][mds-dev] represents work on the next MINOR release, and is the *long-term* development branch.
101+
* [`dev`][mds-dev] contains all work that has happened since the last release, including both breaking and non-breaking changes.
102102

103103
### Feature branches
104104

105-
Work on new features for MDS happens in branches cut from `dev`. When the feature is ready for review, submit a PR against `dev`, ideally with any merge conflicts already resolved. `dev` serves as the collection point for all new feature work.
105+
All development on changes to MDS should happen in branches cut from `dev` (with the exception of hotfixes to release branches, described below). When your work is ready for review, submit a PR against `dev`, ideally with any merge conflicts already resolved. `dev` serves as the collection point for all new feature work.
106106

107107
### Release branches
108108

109-
In anticipation of ongoing maintenance, a branch will be created for the current release series. For example, at the time `0.2.0` is released, a branch will be cut from `master` for `0.2.x`.
109+
Whenever a MINOR version is released, a **release branch** will be created from `dev` to track any changes that should be included in subsequent PATCH versions. For example, at the time `0.4.0` is released, a branch called `0.4.x` will be created that initially points to the same commit as the `0.4.0` tag.
110110

111-
This *release branch* represents the current state of that release series. All maintenance/bugfix work for the series is collected in this branch. To work on a patch, cut a branch from the release branch. When ready, submit a PR against the release branch.
111+
Release branches can be updated in two ways:
112112

113-
When a PATCH release is ready (e.g. `0.2.0` to `0.2.1`), the release branch (e.g. `0.2.x`) is merged to `master` (to make the release official) and `dev` is rebased onto `master` (to ensure the patch is incorporated with any new work).
113+
* When a non-breaking change has been merged to `dev`, a maintainer will usually [backport](#backporting-changes) it onto the newest release branch. This can be skipped if the change isn't relevant to the release branch (e.g., because it modifies language that was added after the last MINOR release) or if there are no plans to make another PATCH release with the same MINOR version.
114114

115-
Breaking changes should always be merged to develop. These may be merged at any time and will be incorporated into the next minor release. For non-breaking changes, these should either be merged to develop if the next release is a minor release, or to the appropriate release branch if the next version is a patch release. During each cycle, we merge changes to both dev and 0.n.x branches, so breaking changes can be proposed and worked on at any time
115+
* If a change needs to be made to spec language that exists in a release branch but is no longer relevant in `dev`, the contributor should create a feature branch based on the release branch and open a PR targeting the release branch directly. For example, if an endpoint was removed in `0.3.0` but needs to be modified for a `0.2.1` PATCH release, the contributor would create a PR based on the `0.2.x` release branch.
116+
117+
As stated earlier, at this time MDS will maintain *two concurrent MINOR versions*. This means that when a MINOR release is made (e.g. `0.4.0`), no further changes will be made to the outgoing series (`0.2.x`, in this case).
118+
119+
### Backporting changes
120+
121+
When non-breaking changes are merged to `dev`, it's generally necessary for a maintainer to backport these changes to the newest release branch so that they'll be included in any subsequent PATCH releases. There are a couple of different ways to do this:
122+
123+
* If the changes can be applied to the release branch without significant editing, the maintainer can use `git cherry-pick` to copy the changes from `dev` into the release branch (assuming the SHA of the merge commit on `dev` was `b70719b`):
124+
125+
```console
126+
git fetch
127+
git checkout 0.3.x
128+
git pull
129+
git cherry-pick -m 1 b70719b
130+
git push
131+
```
132+
133+
Note that the `-m 1` option is unnecessary if the PR was merged with the "Squash and merge" option instead of creating a merge commit.
134+
135+
* If backporting the change needs significant manual work (for example, if there were other changes to the relevant part of the spec in the last MINOR version), the maintainer can open a new PR for the backport targeting the relevant release branch.
136+
137+
First, create a branch containing the backported change (again, assuming the SHA of the merge commit was `b70719b`):
138+
139+
```console
140+
git fetch
141+
git checkout 0.3.x
142+
git pull
143+
git checkout -b backport-helpful-change-to-0.3.x
144+
git cherry-pick -m 1 b70719b
145+
# Do any manual work needed to integrate the changes
146+
git push -u origin backport-helpful-change-to-0.3.x
147+
```
148+
149+
Next, create a PR with the release branch (in this case, `0.3.x`) as its `base`. Once that PR has been approved, merge the PR into the release branch as usual.
116150

117-
As stated earlier, at this time MDS will maintain *two concurrent MINOR versions*. This means that when a MINOR release is made (e.g. `0.4.0`), work on the outgoing series (`0.2.x`, in this case) ceases and its release branch is removed.
118151

119152
## Release Checklist
120153

121154
The following steps **must** be followed for **every** release of MDS:
122155

123156
1. Ensure the [Milestone][mds-milestones] for this release is at `100%`.
124157

125-
1. Update the [schema version regex][mds-schema-common]
158+
1. Update the [schema version regex][mds-schema-common].
126159

127160
1. Run the schema generator to ensure the schema files are up to date:
128161

@@ -131,7 +164,7 @@ The following steps **must** be followed for **every** release of MDS:
131164
pipenv run python generate_provider_schema.py
132165
```
133166

134-
1. Update [`ReleaseNotes.md`](ReleaseNotes.md) following the existing format:
167+
1. [Open a PR][mds-pr-new] against `dev` that updates [`ReleaseNotes.md`](ReleaseNotes.md) using the following format:
135168

136169
```md
137170
## 1.2.3
@@ -145,45 +178,49 @@ The following steps **must** be followed for **every** release of MDS:
145178
* Another change summary referencing a PR [#777](https://github.com/CityofLosAngeles/mobility-data-specification/pull/777)
146179
```
147180

148-
1. [Open a PR][mds-pr-new] against `master`, comparing either `dev` (for a MINOR release) or a release branch (e.g. `0.2.x`) for a PATCH release.
181+
The description of this PR should include a link to a GitHub compare page showing the changes that will be included in the release. This URL depends on the type of release:
182+
183+
* For a PATCH release like 0.4.2, compare the previous version in the series to the current state of the release branch: https://github.com/CityOfLosAngeles/mobility-data-specification/compare/0.4.1...0.4.x
184+
185+
* For a MINOR release like 0.5.0, compare the last release in the previous series to the current state of `dev`: https://github.com/CityOfLosAngeles/mobility-data-specification/compare/master...dev
149186

150-
In the case of a new MINOR version, allow a minimum of 24 hours for community discussion and review of the PR.
187+
In the case of a new MINOR version, allow a minimum of 24 hours for community discussion and review of the current state of the release.
151188

152-
1. Once the PR has been sufficiently reviewed, `rebase merge` into `master`.
189+
1. Once the PR has been sufficiently reviewed, merge it into `dev`.
153190

154-
1. Create a tag on the tip of `master` for this release, e.g. for `0.3.0`:
191+
1. Create a tag for this release on the tip of `dev` (for MINOR versions) or the relevant release branch (for PATCH versions). For example, for `0.5.0`:
155192

156193
```console
157-
git checkout master
158-
git fetch && git pull
159-
git tag 0.3.0
194+
git fetch
195+
git checkout origin/dev
196+
git tag 0.5.0
160197
git push --tags
161198
```
162199

163-
1. Publish a [new Release in GitHub][mds-releases-new] for the tag you just pushed. Copy in the [release notes](ReleaseNotes.md) created earlier.
164-
165-
1. What kind of release was this?
166-
* **PATCH:** rebase `dev` onto `master` to incorporate the PATCH into `dev`
200+
Or for `0.4.2`:
167201

168-
*Caution: be aware that this may impact existing PRs open against `dev`!*
202+
```console
203+
git fetch
204+
git checkout origin/0.4.x
205+
git tag 0.4.2
206+
git push --tags
207+
```
169208

170-
```console
171-
git checkout dev
172-
git rebase master
173-
git push --force origin dev
174-
```
209+
1. If this release is a MINOR version, create a new [release branch](#release-branches). For example, if you've just created the `0.5.0` tag:
175210

176-
* **MINOR:** cut a new branch for this release series from the tip of `master`
211+
```console
212+
git push origin 0.5.0:0.5.x
213+
```
177214

178-
Make this branch the default branch in GitHub. E.g. for `0.3.0`
215+
1. Unless this is a maintenance release on an older branch (for example, releasing `0.3.2` after `0.4.0` has already come out), update `master` to point to the new tag:
179216

180-
```console
181-
git checkout master
182-
git checkout -b 0.3.x
183-
git push origin 0.3.x
184-
```
217+
```console
218+
git checkout master
219+
git reset --hard 0.5.0
220+
git push --force origin master
221+
```
185222

186-
Remove any outgoing series' release branch (e.g. `0.1.x` when releasing `0.3.0`), if applicable.
223+
1. Publish a [new Release in GitHub][mds-releases-new] for the tag you just pushed. Copy in the [release notes](ReleaseNotes.md) created earlier.
187224

188225
1. Post a release announcement to [`mds-announce`](mailto:mds-announce@googlegroups.com), copying the [release notes](ReleaseNotes.md) created earlier and linking to the [GitHub release][mds-releases].
189226

0 commit comments

Comments
 (0)