-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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(pr): ensure PR update after branch commit #18839
Conversation
…ready exist for that branch
We need to be careful about unintended side effects. Here's the
Here's the next
So we might want to skip that second one if We also need to consider what the |
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.
this will cause early automerge again, check the comment above the if condition.
we added this to suppress automerge, because status checks can be missing and renovate has probably at green stability check.
on some platforms you can workaround with required status checks, but not always.
@rarkins yes i dont want to enter in case there's no PR for that branch on, this is supposed to take care of PR CREATION only
that leaves the PR UPDATE flow that i don't want it to enter there, @viceice let's say we have Automerge, and we did an Update flow, why do u step into an IF statement that belongs to the PR Creation? shouldn't the check for automerge be after it? at
i see |
@rarkins yes, i think we need to check commitSha and skip trying automerge then @PhilipAbed #5594 is the original introduction of that condition. it was added to supress automerge when a new commit was made. The code was very different than now and it was easiest solution. You can now try to refactor but you need to make sure automerge is skipped when a new commit was made. The skipped PR update was a trade of not doing automerge. |
there are too many flows going on
There's no way to do this without a refactor, ill see what i can do not to mention that |
…ready exist for that branch
@rarkins @viceice i believe we should split the Immediate flow from the non-immediate flow i just added double condition before: after: i check if |
…ready exist for that branch
it's working according to my test at: reproduction: after fix: |
@rarkins a question that has been bothering me, doesn't make sense to me, if Automerge is before EnsurePR, then it should have a condition saying: there are no new commits |
It's branch automerge |
We need to make sure that we don't branch or PR automerge after a fresh commit unless ignoreTests=true |
you say we should not even try to auto merge branch when there's a fresh commit renovate/lib/workers/repository/update/branch/index.ts Lines 558 to 563 in 6f051f3
this IF condition only quits if so in case the prCreation flag is not used, it would just skip to the automerge where
and enter the loop in case we have an update on the branch.. the update is a Fresh commit, where commitSha is not null. but it is not checked.
so if i add another check to it to make sure i dont do auto merge that would change logic right? is that ok? that condition also doesnt makes sense to me why |
In the current implementation it would have already returned before line 558 |
i will test and see |
That's why i've doen it that way long ago. the early return was the easiest solution to not automerge 😉 |
it actually reaches the condition even if i dont use the so i'm not sure what you mean by the early return as it reaches that line in the branch update case, |
Thanks a lot @rarkins @viceice i learned a lot from this, there are certainly lots of flows and cases I tried to refactor, but i see more than 30 exits to hope i covered everything in my changes |
renovate/lib/workers/repository/update/branch/index.spec.ts Lines 511 to 528 in 6f051f3
this test is failing because i added the in this test: i still don't understand which cases have BranchExists=false? how can we process a branch that doesn't exist? |
branch exists false probably means we created it in this 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.
otherwise LGTM
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
🎉 This PR is included in version 34.26.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Changes
i stopped going inside the IF case, if we have a PR created already,
the code was getting inside the IF case also when there's a branch update, but that doesn't make sense to me.
@rarkins @viceice this solution works, but i'm not sure if i impact any other flow that i dont know about,
it seems logical to me,
but you know better.
Context
Closes #17388
Documentation (please check one with an [x])
How I've tested my work (please tick one)
I have verified these changes via: