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

Automate Release pull requests (or releases in general). #6

Open
nerrad opened this issue Jun 22, 2020 · 3 comments
Open

Automate Release pull requests (or releases in general). #6

nerrad opened this issue Jun 22, 2020 · 3 comments
Assignees
Labels
type: enhancement New feature or request

Comments

@nerrad
Copy link
Collaborator

nerrad commented Jun 22, 2020

This is a tracking issue for automating release pull requests.

What is a release pull request?

In the Woo Blocks project we are implementing a process that is intended to streamline how we do releases so that they are covered by a checklist of items needing done before merging. This also will assist with potentially establishing a convention for other Woo teams to model.

A "release pull request" is a significant part of this process that documents all that needs to be done before a release tag can be generated and released. You can see examples here.

Things to automate

Here's a shortlist of some of the things I think could be built into the automation for this release process:

  • Read from a pull request template in the project's .github folder and fallback to a default.
  • Hooked in on the branch creation event and respond to branches with release in the branch? Likely something that could eventually be an option. release/{milestone} should be the format of the branch name, and the {milestone} should correspond to a GitHub milestone that has all the work being released.
  • Create the pull request using the found template.
  • Generate a changelog using @wordpress/changelog and add that to the pull request description as well as modify the readme.txt. Then, commit to the branch.
  • Run any additional scripts from the .github folder (allows for customizing elements of the release process)?
  • Generate a production zip file from the branch and attach to the pull request to use for testing.
  • Responds to some trigger (label? approved review? comment in pull? watch for checkbox event in pull request?) that triggers the default release script (or custom provided one) and creates a GitHub tag/release from the branch. Then merges branch to master and closes the pull (if straight merge is possible). Otherwise leaves pull open with comment for manual merge. Will always want to make sure branch is not deleted.
  • Optionally (configurable via option, or checkbox in pull?), after release tag in repo is created, open up a pull request in WooCommerce core for bumping the package version and adding the release pull request content there. This would be more involved to add and require a github token for posting to the WooCommerce repository. If implemented, would be good to add a link to that pull request in originating repo's pull request as a comment.

Along with the above, here's some additional things to consider:

  • need to add some sort of protection so that logic only runs once for the initial pull request creation.
  • how would automating patch releases happen (since those will be based off the initial branch)?
    • Could we see if an existing pull request (title match?) for the branch exist?
    • If there's a closed milestone for the branch, could we automatically detect the next milestone for the patch release and use that to inform creating a new pull request?
    • should we allow for different patch release templates?
  • should we have options for tweaking what meta data is added to the created pull request? At a minimum I think we should add a type: release label, but maybe there'd be additional labels that could be added?
  • should we have options for setting what criteria triggers various events in the release process?
@nerrad nerrad added the type: enhancement New feature or request label Jun 22, 2020
@nerrad nerrad self-assigned this Jun 22, 2020
@nerrad
Copy link
Collaborator Author

nerrad commented Jul 4, 2020

Looks like I could used marked to create a tree from the markdown of a pull request description and use that to detect if checkbox items we listen to are checked. These could be used to trigger various stages of the release process!

@nerrad
Copy link
Collaborator Author

nerrad commented Jul 4, 2020

For safety, will need to limit automation actions to users that have the capabilities in the repo.

@nerrad
Copy link
Collaborator Author

nerrad commented Jul 20, 2020

A variation of this script by @senadir could be used to automatically append bundlesize comparisons to the release pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant