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

Automated version bumps with GitHub Actions workflows #12

Merged
merged 8 commits into from
Feb 25, 2022

Conversation

Mandrenkov
Copy link
Collaborator

Context:
To release a new version of the XIR, two PRs are required:

  1. A pre-release PR to remove the -dev suffix from the current version.
  2. A post-release PR to increment the minor version and add a -dev suffix.

Description of the Change:

  • A separate GitHub Actions workflow has been added for each PR described above.
  • Each of these workflows update the changelog and modify the version specified in _version.py.

Benefits:

  • There is less friction for making new XIR releases.

Possible Drawbacks:

  • Some releases (e.g., major version upgrades) still require a manual PR.

Related GitHub Issues:
None.

@Jaybsoni
Copy link

@Mandrenkov, I haven't given it a full review yet but just skimming now it looks great ! Just wondering why you choose to remove the dependance on a python script? I like that everything is self contained in the workflow, I just worry that if in the future one wishes to add additional functionality, it will be limiting?

It also seems that the functionality of cleaning and reformatting the changelog as well as adding the other headers has been removed. Is it okay to leave those out for XIR?

@antalszava
Copy link
Contributor

Looks good to me after a skim through 👍 It's nice to have the commands within the workflow files. 🙂 One thing while going through is that a different type of skillset is required by the readers to understand the steps here (instead of Python, readers need to be familiar more so with the exact options of sed, awk, etc. being used). What was the motivation behind turning to this solution?

Copy link

@thisac thisac left a comment

Choose a reason for hiding this comment

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

This is great to have! Thanks @Mandrenkov! 💯

A few comments, but nothing major. Has this been tested to work properly, or will the next release be the first proper test?

.github/CHANGELOG.md Show resolved Hide resolved
@Mandrenkov
Copy link
Collaborator Author

Thanks for the comment, @Jaybsoni!

Just wondering why you choose to remove the dependance on a python script? I like that everything is self contained in the workflow, I just worry that if in the future one wishes to add additional functionality, it will be limiting?

Actually, it is for exactly that first reason: to make everything self-contained in the workflow! Using Python is definitely a viable option but there are usually other tools which can do this type of processing in a more concise way.

It also seems that the functionality of cleaning and reformatting the changelog as well as adding the other headers has been removed. Is it okay to leave those out for XIR?

Yes, that's right. This is mostly because multi-line text processing is not very easy to do in Bash (although still possible). I would argue that the former functionality is not necessary since these sorts of mistakes should be caught in the PRs that contribute those changes. I will concede that the latter is slightly more useful, although perhaps not a deal-breaker.

@Mandrenkov
Copy link
Collaborator Author

Thanks for the review, @antalszava!

One thing while going through is that a different type of skillset is required by the readers to understand the steps here (instead of Python, readers need to be familiar more so with the exact options of sed, awk, etc. being used).

Yes, that is a very good point. But utilities like sed and awk are designed for exactly this purpose. I know it is convenient to use Python for everything, but I think there is value in learning how to use other, established tools for these types of tasks.

What was the motivation behind turning to this solution?

There are two main reasons why I decided to go with command-line programs:

  1. It keeps the GitHub Actions workflows self-contained.
  2. The result is more terse than their equivalent Python programs.

This approach also requires no additional dependencies and is a good opportunity to learn about tools like sed and awk!

@Mandrenkov
Copy link
Collaborator Author

Thanks for the review, @thisac!

Has this been tested to work properly, or will the next release be the first proper test?

Yes, I've tested this locally using https://github.com/nektos/act! It works as expected but the only way to know if they work for sure is to actually run the workflows using a real GitHub Actions runner! This is a pretty low-risk move though since the workflows just create PRs rather than commit code or tags directly to the repository.

Copy link

@Jaybsoni Jaybsoni 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 to me, just a few minor clarifications 👍🏼

@Mandrenkov
Copy link
Collaborator Author

Thanks, @Jaybsoni!

@Mandrenkov Mandrenkov merged commit 72139dd into main Feb 25, 2022
@Mandrenkov Mandrenkov deleted the sc-14170-version-bump-automation branch February 25, 2022 14:30
Mandrenkov added a commit to XanaduAI/xanadu-cloud-client that referenced this pull request Apr 12, 2022
Mandrenkov added a commit to XanaduAI/xanadu-cloud-client that referenced this pull request Apr 12, 2022
* Add version bump workflows based on XanaduAI/xir#12

* Add @Mandrenkov to list of v0.2.0 contributors
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