Skip to content

Conversation

@barosl
Copy link

@barosl barosl commented Dec 12, 2014

This is an alternative implementation of #46.

Currently it works as follows:

1. Mark the commits to be merged together as rollup. (e.g. r+ rollup)
   These commits will have an implicit priority of -1 to postpone the
   individual merge.
2. If one of the marked commits reaches the top of the queue, all the
   marked commits will be merged together and tested.
3. While merging commits, those commits that fail to merge are ignored.
4. You can prioritize the rollup by setting p=.

Typical usage:

1. We have three commits to be tested together.
2. Set r+ rollup to the first commit.
3. Set r+ rollup to the second commit.
4. Set r+ rollup p=10 to the last commit, which will trigger the rollup
   process soon.

Fixes graydon#34.
bors.py Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be simplified to

p = -1 if self.batched() else 0

Copy link
Author

Choose a reason for hiding this comment

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

I've applied it, thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this cfg.get when the surround code is not?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, I guess it's a default value.

Copy link
Author

Choose a reason for hiding this comment

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

I think providing a sane default when the configuration value does not exist is good. (That's what cfg.get(key, default_value) does.) So I think we might even want to replace almost all the occurrences of cfg[key] to cfg.get(key, default_value).

However, it is just a matter of taste. You could also prefer explicit failing if the configuration value is not provided. Which way do you prefer?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is fine as is, thanks.

@brson
Copy link
Collaborator

brson commented Dec 13, 2014

This looks good to me though the logic around self.merge_sha was a bit hard for me to follow, and my python is weak.

Unfortunately I can't test it right now. I may be able to tonight, but if not I will tomorrow.

ISTM that if the rollup fails the failure will be posted to whichever PR triggered the test, but then bors will proceed to the other rollup PRs and do the test again (which will fail again, until all the PRs have triggered a failed rollup). This would be counter-productive.

I'm wondering what the workflow is for rollups that fail. Currently rollups have a PR and if there's a failure, the rollup author fixes it manually and tries again, or removes. Under this scheme I'd imagine someone would figure out which PR caused the failure, remove the 'rollup' comment or 'r-' it, then '@bors: retry' the rollup. Does that sound right?

@brson
Copy link
Collaborator

brson commented Dec 13, 2014

With this arrangement that doesn't create a new PR it won't be possibly to use the hypothetical '@bors: try' to test a rollup before attempting to land. I'm not sure this is a problem, but my hunch is that rollups often fail a number of times since they're so big.

If it becomes desirable to try rollups it might be nice to support tagging rollups independently of r+, like one comment with '@bors: rollup' (though maybe your regexp supports just the word 'rollup'?).

@barosl
Copy link
Author

barosl commented Dec 13, 2014

@brson

This looks good to me though the logic around self.merge_sha was a bit hard for me to follow, and my python is weak.

I also think the code around self.merge_sha is somewhat ugly and hacky. In fact, the logic was copied from the master branch and does not fit well with the one-by-one strategy of the rust branch. However I cannot think of a better solution to this...

if the rollup fails the failure will be posted to whichever PR triggered the test, but then bors will proceed to the other rollup PRs and do the test again

This is true, but bors won't proceed to one of the remaining rollup PRs immediately, because they all have lower priority than the normal PRs. (We triggered the rollup by setting p=99.) So while bors trying the normal PRs, we can have time to review the rollup and rearrange them.

remove the 'rollup' comment or 'r-' it, then '@bors: retry' the rollup. Does that sound right?

Yes, that would be a typical approach to a failed rollup.

it might be nice to support tagging rollups independently of r+, like one comment with '@bors: rollup' (though maybe your regexp supports just the word 'rollup'?).

Right, rollup is already independent from r+ by the definition of the regular expression, so it can be freely added or removed regardless of the existence of r+. I think this is reasonable.

brson added a commit that referenced this pull request Dec 14, 2014
Alternative rollup implementation for the rust branch
@brson brson merged commit 6f7ada6 into graydon:rust Dec 14, 2014
@brson
Copy link
Collaborator

brson commented Dec 14, 2014

I've deployed this to production. @barosl will you write up a summary of how to do rollups to discuss.rust-lang.org?

@Gankra
Copy link

Gankra commented Dec 14, 2014

🎊

@barosl
Copy link
Author

barosl commented Dec 14, 2014

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants