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

Improving release process #568

Merged
merged 1 commit into from May 10, 2021
Merged

Improving release process #568

merged 1 commit into from May 10, 2021

Conversation

fao89
Copy link
Member

@fao89 fao89 commented Mar 24, 2021


from redminelib import Redmine

REDMINE_API_KEY = os.environ["REDMINE_API_KEY"]
Copy link
Member Author

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

@pulpbot
Copy link
Member

pulpbot commented Mar 24, 2021

Attached issue: https://pulp.plan.io/issues/7961

# 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.
Copy link
Member

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.
Copy link
Member

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`).\
Copy link
Member

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.

Copy link
Member Author

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

Comment on lines +71 to +75
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): "
)
Copy link
Member Author

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

Comment on lines +103 to +111
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"]
Copy link
Member Author

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

Comment on lines 113 to 142
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",
]
)
Copy link
Member Author

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

Copy link
Member

@mdellweg mdellweg Mar 25, 2021

Choose a reason for hiding this comment

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

OIC

@fao89 fao89 requested review from mdellweg and a team April 30, 2021 18:12
"roles/pulp_common/defaults/main.yml",
]
)
sed(["-i", f"s/{previous_installer_version}/{release_version}/", "galaxy.yml"])
Copy link
Member

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.)

Copy link
Member Author

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

@daviddavis
Copy link
Contributor

As a pulp_installer releaser, this change looks good to me. 👍

sed(
[
"-i",
f"0,/{previous_pulpcore_version}/s//{pulpcore_version}/",
Copy link
Member

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:".

Copy link
Member Author

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

@fao89 fao89 merged commit 92f1a48 into pulp:master May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants