Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a workflow which automatically adds backport tags based upon changelogs #2454

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/backports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: mergeit-backport

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
types:
- labeled
- opened
- synchronize
branches:
- main

jobs:
changelog-labeller:
uses: ansible-network/github_actions/.github/workflows/backport-labeller.yml@main
with:
label_minor_release: backport-9
label_bugfix_release: backport-8
38 changes: 31 additions & 7 deletions docs/docsite/rst/collection_release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@ Ensure that your local copy of the ``main`` branch is up to date and contains al
Preparing a new stable branch
-----------------------------

.. warning::
Zuul will need updating here too.

As part of the next release cycle please add an entry here about configuring the Zuul sanity jobs
for the new stable-6 branch.

Create and push a new ``stable-<major-version>`` branch (for example ``stable-6`` for release
``6.0.0``):

Expand All @@ -108,6 +102,14 @@ Create and push a new ``stable-<major-version>`` branch (for example ``stable-6`
git checkout -b stable-6
git push --set-upstream origin stable-6

Create a new label ``backport-<major-version>`` (for example ``backport-6`` for release ``6.0.0``).
This can either be done through the `GitHub UI <https://github.com/ansible-collections/amazon.aws/labels>`_
or using the GH CLI if you have it installed and configured:

.. code-block:: bash

gh label create backport-6 -c FFAA22 --description "PR should be backported to the stable-6 branch" -R ansible-collections/amazon.aws

Create a pull request against the new branch updating any documentation links from ``main`` to the
new ``stable-<major-version>`` branch.

Expand All @@ -121,18 +123,40 @@ Now that our new major release has been branched, we update the ``main`` branch
configured as the pre-release development version for the **next** release (for example
``7.0.0-dev0`` if you're preparing ``6.0.0``).

Create a pull request against the ``main`` branch that updates the
`backport-labeller workflow <https://github.com/ansible-collections/amazon.aws/tree/main/.github/workflows/backports.yml>`_
so that non-breaking changes will automatically be backported to the new branch:

.. code-block:: yaml

---
name: mergeit-backport

...

jobs:
changelog-labeller:
uses: ansible-network/github_actions/.github/workflows/backport-labeller.yml@main
with:
label_minor_release: backport-6
label_bugfix_release: backport-5


Create a pull request against the ``main`` branch updating the
`galaxy.yml <https://github.com/ansible-collections/amazon.aws/blob/main/galaxy.yml>`_ version
information and the `plugins/module_utils/common.py
<https://github.com/ansible-collections/amazon.aws/blob/main/plugins/module_utils/common.py>`_
version information to a ``dev0`` prerelease of the next major release. This may result in deprecation
errors from the sanity tests. Create issues and add entries to the relevant
`sanity test ignore files <https://github.com/ansible-collections/amazon.aws/tree/main/tests/sanity>`_.
(including a link to the issue)
(including a link to the issue).

For an example pull request see
`ansible-collections/amazon.aws#1108 <https://github.com/ansible-collections/amazon.aws/pull/1108>`_

(In theory both steps can be done with a single PR. However, the bot performing our automatic
merges will refuse to merge PRs which make changes to the contents of .github. Splitting the PRs up
reduces the scope of the manually merged PR.)

Next steps
----------
Expand Down
Loading