Skip to content

Commit

Permalink
Hotfix: Enhanced Release Guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Nusnus committed Mar 24, 2024
1 parent e2f9b17 commit 9cba745
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
r"https://github\.com/Jc2k/pytest-docker-tools\?tab=readme-ov-file#images",
r"https://github\.com/Jc2k/pytest-docker-tools\?tab=readme-ov-file#containers",
r"https://github\.com/Jc2k/pytest-docker-tools\?tab=readme-ov-file#fixture-wrappers",
r"https://github\.com/celery/celery/blob/main/requirements/test\.txt#L2",
r"https://github\.com/celery/celery/blob/main/tox\.ini#L30",
],
autodoc_mock_imports=[],
)
Expand Down
92 changes: 91 additions & 1 deletion docs/devguide/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ It will explain how does the CI/CD pipeline work and how to trigger a new releas

.. contents::
:local:
:depth: 3
:depth: 2

CI/CD Pipeline
==============
Expand Down Expand Up @@ -99,6 +99,79 @@ The following release workflow is triggered automatically when a new released is
Release Steps
=============

1. Celery Tests
~~~~~~~~~~~~~~~

The plugin is used as the official testing infrastructure for Celery. Every new release
requires manually testing that the new version works as expected with the Celery test suite.

To run the Celery test suite with the new version of the plugin, modify the Celery test environment as follows:

`test.txt <https://github.com/celery/celery/blob/main/requirements/test.txt#>`_
-------------------------------------------------------------------------------

Comment out the pytest-celery `installation line <https://github.com/celery/celery/blob/main/requirements/test.txt#L2>`_.

`tox.ini <https://github.com/celery/celery/blob/main/tox.ini>`_
---------------------------------------------------------------

Add ``-e "../pytest-celery[all]"`` to the `deps <https://github.com/celery/celery/blob/main/tox.ini#L30>`_ list.

.. code-block:: ini
[testenv]
...
deps=
-e "../pytest-celery[all]"
-r{toxinidir}/requirements/test.txt
...
And then execute with tox::

tox -e 3.12-smoke -- -n auto

This will run the Celery test suite with the new version of the plugin in edit mode, allowing
you to test the new version before releasing it and tweaking it if necessary to debug any issues.

.. tip::

Use the following snippet to run all of the tests with the new version of the plugin:

Pull RabbitMQ & Redis images for the integration tests:

.. code-block:: console
docker run -d -p 6379:6379 --name redis redis:latest
docker run -d -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:management
Unit Tests:

.. code-block:: console
tox -e 3.12-unit
Integration Tests:

.. code-block:: console
docker start rabbitmq redis
tox -e 3.12-integration-rabbitmq_redis
docker stop rabbitmq redis
Unit & Integration & Smoke Tests:

.. code-block:: console
tox -e 3.12-unit && docker start rabbitmq redis && tox -e 3.12-integration-rabbitmq_redis && docker stop rabbitmq redis && tox -e 3.12-smoke -- -n auto
.. warning::

The instructions above assume you have the :pypi:`pytest-celery <pytest-celery>` and :pypi:`celery <celery>` repositories
cloned in the same root directory.

2. Release PR
~~~~~~~~~~~~~

To make a new release, you need to create a new PR with one of these titles.

- **Official Release**: Prepare for release: vX.Y.Z
Expand All @@ -112,3 +185,20 @@ The PR should contain the following changes:
This PR will be used as a double check for the CI to make sure everything passes successfully before releasing the new version.
Once this PR is merged, the last step is to `release a version on GitHub <https://github.com/celery/pytest-celery/releases/new>`_.
This will trigger the :ref:`CD pipeline <continuous_deployment>` to deploy the new release to PyPI automatically.

SemVer
------

If you're not sure how to number the version, consult the `SemVer <https://semver.org/>`_ documentation.

3. Post-release
~~~~~~~~~~~~~~~

After the release is done, you should update the official Celery to use the new version of the plugin, in the
same `test.txt <https://github.com/celery/celery/blob/main/requirements/test.txt#>`_ that you modified earlier.

Future Releases
===============

Releases should be planned in the official `Milestones <https://github.com/celery/pytest-celery/milestones>`_ of the repository.
Each milestone should include in its description what is planned for the release and when is the expected release date.

0 comments on commit 9cba745

Please sign in to comment.