Debian Codegraph @

ansible_collections/amazon/aws/docs/docsite/rst/collection_release.rst

raw
1 :orphan:
2
3 .. _ansible_collections.amazon.aws.docsite.collection_release:
4
5 AWS collection release process
6 ##############################
7
8 The ``amazon.aws`` and ``community.aws`` collections follow `semantic versioning <https://semver.org/>`_
9 with the `main branch <https://github.com/ansible-collections/amazon.aws/tree/main>`_ being the
10 pre-release or development branch, and separate ``stable`` branches used to backport patches for
11 release in minor and patch releases. Please make sure you're familiar with semantic versioning
12 prior to preparing a release.
13
14 * Patch releases may **only** contain backwards compatible bug fixes.
15 * Minor releases must be backwards compatible, but may also include new functionality and
16 deprecation announcements.
17 * Major releases may also include breaking changes.
18
19 Releases to `Ansible Galaxy <https://galaxy.ansible.com>`_ are automated through GitHub and Zuul
20 integrations.
21
22 Major releases
23 **************
24
25 .. note::
26 The examples below will be based upon preparing the major release ``6.0.0``. At the end of the
27 process a new ``stable-6`` branch will have been created and the ``main`` branch will be ready for
28 use as the ``7.0.0dev0`` development branch.
29
30 The major release process has two phases.
31
32 #. Preparing the branches
33 #. Generating the release
34
35 Preparing the branches involves creating a new ``stable`` branch, updating documentation links, and
36 bumping the version for the ``main`` branch.
37
38 Generating the release involves updating the version information, creating the changelog and
39 tagging the release. This part of the process is identical to performing
40 `Minor and Patch releases<ansible_collections.amazon.aws.docsite.minor_releases>`
41 and will be covered in that section.
42
43 Pre-flight checks
44 =================
45
46 It's generally advisable to ask in the `Ansible + AWS Matrix chat room
47 <https://matrix.to/#/#aws:ansible.com>`_ prior to preparing a release to see if folks have any
48 patches that they'd like to get into a release.
49
50 Deprecations
51 ------------
52
53 Prior to proceeding with a major release check that no ``collection-deprecated-version`` or
54 ``ansible-deprecated-date`` entries exist in the
55 `sanity test ignore files <https://github.com/ansible-collections/amazon.aws/tree/main/tests/sanity>`_.
56
57 This generally involves changing a default or dropping support for something, however deprecations
58 are used as a warning for breaking changes. Once a major version has been released breaking changes
59 should wait for the next major release before being applied.
60
61 In some cases it may be appropriate to either delay the change (update the deprecation version),
62 or abandon the deprecation.
63
64 Python and AWS SDK dependencies
65 -------------------------------
66
67 Starting with the 2.0.0 releases of ``amazon.aws`` and ``community.aws``, it is generally the
68 collection's policy to support the minor versions of ``botocore`` and ``boto3`` that were released
69 12 months prior to the most recent major collection release. SDK support for Python versions also
70 drives which versions of Python the collections support.
71
72 SDK dependencies need to be updated in a number of places, primarily:
73
74 * README.md
75 * constraints.txt files (for our tests)
76 * ``ansible_collections.amazon.aws.plugins.module_utils.botocore.MINIMUM_BOTOCORE_VERSION``
77 * ``ansible_collections.amazon.aws.plugins.module_utils.botocore.MINIMUM_BOTO3_VERSION``
78
79 The pull request to update the SDK requirements can also include dropping explicit requirements for a
80 minimum ``boto3`` or ``botocore`` version in modules. However, dropping code that maintains
81 backwards compatible support for an older SDK version would be a breaking change and must not be
82 backported.
83
84 For an example see `ansible-collections/amazon.aws#1342 <https://github.com/ansible-collections/amazon.aws/pull/1342>`_
85
86 Preparing the branches
87 ======================
88
89 Ensure that your local copy of the ``main`` branch is up to date and contains all planned patches.
90
91 Preparing a new stable branch
92 -----------------------------
93
94 Create and push a new ``stable-<major-version>`` branch (for example ``stable-6`` for release
95 ``6.0.0``):
96
97 .. code-block:: bash
98
99 git fetch origin
100 git checkout main
101 git reset --hard origin/main
102 git checkout -b stable-6
103 git push --set-upstream origin stable-6
104
105 Create a new label ``backport-<major-version>`` (for example ``backport-6`` for release ``6.0.0``).
106 This can either be done through the `GitHub UI <https://github.com/ansible-collections/amazon.aws/labels>`_
107 or using the GH CLI if you have it installed and configured:
108
109 .. code-block:: bash
110
111 gh label create backport-6 -c FFAA22 --description "PR should be backported to the stable-6 branch" -R ansible-collections/amazon.aws
112
113 Create a pull request against the new branch updating any documentation links from ``main`` to the
114 new ``stable-<major-version>`` branch.
115
116 For an example pull request see
117 `ansible-collections/amazon.aws#1107 <https://github.com/ansible-collections/amazon.aws/pull/1107>`_
118
119 Updating main
120 -------------
121
122 Now that our new major release has been branched, we update the ``main`` branch so that it's
123 configured as the pre-release development version for the **next** release (for example
124 ``7.0.0-dev0`` if you're preparing ``6.0.0``).
125
126 Create a pull request against the ``main`` branch that updates the
127 `backport-labeller workflow <https://github.com/ansible-collections/amazon.aws/tree/main/.github/workflows/backports.yml>`_
128 so that non-breaking changes will automatically be backported to the new branch:
129
130 .. code-block:: yaml
131
132 ---
133 name: mergeit-backport
134
135 ...
136
137 jobs:
138 changelog-labeller:
139 uses: ansible-network/github_actions/.github/workflows/backport-labeller.yml@main
140 with:
141 label_minor_release: backport-6
142 label_bugfix_release: backport-5
143
144
145 Create a pull request against the ``main`` branch updating the
146 `galaxy.yml <https://github.com/ansible-collections/amazon.aws/blob/main/galaxy.yml>`_ version
147 information and the `plugins/module_utils/common.py
148 <https://github.com/ansible-collections/amazon.aws/blob/main/plugins/module_utils/common.py>`_
149 version information to a ``dev0`` prerelease of the next major release. This may result in deprecation
150 errors from the sanity tests. Create issues and add entries to the relevant
151 `sanity test ignore files <https://github.com/ansible-collections/amazon.aws/tree/main/tests/sanity>`_.
152 (including a link to the issue).
153
154 For an example pull request see
155 `ansible-collections/amazon.aws#1108 <https://github.com/ansible-collections/amazon.aws/pull/1108>`_
156
157 (In theory both steps can be done with a single PR. However, the bot performing our automatic
158 merges will refuse to merge PRs which make changes to the contents of .github. Splitting the PRs up
159 reduces the scope of the manually merged PR.)
160
161 Next steps
162 ----------
163
164 Once these pull requests have been merged there should be a new ``stable`` branch for the release
165 series (for example ``stable-6`` for all ``6.x.y`` releases) and the ``main`` branch should have
166 been updated. After which you can continue the major release process by following the steps for
167 `Minor and Patch releases<ansible_collections.amazon.aws.docsite.minor_releases>`.
168
169
170 .. _ansible_collections.amazon.aws.docsite.minor_releases:
171
172 Minor and Patch releases
173 ************************
174
175 .. note::
176
177 The examples below will be based upon preparing the major release ``6.0.0`` using the ``stable-6``
178 branch. While ``6.0.0`` is a major release, this part of the process is identical for major,
179 minor and patch releases.
180
181 Ensure that the relevant stable branch (for example ``stable-6``) is up to date and includes all
182 planned patches. If you have local copies of both ``amazon.aws`` and ``community.aws`` it is
183 strongly recommended that you checkout the same branch for both collections.
184
185 Outline of steps for generating a release:
186
187 #. Create a local branch
188 #. Update version information
189 #. Generate the changelog
190 #. Generate (and merge) the PR
191 #. Tag the release
192 #. Announce the release
193
194 Create a working branch for your release
195 ========================================
196
197 Checkout the relevant stable branch, and create a local working branch for the release.
198
199 .. code-block:: bash
200
201 git fetch origin
202 git checkout stable-6
203 git reset --hard origin/stable-6
204 git checkout -b release/6.0.0/prepare
205
206
207 Update version information
208 ==========================
209
210 We need to update the version information in a couple of places:
211
212 * galaxy.yml
213 * plugins/module_utils/common.py
214
215 In your local clone of the repository, update ``galaxy.yml`` with the new release version
216 information.
217
218 **galaxy.yml:**
219
220 .. code-block:: yaml
221
222 namespace: amazon
223 name: aws
224 version: 6.0.0
225 ...
226
227 **plugins/module_utils/common.py:**
228
229 .. code-block:: python
230
231 AMAZON_AWS_COLLECTION_VERSION = "6.0.0"
232
233 .. note::
234
235 Separately committing each of the changes to your local branch as you go will save you time if
236 there are problems with changelog fragments.
237
238 While the sanity tests can pick up invalid YAML and RST, they don't detect broken links
239 prior to the final changelog generation.
240
241 Generate the Changelogs
242 =======================
243
244 Install Antsibull
245 -----------------
246
247 We use `antsibull-changelog <https://github.com/ansible-community/antsibull-changelog>`_ to generate
248 our changelogs from the fragments, and `antsibull-docs
249 <https://github.com/ansible-community/antsibull-docs>`_ to generate the `rendered documentation.
250 <https://ansible-collections.github.io/amazon.aws/branch/main/collections/amazon/aws/index.html>`_
251
252 If you've not already installed these tools then you'll need to do so (this can be done in a virtual
253 environment if desired):
254
255 .. code-block:: bash
256
257 pip install ansible sphinx-ansible-theme antsibull-changelog antsibull-docs
258
259 Add a release_summary changelog fragment
260 ----------------------------------------
261
262 While not strictly necessary it's preferable to add a release summary that will be added to the
263 changelog. For example, the `release summary for 5.2.0
264 <https://ansible-collections.github.io/amazon.aws/branch/stable-5/collections/amazon/aws/docsite/CHANGELOG.html#release-summary>`_
265
266 **changelogs/fragments/release-summary.yml:**
267
268 .. code-block:: yaml
269
270 release_summary: |
271 Add a short description highlighting some of the key changes in the release.
272
273 Commit the release summary to your local branch.
274
275 Generate the merged changelog
276 -----------------------------
277
278 Next we need to generate the merged changelog. This will automatically delete the used fragments,
279 update ``CHANGELOG.rst``, ``changelogs/changelog.yaml``, and ``git add`` what it changes.
280
281 .. code-block:: bash
282
283 antsibull-changelog release
284
285 Commit all of these changes to your local branch.
286
287 Create your Pull Request
288 ------------------------
289
290 Once everything's been committed locally you can prepare a pull request. The pull request should be
291 for the relevant ``stable`` branch and **not** the ``main`` branch.
292
293 All tests for the PR should pass prior to merging. This pull request can be approved and merged as
294 usual.
295
296 Because ``CHANGELOG.rst`` is actually generated from ``changelogs/changelog.yaml``, if you need to
297 fix issues with a changelog fragment, the easiest option is to revert the final changelog
298 generation, fix the original fragment, and re-generate the final changelog (This is why you should
299 commit small changes as you go).
300
301 .. note::
302
303 Releases for amazon.aws should either be prepared by someone from the Ansible Cloud Content
304 team, or be approved by at least one person from the Ansible Cloud Content team.
305
306 .. warning::
307
308 Prior to triggering the merge for the release pull request, please warn the `Ansible + AWS Matrix
309 chat room <https://matrix.to/#/#aws:ansible.com>`_ the final tagging (which releases the code to
310 `Ansible Galaxy <https://galaxy.ansible.com>`_) should be done using the pull request commit.
311
312 Tag the release
313 ===============
314
315 Pushing the release to `Ansible Galaxy <https://galaxy.ansible.com>`_ is performed by Zuul. When
316 a tag is pushed GitHub Zuul will automatically build the relevant artifacts and push them to Galaxy.
317
318 .. code-block:: bash
319
320 git fetch origin
321 git checkout stable-6
322 git reset --hard origin/stable-6
323 git tag 6.0.0
324 git push origin 6.0.0
325
326
327 Announce the release
328 ====================
329
330 Bullhorn
331 --------
332
333 The Bullhorn is a newsletter for the Ansible developer community. If you have anything to share
334 about what you've been up to with Ansible lately, including new collection releases, simply hop
335 into `#social:ansible.com <https://matrix.to/#/#social:ansible.com>`_ (the Ansible Social room on
336 Matrix) and leave a message, tagging newsbot. Your update will then be included in the next
337 edition of the Bullhorn (pending editor approval).
338
339 For more information (and some examples) see the `Ansible News Working Group wiki page
340 <https://github.com/ansible/community/wiki/News#the-bullhorn>`_
341
342 .. warning::
343 As part of the next release cycle please add an example here.
344
345 .. .. code-block:: none
346 ..
347 .. @newsbot [amazon.aws 6.0.0](https://github.com/ansible-collections/amazon.aws/tree/6.0.0) has been released.
348 This is a major release, and includes XXX WRITE ME XXX
349 [see changelog for more details](https://github.com/ansible-collections/amazon.aws/blob/6.0.0/CHANGELOG.rst)
350
351 Update the chat room topic
352 --------------------------
353
354 Once the release is available from Ansible Galaxy, the topic should be updated in the
355 `Ansible + AWS Matrix chat room. <https://matrix.to/#/#aws:ansible.com>`_ This generally requires
356 assistance from a member of Ansible staff.
357
358 Create a GitHub "Release"
359 -------------------------
360
361 While the AWS collections are generally distributed via Ansible Galaxy, for visibility we also
362 create a GitHub release. Pushing a tag should automatically do this, however, should the automation
363 fail, releases can also be created manually.
364
365 Copy the release notes from the rendered changelog file and generate a GitHub release based upon the
366 newly created tag.
367
368 * `amazon.aws <https://github.com/ansible-collections/amazon.aws/releases>`_
369 * `community.aws <https://github.com/ansible-collections/community.aws/releases>`_
370
371 .. note::
372 For more information see: `Managing releases in a repository
373 <https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository>`_
374
375 Cleanup
376 *******
377
378 We usually forward-port the changelog entries. If multiple releases are planned concurrently then
379 the changelog entries can be merged into the ``main`` branch in a single PR.
380
381 .. code-block:: bash
382
383 git fetch origin --tags
384 git checkout main
385 git reset --hard origin/main
386 git checkout -b release/6.0.0/changelog-to-main
387 git cherry-pick -n 6.0.0
388 git checkout origin/main galaxy.yml
389 git commit -m "Add changelogs from release 6.0.0 to main"
390
391 .. note::
392
393 To improve visibility of collection-wide deprecations, such as pending changes to module_utils,
394 or deprecated support for a version of Python, the corresponding changelog fragment can be kept in
395 the main branch. This will ensure that there is also a deprecation warning in the next major
396 release.
397 Keeping a fragment can be done by using git to checkout the original fragment prior to
398 commiting and pushing:
399 ``git checkout origin/main changelogs/fragments/<some fragment>.yml``
400
401 .. warning::
402
403 Any conflicts will need to be resolved prior to commiting.
404
405 .. warning::
406
407 Be careful not to update galaxy.yml when you're forward-porting the changelog entries.