auto-merge should obey combined CI status#69
Conversation
|
Thanks! |
|
Ah, that's just an issue not the fix :) |
|
@MartinNowak Can you make it so when someone adds the auto-merge label on an issue @dlang-bot submits a pull request with a fix? 🤣 |
|
|
|
How would we notify contributors that a PR is having the "auto-merge" label, but isn't merged due to issues with CI X. Plain-old email? |
Just update the comment? |
And how would you notice this? |
|
I think the CI status being red should be enough of an indicator on its own, with the explanation in the comment being supplementary. Right now it's just that people are used that auto-merge works even with failing CI services, but breaking old expectations would be a matter of time. Maybe I don't understand the problem. |
No we don't, red is red, there are no two ways about. |
I wouldn't do that. I often have to restart your spurious Jenkins instance. It would be annoying to re-add auto-merge on every restart (even if the approved PR code didn't change). |
|
OK granted for now that would be counter-productive. |
- for more code consistency/symmetry - also fix orphan %s/%s format specifier
- do not auto-merge when one of the CIs fails or still is pending - fixed by querying combined status before getting more infos and trying to merge - this means dlang-bot will no longer treat CIs as lesser cousins of required CIs
|
Thanks for your pull request, @MartinNowak! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Some tips to help speed things up:
Bear in mind that large or tricky changes may require multiple rounds of review and revision. Please see CONTRIBUTING.md for more information. |
|
Now implemented and converted the issue to a pull request. |
wilzbach
left a comment
There was a problem hiding this comment.
Can we please withhold this until we have fixed Travis for DMD?
No one wants to wait >24h for it to pass or more likely time out. All other CIs are enforced at the DMD repos anyways.
| if (e.state == GHCiStatus.State.failure || | ||
| e.state == GHCiStatus.State.error) | ||
| // TODO: unclear whether we want all statuses for PR commit, or only the latest | ||
| auto status = t.pr.combinedStatus; |
There was a problem hiding this comment.
This will be yet another request for the cron job. Each request multiplies with ~400 here.
There was a problem hiding this comment.
Only open auto-merge PRs, not so many.
|
|
||
| return ghGetRequest(_pullRequest.url) | ||
| .readJson | ||
| .deserializeJson!PullRequest; |
There was a problem hiding this comment.
This will silently lead to a lot more requests.
There was a problem hiding this comment.
Hard to avoid, issues have no head commit, but on the plus side we're saving many requests because merge attempts for non-green PRs can be canceled early on.
| e.state == GHCiStatus.State.error) | ||
| // TODO: unclear whether we want all statuses for PR commit, or only the latest | ||
| auto status = t.pr.combinedStatus; | ||
| auto failCount = status.latestStatuses.filter!((e){ |
There was a problem hiding this comment.
There was a problem hiding this comment.
Yes, I just went with the one from the API docs.
|
Also - I'm not sure whether you are aware - but we use the dlang-bot at dlang-community where Windows is still often failing: It's not a huge deal as we can simply remove the failing Windows builds. |
| continue; | ||
|
|
||
| auto pr = issue.toPullRequest; | ||
| auto pr = issue.pullRequest; |
There was a problem hiding this comment.
The motivation behind toPullRequest was to save API requests.
There was a problem hiding this comment.
Yes, I know, but not avoidable if we want to check the status. Issues don't have commits.
Those are only open PRs with auto-merge btw, a rather small number.
open auto-merges:
dmd -> 1
druntime -> 1
phobos -> 1
dlang.org -> 1
installer -> 0
tools -> 0
And that's only because of the merge_stable step.
Kind of ironic that dlang-bot wouldn't merge this PR? |
|
Sure it's going to be some hassle, but I'm positive that it will help us to clean our CI forest. BTW, Without required non-admins can decide to skip coverage ;). |
|
Here comes the coverage bump, dropping untested and unused code. |
Don't get me wrong. I'm fully in favor of improving the CIs and I have been trying to improve the reliability of them for the last weeks (still waiting for your approval on dlang/installer#291 BTW). |
|
That backlog will be gone at some point, no? |
I'm not so sure, we could try to disable builds on master to get more throughput, but that won't prevent cases where we run over the maximal build time which is still very frequent. https://travis-ci.org/dlang/dmd/builds
Ehm didn't you add the OSX test?
Yes my point! |
|
Yes, but I vaguely remember why. Looks like it was for the missing clang coverage on the auto-tester at that time. Since Brad updated the toolchain/OSXes it's no longer necessary dlang/druntime#1542 |
|
Travis is gone from DMD -> we can merge this now :) |

Not only status from required tests. If some tests fail ppl. should merge manually.
The main motivation here is to avoid accidentally merging PRs w/ CI issues that weren't yet visible when adding the auto-merge label.