HOWTO write the release notes » History » Version 4
Loïc Dachary, 04/27/2015 07:43 AM
1 | 1 | Loïc Dachary | * git clone -b release (for instance git clone -b dumpling http://github.com/ceph/ceph) |
---|---|---|---|
2 | * run the following to get a base to work on |
||
3 | <pre> |
||
4 | #!/usr/bin/env python |
||
5 | 4 | Loïc Dachary | # First published by Abhishek Lekshmanan at https://gist.github.com/theanalyst/a0932d863a8f4b0d1b98 |
6 | # Originally borrowed from A. Israel's https://gist.github.com/aisrael/b2b78d9dfdd176a232b9 |
||
7 | from __future__ import print_function |
||
8 | 1 | Loïc Dachary | import re |
9 | 4 | Loïc Dachary | import github |
10 | 1 | Loïc Dachary | |
11 | from git import Repo |
||
12 | |||
13 | |||
14 | 4 | Loïc Dachary | gh = github.GitHub( |
15 | access_token="somesecret") |
||
16 | merge_re = re.compile("Merge pull request #(\d+).*") |
||
17 | fixes_re = re.compile("Fixes (#\d+)") |
||
18 | tracker_re = re.compile("http://tracker.ceph.com/issues/(\d+)") |
||
19 | signed_off_re = re.compile("Signed-off-by: (.+) <") |
||
20 | 1 | Loïc Dachary | |
21 | 4 | Loïc Dachary | def make_release_notes(repo, ref): |
22 | 1 | Loïc Dachary | |
23 | 4 | Loïc Dachary | for commit in repo.iter_commits(ref): |
24 | merge = merge_re.match(commit.summary) |
||
25 | if merge: |
||
26 | pr = {} |
||
27 | issue = '' |
||
28 | pr = gh.repos("ceph")("ceph").pulls(merge.group(1)).get() |
||
29 | # We are not handling multiple issues here yet |
||
30 | if pr['body']: |
||
31 | fixes = fixes_re.findall(pr['body']) |
||
32 | tracker = tracker_re.findall(pr['body']) |
||
33 | if tracker: |
||
34 | issue = ','.join(tracker) |
||
35 | elif fixes: |
||
36 | issue = ','.join(fixes) |
||
37 | 1 | Loïc Dachary | |
38 | |||
39 | 4 | Loïc Dachary | title = pr['title'] |
40 | # Big assumption, do a sanity check in the end, we are |
||
41 | # getting the author of final merge commit |
||
42 | author = commit.parents[-1].author.name |
||
43 | if issue: |
||
44 | print ("{0}(#{1}, {2})".format(title,issue,author)) |
||
45 | elif author: |
||
46 | print ("{0}({1})".format(title,author)) |
||
47 | else: |
||
48 | print (title) |
||
49 | 2 | Loïc Dachary | |
50 | 1 | Loïc Dachary | |
51 | 4 | Loïc Dachary | if __name__ == "__main__": |
52 | make_release_notes(Repo("."),"tags/v0.87.1..giant") |
||
53 | |||
54 | 1 | Loïc Dachary | </pre> |
55 | * manual edit the list of commits |
||
56 | * add a section in http://docs.ceph.com/docs/master/release-notes/ in the *master* branch of ceph in the "release-notes.rst":https://github.com/ceph/ceph/blob/master/doc/release-notes.rst file with the list of commits |
||
57 | * backport the release notes to the release branch when they are final. Ideally this is done before the point release is published. If not it can be backported shortly afterwards. |
||
58 | * add the release to the "timeline":https://github.com/ceph/ceph/blob/master/doc/release.rst |
||
59 | * the release notes come with an introduction that "is prepared in a separate file":https://github.com/ceph/ceph/blob/master/PendingReleaseNotes . It can be edited if something significant must not be forgotten and it does not need to well written because it is a draft. |