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

Introducing release script #215

Merged
merged 1 commit into from May 27, 2020
Merged

Introducing release script #215

merged 1 commit into from May 27, 2020

Conversation

fao89
Copy link
Member

@fao89 fao89 commented May 5, 2020

which executes the first 6 steps of https://pulp.plan.io/projects/pulp/wiki/Pulp3_Release_Guide

https://pulp.plan.io/issues/6600
closes #6600

python .travis/release.py new_version new_dev_version current_pulpcore_version next_pulpcore_version

Executing the script for pulp_file:

python .travis/release.py 1.0.0 1.0.1 4.0 4.1

Output:
pulp/pulp_file@master...fao89:release_1.0.0

Executing the script for pulpcore:

python .travis/release.py 3.3.1 3.4.0

Output:
pulp/pulpcore@master...fao89:release_3.3.1


# Second commit: release version
sed -i "s/\.dev//g" setup.py
# Missing sed on pulpcore requirement on setup.py
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 could not think of a good sed for this

Copy link
Member

@mdellweg mdellweg May 5, 2020

Choose a reason for hiding this comment

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

maybe something like
sed -i -e '/version=/s/\.dev//'
To only perform it once and on a line that contains "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.

Sorry, I did not describe well the problem, what I need to do is find a way to:
pulpcore>=3.3 into this pulpcore>=3.4,<3.5


cd $BASEDIR/..

towncrier --version $NEW_VERSION --draft
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't bother with this. Once we fully automate this and move it to a CI, we won't be able to run this step.

I think the release nanny will have to run this before triggering the release.

Copy link
Member

Choose a reason for hiding this comment

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

I agree. Those changelog entries probably need to be revisited redactorially anyway.

@daviddavis
Copy link
Contributor

The logic looks great. Very glad to see this.

@fao89
Copy link
Member Author

fao89 commented May 6, 2020

I remembered why I did not use pygithub, it was about credentials:
https://github.com/pulp/pulp_file/blob/master/.travis/cherrypick.py#L9-L12
Running it locally would require to set GITHUB_TOKEN for example, and with bash script you can just use git commands

@fao89 fao89 force-pushed the 6600 branch 7 times, most recently from 82d806b to 98e36cb Compare May 7, 2020 14:17
@fao89
Copy link
Member Author

fao89 commented May 7, 2020

Executing the script for pulp_file:

python .travis/release.py 1.0.0 1.0.1 4.0 4.1

Output:

pulp/pulp_file@master...fao89:release_1.0.0

Executing the script for pulpcore:

python .travis/release.py 3.3.1 3.4.0

Output:

pulp/pulpcore@master...fao89:release_3.3.1

@fao89 fao89 marked this pull request as ready for review May 7, 2020 14:19
@fao89 fao89 requested a review from daviddavis May 7, 2020 14:19
@fao89 fao89 force-pushed the 6600 branch 2 times, most recently from 7bbfbf1 to d1bc5d6 Compare May 7, 2020 15:50

# First commit: changelog
os.system(f"towncrier --yes --version {new_version}")
git.add(".")
Copy link
Contributor

Choose a reason for hiding this comment

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

Might just want to check in CHANGES.rst and anything in CHANGES/

"""
Release script

$ python .travis/realease.py
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick - s/realease/release/

if "pulpcore" in word:
pulpcore_word = word

line = line.replace(
Copy link
Member

Choose a reason for hiding this comment

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

Can we use bump2version to do this instead? https://pypi.org/project/bump2version/ Since that's software is made to do that I think it would be better.

That is also one of the recommended tools to help "single source" python versions https://packaging.python.org/guides/single-sourcing-package-version/ It would be cool if the plugin_template configured plugins with bump2version.

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'm reading the docs, but so far I could not understand how to deal with .dev using bump2version

Copy link
Member

Choose a reason for hiding this comment

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

What about --new-version 0.1.2.dev ?

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 believe I understood how to do it, but I would need to open PR against all plugins first, I will do it on pulp_file as PoC

Copy link
Member Author

Choose a reason for hiding this comment

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

draft PR on pulp_file:
pulp/pulp_file#390

python .travis/release.py major 4.0 4.1
Args:
    release_part - major/minor/patch
    current_pulpcore_version - lower bound of pulpcore requirement
    next_pulpcore_version - upper bound of pulpcore requirement

Copy link
Member

@bmbouter bmbouter left a comment

Choose a reason for hiding this comment

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

If this is up to date with the changes here pulp/pulpcore#714 then +1 to merging it. It looks like it is, so I'm lgtm-ing it.

@fao89 fao89 force-pushed the 6600 branch 2 times, most recently from b6c9276 to dc39f55 Compare May 27, 2020 21:35
@fao89 fao89 merged commit c5a1e2c into pulp:master May 27, 2020
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