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: auto-merge dependabot patch versions #778

Merged

Conversation

Junjiequan
Copy link
Contributor

@Junjiequan Junjiequan commented Sep 27, 2023

Description

Added new workflow to auto merge dependabot package version bump PR when all checks pass.
Solves #762

The logic of Dependabot auto-merge workflow are:

  1. checks if pull request user is dependabot
  2. approve the pull request made by dependabot, if the bump is either minor or patch level. ( TOKEN with PR approval permission is required )
  3. enabling auto merge, so the PR is only get merged after all checks passes (auto-merge prerequisite can be configured)

auto-merge prerequisite configuration can be done in Settings > Branches > Edit or Add rule

image

Tests included/Docs Updated?

  • Included for each change/fix?
  • Passing? (Merge will not be approved unless this is checked)
  • Docs updated?
  • New packages used/requires npm install?
  • Toggle added for new features?

@Junjiequan Junjiequan marked this pull request as ready for review September 27, 2023 12:04
@Junjiequan Junjiequan added the enhancement New feature or request label Sep 27, 2023
steps:
- uses: actions/checkout@v4
## https://github.com/ahmadnassri/action-dependabot-auto-merge
- uses: ahmadnassri/action-dependabot-auto-merge@v2
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of using an intransparent third-party action, check https://github.com/SciCatProject/frontend/pull/1216/files#diff-2fe48d1021006468ac63263583b5db615dd5e63a39ebff862cc4e2f06b59caa1

its just 3 or 4 lines more without, and we have much more control.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @bpedersen2. Con we try the other solution?

Copy link
Contributor Author

@Junjiequan Junjiequan Sep 28, 2023

Choose a reason for hiding this comment

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

With that solution it seems like we need to enable auto-merge, I'm not sure if that's a good idea.
Most importantly, it doesn't check whether all the tests are passing or not..
I need to test the script further

Copy link
Contributor

Choose a reason for hiding this comment

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

My version just sets automerge per pull-request if it is coming from dependabot. So changes get merge if tests pass.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, enable auto merge will check if all the requirements passed. Then we just need to include an PR approved flow it should work, because with current merge rule at least 1 approval is required

steps:
- uses: actions/checkout@v4
## https://github.com/ahmadnassri/action-dependabot-auto-merge
- uses: ahmadnassri/action-dependabot-auto-merge@v2
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @bpedersen2. Con we try the other solution?

Copy link
Contributor

@bpedersen2 bpedersen2 left a comment

Choose a reason for hiding this comment

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

Looks f ine.

@nitrosx nitrosx merged commit 0a82027 into master Oct 2, 2023
6 checks passed
@nitrosx nitrosx deleted the SWAP-3518-scicat-be-automate-merge-for-dependabot-pr branch October 2, 2023 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants