Skip to content

Commit fe0ed95

Browse files
committed
Add more steps to release docs.
1 parent bdb7b0d commit fe0ed95

1 file changed

Lines changed: 58 additions & 61 deletions

File tree

docs/releasing.md

Lines changed: 58 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,59 @@
11
# Releasing
22

3-
Our default branch for making changes is `next`: new features and non-urgent
4-
bug fixes should be merged into here.
3+
The `next` branch is used to collect and test changes before a release. Only
4+
changes scheduled for the next release should be in `next`, and commits may be
5+
reverted or added to reflect scope changes.
56

6-
The `release` branch is a reference to what is in production at any point in
7-
time. It usually tracks `main` but can also point to hotfix branches as
8-
necessary.
9-
10-
Releasing basically follows these steps:
11-
12-
1. Merge `next` into `main`
13-
2. Create a draft release by running the `Draft new release` workflow. This will
14-
create a tag (e.g. `v1.0.0`) on `main` and create a draft release in GitHub with initial release notes.
15-
3. Update the release notes, add information about the changes.
16-
4. Update the assurance statement.
17-
5. Fast-forward or reset `release` to the release tag
18-
6. Run the `Deploy` workflow to deploy to production.
19-
7. Publish the release in GitHub.
20-
21-
```mermaid
22-
gitGraph
23-
branch release
24-
commit tag: "v0.9.9"
25-
checkout main
26-
commit tag: "v1.0.0-rc1"
27-
checkout release
28-
merge main tag: "v1.0.0"
29-
```
7+
Once a release has gone through the assurance stops and ready to release, `next`
8+
is merged into `main` using a PR, and then `main` is deployed out to production.
309

31-
Details below.
32-
33-
## Pre-release and testing
34-
35-
Changes merged into `next` are deployed to the `qa` and `test` environments for
36-
testing. When there is a large batch of PRs to merge at once, after a
37-
merge-freeze for example, only merge a few at a time to try to make it easier to
38-
trace any issues that arise during testing.
39-
40-
## Release candidate
41-
42-
Once all the necessary changes are merged and have been tested, merge `next` into `main` and create a new draft release.
43-
44-
At this point the changes in the release will go through the NHS assurance
45-
processes, and possibly through external testing and assurance. If required it
46-
can be deployed to the `preview` or `training` environments.
47-
48-
## Deploy to production
49-
50-
When we are ready to release, update the `release` branch and deploy it to
51-
production. If there have been no hot-fixes since the last release then this is
52-
a simple fast-forward merge that has to be done on your localhost (see below for
53-
how to manage non-fast-forwardable situations):
10+
The `release` branch is a reference to what is in production at any point in
11+
time and updated at the time the release is performed. It usually tracks `main`
12+
but can also point to hotfix branches as necessary.
13+
14+
Releasing follows these steps, performed once approval for release has been
15+
given:
16+
17+
1. Create a PR to merge `next` into `main`; approve and merge.
18+
2. Create a draft release by running the `Draft new release` workflow. This
19+
creates a draft release in GitHub with initial release notes.
20+
3. Update the release notes with information about the changes. This is
21+
generated from the Jira tickets by a team member.
22+
4. Publish the release in GitHub. This will create the tag.
23+
5. Check the notes for pre and post-release tasks and ensure these are performed
24+
before and after releasing to the environments below.
25+
6. Deploy the release to the `preview` and `training` envs, if not already done.
26+
This can be used as a test that the tag deploys as expected.
27+
7. If there are migrations that need testing (e.g. a data migration or a
28+
long-running migration), deploy this release to `data-replication` and test
29+
the performance of the migration(s) there.
30+
8. Perform pre-release tasks.
31+
9. Run the `Deploy` workflow to deploy to production.
32+
10. Smoke test: login to the production service to ensure it looks normal.
33+
11. Perform post-release tasks.
34+
12. Fast-forward or reset `release` to the release tag.
35+
13. Update the service management channel on NHSE Slack.
36+
14. Update the topic in the Mavis tech channel to reflect the new version.
37+
38+
Additional notes below.
39+
40+
## Running the Deploy workflow
41+
42+
Use the `deploy.yml` workflow to run the deployments. For the production
43+
deployment, it's important to start the workflow from the `main` branch and
44+
specify the tag to deploy as input. This is because only workflows from the
45+
`main` branch can authenticate with the production AWS account.
46+
47+
Changes to the backup infrastructure must be deployed separately. In the rare
48+
case that the backup infrastructure needs to be updated, run the
49+
`deploy-backup-infrastructure.yml` workflow.
50+
51+
## Upading the release branch
52+
53+
We update the `release` branch after we've deployed `main` to production. If
54+
there have been no hot-fixes since the last release then this is a simple
55+
fast-forward merge that has to be done on your localhost (see below for how to
56+
manage non-fast-forwardable situations):
5457

5558
```shell
5659
git checkout release
@@ -65,15 +68,7 @@ git merge --ff-only v1.0.0-rc1
6568
git push --tags origin release
6669
```
6770

68-
Once the `release` branch is updated on GitHub, it's time to deploy. Start with a deploy to `training` or
69-
`preview` to ensure the tagged version is correct. Once that's done you can
70-
deploy to production.
71-
72-
Use the `deploy.yml` workflow to run the deployments. For the production deployment, it's important to start the workflow from the `main` branch and specify the tag to deploy as input. This is because only workflows from the `main` branch can authenticate with the production AWS account.
73-
74-
Changes to the backup infrastructure must be deployed separately. In the rare case that the backup infrastructure needs to be updated, run the `deploy-backup-infrastructure.yml` workflow.
75-
76-
## When `release` and `main` have diverged
71+
### When `release` and `main` have diverged
7772

7873
There are cases when `release` won't be fast-forwardable to the release
7974
candidate on `main`. This will happen when a fix has been applied to the
@@ -131,6 +126,8 @@ previously described.
131126

132127
## Rollback
133128

134-
A release can be rolled back by deploying the previous release tag using the regular GitHub workflow. This can be done on a per-service level or for all services.
135-
If the issue is spotted early and the CodeDeploy deployment is still in progress, the new deployment can still be aborted.
136-
To do this, go to the CodeDeploy console, select the deployment group, and click "Stop deployment".
129+
A release can be rolled back by deploying the previous release tag using the
130+
regular GitHub workflow. This can be done on a per-service level or for all
131+
services. If the issue is spotted early and the CodeDeploy deployment is still
132+
in progress, the new deployment can still be aborted. To do this, go to the
133+
CodeDeploy console, select the deployment group, and click "Stop deployment".

0 commit comments

Comments
 (0)