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

Release Machine Stats main using tags #210

Merged
merged 6 commits into from
Apr 22, 2022

Conversation

pranavmalaviya
Copy link
Collaborator

This PR removes the previous approach of using bump2version and replaces it with tags. With this, you won't need a dev setup to release a new machine stats version.

To make a new release, simply create a tag on the master branch and the pypi-upload GitHub Workflow will take care of the rest.

Copy link
Contributor

@SamDesmondKing SamDesmondKing left a comment

Choose a reason for hiding this comment

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

Looks good!

@@ -83,6 +83,12 @@ We use the following tools:
1 debian10 running
```

### How to bump libvirt's version
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting, so virt stats is served from the pypi also?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, checkout https://pypi.org/project/virt-stats/
It's been under the radar because it is released with the same version as machine stats (because it's the same workflow). So you'll see a lot of virtstat versions without any changes (and yet a new version) because those versions were only intended for machine stats.

@@ -5,7 +5,7 @@

setup(
name="virt_stats",
version="2.5.4",
version="develop",
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it need to be develop here?

@@ -5,7 +5,7 @@

setup(
name="machine_stats",
version="2.5.4",
version="develop",
Copy link
Contributor

Choose a reason for hiding this comment

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

Im curious about this as well. can you please explain to us why the change to develop?

@@ -2,6 +2,7 @@ name: PyPI Upload

on:
push:
Copy link
Contributor

Choose a reason for hiding this comment

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

I was under the impression that we were aiming to use releases :. Is that change coming soon? or this is just a leftover?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A change is coming and I wanted to keep it the same as what we have in alpha but first I'm checking in a private repo to make sure the tags don't get mixed up, meaning releasing a tag for alpha shouldn't release the main machine stats.

run: |
# from refs/tags/v1.2.3 get 1.2.3
VERSION=${GITHUB_REF/refs\/tags\//}
PLACEHOLDER='version="develop"'
Copy link
Contributor

Choose a reason for hiding this comment

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

I see the develop line here. 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To also answer your other 2 questions about develop, it can be any string (or even be empty).
The magic in this workflow is actually happening in line#36. After stripping off the variables, it'll look something like

sed -i "s/develop/1.2.3/g" script.py

So we are replacing the string develop in that file with the tag(1.2.3) that we get from the GitHub context. This also means that we have no way to know what's the latest MS version from codebase without having to look at GitHub or PyPI.

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, thanks for the explanation 👍

Copy link
Contributor

@jmariomejiap jmariomejiap left a comment

Choose a reason for hiding this comment

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

Thanks @pranavmalaviya 🚀

@pranavmalaviya pranavmalaviya merged commit 5c7208c into master Apr 22, 2022
@pranavmalaviya pranavmalaviya deleted the pranav/pypi-release-main branch April 22, 2022 13:33
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.

3 participants