We didn't really get anywhere on the question of how many review requests to create per bug. I still think my idea of creating one review request per bug no matter how many changesets/commits are being pushed is better. ;-) Thoughts?1. Steven convinced me that the model that he is proposing for multiple pushes to the same bug will work. I think we should at least try to prototype it. He will provide more details on what he is envisioning tomorrow.2. I convinced Steven that we don't want the multiple units of works per bug model. Instead, people can just file a new bug for a new unit of work, the same way they do today.
--
You received this message because you are subscribed to the Google Groups "mozilla-code-review" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozilla-code-re...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I think that' breaks the mq workflow. People usually have a patch per logical thing to review.We didn't really get anywhere on the question of how many review requests to create per bug. I still think my idea of creating one review request per bug no matter how many changesets/commits are being pushed is better. ;-) Thoughts?1. Steven convinced me that the model that he is proposing for multiple pushes to the same bug will work. I think we should at least try to prototype it. He will provide more details on what he is envisioning tomorrow.2. I convinced Steven that we don't want the multiple units of works per bug model. Instead, people can just file a new bug for a new unit of work, the same way they do today.








--
Hey, that looks nice!I still have a ton of questions, but I’ll try to implement what I can.
Meanwhile, a question: do we want to set the limit to one (parent) review request per bug?
Having multiple (competing) fixes from different contributors to the same bug looks feasible, but we definitely don’t want to bulk them into a single review request.
The current algorithm would work like this:1. User runs "BUG=31337 hg push -e 'ssh -o SendEnv=BUG’” (see https://github.com/ehsan/reviewtool/issues/2 for details)2. User gets the URL like http://review.example.org/?changeset=<something>&bug=313373. User opens this URL4. We look up a parent review request for bug 313375. If there’s no existing review request, we create a new one and its children6. If there is existing review request, we update it and its children
That workflow will fail if someone wants to create a second review request for the same bug.We could probably identify review requests not just by bug number, but by a tuple of (bug number, user), but that means two users who collaborate on a common fix won’t be able to incrementally push their changesets for review - that would create separate review requests per user.
Great, then let’s carry on with one review request per bug.The main question right now is here:
The second question is how do we generate a squashed diff of arbitrary changesets, preferably without touching the working copy of the repository (to avoid locks etc.)?E.g. we have changesets C1 => C2 => C3.
If user picks (C1, C2, C3) or (C1, C2) or (C2, C3) - we can be sure there are no conflicts and can simply use “hg diff” to get a squashed diff.But if user picks (C1, C3) there’s a chance that C3 won’t apply on C1 without C2.The only way to detect this that I can think of is to try to apply those changesets one by one on the working copy.Is there a better way?
Next, I’m not sure why do we need to match C5 to C5?
We can simply show that C5 already has a review request and optionally allow to discard it from review.The idea is that if I’ve pushed 10 changesets for review, I don’t want to match them all when I push 11-th.Am I missing something?
On March 19, 2014 at 18:10:57 , Ehsan Akhgari (ehsan....@gmail.com) wrote:
On Wed, Mar 19, 2014 at 10:24 AM, George Miroshnykov <gmiros...@rebbix.com> wrote:Great, then let’s carry on with one review request per bug.The main question right now is here:I'll take a look at that later today, it requires a bit of thought.
Thanks!
The second question is how do we generate a squashed diff of arbitrary changesets, preferably without touching the working copy of the repository (to avoid locks etc.)?E.g. we have changesets C1 => C2 => C3.
If user picks (C1, C2, C3) or (C1, C2) or (C2, C3) - we can be sure there are no conflicts and can simply use “hg diff” to get a squashed diff.But if user picks (C1, C3) there’s a chance that C3 won’t apply on C1 without C2.The only way to detect this that I can think of is to try to apply those changesets one by one on the working copy.Is there a better way?We don't need to bother with that -- we can just use hg diff with the first and last changesets. If there are irrelevant commits in the middle, they _will_ appear in the squashed diff.
Got it.
Note that for the majority of the cases, the squashed diff will not be reviewed or even looked at. In case someone looks at it and is bothered by the potentially irrelevant stuff, they can just ask the change author to resubmit without that stuff.Next, I’m not sure why do we need to match C5 to C5?I assume you mean C5 to C5'. The reason why someone would want to do that is for RB to be able to show you the interdiff of what changed between C5 and C5'. It's optional of course, and is left at the discretion of the patch author, so they will do that where it makes sense.
Nope, I did mean matching C5 to C5, because C5 is not changed in the case that Steven described:
> The reason we require matching C5 to C5, is that if any of the old review requests don't have a match, we will close them and assume they have been folded into another commit, or removed.
I just thought that it would be better to revere this behaviour: when we can automatically match some existing changesets, we should do it.
If user doesn’t want those changesets reviewed, they can be explicitly removed.
What do you think?
We can simply show that C5 already has a review request and optionally allow to discard it from review.The idea is that if I’ve pushed 10 changesets for review, I don’t want to match them all when I push 11-th.Am I missing something?If you just add the 11th changeset on top, you don't need to match anything, you'll just request an additional review on the 11th commit. If however you have rebased and/or changed the other 10 commits, you would want to tell this tool which old commit corresponds to which new one. If you haven't done any changes to those and you don't want review on them, you can just do nothing, and they no review request will be created for them.
Oh, I probably misunderstood Steven.
I’m also concerned about edge cases of history rewrite.
The approach we’ve discussed so far covers following cases:
But what should we do in case of squashed commits?
As far as I can see, there’s no way for us to preserve review comments from the initial commits if they were later squashed.
Unless we track comments of the parent (squashed) review request too, like GitHub does.
Does this help explain things more?
It sure does, thanks!
On March 19, 2014 at 18:10:57 , Ehsan Akhgari (ehsan....@gmail.com) wrote:
On Wed, Mar 19, 2014 at 10:24 AM, George Miroshnykov <gmiros...@rebbix.com> wrote:
Great, then let’s carry on with one review request per bug.The main question right now is here:I'll take a look at that later today, it requires a bit of thought.Thanks!
The second question is how do we generate a squashed diff of arbitrary changesets, preferably without touching the working copy of the repository (to avoid locks etc.)?E.g. we have changesets C1 => C2 => C3.
If user picks (C1, C2, C3) or (C1, C2) or (C2, C3) - we can be sure there are no conflicts and can simply use “hg diff” to get a squashed diff.But if user picks (C1, C3) there’s a chance that C3 won’t apply on C1 without C2.The only way to detect this that I can think of is to try to apply those changesets one by one on the working copy.Is there a better way?We don't need to bother with that -- we can just use hg diff with the first and last changesets. If there are irrelevant commits in the middle, they _will_ appear in the squashed diff.Got it.
Note that for the majority of the cases, the squashed diff will not be reviewed or even looked at. In case someone looks at it and is bothered by the potentially irrelevant stuff, they can just ask the change author to resubmit without that stuff.
Next, I’m not sure why do we need to match C5 to C5?I assume you mean C5 to C5'. The reason why someone would want to do that is for RB to be able to show you the interdiff of what changed between C5 and C5'. It's optional of course, and is left at the discretion of the patch author, so they will do that where it makes sense.Nope, I did mean matching C5 to C5, because C5 is not changed in the case that Steven described:
> The reason we require matching C5 to C5, is that if any of the old review requests don't have a match, we will close them and assume they have been folded into another commit, or removed.
I just thought that it would be better to revere this behaviour: when we can automatically match some existing changesets, we should do it.
If user doesn’t want those changesets reviewed, they can be explicitly removed.
What do you think?
We can simply show that C5 already has a review request and optionally allow to discard it from review.The idea is that if I’ve pushed 10 changesets for review, I don’t want to match them all when I push 11-th.Am I missing something?If you just add the 11th changeset on top, you don't need to match anything, you'll just request an additional review on the 11th commit. If however you have rebased and/or changed the other 10 commits, you would want to tell this tool which old commit corresponds to which new one. If you haven't done any changes to those and you don't want review on them, you can just do nothing, and they no review request will be created for them.Oh, I probably misunderstood Steven.
I’m also concerned about edge cases of history rewrite.
The approach we’ve discussed so far covers following cases:
- Creating a new review request
- Adding changesets to existing review request
- Removing changesets from existing review request
- Rewriting a changeset, then replacing old one (C6) with a new one (C6’).
But what should we do in case of squashed commits?
As far as I can see, there’s no way for us to preserve review comments from the initial commits if they were later squashed.
Unless we track comments of the parent (squashed) review request too, like GitHub does.
Let’s say you push two changesets for review.
A reviewer comes and leaves two inline comments, one for each changeset.
Then you decide to squash those two changesets into one.
At this point you have two options:
I just thought that it would be better to revere this behaviour: when we can automatically match some existing changesets, we should do it.
If user doesn’t want those changesets reviewed, they can be explicitly removed.
What do you think?The only case where we would be able to do this matching automatically is if the changeset sha1 has not changed, right? Which means that there is nothing to create a new review request based on. I think Steven was talking about the case where C5 is "essentially" the same patch, but rebased or something. With that, what I said above should still apply.
We can simply show that C5 already has a review request and optionally allow to discard it from review.The idea is that if I’ve pushed 10 changesets for review, I don’t want to match them all when I push 11-th.Am I missing something?If you just add the 11th changeset on top, you don't need to match anything, you'll just request an additional review on the 11th commit. If however you have rebased and/or changed the other 10 commits, you would want to tell this tool which old commit corresponds to which new one. If you haven't done any changes to those and you don't want review on them, you can just do nothing, and they no review request will be created for them.Oh, I probably misunderstood Steven.
I didn't get the part about being able to preserve review comments, can you please elaborate on that?Let’s say you push two changesets for review.
A reviewer comes and leaves two inline comments, one for each changeset.
Then you decide to squash those two changesets into one.
At this point you have two options:
- Create a new review request for your newly squashed changeset. You lose both comments.
- Discard one of the previous changesets and associate the newly squashed squashed with the old one that’s left. You lose one comment on the discarded changeset.
GitHub avoids this issue by tracking comments on the squashed diff, not on individual commits.They also hide comments that are no longer relevant automatically after each push.
This works for squashes and other forms of history rewrites.It can be better demonstrated by live example:Of course, inline comments on individual commits are also available (at the bottom):Should we try to do something similar with RB?
On March 20, 2014 at 6:09:51 PM, Steven MacLeod (ste...@smacleod.ca) wrote:
Sorry for the confusion from my example, I'll try and clear a few things up:I just thought that it would be better to revere this behaviour: when we can automatically match some existing changesets, we should do it.
If user doesn’t want those changesets reviewed, they can be explicitly removed.
What do you think?The only case where we would be able to do this matching automatically is if the changeset sha1 has not changed, right? Which means that there is nothing to create a new review request based on. I think Steven was talking about the case where C5 is "essentially" the same patch, but rebased or something. With that, what I said above should still apply.So, George was correct, I was talking about the case where C5 == C5, meaning it is the *exact* commit. Confusingly in my example I showed manual matching of this commit because I wasn't trying to add extra intelligence to this system for a first run.
In this case, we definitely could automatically match C5 and C5 by walking backwards until we hit a changeset that was not part of the previous review. So, we'd check the parent of the pushed C6', see it was C5, and match. Then check the parent of C5, see it was C4, and stop walking the commits. This auto matching will break down in the case where there were interleaved commits not put up for review, in which case we'd just require manual matching like I showed.Now, the reason why I think the matching needs to be shown explicitly, even for the case where C5 is up for review and unchanged, is it gives the ability to remove a commit from review. We will *discard* any review request for a commit that didn't get matched in the latest push (Discard is a specific term to Review Board here, which closes the review request, marking it as *discarded*. This process preserves the diffs, and reviews, and the review request could be reopened in the future).Now, I'm not sure if this UX of *not* matching a commit to a previous one causing the review request to be discarded is the best, but I thought it was a simple model that fit in with the rest, giving us a way to discard.
Okay, now I think I got it.
We’re looking at this interface from somewhat different perspectives.
My current implementation (still work in progress) looks like this:
https://cloudup.com/cb5eMMDNkfj
As you’ve suggested, we now have two tables: existing changesets and new changesets.
Existing changesets are looked up as following:
We can simply show that C5 already has a review request and optionally allow to discard it from review.The idea is that if I’ve pushed 10 changesets for review, I don’t want to match them all when I push 11-th.Am I missing something?If you just add the 11th changeset on top, you don't need to match anything, you'll just request an additional review on the 11th commit. If however you have rebased and/or changed the other 10 commits, you would want to tell this tool which old commit corresponds to which new one. If you haven't done any changes to those and you don't want review on them, you can just do nothing, and they no review request will be created for them.Oh, I probably misunderstood Steven.
This again was me just making my example have a less intelligent tool than is possible. This auto matching when there is no rebase is certainly possible.I didn't get the part about being able to preserve review comments, can you please elaborate on that?Let’s say you push two changesets for review.
A reviewer comes and leaves two inline comments, one for each changeset.
Then you decide to squash those two changesets into one.
At this point you have two options:
- Create a new review request for your newly squashed changeset. You lose both comments.
- Discard one of the previous changesets and associate the newly squashed squashed with the old one that’s left. You lose one comment on the discarded changeset.
GitHub avoids this issue by tracking comments on the squashed diff, not on individual commits.They also hide comments that are no longer relevant automatically after each push.
This works for squashes and other forms of history rewrites.It can be better demonstrated by live example:Of course, inline comments on individual commits are also available (at the bottom):Should we try to do something similar with RB?When we rebase and remove or squash commits, the pusher will need to select which Review Request to become the new commit. Generally this should be the child commit in the chain, because if this is done, the way Review Board generates interdiffs, it will only show the changes that are new for the squashed commit, not the entire parent commit as well (You'll of course see the entire commits diff in the normal diff view).As for preserving review comments, we will not delete the other review requests, we will only *discard* them. As mentioned previously, this will preserve all history, it just marks the review request. I'm unsure if we should list them somehow in the squashed review request, but links to them will be preserved in the history of the squashed review request anyway. Basically, nothing is lost, it just won't be presented as part of the current state.
You’re right, technically we’re not losing history.
But unless we’re showing this history somewhere, it will be effectively lost for the reviewer and reviewee.
Consider this case:
User pushes three changesets for review.
The first feedback he gets is “please squash all changesets into one”, followed by some other suggestions.
User squashes the changesets as requested and pushes new single squashed changeset for review.
He is presented with the UI listing three existing outdated changesets and the new squashed changeset. He’s not sure what to do now.
Moreover, even if he manages to match one changeset and discard the rest, he now has to go over every discarded changeset’s review request and look for the feedback he may have missed / not yet applied.
He’ll have no indication if this feedback is still relevant or he already fixed the issue in the newer commit(s).
I’m still not sure how we can deal with this...
Thanks,
George
On March 20, 2014 at 21:56:42 , Gregory Szorc (g...@mozilla.com) wrote:
There were some comments about looking up changesets that are
descendants/children of existing changesets.
This kind of operation can be computationally expensive, especially when
we have thousands of commit "branches." You'll almost certainly want to
have a database of some kind indexing things. But I encourage you to
measure this yourself before you reach that conclusion!
Yeah, I’m looking forward to deal with all those challenging performance bottlenecks :)
A database (or just some cache) would definitely be helpful.
The good part is that because changesets are immutable, I believe we can cache ancestry info indefinitely.
BTW, right now my naive approach to resolving ancestry involves sorting changesets by their local rev numbers.
Is it good enough for our use case or should I search for a different solution?
I started a project over Christmas to index repository data and make it
available as a web service. The source lives at
https://bitbucket.org/indygreg/moz-tree-utopia. It's deployed at
https://hg.stage.mozaws.net/ and http://moztree.stage.mozaws.net/docs/.
It's backed by a Postgres DB. But, finding all descendants of a single
commit is very inefficient with a relational database (tons of
sub/follow-up queries). I've been wanting to port the backend to a graph
database, like Neo4j.
Anyway, if you want to lean on the web API for performing queries
against repository data, go for it. If you have any feature requests for
new APIs, send a pull request my way or let me know. I could also have
it start indexing the review repository. Let me know.
Sweet! I’ll take a look.
I didn’t know you can use ZFS in Ubuntu, that’s cool…
Thanks,
George
You’re right, technically we’re not losing history.
But unless we’re showing this history somewhere, it will be effectively lost for the reviewer and reviewee.
Consider this case:
User pushes three changesets for review.
The first feedback he gets is “please squash all changesets into one”, followed by some other suggestions.
User squashes the changesets as requested and pushes new single squashed changeset for review.
He is presented with the UI listing three existing outdated changesets and the new squashed changeset. He’s not sure what to do now.
Moreover, even if he manages to match one changeset and discard the rest, he now has to go over every discarded changeset’s review request and look for the feedback he may have missed / not yet applied.
He’ll have no indication if this feedback is still relevant or he already fixed the issue in the newer commit(s).
I’m still not sure how we can deal with this...
When I’ve discussed this with Ehsan, I believe we agreed that whenever you push something into review repo, chances that you’ll see some irrelevant commits are extremely small, unless you previously pulled them knowingly.
Most (all?) stuff that will land in mozilla-central should go through the review repo.
Review repo should also periodically pull from mozilla-central, maybe even real-time.
So I think the vast majority of review pushes will only show commits actually intended for review, that’s why I've assumed that pre-selecting them is safe.
Maybe we could be clever and autoselect commits with the matching Bug in the commit message? I'll let others weigh in on if we should use a heuristic like that.
That’s definitely doable.
Additionally, I think I'd prefer the previous commits, and the new commits, appear side by side, rather than on top of each other. I think trying to match things up and compare the pushes is harder when they are listed like the way you show in the screenshot.
Yeah, this is a temporary layout, it wouldn’t fit in two columns, but we’ll figure it out :)
As for drag and drop, I don't really care if it actually is "Drag and Drop", I just want a nice way to quickly match the commits, and some sort of visual indicator for how they are matched. I'm no UX expert, drag and drop was just the first thing that came to my mind :D.
I don’t like the idea of manually matching commits at all, but I don’t have any alternatives to suggest, so for now I’m pushing forward...
You’re right, technically we’re not losing history.
But unless we’re showing this history somewhere, it will be effectively lost for the reviewer and reviewee.These "discarded" review requests can still be visited, and they'll be linked to in the change history of the squashed review request as they're removed from the depends on field or the description etc. They aren't hard to get to if someone wants to view them.Consider this case:
User pushes three changesets for review.
The first feedback he gets is “please squash all changesets into one”, followed by some other suggestions.
User squashes the changesets as requested and pushes new single squashed changeset for review.
He is presented with the UI listing three existing outdated changesets and the new squashed changeset. He’s not sure what to do now.
Moreover, even if he manages to match one changeset and discard the rest, he now has to go over every discarded changeset’s review request and look for the feedback he may have missed / not yet applied.
He’ll have no indication if this feedback is still relevant or he already fixed the issue in the newer commit(s).
I’m still not sure how we can deal with this...As for squashing and matching, to cover the 3 commits squashed into one case, in the tool the user would have to match 3 old commits all to the same new commit. We could then just use the most child commit of the three as the review request we update, and discard the other two.
Say we have commits "C<-B<-A", where A is the parent of B, which is the parent of C. and these all become a single D commit, with additional changes. The user would match C, B, and A all to D. We would then use the review request for C as the one to update.When you visit this consolidated review request and viewed the diff, you would see the entire change of D. But, the way Review Board's interdiffs work, if you look at the interdiff you'd only see changes which weren't in B and C. That is to say, those two commits wouldn't appear as part of the interdiff, just the new changes that were on top of the 3 commits before. This is a result of actually diffing file contents behind the scenes to generate interdiffs.So, I think that solves the use case of the reviewer knowing, and seeing what has changed. I also think getting much better than this is a "hard problem".
Yup.
I highly recommend that any automated system not store numeric
revisions. Store the full 40 character hex SHA-1 or the 20 byte raw
SHA-1 (not the 12 character abbreviation that commonly appears in the UI).
Sure, I’m not storing them.
All review requests use full 160-bit node IDs to identify changesets.
For now, all I need is to sort the array of node IDs in some meaningful order :)
Also, I have to find edges (first and last changeset) to generate a squashed diff.
Yeah, I already appreciate those querying capabilities :)
The problem is that I have more than two IDs and I don’t know their order in advance.
So first I have to sort them (or at least find the first and the last one) and then I can do the diff.
And for that kind of sorting I’m using local rev numbers, so I hope it’s fine.
Thanks,
George
Another way to deal with history rewrites is to preserve the original changesets with their associated comments in the review but create an "equivalent merge commit" that represents the effect of the rebase. For a (somewhat complex) example of this see [1]. This approach has the advantage that you keep the comments on the initial commits, no manual work is required to match changesets and you get the chance to explicitly review the changes that went into the rebase.
On March 28, 2014 at 1:39:49 PM, James Graham (ja...@hoppipolla.co.uk) wrote:
On 28/03/14 10:46, George Miroshnykov wrote:
> I think I know what you mean, but unfortunately we can’t use this approach.
>
> In order not to enforce a specific Mercurial workflow upon contributors, we had to make a number of compromises.
FWIW I think "don't require a particular workflow" should be a non-goal.
We shouldn't prefer a tool that provides mediocre support for an
ill-defined variety of workflows compared to a tool that provides
excellent support for a small number of well-defined workflows.
I completely agree with you here, but unfortunately I’m not in position to make decisions.
Let’s hear out what others have to say.
> Internally, we don’t have a concept of feature branches.
> Every push to review repository will be a force-push because:
> every commit is done on branch “default”
I don't really understand how the tool works then? Having each review be
a single branch in the VCS seems like the most obvious design.
It sure is the most obvious design approach.
And the most familiar to GitHub / Bitbucket pull request users too.
Unfortunately, we don’t have lightweight branches in Mercurial and I’m told that bookmarks are not used widely enough among mozillians to make them mandatory.
> any push can create a new head (e.g. rewrite history)
> The second point is basically a consequence of the first point - every contributor will have a slightly different version of the “default” branch.
> With this setup, during a force-push the only usable info we can get from server-side Mercurial hook is the commit ID of the first incoming changeset.
> To get the list of pushed commits, we go down the ancestry chain from the first commit to the tip.
> At this point, we don’t know anything about previously pushed commits.
>
> Compare this to e.g. GitHub API:
> http://developer.github.com/v3/pulls/#create-a-pull-request
> They require you to explicitly tell the head (feature branch name or just a tip commit ID) and the base (the branch you’re changes are based on, e.g. “master”).
>
> As we don’t have a concept of master branch and feature branches, we can’t distinguish between an actual history rewrite and a regular force push.
> The only thing we can do is to show both incoming commits and the commits that were previously associated with a given bug number.
FWIW in critic all force-pushes to the review repo are explicitly
disabled unless you tell it that you are about to perform a rebase. When
you do perform a rebase you have to manually tell it what commit you are
rebasing onto.
I found the docs:
https://critic-review.org/tutorial?item=rebase
That looks interesting and well-thought.
I have to think this over.
As we’re not using branches, but rather arrays of arbitrary commits, I’m not yet sure we can implement something like that as is.
Thanks,
George
On March 28, 2014 at 1:39:49 PM, James Graham (ja...@hoppipolla.co.uk) wrote:
On 28/03/14 10:46, George Miroshnykov wrote:
> I think I know what you mean, but unfortunately we can’t use this approach.
>
> In order not to enforce a specific Mercurial workflow upon contributors, we had to make a number of compromises.
FWIW I think "don't require a particular workflow" should be a non-goal.
We shouldn't prefer a tool that provides mediocre support for an
ill-defined variety of workflows compared to a tool that provides
excellent support for a small number of well-defined workflows.I completely agree with you here, but unfortunately I’m not in position to make decisions.
Let’s hear out what others have to say.
> Internally, we don’t have a concept of feature branches.
> Every push to review repository will be a force-push because:
> every commit is done on branch “default”
I don't really understand how the tool works then? Having each review be
a single branch in the VCS seems like the most obvious design.It sure is the most obvious design approach.
And the most familiar to GitHub / Bitbucket pull request users too.
Unfortunately, we don’t have lightweight branches in Mercurial and I’m told that bookmarks are not used widely enough among mozillians to make them mandatory.
> any push can create a new head (e.g. rewrite history)
> The second point is basically a consequence of the first point - every contributor will have a slightly different version of the “default” branch.
> With this setup, during a force-push the only usable info we can get from server-side Mercurial hook is the commit ID of the first incoming changeset.
> To get the list of pushed commits, we go down the ancestry chain from the first commit to the tip.
> At this point, we don’t know anything about previously pushed commits.
>
> Compare this to e.g. GitHub API:
> http://developer.github.com/v3/pulls/#create-a-pull-request
> They require you to explicitly tell the head (feature branch name or just a tip commit ID) and the base (the branch you’re changes are based on, e.g. “master”).
>
> As we don’t have a concept of master branch and feature branches, we can’t distinguish between an actual history rewrite and a regular force push.
> The only thing we can do is to show both incoming commits and the commits that were previously associated with a given bug number.
FWIW in critic all force-pushes to the review repo are explicitly
disabled unless you tell it that you are about to perform a rebase. When
you do perform a rebase you have to manually tell it what commit you are
rebasing onto.I found the docs:
https://critic-review.org/tutorial?item=rebase
That looks interesting and well-thought.
I have to think this over.
As we’re not using branches, but rather arrays of arbitrary commits, I’m not yet sure we can implement something like that as is.
On 3/31/14, 11:34 AM, Ehsan Akhgari wrote:
On Fri, Mar 28, 2014 at 8:21 AM, George Miroshnykov<gmiros...@rebbix.com <mailto:gmiroshnykov@rebbix.com>> wrote:
On March 28, 2014 at 1:39:49 PM, James Graham(ja...@hoppipolla.co.uk <mailto:ja...@hoppipolla.co.uk>) wrote:
On 28/03/14 10:46, George Miroshnykov wrote:
> I think I know what you mean, but unfortunately we can’t use this approach.
>
> In order not to enforce a specific Mercurial workflow upon contributors, we had to make a number of compromises.
FWIW I think "don't require a particular workflow" should be a
non-goal.
One of the goals behind this project is building a review workflow which
works for a number of different types of workflows that people use here
at Mozilla, and as a result, we need to focus on the lowest common
denominator, hence the "don't require a particular workflow" goal. If
you disagree with that goal, it's fine, but you should keep in mind that
is what we're building here.
I somewhat disagree with the statement "we need to focus on the lowest common denominator." The trap here is that by focusing on the "lowest common denominator," we'd be building a tool that works for everyone but it sucks or isn't efficient.
I believe our current approach to Mercurial is doing just this. We've effectively said "the way we can support bookmarks, branches, mq, and anonymous heads at the same time is if we pass an environment variable to the server." That solution - the lowest common denominator - sucks.
While we could (should?) support environment variables as a solution, I think we should go out of our way to support more intuitive and efficient mechanisms. Here's how.
1. For people doing bookmark-based development, we say "push your bookmark to the server and a review will be initiated." The review ID is the name of the bookmark. From client side, this is `hg push -B <bookmark>`. Simple.
2. For people doing mq-based development, we say "install this simple extension that allows you to run `hg push review`." Under the hood, that extension exports a bookmark to the remote having the same name as the current tip-most applied mq patch. The argument "we don't want to require an extension" is inconsistent with the fact that mq is itself an extension (albeit a built-in one) that people have already activated. One-time extension installation is not a big deal. People will do it in order to have better code review.
3. For people doing anonymous heads (I doubt there are many), we say "specify an environment variable" or "install this extension."
And for the record, one of my unofficial goals is to get more Mozilla developers off mq and using bookmarks. I'm bringing in the developer behind changeset evolution for a brown bag in April. Hopefully we'll be able to drum up more interest with that.
On 3/31/14, 2:43 PM, Ehsan Akhgari wrote:
On Mon, Mar 31, 2014 at 5:12 PM, Gregory Szorc <g...@mozilla.com
<mailto:g...@mozilla.com>> wrote:
On 3/31/14, 11:34 AM, Ehsan Akhgari wrote:
On Fri, Mar 28, 2014 at 8:21 AM, George Miroshnykov
<mailto:gmiroshnykov@rebbix.__com
If we're keying reviews off bug #'s, that seems to limit workflows quite substantially. I often have heads involving patches from multiple bugs (similar to you it sounds like). I get reviews "bottom up." What I really want are feature-based branches/reviews where bug #'s merely fall out of commit messages. I don't want rebases changing patch order to lead to confusion in the review tool because a new bug # is on top of the review "stack."
Furthermore, (and we can both relate to this as two of Mozilla's most prolific patch writers - you were #2 in 2013 (only behind bholley) and I was #8), I think Bugzilla overhead is a real thing. I foresee the day where we loosen our requirements on bugs needing to exist for pretty much every change. IMO, if an appropriate person signs off on a patch, no bug is needed. I feel there are many "trivial" patches I'm leaving on the table because I don't want to deal with overhead: I just want to write a "10 second" patch and ask for review "10 second review." We can't easily do this today because we are using Bugzilla for reviews. (The overhead for bug management dominates patch writing and review time.) But once reviews are moved elsewhere, Bugzilla's necessity wanes. What I'm trying to say is that limiting our review tracking to bug numbers (and thus requiring Bugzilla) may be a bit shortsighted. I hope we can use arbitrary identifiers for tracking reviews (e.g. branch/bookmark/mq names) so as to not require Bugzilla down the road.
(I understand this opinion might be controversial. But it's one I'm willing to fight for in the name of increased productivity.)
On 31/03/14 19:34, Ehsan Akhgari wrote:Well I don't really understand how we've arrived at the conclusion that supporting arbitrary workflows is an immovable requirement, even if it comes at the expense of the overall quality of the tool. To me it feels like we are selling out the long-term productivity of the organization in order to avoid some short term pain in getting people to adapt.
On Fri, Mar 28, 2014 at 8:21 AM, George Miroshnykov <gmiros...@rebbix.com
wrote:
works for a number of different types of workflows that people use here at
On March 28, 2014 at 1:39:49 PM, James Graham (ja...@hoppipolla.co.uk)
wrote:
On 28/03/14 10:46, George Miroshnykov wrote:
I think I know what you mean, but unfortunately we can’t use thisapproach.
we had to make a number of compromises.
In order not to enforce a specific Mercurial workflow upon contributors,
FWIW I think "don't require a particular workflow" should be a non-goal.
One of the goals behind this project is building a review workflow which
Mozilla, and as a result, we need to focus on the lowest common
denominator, hence the "don't require a particular workflow" goal. If you
disagree with that goal, it's fine, but you should keep in mind that is
what we're building here.
I would be much more sympathetic to this if there wasn't ample evidence that people are willing and able to change VCS habits in order to get a better experience and/or to meet the requirements of the project that they are working with. For example GitHub has a workflow that is very different to the patch based system that was common in pre-VCS days, but the enormous success of GitHub doesn't seem to have been affected by the fact that it insists that you use branches + PRs for development and doesn't also provide the option to upload diff files, for example. Even within Mozilla, people seem to cope with having some things in Mercurial and other things on GitHub. Although it creates some process problems, the developers themselves seem to be able to make the transitions back and forth rather smoothly.
And new people coming to the project are substantially more likely to have experience of branch-based development than mq-based development.
I am particularly troubled by mq because it feels like Mozilla might be one of the few organisations still using the tool. At least whenever you search for mq help on Google, you have about a 50% chance of getting a MDN page as the top result. It also seems like the wider mercurial community are starting to think that it was a bad idea. Therefore it seems all too plausible that it will be increasingly marginalised in the future, and we will be left depending on a tool that no one else is interested in.
Without wanting to suggest that we copy the GitHub or Bitbucket systems directly (we shouldn't; we can do substantially better), they aren't solving a different problem. They even had the same initial problem we had (how do we move users used to a centralised, patch-based workflow to a DVCS workflow). I really think we should try to design the best possible thing for a branchy development model and then if we find we *can't* get people to switch how they work, add mq support, rather than building the entire product around the assumption that people will refuse to try something new even if it offers considerable benefits.
As the goal of this project is building a review workflow that all Mozilla
developers can switch to easily with minimal friction, reiterating how
github and bitbucket do things without keeping this in mind always gets us
back to the same issue: these systems are trying to solve different
problems.
Yes, having to tell critic you are doing a rebase is annoying. But it's substantially less annoying than it would be to have to map each commit in the new branch to a commit in the old branch by hand.
The mq use case only does rebases in a loose conceptual sense. That is one
big difference with our workflow and Critic's. In addition, requiring
people to let the code review tool know when they're planning to do a local
rebase adds one additional step to the workflow, and I don't think there is
a good reason why we would want to do that.
In general rebases should be relatively rare (because they alter published history and create work for all the people collaborating on a branch), so having one manual step isn't *too* bad.
FWIW I am trying to stand up a critic system (not connected to github) with the gecko-dev repo, just so that people can try it out and see what the workflow's like.