On Fri, Nov 18, 2016 at 5:31 AM, Pierre Tardy <
tar...@gmail.com> wrote:
>
> Having 100% coverage from the start will indeed not be possible, but 2% is
> better than 0%, and the 4% will be even better, until we can require 90%
> coverage of the patched lines for every contribution.
> This is what we did for the venerable buildbot which I am now maintainer of.
>
> That said indeed if submodule is say 6 month away from achieving what we do
> with repo, maybe its not worth to make such big investment.
While I do not promise a 6 month here, I actually think it is a
reasonable time frame.
Then the manifest is tracking the projects by sha1 and not by target branch?
>
> The problem that I did not automate is atomic cross-project revert. What we
> did is revert the problematic patches manually, and merge them together
> atomically.
> I wonder if this is a problem that you have a solution for. Will git revert
> in a top dir will revert the patches in the subrepositories instead of just
> pointing the top dir to the ancient commit (and break tracability in the
> subrepositories)
For now I'd expect revert to be broken in the sense it would point at
the ancient commits. (Well actually revert would have a merge conflict
with follow ups that also touched the submodule pointer, I would assume)
>> Now we could come up with such a sync repo under the hood within
>> git-repo as well. However instead of piling more on top of Git,
>> why not use Git directly? (Submodules solve this exact problem,
>> they are just hard to use, so we need to make it as nice as the repo tool
>> such that people will switch voluntarily).
>
> For me the main reason is to have a scripting language to handle those high
> level problems instead of having to write it in C (and then rewrite it in
> java in JGIT)
The serving side (speaking for JGit/Gerrit) seems surpringly advanced w.r.t.
submodules already IMHO, so I don't think a lot of work needs to be done there.
Heh, yeah we'd expect server load to go down by a lot once submodules
are in use. This is because you would fetch the superproject, which records
all submodules that were changed, and then you only have to fetch these
~5 / 800 submodules that actually changed.
But server load is not the main selling point.
>
> When doing git fetch of a branch the git protocol will send all the refs
> available for the repo (including the refs/changes!). This was a 22MB of
> sha1+branchref lines with a noop repo sync.
I agree that the protocol needs some overhaul to accommodate Gerrits
excessive use of refs.
>
> We have a repo optimization which will use the gerrit ls-project api to
> query the state of only the branches that we are following and decide if
> there is a need to use git fetch.
>
> I wonder if you have a solution in mind for this problem.
"Shortterm" we'll migrate to submodules, which requires less repositories
to be fetched (superproject + all changed submodules; lots of submodules
are expected to be unchanged) and longer term we'd want to fix the protocol,
e.g. protocol version 2 ("client speaks first", first round is
capability negotiation
only, instead of having the server blast 22MB of refs at the client
without a way to stop it)
>
>>
>> > - What is the pre-commit/pre-submit check support from CI tools?
>>
>> How do current pre submit tests work? hint: they are incredible hard to
>> get right across multiple repositories; In the future it is as simple
>> as using one call
>> to get all changes across repositories (and possibly including the project
>> that manages the dependencies, the superproject) in one go
>>
>>
https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#submit-preview
>
> That is a quite interesting API indeed!
> The first question that come in mind is how fast is it? how much load will
> gerrit be able to achieve?
We haven't measured yet.
> Gerrit is already quite loaded, I am not sure if this is a good idea to put
> it on the master. I guess this API will work on a read-only mirror, right?
I don't see any reason why it would not work there.
>
> The second remark is that there are two needs for such API.
>
> The first need is for the scheduling.
> CI needs to figure out which job needs to be triggered by a change. Usually
> there is one job per (topproject, branch), then those job trigger parallel
> subjobs.
> The complexities of the programs makes it not always feasible to use same
> branch for subprojects and topprojects.
> So in order to fully use of this great stuff, there is a need for an API
> which tell the list of (topprojects, branch) that are affected more or less
> recursively.
What are you recursing into here? (I assume you do not mean submodules,
but superprojects?) The submit_preview would include any affected
superproject recursively though.
>
> The second is the cherry-picking, and this idea of packing the bundles looks
> pretty cool. BTW, we use cherry-pick policy for most of our projects and not
> merge, in order to keep the git history clean.
> so the apply of the bundle will be a git rebase for us, which looks fine
> enough.
Well the bundle contains a dry run of "what would happen if I were to
submit right now", i.e. the bundles would contain the cherrypicks already,
no need to rebase. (You could have a check in there to see if Gerrit
put the correct footers while cherry picking for example).
> Another remark is a problem that we had, and could not resolve yet is how to
> atomically test and update very top project that are affected by a change.
> This was a problem that our kernel team asked. They wanted to have the
> kernel branch to be the same in the current dessert, and the next dessert
> manifests.
> Again, how do you see this problem to be resolved?
>
> The main problem that we had to resolve here is how to track the user spaces
> dependencies. sometime, e.g. graphics kernel patches have to be merged with
> associated graphics userland, and then you have to describe somehow the
> dependency list for each dessert, and this was too much complexity.
So ideally we'd have Depends-On footers in Gerrit as well as the topics,
such that the user land patches could depend on the kernel patches?
The submit_preview API would include the changes to the superproject
but also having the state of the rest of the superproject, e.g. you'd
notice that
the kernel submodule advances by $sha1..$sha1 but the userspace
submodule `foo` is pinned at $sha1, and then the build may fail because
the dependency was not there?
>
>> > It is not easywith repo but relatively easier, as there is all the
>> > metadata needed in the manifest, including branches that are tracked in
>> > submodules, etc.
>>
>> All information that is in git-repo ought to be available via the
>> gitmodules file as well.
>
>
> I can't find from the git documentation if it is now possible to not fix the
> commit of a submodule, i.e just always sync the latest commit of the tracked
> branch.
By design submodules are defined via the sha1. However some repo
workflow is to use moving targets (refs) instead of fixed sha1s for
the subprojects,
so you may be interested in
`git submodule update --remote`
which would fetch all submodules and checkout the branch that is specified
via $(git config --file .gitmodules submodule.<name>.branch).