Skip to content

Comments

auto-merge should obey combined CI status#69

Merged
wilzbach merged 3 commits intodlang:masterfrom
MartinNowak:fix69
Jan 16, 2018
Merged

auto-merge should obey combined CI status#69
wilzbach merged 3 commits intodlang:masterfrom
MartinNowak:fix69

Conversation

@MartinNowak
Copy link
Member

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.

@andralex
Copy link
Member

andralex commented Apr 5, 2017

Thanks!

@andralex
Copy link
Member

andralex commented Apr 5, 2017

Ah, that's just an issue not the fix :)

@CyberShadow
Copy link
Member

@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? 🤣

@MartinNowak
Copy link
Member Author

rm -rf code

@wilzbach
Copy link
Contributor

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?
Also we definitely would want to exclude CodeCov from this list.

@CyberShadow
Copy link
Member

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?

@wilzbach
Copy link
Contributor

Just update the comment?

And how would you notice this?

@CyberShadow
Copy link
Member

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.

@MartinNowak
Copy link
Member Author

Also we definitely would want to exclude CodeCov from this list.

No we don't, red is red, there are no two ways about.
We fix any broken CIs, green is green.
We use required only for CIs that definitely need admin feedback to be overridden (cov and lint no, tests and broken code/projectd yes).
The bot never overrides any CI or tries to merge with pending CIs. Auto-merge will be untagged when a CI fails.

@wilzbach
Copy link
Contributor

Auto-merge will be untagged when a CI fails.

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).
Also the label "auto-merge" makes them easy to find (e.g. by label or on auto-tester), so it increases their exposure and the chances that someone looks at the CI failure.

@MartinNowak
Copy link
Member Author

OK granted for now that would be counter-productive.

- for more code consistency/symmetry
- also fix orphan %s/%s format specifier
@MartinNowak MartinNowak changed the title auto-merge should obey integrated CI status auto-merge should obey combined CI status Jan 16, 2018
- 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
@dlang-bot
Copy link
Collaborator

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:

  • smaller, focused PRs are easier to review than big ones

  • try not to mix up refactoring or style changes with bug fixes or feature enhancements

  • provide helpful commit messages explaining the rationale behind each change

Bear in mind that large or tricky changes may require multiple rounds of review and revision.

Please see CONTRIBUTING.md for more information.

@MartinNowak
Copy link
Member Author

Now implemented and converted the issue to a pull request.

Copy link
Contributor

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

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

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

This will be yet another request for the cron job. Each request multiplies with ~400 here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Only open auto-merge PRs, not so many.


return ghGetRequest(_pullRequest.url)
.readJson
.deserializeJson!PullRequest;
Copy link
Contributor

Choose a reason for hiding this comment

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

This will silently lead to a lot more requests.

Copy link
Member Author

Choose a reason for hiding this comment

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

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){
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I just went with the one from the API docs.

@wilzbach
Copy link
Contributor

Also - I'm not sure whether you are aware - but we use the dlang-bot at dlang-community where Windows is still often failing:

dlang-community/D-Scanner#546

image

It's not a huge deal as we can simply remove the failing Windows builds.

continue;

auto pr = issue.toPullRequest;
auto pr = issue.pullRequest;
Copy link
Contributor

@wilzbach wilzbach Jan 16, 2018

Choose a reason for hiding this comment

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

The motivation behind toPullRequest was to save API requests.

Copy link
Member Author

@MartinNowak MartinNowak Jan 16, 2018

Choose a reason for hiding this comment

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

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.

@wilzbach
Copy link
Contributor

X codecov/patch - 89.361% of diff hit (target 91.08%)

Kind of ironic that dlang-bot wouldn't merge this PR?
The trick is informational: true -> https://github.com/dlang/dmd/blob/master/.codecov.yml

@MartinNowak
Copy link
Member Author

Sure it's going to be some hassle, but I'm positive that it will help us to clean our CI forest.
Also we can now use required to really mean only an admin can make this decision, rather than please consider this check.
And in the end we could still revert this if it doesn't work out.

BTW, -0.649% coverage drop indeed ask for an explanation and shouldn't be silently skipped. Could we just increase the tolerance below the target for codecov/patch a bit.

Without required non-admins can decide to skip coverage ;).

@MartinNowak
Copy link
Member Author

Here comes the coverage bump, dropping untested and unused code.

@wilzbach
Copy link
Contributor

Sure it's going to be some hassle, but I'm positive that it will help us to clean our CI forest.

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).
I'm just pointing out that if we go through with this, we have to kill Travis on DMD because currently dlang-bot always merged with 9/10 status checks passing and 1 pending. See dlang/dmd#7617 (comment) for details.

@MartinNowak
Copy link
Member Author

That backlog will be gone at some point, no?
Travis CI Status - Reduced macOS capacity
And even if not, what's the worth of a CI that doesn't report back in 1 day.
IIRC the OSX test was only added for 32-bit anyhow, right?

@wilzbach
Copy link
Contributor

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.
I have been actively cancelling builds, but the history still doesn't look good:

https://travis-ci.org/dlang/dmd/builds

IIRC the OSX test was only added for 32-bit anyhow, right?

Ehm didn't you add the OSX test?

dlang/dmd@b2c10f8

And even if not, what's the worth of a CI that doesn't report back in 1 day.

Yes my point!
If I understand correctly the point of TravisCI was to test whether we can bootstrap master with {dmd,ldc,gdc} and SemaphoreCI does this for the time being pretty reliable.
I wasn't sure how much value testing the bootstrapping with the latest DMD on OSX brings as we already build the latest DMD on auto-tester on OSX (though auto-tester does no rebuild against the newly built compiler).

@wilzbach
Copy link
Contributor

And even if not, what's the worth of a CI that doesn't report back in 1 day.

-> dlang/dmd#7721

@MartinNowak
Copy link
Member Author

Ehm didn't you add the OSX test?

dlang/dmd@b2c10f8

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

@wilzbach
Copy link
Contributor

Travis is gone from DMD -> we can merge this now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants