After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 774825 - Changing the URL of a git repository on the moduleset is broken when using a dvcs_mirror_dir
Changing the URL of a git repository on the moduleset is broken when using a ...
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2016-11-22 00:52 UTC by Carlos Alberto Lopez Perez
Modified: 2016-12-13 17:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Ensure git remote is updated correctly when using a dvcs_mirror_dir (2.35 KB, patch)
2016-11-22 01:28 UTC, Carlos Alberto Lopez Perez
committed Details | Review

Description Carlos Alberto Lopez Perez 2016-11-22 00:52:55 UTC
When using a local directory to mirror/cache the sources:

jhbuildrc_globals['dvcs_mirror_dir'] = '/home/user/jhbuild_mirror'

If some of the git repositories on the moduleset is updated to a new URL (a fork), the remote URL on the git repository that mirrors it is not updated.

This breaks things.
Comment 1 Carlos Alberto Lopez Perez 2016-11-22 01:28:30 UTC
Created attachment 340483 [details] [review]
Ensure git remote is updated correctly when using a dvcs_mirror_dir
Comment 2 Michael Catanzaro 2016-11-22 03:20:44 UTC
Review of attachment 340483 [details] [review]:

I guess I don't understand the code, it looks like it's calling 'git remote set-url' twice in a row redundantly? Once in self.update_dvcs_mirror and then once again right under that?
Comment 3 Carlos Alberto Lopez Perez 2016-11-22 03:38:02 UTC
(In reply to Michael Catanzaro from comment #2)
> Review of attachment 340483 [details] [review] [review]:
> 
> I guess I don't understand the code, it looks like it's calling 'git remote
> set-url' twice in a row redundantly? Once in self.update_dvcs_mirror and
> then once again right under that?

Right.

When you set in your jhbuilrc file this:

jhbuildrc_globals['dvcs_mirror_dir'] = '/home/user/jhbuild_mirror'

Then JHBuild mantains a bare git repository that uses as a mirror of the upstream one at /home/user/jhbuild_mirror.

We use this on the WebKitGTK+ bots to avoid fetching the same repository over and over after a clean build. A similar feature is available also for tarballs by setting jhbuildrc_globals['tarballdir'].

When using this feature, the remote on the git repository that is checked out on the Sources directory is updated to point to your local folder /home/user/jhbuild_mirror containing this mirror.

And when you update your sources, JHBuild updates your clone of the repository from the local mirror, and after that updates the mirror.


What this patch does is:

1. Ensure that the remote URL for the mirror (the one at /home/user/jhbuild_mirror) is automatically updated with the module's URL from the moduleset.
2. First fetch the mirror for new changes upstream, then update the clone of the mirror on the Sources directory.
Comment 4 Carlos Alberto Lopez Perez 2016-11-22 03:46:26 UTC
(In reply to Carlos Alberto Lopez Perez from comment #3)
> (In reply to Michael Catanzaro from comment #2)
> > Review of attachment 340483 [details] [review] [review] [review]:
> > 
> > I guess I don't understand the code, it looks like it's calling 'git remote
> > set-url' twice in a row redundantly? Once in self.update_dvcs_mirror and
> > then once again right under that?
> 
> Right.
> 
> When you set in your jhbuilrc file this:
> 
> jhbuildrc_globals['dvcs_mirror_dir'] = '/home/user/jhbuild_mirror'
> 
> Then JHBuild mantains a bare git repository that uses as a mirror of the
> upstream one at /home/user/jhbuild_mirror.
> 
> We use this on the WebKitGTK+ bots to avoid fetching the same repository
> over and over after a clean build. A similar feature is available also for
> tarballs by setting jhbuildrc_globals['tarballdir'].
> 
> When using this feature, the remote on the git repository that is checked
> out on the Sources directory is updated to point to your local folder
> /home/user/jhbuild_mirror containing this mirror.
> 
> And when you update your sources, JHBuild updates your clone of the
> repository from the local mirror, and after that updates the mirror.
> 
> 
> What this patch does is:
> 
> 1. Ensure that the remote URL for the mirror (the one at
> /home/user/jhbuild_mirror) is automatically updated with the module's URL
> from the moduleset.
> 2. First fetch the mirror for new changes upstream, then update the clone of
> the mirror on the Sources directory.


Maybe I didn't expressed myself 100% clear.

With this feature enabled there are two repositories: the one in the Sources dir that is checked out, and the mirror one (a bare git repository).

Currently 'git remote set-url' is executed as expected on the one that is checked out in the Sources directory (with this feature enabled it is pointing to your local folder containing the mirror).

What is missing is calling 'git remote set-url' on the mirror itself that should point to the upstream URL from the moduleset.
Comment 5 Michael Catanzaro 2016-11-22 03:59:14 UTC
Review of attachment 340483 [details] [review]:

OK!
Comment 6 Carlos Alberto Lopez Perez 2016-12-13 16:00:31 UTC
Can you please commit this? I'm not committer. 

Thanks
Comment 7 Michael Catanzaro 2016-12-13 17:13:16 UTC
Attachment 340483 [details] pushed as e58ee08 - Ensure git remote is updated correctly when using a dvcs_mirror_dir