Last modified: 2013-10-10 14:50:10 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44953, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42953 - Git submodules initialized with wrong URL
Git submodules initialized with wrong URL
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
Continuous integration (Other open bugs)
unspecified
All All
: High major (vote)
: ---
Assigned To: Antoine "hashar" Musso (WMF)
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-11 16:02 UTC by Antoine "hashar" Musso (WMF)
Modified: 2013-10-10 14:50 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
output of failing build with git non bare repo (2.21 KB, text/plain)
2012-12-12 21:55 UTC, Antoine "hashar" Musso (WMF)
Details
code for Jenkins Git Plugin fixSubmoduleUrls() (3.96 KB, text/plain)
2012-12-12 22:05 UTC, Antoine "hashar" Musso (WMF)
Details
Jenkins git plugin 1.5 documentation regarding submodule fetching (HTML) (1.76 KB, text/plain)
2013-09-25 11:02 UTC, Antoine "hashar" Musso (WMF)
Details

Description Antoine "hashar" Musso (WMF) 2012-12-11 16:02:47 UTC
Jenkins git plugin has an issue that prevents us from using submodules in the two repositories. The plugin set the URL for the submodules to be /var/lib/zuul/git/... instead of the supplied url in .gitmodules.

Running "git submodule sync" does fix it though.

I had to disable two Analytics jobs because of that. https://gerrit.wikimedia.org/r/38097
Comment 1 Antoine "hashar" Musso (WMF) 2012-12-11 18:56:36 UTC
This seems to come from https://github.com/jenkinsci/git-plugin/commit/8fcff2a227cbd8e01ac2b6164c1aee0ef8243613 which rewrite the submodules URL whenever the origin repository is not a bare repository :(
Comment 2 Antoine "hashar" Musso (WMF) 2012-12-12 21:55:50 UTC
Created attachment 11498 [details]
output of failing build with git non bare repo

Example output for the failure:

https://integration.mediawiki.org/ci/view/All-disabled/job/analytics-webstatscollector/3/console
Comment 3 Antoine "hashar" Musso (WMF) 2012-12-12 22:05:21 UTC
Created attachment 11499 [details]
code for Jenkins Git Plugin fixSubmoduleUrls()

The code is in https://github.com/jenkinsci/git-plugin.git src/main/java/hudson/plugins/git/GitAPI.java function fixSubmoduleUrls().
Comment 4 Antoine "hashar" Musso (WMF) 2012-12-13 08:38:57 UTC
The workaround is to disable submodule processing in the Git plugin and process them manually using:  git submodule sync && git submodule update --init.

I have done so for the webstatscollector and udp-filters project of the Analytics team: https://gerrit.wikimedia.org/r/38497
Comment 5 Antoine "hashar" Musso (WMF) 2013-09-25 09:41:42 UTC
This is happening again and the workaround of comment #4 can not realistically be used nowadays.

An example of failure is https://integration.wikimedia.org/ci/job/operations-puppet-doc/2564/console

It clones operations/puppet.git from /srv/ssd/zuul/git/operations/puppet (that is the Zuul maintained repository.

The repository as several submodules declared as:

  [submodule "modules/cdh4"]
      path = modules/cdh4
      url = https://gerrit.wikimedia.org/r/operations/puppet/cdh4

The Jenkins git plugin tries to be smart and dynamically rewrite the submodule URL supposing it is a subfolder:


 FATAL: Command "git submodule update" returned status code 1:
 fatal: repository '/srv/ssd/zuul/git/operations/puppet/modules/cdh4' does not exist
 Clone of '/srv/ssd/zuul/git/operations/puppet/modules/cdh4' \
   into submodule path 'modules/cdh4' failed

That is really dumb :-(
Comment 6 Antoine "hashar" Musso (WMF) 2013-09-25 11:02:08 UTC
Created attachment 13375 [details]
Jenkins git plugin 1.5 documentation regarding submodule fetching (HTML)

HTML doc from Jenkins
Comment 7 Antoine "hashar" Musso (WMF) 2013-09-25 11:10:03 UTC
If the remote is /srv/ssd/zuul/git/$ZUUL_PROJECT , that translates to:

/srv/ssd/zuul/git/operations/puppet

Being a local URL, Jenkins use 'git rev-parse --is-bare-repository' which returns false (Zuul creates working repos since it merges submitted patches on top of master). Being a non-bar repository, Jenkins assume the submodules have been fetched there and will rewrite the submodules URLs:

 <li>If the super-project is <b>not</b> bare, it is assumed that the
    repository has each of its submodules cloned and checked out appropriately.
    Thus, the submodules will be taken directly from a path like
    <code>${SUPER_PROJECT_URL}/${SUBMODULE}</code>, rather than relying on
    information from <i>.gitmodules</i>.</li>


The definitive fix is to never use /srv/ssd/zuul/git/ as a git URL whenever we have submodules.  Instead we can use git://integration.wikimedia.org/... and use /srv/ssd/gerrit/git as a reference to speed up thing.


I have manually updated the operations-puppet-doc job to use the git:// URL, and that fixed the issue.  Looking at the config files, the following jobs still reference /srv/ssd/zuul for a git repository and thus need to be updated in Jenkins job builder:

analytics-libanon
analytics-udp-filters
analytics-webstatscollector
analytics-wikistats
integration-jjb-config-test
mediawiki-core-doxygen-publish
mediawiki-core-install-sqlite
mediawiki-core-jsduck
mediawiki-core-jsduck-publish
mediawiki-core-lint
mediawiki-core-qunit
mediawiki-core-regression-master
mediawiki-core-regression-REL1_19
mediawiki-core-regression-REL1_20
mediawiki-core-regression-REL1_21
mwext-DonationInterface-runtests
mwext-Wikibase-server-tests
operations-puppet-doc
operations-puppet-spec
phpcomponent-Diff-phpunit
test-mediawiki-dumpenv
test-mediawiki-phpcs-HEAD
test-phpunit-on-slave


Whenever one of those job uses submodules, it will end up failing to clone the submodule due to the path rewriting :(
Comment 8 Gerrit Notification Bot 2013-09-25 12:31:36 UTC
Change 85972 had a related patch set uploaded by Hashar:
point operations-puppet-doc to git:// url

https://gerrit.wikimedia.org/r/85972
Comment 9 Antoine "hashar" Musso (WMF) 2013-09-25 12:32:29 UTC
The analytics job are not in JJB.

integration-jjb-config-test does not have submodules

mediawiki-core-* jobs have submodules disabled (the wmf branches containing submodules, that ends up being toooo slow).


mwext-DonationInterface-runtests mwext-Wikibase-server-tests are on repositories not having submodules.

The rest are experiments:
operations-puppet-spec
phpcomponent-Diff-phpunit
test-mediawiki-dumpenv
test-mediawiki-phpcs-HEAD
test-phpunit-on-slave
Comment 10 Gerrit Notification Bot 2013-09-25 12:32:47 UTC
Change 85972 merged by jenkins-bot:
point operations-puppet-doc to git:// url

https://gerrit.wikimedia.org/r/85972
Comment 11 Gerrit Notification Bot 2013-10-10 14:49:12 UTC
Change 88993 had a related patch set uploaded by Hashar:
point operations-puppet-rspec to git:// url

https://gerrit.wikimedia.org/r/88993
Comment 12 Gerrit Notification Bot 2013-10-10 14:50:10 UTC
Change 88993 merged by jenkins-bot:
point operations-puppet-rspec to git:// url

https://gerrit.wikimedia.org/r/88993

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links