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
Improving release process #568
Conversation
|
|
||
| from redminelib import Redmine | ||
|
|
||
| REDMINE_API_KEY = os.environ["REDMINE_API_KEY"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to check if this var is set for this repo
|
Attached issue: https://pulp.plan.io/issues/7961 |
.ci/scripts/redmine.py
Outdated
| # WARNING: DO NOT EDIT! | ||
| # | ||
| # This file was generated by plugin_template, and is managed by it. Please use | ||
| # './plugin-template --github pulp_ansible' to update this file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shows, where you borrowed it. ;) But pulp_ansible looks out of place here.
RELEASING.md
Outdated
| 1. Make sure that you are one of the owners on Galaxy! Github perms are not helping here. | ||
| 1. Go to https://galaxy.ansible.com/my-content/namespaces. | ||
| 1. Choose/unfold pulp namespace. | ||
| 1. "Upload new verison" to the pulp_installer collection. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only looking at the docs, this is a great improvement!
| 1. Generate changelog (`towncrier --yes --version 3.8.0`). | ||
| 1. Update version in the `galaxy.yml` and in the `roles/pulp_common/{vars,defaults}/main.yml`. | ||
| 1. Update references to current and previous versions in `docs/index.md` | ||
| (`sed -i -e 's/3.7.1/3.8.0/g' -e 's/3.6.z/3.7.z/g' -e 's/3.5.z/3.6.z/g' docs/index.md`).\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those changes are not handled by bump2version, are they?
Maybe we should keep that line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of using bump2version I added some input() asking for the new versions, I get the old ones and do a sed, so the idea is just to check if the sed did change the right places before starting the PR
| release_version = input("Please enter the pulp_installer version e.g. (3.12.0): ") | ||
| pulpcore_version = input("Please enter the pulpcore version e.g. (3.12.0): ") | ||
| pulpcore_selinux_version = input( | ||
| "Please enter the pulpcore-selinux version e.g. (1.2.4): " | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User will give the desired versions
| with open("roles/pulp_common/vars/main.yml") as f: | ||
| __pulp_version = yaml.safe_load(f)["__pulp_version"] | ||
| previous_pulpcore_version = __pulp_version.split('"')[1] | ||
|
|
||
| with open("roles/pulp_common/defaults/main.yml") as f: | ||
| previous_selinux_version = yaml.safe_load(f)["__pulp_selinux_version"] | ||
|
|
||
| with open("galaxy.yml") as f: | ||
| previous_installer_version = yaml.safe_load(f)["version"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will get the old values
.ci/scripts/release.py
Outdated
| sed( | ||
| [ | ||
| "-i", | ||
| f"s/{previous_pulpcore_version}/{pulpcore_version}/", | ||
| "roles/pulp_common/vars/main.yml", | ||
| ] | ||
| ) | ||
| sed( | ||
| [ | ||
| "-i", | ||
| f"s/{previous_selinux_version}/{pulpcore_selinux_version}/", | ||
| "roles/pulp_common/defaults/main.yml", | ||
| ] | ||
| ) | ||
| sed(["-i", f"s/{previous_installer_version}/{release_version}/", "galaxy.yml"]) | ||
| sed( | ||
| [ | ||
| "-i", | ||
| f"s/This version of the installer, {previous_installer_version}/{release_version}/", | ||
| "docs/index.md", | ||
| ] | ||
| ) | ||
| sed( | ||
| [ | ||
| "-i", | ||
| f"s/{previous_pulpcore_version}/{pulpcore_version}/", | ||
| "docs/index.md", | ||
| ] | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and then: sed -i s/old_value/new_value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OIC
.ci/scripts/release.py
Outdated
| "roles/pulp_common/defaults/main.yml", | ||
| ] | ||
| ) | ||
| sed(["-i", f"s/{previous_installer_version}/{release_version}/", "galaxy.yml"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you see a way to make those replacements to be more specific? I know there is
sed /pattern/s/match_pattern/replace_pattern/ to only touch lines that match the first pattern.
(My concern is that we cannot assume that different projects will never have the same version by accident. Pulpcore e.g. just rolled over python versions.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is possible, only the last sed needs to be general
|
As a pulp_installer releaser, this change looks good to me. 👍 |
.ci/scripts/release.py
Outdated
| sed( | ||
| [ | ||
| "-i", | ||
| f"0,/{previous_pulpcore_version}/s//{pulpcore_version}/", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, i may haven't expressed myself good enough. I thought of something like
/^__pulp_version:/s/{previous_pulpcore_version}/pulpcore_version}/.
This will limit the scope of the replacement command "s" to lines starting with "__pulp_version:".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh! yeah, this is much better
https://pulp.plan.io/issues/7961
closes #7961