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

chore(workflows): Enable auto-merge for minor upgrades. #1008

Merged
merged 2 commits into from Nov 23, 2021

Conversation

vicary
Copy link
Member

@vicary vicary commented Nov 20, 2021

What did you implement:

Auto approve and merge a PR if,

  1. Tests are all green
  2. It's from dependabot
  3. It's not a major upgrade

How did you implement it:

IDK, Github Copilot did 80% of the work, the rest is me confirming it from Google.

How can we verify it:

Made a repo to test, dependabot triggers at most daily so validation may take days.

Todos:

  • Write tests
  • Write documentation
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification config / commands / resources
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

@vicary vicary changed the title chore(workflows): Enable auto-merge for minor upgrades. WIP: chore(workflows): Enable auto-merge for minor upgrades. Nov 20, 2021
@vicary
Copy link
Member Author

vicary commented Nov 22, 2021

So by the look of it, dependabot/fetch-metadata only returns update-type for the first time it creates a PR.

  1. Reopening a PR does not provide such information
    Bump jsoneditor from 9.0.0 to 9.5.6 vicary/test-dependabot#2
  2. But when dependabot creates it all by itself, the information is available
    Bump jsoneditor from 9.0.0 to 9.5.7 vicary/test-dependabot#3

Also, it is not possible to approve AFTER tests are passing. github.event.workflow_run.conclusion == 'success' only skips the whole workflow. All it can do is to approve and enable auto-merge, failing tests will prevent the auto-merge so it is doing all the guarding for minor and patch updates.

If we trust the GitHub Advisory Database, this reduces chore maintenance to a very low level.

@j0k3r
Copy link
Member

j0k3r commented Nov 22, 2021

Let's to it then!

@vicary vicary self-assigned this Nov 22, 2021
@vicary vicary changed the title WIP: chore(workflows): Enable auto-merge for minor upgrades. chore(workflows): Enable auto-merge for minor upgrades. Nov 23, 2021
@vicary vicary requested a review from j0k3r November 23, 2021 05:38
@vicary vicary merged commit a6a83f6 into master Nov 23, 2021
@vicary vicary deleted the dependabot-automerge branch November 23, 2021 06:09
@j0k3r j0k3r added this to the 5.7.0 milestone Dec 1, 2021
@j0k3r j0k3r modified the milestones: 5.7.0, 5.6.1 Jan 26, 2022
@j0k3r j0k3r mentioned this pull request Jan 26, 2022
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

2 participants