Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix(gerrit): not auto-merging if Code-Review changed from +2 to +1 #32818
base: main
Are you sure you want to change the base?
fix(gerrit): not auto-merging if Code-Review changed from +2 to +1 #32818
Changes from 4 commits
46f8eed
107a298
6ac7b9e
6ffa5b6
7877331
1d8daf5
5eb2846
c679c28
dbdf41a
bd05816
ac30f2b
539c12f
7923d5b
c4c81e3
4dfc817
bb317ce
b1ce02b
53743b2
e0b6f8d
74137a8
b93ee7a
add6ca5
933f13d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 439 in lib/modules/platform/gerrit/index.ts
Codecov / codecov/patch
lib/modules/platform/gerrit/index.ts#L439
Check warning on line 76 in lib/workers/repository/update/pr/automerge.ts
Codecov / codecov/patch
lib/workers/repository/update/pr/automerge.ts#L75-L76
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.
Will this cause each PR to be approved on each run? i.e. one extra API call per PR per run?
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.
Only if the PR is not yet approved. I implemented all
approvePr
functions to account for this case.Per auto-merge attempt, there will be one extra API call to verify whether the PR is not yet approved, and one more API call to approve it in case it's not yet approved.
Just remember:
autoApprove: true
automerge.ts
already passed (exceptbranchStatus
, which depends on the approval to be green)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.
But if you believe it's not a good idea, I can find another way.
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.
Possibly it could be optimized so that it doesn't perform this "is the PR already approved?" check right after we create the PR? i.e. because we know it's impossible that we approved it already.