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 initial release-process.md #227

Merged
merged 3 commits into from
Jul 13, 2023
Merged
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
156 changes: 156 additions & 0 deletions docs/release-process.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# Ansible Release Process

## Preamble

This document describes the ansible community package release process.

> **Note**
>
> Throughout this page, placeholder values in code blocks are formatted as
> `{PLACEHOLDER}` where `PLACEHOLDER` describes the value to fill in.

gotmax23 marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a build check list, that might be helpful.

  • Create an issue at ansible-build-data Github repo

  • Communicate with the Community about the start and the progress

  • Fork ansible-community/ansible-build-data

  • Build the release artifacts and package

  • PR to ansible-build-data

  • PR to ansible/ansible (PR_Porting guide)

  • Upload it to PyPI

  • Release Announcement

  • Git Tag

  • Close the Github issue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Release Announcement

Can you shed some more light on this step? Where do the announcement templates come from? What Matrix rooms and mailing lists are the announcements sent to?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We created a template for the announcement templates. We need to figure out a place to publish it. @gotmax23 can you suggest something?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put the template(s) in this repository as well (maybe some subdirectory of docs/, like docs/templates/?). That way it's also easier for folks to suggest improvements to the templates (by creating a PR).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @felixfontein that this repo is a good place to publish the announcement templates. I think a docs/announcements or maybe just a separate folder at the repo root would work.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @felixfontein that this repo is a good place to publish the announcement templates. I think a docs/announcements or maybe just a separate folder at the repo root would work.

I will do a separate PR on this then.


## Set up container

Release managers may choose to preform the following steps inside a podman or
docker container created from the [`docker.io/library/python:3.10`][container]
image.
Make sure to mount your working directory as a volume so you don't have to set
up new repository clones every time.

```
podman run --name ansible-release -v {PERSISTENT DIRECTORY}:/pwd:z -w /pwd -ti docker.io/library/python:3.10 bash
```


## Set up repository clones
gotmax23 marked this conversation as resolved.
Show resolved Hide resolved

First, you need to set up ansible-build-data and antsibull repository clones.
This only needs to be done once.

1. [Fork][abd-fork] the [ansible-build-data] repository.
2. Checkout the antsibull and ansible-documentation repositories
and change into antsibull.

```
git clone https://github.com/ansible/ansible-documentation
git clone https://github.com/ansible-community/antsibull
cd antsibull
```
3. Checkout ansible-build-data and configure your fork.

To checkout the repository run

```
mkdir build
cd build
git clone https://github.com/ansible-community/ansible-build-data
cd ansible-build-data
```

Then, configure your fork.
This guide uses your Github username as the fork remote name.

```
git remote add {USERNAME} https://github.com/{USERNAME}/ansible-build-data
git fetch {USERNAME} -v
```

## Preform release process

1. Change into the antsibull checkout.
Make sure you have the `main` branch checked out
and run `git pull` to update to the latest commit.

2. Create a clean virtual environment for the release process.

```
rm -rf release-venv
python3 -m venv release-venv
. ./release-venv/bin/activate
python3 -m pip install -U pip
```

Install the `antsibull`, `ansible-core`, and `twine` python packages,
as well as the community.general collection.

```
python3 -m pip install antsibull ansible-core twine
ansible-galaxy collection install --force community.general
```

3. Run the [ansible release playbook][release-playbook]
with the appropriate options.
You can see the [argument spec][release-playbook-args]
for a full breakdown, but this describes the basic usage.

```
export ANSIBLE_CALLBACK_RESULT_FORMAT=yaml
ansible-playbook playbooks/build-single-release.yaml -e antsibull_ansible_version={VERSION}
```

> **Note**
>
> When building ansible versions greater than 9.0.0a1,
> `Validate tags file` task failures will fail the release playbook instead
> of warning and moving on.
> See [policies.md][tagging-enforcement] for how to proceed if this step fails.

4. Commit the changes and push them to your fork.

You can run the following commands to do so

```
cd build/ansible-build-data
git switch -c release-{VERSION}
git add {MAJOR VERSION}/
git commit -m "Ansible {VERSION}: Dependencies, changelog and porting guide"
git push -u {USERNAME} release-{VERSION}
```

Then, submit a pull request against ansible-build-data upstream.

5. Submit a PR to ansible/ansible-documentation to add the new porting guide to the docsite.
Copy the porting guide to the ansible docsite directory
in your ansible checkout with the following command

```
cp {MAJOR VERSION}/porting_guide_{MAJOR VERSION}.rst ../ansible-documentation/docs/docsite/rst/porting_guides/
```

switch to the ansible checkout,
commit and push the changes,
and then submit a PR as you normally would.
You can use `Add Ansible community {VERSION} porting guide` as the commit message.

6. Once the ansible-build-data PR has been merged,
publish the build artifacts to PyPI.
From the antsibull repository root, run

```
gotmax23 marked this conversation as resolved.
Show resolved Hide resolved
twine upload build/ansible-{VERSION}.tar.gz build/ansible-{VERSION}*.whl
```

7. Tag the release commit in the ansible-build-data repository.

```
cd build/ansible-build-data
git switch main
git pull
git tag {VERSION} {MERGED PR COMMIT HASH} -a -m "Ansible {VERSION}: Changelog, Porting Guide and Dependent Collection Details"
git push --follow-tags
```

8. Announce the release on Matrix and the mailing list.
TODO: Move announcement templates into this repository.
Release managers can copy and paste the previous release's announcement for
now.
Make sure to change the version numbers and sha256sum in the announcement
text.

[container]: https://hub.docker.com/_/python
[abd-fork]: https://github.com/ansible-community/ansible-build-data/fork
[ansible-build-data]: https://github.com/ansible-community/ansible-build-data
[release-playbook]: https://github.com/ansible-community/antsibull/blob/main/playbooks/build-single-release.yaml
[release-playbook-args]: https://github.com/ansible-community/antsibull/blob/main/roles/build-release/meta/argument_specs.yml
[tagging-enforcement]: https://github.com/gotmax23/ansible-build-data/blob/docs/docs/policies.md#enforcement