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

Add initial iteration of automation for release pull requests #11

Merged
merged 8 commits into from
Aug 24, 2020

Conversation

nerrad
Copy link
Collaborator

@nerrad nerrad commented Aug 23, 2020

Attached to: #6

To help aid with the release process of WooCommerce blocks, we've been doing something called a "release pull request" that has the following basic steps (not exhaustive, just those related to this automation):

  • create a branch release/x.x.x where x.x.x is the version being released. This branch is based off of main and is used to build the release.
  • generate a changelog and commit to the branch.
  • create a pull request using a standard template for these type of releases.
  • follow a set of release steps for the release (in other docs).

As a part of #6, we want to automate as much of this process as possible. This pull request implements the first iteration of a new automation for releases. In this first iteration:

  • The automation reacts to new created branches.
  • It will create a pull request based on a template found in a project's .github folder.
  • It will generate a changelog and add it to the description of the pull request template given the placeholder provided by the template.
  • It will generate a release checklist as a comment on the pull request using a template provided in the project's .github folder.

This initial iteration is fairly basic but lays the groundwork for more automations around the release in future iterations.

There are some automated tests for the new automation but complete testing will need this merged to master to verify things are working as expected.

Adds entrypoint and initial runner.
This adds the initial test for the branch-create-handler for the release pull request creation. Demonstrates it _should_ work. Just need to add additional tests for all variations of what could happen (handling errors etc).
@github-actions
Copy link
Contributor

Handle re-attempting creation of changelog after resolvin...

Handle re-attempting creation of changelog after resolving error.


// @todo Handle re-attempting creation of changelog after resolving error.
//
// Currently, the changelog error is a consistent error message string
// so that future pushes where the pull already exists can optionally retry.
changelog =
`Changelog Error: ${ e.message }` +
'\n' +
"You'll need to edit this section manually";
devNoteItems =
`Devnotes Error: ${ e.message }` +
'\n' +
"PRs tagged for dev notes cannot be found, you'll need to edit this section manually.";

🚀 This comment was generated by the automations bot based on a todo comment in e7da543 in #11. cc @nerrad

@github-actions
Copy link
Contributor

Code coverage

Filename Statements Branches Functions Lines
lib/automations/todos/utils/get-todos.js 100% 100% 100% 100%
lib/automations/todos/utils/get-diff.js 100% 100% 100% 100%
lib/automations/todos/utils/parse-to-do.js 100% 97.67% 100% 100%
lib/automations/todos/utils/get-details.js 100% 90.91% 100% 100%
lib/debug.js 66.67% 50% 100% 66.67%
lib/automations/todos/utils/check-for-duplicate-issue.js 100% 100% 100% 100%
lib/automations/todos/index.js 100% 100% 100% 100%
lib/automations/todos/runner.js 88.89% 66.67% 100% 88.89%
lib/automations/todos/pull-request-handler.js 90.48% 83.33% 100% 90.48%
lib/automations/todos/templates/index.js 100% 100% 100% 100%
lib/automations/todos/templates/comment.js 100% 100% 100% 100%
lib/automations/todos/templates/issue.js 100% 100% 100% 100%
lib/automations/todos/templates/issue-from-merge.js 100% 100% 100% 100%
lib/automations/todos/templates/title-change.js 100% 100% 100% 100%
lib/automations/todos/templates/reopen-closed.js 100% 100% 100% 100%
lib/utils/index.js 100% 100% 100% 100%
lib/utils/milestones.js 100% 100% 100% 100%
lib/utils/helpers.js 85.71% 66.67% 100% 83.33%
lib/automations/todos/pull-request-merge-handler.js 91.3% 87.5% 100% 91.3%
lib/automations/todos/utils/reopen-closed.js 100% 100% 100% 100%
lib/automations/todos/push-handler.js 92% 90% 100% 92%
lib/automations/todos/issue-rename-handler.js 100% 100% 100% 100%
lib/automations/release/index.js 100% 100% 100% 100%
lib/automations/release/runner.js 86.67% 50% 100% 86.67%
lib/automations/release/branch-create-handler.js 86.79% 69.23% 66.67% 88.46%
lib/automations/release/templates/index.js 82.14% 42.86% 75% 82.14%
lib/automations/release/utils/index.js 100% 100% 100% 100%
lib/automations/release/utils/get-release-version.js 90.91% 87.5% 100% 90.91%
lib/automations/release/utils/is-patch-release.js 100% 100% 100% 100%
lib/automations/release/utils/get-release-branch.js 100% 100% 100% 100%
lib/automations/release/utils/duplicate-pr-checker.js 100% 100% 100% 100%
lib/automations/release/utils/has-milestone.js 100% 100% 100% 100%
lib/utils/changelog/index.js 100% 100% 100% 100%
lib/utils/changelog/common/changelog.js 83.51% 56.76% 86.49% 82.42%
lib/automations/release/config/index.js 78.57% 0% 100% 78.57%
lib/automations/release/config/validate-config.js 92.31% 88.89% 100% 92.31%
lib/utils/version.js 0% 0% 0% 0%
lib/typedefs.js 0% 100% 100% 0%
lib/if-not-fork.js 0% 0% 0% 0%
lib/index.js 0% 0% 0% 0%
lib/automations.js 0% 100% 100% 0%

@nerrad nerrad merged commit 3c168f5 into master Aug 24, 2020
@nerrad nerrad deleted the add/automate-release-pull-request branch August 24, 2020 00:08
@nerrad nerrad added this to the 1.1 milestone Aug 30, 2020
@github-actions github-actions bot mentioned this pull request Aug 30, 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.

1 participant