
--
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.
--
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-review+unsub...@googlegroups.com.
On 4/2/14, 6:15 PM, Ehsan Akhgari wrote:
On Wed, Apr 2, 2014 at 4:59 PM, James Graham <ja...@hoppipolla.co.uk<mailto:ja...@hoppipolla.co.uk>> wrote:
On 02/04/14 21:05, George Miroshnykov wrote:
Things may also be complicated by the fact that every push to
our review repo will be a force-push (as discussed before).
Sorry, I don't know if I didn't see this discussion or didn't fully
understand it, but can you point me to the reason for that? It seems
very poor from a user's point of view, not least because it make it
very difficult to pull from the review repo and have multiple people
push to the same review branch. The possibility of having such a
workflow is very important to me.
The reason is because hg is stupid. hg has the concept of multi-headed
branches, and makes it very hard to work with those multiple heads in a
sane way. As a result, it prevents pushes that create remote heads by
default and to work around that you need to force-push.
It seems like you're confusing hg push -f with git push -f which are
very different things. The cases you mentioned above will all work fine
when force-pushing in hg.
`hg push -B <bookmark>` (push a bookmark to a remote) does *not* require --force. In your defense, I believe this was recently changed (in 2.8 or 2.9).
Even if --force were required, this would be hidden from view via the planned-to-be-written Mercurial extension (just like the try extensions today abstract that detail).
On 4/2/14, 6:28 PM, Ehsan Akhgari wrote:No, the server (not client) controls publishing.
Unfortunately we can't rely on phases since the commits under review
might have been pushed to some other public repo which makes them
"public" by default unless you do some crazy client side dance. And we
need to be git compatible anyway.
If the server is marked as publishing, all changesets *pushed* to the server will be marked as "public."
If the server is marked as non-publishing, all changesets *pushed* to the server will be marked as "draft."
If the server *pulls* from another repository (central, inbound, etc), it will inherit the phases from that other repo.
Therefore, if the server is marked as non-publishing and the server periodically pulls changesets from central, inbound, etc, the only way a changeset becomes public is if it were marked as public on a repo the server is pulling from (central, inbound, etc).
I don't think it is fair to require every semantic detail to be compatible. We know Mercurial's changeset evolution feature will enable us to eventually track changesets across rebases (and solve this problem in a more robust manner). I think we can agree that not supporting changeset evolution because Git doesn't have this (powerful) feature would be silly.
I think our push volume is low enough that having the code review repo periodically pull will be sufficient. i.e. the window where someone pushes up "published" commits as part of a review should be very short. Assuming the code review repo is pulling in new commits every 10s or so, the only way I see this happening is if the client pushes to inbound, fx-team, etc *and* the code review repo as part of the same shell command. Think about it: for a review to have published commits the code review repo doesn't know about yet, it either needs to pull-rebase-push or push-push. I don't think that will happen that often.
For now, what that means is that we need to pull from our upstream
remotes (let's say, mozilla-central/inbound/fx-team/etc.), update the hg
bookmarks that point to those heads, and walk up the rest of the graph
like Greg said below.
The sucky part of this is how to make sure that your head bookmarks are
updated right when an incoming push comes in. I don't know if there is
a great solution here unfortunately. One approach would be to pull from
the remotes right at that time, and then do the graph walking. This
will make pushes slow. Another approach would be to do that lazily,
i.e., accept the push, dump the commits you received in a db somewhere,
and then pull from those remotes lazily and do the graph walking there.
This will make pushes fast, but makes them async so you won't have a
review URL to spit out to stdout when the push is done, and people need
to wait a while before their review is available.
Maybe there are better solutions for that which I can't think of right
now? Taras, Grag, Ben, any ideas?
We could certainly work in a hook or extension that "paused" the push until the code review repo is up to date.
Please note that iterating over all the repos takes time - about 10s per loop for remote repos. Clients may have to wait for a repository lock while that is occurring.
I highly recommend pulling from a "unified" repository from the code review repo to keep this window as short as possible. You can either have a second repo on the server or you can pull from a remote such as https://hg.stage.mozaws.net/gecko (which has bookmarks tracking each repo). It shouldn't take more than a few seconds to perform an incremental pull from a single unified repo.
Also, BitBucket offers a configuration option to control whether repositories are publishing. The publishing settings of remotes should not come into play. Worst case, we can write an extension to force modify the phases to be what we need them to be.
First, I *do* agree we should not bet the farm on changeset evolution. That being said, I do think the people investing in changeset evolution will ensure it can eventually scale to meet our needs and that makes it a relatively safe bet in the long term. To be clear, I'm stating that when changeset evolution is ready, I think we should utilize it as part of the review tool. In addition, the short to medium term solution for Mercurial and Git will be the same, so we don't need to worry about this now.
I don't think it is fair to require every semantic detail to be
compatible. We know Mercurial's changeset evolution feature will
enable us to eventually track changesets across rebases (and solve
this problem in a more robust manner). I think we can agree that not
supporting changeset evolution because Git doesn't have this
(powerful) feature would be silly.
I disagree quite strongly. :-) I think it's quite wise to 1) not bet
on changeset evolution ending up being what we hope it will be and 2)
not build something that cannot be supported just as well in git.
FWIW I would also disagree quite strongly if you were advocating to use
a git-only feature which would make it miserable to support hg.
That being said, I disagree strongly on your opinion that we should not eventually support changeset evolution (and other varying features) someday. I disagree because that does not put user experience first. At the end of the day, we're serving our users. Telling them "no, you cannot use this shiny feature because we're artificially limiting support to the least common denominator" is our choice and it doesn't serve the needs of the masses. The only benefactor AFAICT is less complexity on the review tool (2 code paths instead of 1), which makes our lives easier. Trading review tool simplicity for a worse overall user experience is not a good long-term choice.
While I appreciate the sentiment in "I would also disagree quite strongly if you were advocating to use a git-only feature which would make it miserable to support hg," I reject the premise. Changeset evolution is not a feature that would make it "miserable" to support Git, at least from the perspective of the review tool. Actually, no, I take that back. After deploying the changeset evolution aware commit matching code, we'll look at the pile of code that performs semantic matching of commits (now obsoleted by changeset evolution and used only for Git) and reach the conclusion that Mercurial is much easier to support. This could lead to it being "miserable" to support Git. But unless Git's user base dies off, we'll support Git, so I still reject the premise of the argument because we are choosing to support Git *and* Mercurial. Again, I think our responsibility is to best serving our users. We do that by supporting features that make it easier to use.
FWIW, I seem to recall you making arguments (IRL?) that one of the faults of ReviewBoard was that it aimed to support the lowest common denominator of {CVS, Subversion, Mercurial, Git, etc} and in doing so sacrificed some of its potential to excel at handling DVCSs. I agree with that logic, which is why I'm concerned that things like rejecting changeset evolution because Git doesn't have that feature violates that rationale and could lead this review tool to being less than its potential.
FWIW, remember that the Try phase fiasco was due to Mozilla not upgrading Mercurial and then taking seemingly ages to make a 2 line change to the hgrc of the Try repository. If we had been actively following Mercurial development, the whole issue could have been avoided.
We're kind of in a weird situation. Mozilla doesn't seem eager to invest in improvements to Mercurial (by staying up to date on releases, running extensions on the server, etc). As a result, people don't know about new features and there is no demand for them. Someone needs to push for these things and I find myself being a (seeming) lone voice. I think it's fair to assume that a lot of my replies about Mercurial are targeting an audience that's ignorant of Mercurial's features and capabilities, not just at you :) I'm also trying to ensure whatever solutions we employ on this review tool are compatible as possible with the long term. We know what's coming down the Mercurial pipe: I think it's rational to prepare for the future when it's known.
On 04/04/14 22:20, Ehsan Akhgari wrote:I don't think the server can know. Apart from the practical problems in simple cases, there are a whole load of edge cases where it is more or less impossible for the server to figure out what's going on. For example if I pull in some changes from one of my coworkers, that they are going to push to review, and make an additional change on top of their branch, that I push to review, I don't want my review to include their changes, even if they haven't pushed them yet. Similarly, if I have put some hacky patch that the remaining commits don't build on, e.g. something to change logging or whatever, in my branch history, I don't want the review to include that commit.
On Fri, Apr 4, 2014 at 11:38 AM, James Graham <ja...@hoppipolla.co.uk <mailto:ja...@hoppipolla.co.uk>> wrote:
I don't know what "without UI" means exactly, but if the default
way to start a review is via a mach command (and I hope the intent
is that this can desugar into a comprehensible set of VCS
actions), can't the mach command allow one to specify the set of
commits that will make up the review? For example
./mach review --base=HEAD~3
(syntax could be better ofc). On the backend, this would push the
current branch to the review-tool owned VCS and then actually
create the review in a second step using a REST API like
/create_review?base=sha1_of_base&branch=name_of_remote_branch_or_bookmark
Of course --base could have a sensible default like HEAD~ or the
upstream of the current branch, or whatever.
We can do that of course, but I think that's a sucky UI because it makes the developer think about something that their VCS already knows. :-) I'm still hopeful that we can fix the server side issue to be able to detect things reliably on the server side, but this obviously is a fallback approach that we can use if we realize that won't work.
Basically I think the user has to be in ultimate control, and I think that's much easier to achieve if the definition of the base commit is provided by the client rather than the server. This still allows sensible defaults that could use phases, or the merge base, or whatever is available. It just means that simple things are simple but hard things are also possible.
I don't really understand the advantage of putting this logic in the server compared to the client?
I also haven't understood why "one optional argument when creating a review" is considered too complicated?