summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2018-12-12 03:34:28 -0500
committerMike Frysinger <vapier@google.com>2019-06-12 23:18:10 -0400
commita26c49ead4d4b1fdd71d91ebf997079f7acefc99 (patch)
tree8be97e09fd1bfa8b2c65ca7f62a13db4c7912b3b /docs
parentc5b0e23490478b4e5d22335d7015f40a8c187518 (diff)
downloadgit-repo-a26c49ead4d4b1fdd71d91ebf997079f7acefc99.tar.gz
docs: start a release document
Change-Id: I884639665c020338ec9ceeb1add5c3b862583674
Diffstat (limited to 'docs')
-rw-r--r--docs/release-process.md167
1 files changed, 167 insertions, 0 deletions
diff --git a/docs/release-process.md b/docs/release-process.md
new file mode 100644
index 00000000..22c2fd19
--- /dev/null
+++ b/docs/release-process.md
@@ -0,0 +1,167 @@
1# repo release process
2
3This is the process for creating a new release of repo, as well as all the
4related topics and flows.
5
6[TOC]
7
8## Launcher script
9
10The main repo script serves as a standalone program and is often referred to as
11the "launcher script".
12This makes it easy to copy around and install as you don't have to install any
13other files from the git repo.
14
15Whenever major changes are made to the launcher script, you should increment the
16`VERSION` variable in the launcher itself.
17At runtime, repo will check this to see if it needs to be updated (and notify
18the user automatically).
19
20## Key management
21
22Every release has a git tag that is signed with a key that repo recognizes.
23Those keys are hardcoded inside of the repo launcher itself -- look for the
24`KEYRING_VERSION` and `MAINTAINER_KEYS` settings.
25
26Adding new keys to the repo launcher will allow tags to be recognized by new
27keys, but only people using that updated version will be able to.
28Since the majority of users will be using an official launcher version, their
29version will simply ignore any new signed tags.
30
31If you want to add new keys, it's best to register them long ahead of time,
32and then wait for that updated launcher to make its way out to everyone.
33Even then, there will be a long tail of users with outdated launchers, so be
34prepared for people asking questions.
35
36### Registering a new key
37
38The process of actually adding a new key is quite simple.
39
401. Add the public half of the key to `MAINTAINER_KEYS`.
412. Increment `KEYRING_VERSION` so repo knows it needs to update.
423. Wait a long time after that version is in a release (~months) before trying
43 to create a new release using those new keys.
44
45## Self update algorithm
46
47When creating a new repo checkout with `repo init`, there are a few options that
48control how repo finds updates:
49
50* `--repo-url`: This tells repo where to clone the full repo project itself.
51 It defaults to the official project (`REPO_URL` in the launcher script).
52* `--repo-branch`: This tells repo which branch to use for the full project.
53 It defaults to the `stable` branch (`REPO_REV` in the launcher script).
54
55Whenever `repo sync` is run, repo will check to see if an update is available.
56It fetches the latest repo-branch from the repo-url.
57Then it verifies that the latest commit in the branch has a valid signed tag
58using `git tag -v` (which uses gpg).
59If the tag is valid, then repo will update its internal checkout to it.
60
61If the latest commit doesn't have a signed tag, repo will fall back to the
62most recent tag it can find (via `git describe`).
63If that tag is valid, then repo will warn and use that commit instead.
64
65If that tag cannot be verified, it gives up and forces the user to resolve.
66
67## Branch management
68
69All development happens on the `master` branch and should generally be stable.
70
71Since the repo launcher defaults to tracking the `stable` branch, it is not
72normally updated until a new release is available.
73If something goes wrong with a new release, an older release can be force pushed
74and clients will automatically downgrade.
75
76The `maint` branch is used to track the previous major release of repo.
77It is not normally meant to be used by people as `stable` should be good enough.
78Once a new major release is pushed to the `stable` branch, then the previous
79major release can be pushed to `maint`.
80For example, when `stable` moves from `v1.10.x` to `v1.11.x`, then the `maint`
81branch will be updated from `v1.9.x` to `v1.10.x`.
82
83We don't have parallel release branches/series.
84Typically all tags are made against the `master` branch and then pushed to the
85`stable` branch to make it available to the rest of the world.
86Since repo doesn't typically see a lot of changes, this tends to be OK.
87
88## Creating a new release
89
90When you want to create a new release, you'll need to select a good version and
91create a signed tag using a key registered in repo itself.
92Typically we just tag the latest version of the `master` branch.
93The tag could be pushed now, but it won't be used by clients normally (since the
94default `repo-branch` setting is `stable`).
95This would allow some early testing on systems who explicitly select `master`.
96
97### Creating a signed tag
98
99Lets assume your keys live in a dedicated directory, e.g. `~/.gnupg/repo/`.
100
101*** note
102If you need access to the official keys, check out the internal documentation
103at [go/repo-release].
104Note that only official maintainers of repo will have access as it describes
105internal processes for accessing the restricted keys.
106***
107
108```sh
109# Set the gpg key directory.
110$ export GNUPGHOME=~/.gnupg/repo/
111
112# Verify the listed key is “Repo Maintainer”.
113$ gpg -K
114
115# Pick whatever branch or commit you want to tag.
116$ r=master
117
118# Pick the new version.
119$ t=1.12.10
120
121# Create the signed tag.
122$ git tag -s v$t -u "Repo Maintainer <repo@android.kernel.org>" -m "repo $t" $r
123
124# Verify the signed tag.
125$ git show v$t
126```
127
128### Push the new release
129
130Once you're ready to make the release available to everyone, push it to the
131`stable` branch.
132
133Make sure you never push the tag itself to the stable branch!
134Only push the commit -- notice the use of `$t` and `$r` below.
135
136```sh
137$ git push https://gerrit-review.googlesource.com/git-repo v$t
138$ git push https://gerrit-review.googlesource.com/git-repo $r:stable
139```
140
141If something goes horribly wrong, you can force push the previous version to the
142`stable` branch and people should automatically recover.
143Again, make sure you never push the tag itself!
144
145```sh
146$ oldrev="whatever-old-commit"
147$ git push https://gerrit-review.googlesource.com/git-repo $oldrev:stable --force
148```
149
150### Announce the release
151
152Once you do push a new release to `stable`, make sure to announce it on the
153[repo-discuss@googlegroups.com] group.
154Here is an [example announcement].
155
156You can create a short changelog using the command:
157
158```sh
159# If you haven't pushed to the stable branch yet, you can use origin/stable.
160# If you have pushed, change origin/stable to the previous release tag.
161$ git log --format="%h (%aN) %s" --no-merges origin/stable..$r
162```
163
164
165[example announcement]: https://groups.google.com/d/topic/repo-discuss/UGBNismWo1M/discussion
166[repo-discuss@googlegroups.com]: https://groups.google.com/forum/#!forum/repo-discuss
167[go/repo-release]: https://goto.google.com/repo-release