-
Notifications
You must be signed in to change notification settings - Fork 28
adding automated releaser #356
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
Conversation
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.
Could you add a review step? I like making releasing as fast as possible but I want a human to review the unreleased changes and maybe outstanding issues. We may want to introduce some PR tags to note any breaking changes that should be carefully released.
@tannewt Initially I had the final "make_release()" call here: https://github.com/adafruit/adabot/pull/356/files#diff-34c53f9e30a2cb813b306e48039016f5b5f4b1d4d0050910ca9469f975a322a9R22 Do you have a preferred way for the review mechanism to work? I could add a boolean that must be flipped to True for the final run in order to submit the release to github? Also note that name of this might be prone to confusion. As it is set up now this tool must be run manually by a person. There are a few steps involved in cloning the bundle and then copying in these scripts and running them with the commands provided. When the person runs the tool it will iterate over the bundle and make the releases. My intention is not for any of this to happen automatically as part of an actions run or cron job or anything like that. It still definitely requires a human to run it in order for the releases to be made. I don't really envision this being used as the primary way to make a release after "normal" PRs for individual libraries. I mainly envision this being used specifically for cases when a patch change has been rolled out to all libraries and the release should ideally only include changes from that patch rollout, nothing from other PRs or unrelated changes. |
I was thinking some sort of prompt that asks "here is the new version, the notes and the included changes" are you sure? If no, then leave release as draft. I'm thinking of a case where you'll want a major version number bump.
Ya, I get that.
I know the patch cases is where you are coming from. I'm imagining this would be helpful for "release sweeps" where at some interval, we make sure libraries have been released. For patch cases, you could have a way to say "this commit is auto-yes". |
The latest commit adds a prompt that serves two purposes:
I also added new logic and an additional prompt for the release title if one was not set inside of the configuration variable in These make the tool more a bit more general and allows it to cover a wider range of release use-cases. Adding the Here is an example of the logged output and the prompts:
I've tested all four prompt menu options with scripts that were modified to just print the gh command instead of running it so that the behavior can be verified without making real releases, everything seems to be working as intended as far as I can tell. @tannewt have another look when you get a chance. I'm not sure how to have it also output what the specific changes to the repo were. Let me know if I should continue digging into it to see if I can figure out how. |
The easiest thing would probably printing a link to the diff since the last release. Here is an example: adafruit/circuitpython-build-tools@1.10.4...main |
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.
Thanks! The prompt looks good. One more question.
@tannewt the new commits have a few changes that make it possible to run this without the need to copy/paste any files
I ran this locally on the bundle and it did complete successfully, however it wasn't a complete test because there are currently no libraries in need of a release so it checked them all but never took me to a release prompt so that I could validate that portion of behavior. I can try to test later tonight against a single library with a new commit in Adafruit_CircuitPython_TestRepo in order to confirm it's working as intended. I'll also work later on making it output the changes link, that'll be easier to develop once I have a library that is actually needing the release to work with. In my environment (py 3.10) I was unable to successfully install |
This is exactly what I was thinking! Thanks! I don't think it needs to be on pypi but making it pip installable locally simplifies it a bunch. Will look at the code now. |
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.
One more small suggestion to make the cli a little cleaner
@tannewt The latest commit adds the I've also added the compare link output: My terminal links it, but it could be copy/pasted from a plain text only terminal. Here is the full output after all prompts and it created the release successfully:
|
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.
Looks great! Thanks for the updates
@FoamyGuy is this all ready to merge? |
These scripts were the result of combining some existing logic in adabot that checks if new releases are needed together with some library iteration code from Adabot and some pieces from scripts made by Eva for prior release roll outs.
A readme file is included that shows requirements and instructions on how to use the utility.
In summary this utility:
Uses
git submodule foreach
to loop over all libraries, uses Jinja2 to render a template for the release notes populated with appropriate values, then uses the GitHub CLIgh
to make the release from the rendered release notes and a title pulled from a variable in one of the scripts.The utility ensures there are newer commits than the latest release before acting. If there are not newer commits then the library will be skipped.