I'm not sure I follow why the super-project change has to be
explicitly reviewed. I'm assuming that in order to verify a change
the user will need to download it into some super-project that
contains it and test it out there. If the change depends on other
changes (because it is in an atomic group), repo could be updated to
help you pull down any dependent changes.
With Gerrit/Repo, I don't think there has ever been a requirement to
review a change in the context of all projects that are tracking it
(historically using repo manifests). I'm not sure that the
introduction of "atomically grouped" changes would necessarily imply
the creation of this requirement. If this requirement is introduced,
why would it not be extended to non-grouped changes as well? For
example, if I upload a single change to submodule a', shouldn't a
corresponding change be created on super-project s' automatically that
is part of the automatic group (and t' as well if it also tracks a'
and so on)?
What I'm getting at is that it may be worth treating (requirement to
support atomically grouped changes) and (requirement to verify any
change in all relevant super-projects) as two separate requirements.
> > - Several super projects tracking the submodules. This would result
> > in multiple super project changes for every creation of an atomic
> > group or every change to an atomic group.
> > - What happens if the super-project change is accidentally submitted
> > before all the submodule changes are in? The gitlink entries would
> > then point to non-existent commits (which is the typical problem
> > with git submodules)
>
> It cant be submitted in wrong order since there will be dependencies
> set up in Gerrit between the superproject and the submodules.
I hadn't thought about the super-project changes being dependent on
the submodule changes. It seems like that would take of the problem.
> > - What happens if a super project starts tracking one of the
> > submodules that is currently part of an atomic group? Would Gerrit
> > need to create a change for the super project right away?
> > Likewise, what happens if a super-project stops tracking one of the
> > submodules involved in an atomic group.
>
> Yes when the submodule file is changed in the superproject you will
> need to upload and submit that change by hand. When Gerrit sees a
> commit with a filename like this Gerrit will setup/remove subscription
> for the submodule changes (change 14033 handles the subscription
> part). Basically every user of a superproject has to do a "git pull"
> and "git submodule update" to get changes locally.
If the super-project s' is updated to start tracking a submodule a',
would changed be created or abandoned for s' corresponding to all the
atomic group changes that a' is currently participating in?
> > - Once the submodules are merged in, the super-project change may
> > become out of date if something is merged in before it goes in.
> > Would the user be required to rebase the super project change? I
> > don't want to explain how to our users how to rebase a change with
> > gitlink updates :)
>
> I dont want to do that either ;-) The superproject is part of the
> atomc commit and this will ensure that all changes + the super project
> changes are merged in all at the same time (the submodules first and
> the superproject last).
How would the super-project change be updated if it no longer cleanly
applies because some unrelated change has been made to the super-
project in the mean time? It seems that either the change to the
super-module project would need to be updated automatically anytime a
change occurred on the super-module project or the user will have to
manually do this.
> > Instead, I would probably modify the submodule updating logic you're
> > working on in change 14033 to look for these atomic submissions. It
>
> So the question is: based on the stream of commit coming into Gerrit
> is there a clever way to group some of these changes together? Without
> more information I would say no, but if anyone has an idea here this
> would be most welcome. The current solution is a new gerrit command to
> let the user specify before the upload "hey, Gerrit, I will upload SHA
> x,y and z and they belong together".
Is there a requirement that the dependencies are created at the exact
same time the change is created in Gerrit? If this isn't a
requirement, it should be fairly easy to change the UI to allow users
to enter dependencies between changes. If this is a requirement, what
use case is it trying to solve?
> > would need to be smart enough to ignore individual merges that are a
> > part of an atomic transaction. Once an atomic transaction is complete
> > it would go about automatically updating the super-project's gitlinks
> > to point to the current commit of all it's submodules that have a
> > "revision" specified.
>
> How would you update them?
In the submodule op, the following logic could be used.
When a change comes in, determine if everything else the change
depends on (or is in the same atomic group) has also been committed.
If not all dependencies have been submitted, don't update the
gitlinks. Otherwise, go ahead and update gitlinks accordingly. When
determining the dependencies, you would need to take into account what
the current super-project is actually tracking and filter accordingly.
> Dont you need a super project commit on the server to achieve that?
Yes, there does need to be some change to the super-module project.
Two ways this could be done are 1) creating the super-project
change(s) automatically in advance and then creating new revisions on
those changes as necessary automatically. Or 2) Don't make an
explicit Gerrit change on the server. Instead, let the merge op do
this for you automatically as described above.
> What you are say is pretty much what we intend to do ;-)
> > If there is a desire to somehow download all the changes of an atomic
> > group to a users working copy, I would think about adding this into
> > repo some how. Perhaps a new SSH command can be added to get a list
> > of all dependent changes.
>
> Yes good point.... its just that we have made our users very used to a
> glossy nice web UI and I would think that there would be a few visits
> to my desk about this.
The user wouldn't necessarily call the ssh-command directly, all that
could be wrapped by Repo:
1) User runs a command like
"repo <checkout/pull/cherry-pick> tools/gerrit 14033/6"
2) Repo in turn runs something like
"ssh
gerrit.server.com gerrit get-dependencies 14033/6".
3) Gerrit returns a list of all the dependencies
4) Gerrit then checks out/pulls/cherry-picks all the appropriate
changes.
It can look at the current .gitmodules file to filter the list of
changes and determine where the submodules are on disk.
> > I'm certainly not an expert on the Gerrit code base, so these
> > suggestions may not be the realistic or the best thing to do. But
> > hopefully they still provide some useful feedback.
>
> This is a big change and think it is very important that we discuss
> it.
Sounds good :).