1RDOPKG-ADV-NEW-VE(7)                                      RDOPKG-ADV-NEW-VE(7)
2
3
4

NAME

6       rdopkg-adv-new-version - rdopkg adventures: new-version
7

SYNOPSIS

9       This is a short story about updating RDO python-swiftclient package to
10       new upstream version using rdopkg new-version.
11
12       Let’s assume update of Havana epel-6 python-swiftclient-1.8.0-1 package
13       to latest upstream version 2.0.2.
14

PROLOGUE

16       dist-git & remotes
17
18           $ cd python-swiftclient
19           $ git fetch --all
20           $ git remote -v
21           openstack   git://github.com/openstack/python-swiftclient.git (fetch)
22           openstack   git://github.com/openstack/python-swiftclient.git (push)
23           origin      ssh://jruzicka@pkgs.fedoraproject.org/python-swiftclient (fetch)
24           origin      ssh://jruzicka@pkgs.fedoraproject.org/python-swiftclient (push)
25           patches     git@github.com:redhat-openstack/python-swiftclient.git (fetch)
26           patches     git@github.com:redhat-openstack/python-swiftclient.git (push)
27
28       To summarise, above remotes are:
29
30       ·   origin: Fedora dist-git containing .spec & patches
31
32           (obtained by fedpkg clone python-swiftclient)
33
34       ·   patches: github remote with RDO patches branches
35
36       ·   openstack: upstream code repo to cherry-pick backported patch from
37
38       This is a Havana epel-6 fix, so I’m gonna work with:
39
40       ·   origin/el6-havana dist-git
41
42       ·   patches/stable/havana patches branch
43
44       See rdopkg info output for current branch names.
45
46       Before we proceed, let’s inspect the patches branch:
47
48           o [patches/stable/havana] Add SSL certificate verification by default
49           o Remove builtin requirements handling
50           M─┐ [1.8.0] Merge "Make pbr only a build-time dependency."
51           │ o Make pbr only a build-time dependency.
52           o │ assertEquals is deprecated, use assertEqual (H602
53           ...
54
55       You can see that there are two commits on top of 1.8.0. These two
56       patches are present in dist-git and applied in .spec file:
57
58           ...
59           Patch0001: 0001-Remove-builtin-requirements-handling.patch
60           Patch0002: 0002-Add-SSL-certificate-verification-by-default.patch
61           ...
62           %patch0001 -p1
63           %patch0002 -p1
64           ...
65

CHAPTER 1

67       rdopkg new-version
68
69       With remotes set up and up to date, it’s time to run rdopkg
70       new-version.
71
72       The only required positional argument specifies a version to update to.
73       This is 2.0.2 in this case and it’s both new rpm Version and git tag to
74       rebase patches branch on. For other packages and versions, version tag
75       and rpm Version might differ.
76
77           $ git fetch --all
78           $ git checkout el6-havana
79           $ rdopkg new-version 2.0.2
80

CHAPTER 2

82       diff
83
84       First, rdopkg displays summary of changed files and changes to
85       requirements.txt files:
86
87           --- a/requirements.txt
88           +++ b/requirements.txt
89           @@ -1 +1,2 @@
90           +requests>=1.1
91           simplejson>=2.0.9
92
93       I make a mental note I need to add Requires: python-requests later and
94       press enter to advance.
95

CHAPTER 3

97       rebase of patches branch
98
99       Next, rdopkg resets the local stable/havana branch to
100       patches/stable/havana, switches to it, and tries to rebase it on 2.0.2
101       git tag.
102
103       The rebase failed due to a conflict of downstream patches nuking pbr
104       and rdopkg exited to shell so I can finish the rebase manually.
105
106       I modified the conflicting patch and continued the rebase with
107
108           git rebase --continue
109
110       Then the second patch failed to apply as well. This was a downstream
111       only fix and upstream has chosen a different solution which is already
112       included in 2.0.2 and thus I skipped this patch entirely with
113
114           git rebase --skip
115
116       Now, the patches branch look like this:
117
118           o [stable/havana] Remove builtin requirements handling
119           o [2.0.2] Remove multipart/form-data file upload
120           o Fix --insecure option on auth
121           M─┐ Merge "Port to python-requests"
122
123       First patch is on top of 2.0.2, second obsolete patch is gone.
124

CHAPTER 4

126       the rest is magic
127
128       Once I’m happy with the rebased patches branch, I resume rdopkg action
129       with
130
131           rdopkg -c
132
133       Now, rdopkg asks if I want to push the shiny rebased patches branch. I
134       indeed do. Note that you need to have force push permission in the
135       patches remote.
136
137           Push stable/havana to patches / stable/havana (with --force)? [Yn]
138
139       After this, rdopkg:
140
141       ·   downloads the source tarball
142
143       ·   calls fedpkg new-sources
144
145       ·   updates .spec file (Version, Release, patches_base, new changelog
146           entry)
147
148       ·   creates new commit with updated .spec
149
150       ·   updates patches from local patches branch stable/havana
151
152       ·   shows final diff
153
154       pseudo-diff of .spec file:
155
156           -Version:    1.8.0
157           +Version:    2.0.2
158            ...
159           -# patches_base=1.8.0
160           +# patches_base=2.0.2
161            ...
162            Patch0001: 0001-Remove-builtin-requirements-handling.patch
163           -Patch0002: 0002-Add-SSL-certificate-verification-by-default.patch
164            ...
165            %patch0001 -p1
166           -%patch0002 -p1
167            ...
168           +* Thu Feb 20 2014 Jakub Ruzicka <jruzicka@redhat.com> 2.0.2-1
169           +- Update to upstream 2.0.2
170           +
171            ...
172
173       As you can see, obsolete patch I deleted during rebase is gone.
174
175       Commit message and changed files:
176
177           Update to upstream 2.0.2
178
179           M   .gitignore
180           M   0001-Remove-builtin-requirements-handling.patch
181           D   0002-Add-SSL-certificate-verification-by-default.patch
182           M   python-swiftclient.spec
183           M   sources
184

CHAPTER 5

186       finishing touches & rdopkg amend
187
188       Finally, I need to tune .spec file due to new deps and amend with
189       rdopkg amend to regenerate commit message from %changelog:
190
191           vim python-swiftclient.spec
192           rdopkg amend
193
194       Final commit message:
195
196           Update to upstream 2.0.2
197
198           Changelog:
199           - Update to upstream 2.0.2
200           - Switch from pyOpenSSL to python-requests - update dependencies
201           - Remove unneeded dependency: python-simplejson
202

EPILOGUE

204       See available options
205
206           rdopkg new-version -h
207
208       and rdopkg(1) manual for more information.
209
210
211
212                                  04/08/2019              RDOPKG-ADV-NEW-VE(7)
Impressum