fix(gerrit): defer change creation to createPr()#39250
fix(gerrit): defer change creation to createPr()#39250felipecrs wants to merge 19 commits intorenovatebot:mainfrom
createPr()#39250Conversation
34af483 to
38b16bd
Compare
Signed-off-by: Felipe Santos <felipe.santos@ericsson.com>
0b1cce2 to
d7a2601
Compare
113b707 to
5aa8581
Compare
5aa8581 to
0b491aa
Compare
e1fdb37 to
e512e13
Compare
|
Is this being worked on, we have been forced to pin the version of Renovate to 41.167.0 which is the version prior to the change where Renovate stopped adding reviewers. Looks like this pr has multiple parts, are all necessary to fix that bug or could it be split into several PRs that could be merged individually? |
|
I'll look into completing this PR tomorrow. |
|
Sorry, change of plans. I'll look into completing this next week or the other. |
…errit-fix-create-pr
928e627 to
1ddaf28
Compare
c6e53b6 to
5acc7f0
Compare
|
Hey! As requested, I just took a look at the change. I left some comments that popped up, but both the approach and the entire diff LGTM! I also thought about an alternative approach while reading your PRs (but I think it is worse than yours):
It might be helpful to keep this alternative approach in mind in the case that, in the future, Renovate changes in some way such that it requires the branch to exist in the remote after branch creation. Since I don't think this is the case currently, your approach looks much simpler and cleaner! |
|
About your alternative approach suggestion: Renovate has this concept of Draft PRs, which is in my TODO to be implemented in Gerrit through WIP changes. |
|
Oh, thanks! |
|
@avm99963 thanks a lot for your review! |
…errit-fix-create-pr
…errit-fix-create-pr
TODOs
prTitleto allcommitAndPushcalls (very important, as otherwise changes could be created with a different title and Renovate no longer find it)updatePrin Gerrit is called withprTitle. That should never happen and this warning may help find spots wherecommitAndPushis not pushing the commit with the correctprTitleprTitlemandatory forcommitAndPushto also avoid that. Edit: No go: in many cases theprTitleitself is undefined. It would require too much changes.Changes
The thing is: Gerrit has a very different workflow compared to the other platforms. There is simply no concept of branches for code changes, just the changes themselves.
After a lot of thought, I realized this is the best compromise for the Gerrit platform.
This PR defers the creation of the change to the
createPr()method, rather than letting the change be created while preparing the branch.This is better because it lets the standard Renovate flow continue as usual, and closes a few gaps with the Gerrit platform in Renovate.
This PR also refactors part of #35900 and reverts #38288, as these code hacks outside of the Gerrit platform can now be dropped.
Context
Please select one of the below:
AI assistance disclosure
Did you use AI tools to create any part of this pull request?
Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
The public repository: https://review.gerrithub.io/c/felipecrs/renovate-tutorial/+/1226234