Page MenuHomePhabricator

Bug in scap3 git submodule url rewriting
Closed, ResolvedPublic

Description

When rewriting git submodule URLs on targets to point at deploy server, it looks like the submodule name and url is overwritten with the checkout path, instead of the actual path to the module in the .git/modules dir.

[@tin:/srv/deployment/eventlogging/eventbus]$ cat .gitmodules
[submodule "config/event-schemas"]
	path = config/schemas
	url = https://gerrit.wikimedia.org/r/mediawiki/event-schemas

[@tin:/srv/deployment/eventlogging/eventbus] (master)[4c422c3] ± ls .git/modules/config/
event-schemas
[@kafka1002:/srv/deployment/eventlogging/eventbus]$ cat .gitmodules
[submodule "config/schemas"]
	path =  config/schemas
	url =  http://tin.eqiad.wmnet/eventlogging/eventbus/.git/modules/config/schemas

http://tin.eqiad.wmnet/eventlogging/eventbus/.git/modules/config/schemas is not the proper path on tin to the submodule. It should be 'http://tin.eqiad.wmnet/eventlogging/eventbus/.git/modules/config/event-schemas`.

Revisions and Commits

rMSCA Scap
Restricted Differential Revision

Event Timeline

Ottomata raised the priority of this task from to Needs Triage.
Ottomata updated the task description. (Show Details)
Ottomata added a project: Scap.
Ottomata added subscribers: Ottomata, thcipriani.

Although, now that I am redeploying (instead of the first checkout), the url is still as I said, but the submodule checkout is working?

Ahh, no its not. I believe the submodule was cached in -cache somehow. If I remove the whole target path, and start again, I get:

Submodule 'config/schemas' (http://tin.eqiad.wmnet/eventlogging/eventbus/.git/modules/config/schemas) registered for path 'config/schemas'
Cloning into 'config/schemas'...
fatal: repository 'http://tin.eqiad.wmnet/eventlogging/eventbus/.git/modules/config/schemas/' not found
Clone of 'http://tin.eqiad.wmnet/eventlogging/eventbus/.git/modules/config/schemas' into submodule path 'config/schemas' failed
mmodell subscribed.

Tyler says this is fixed but he forgot to close it.

@thcipriani: can you link to the commit if it's not too difficult to find? :)

Yup, should be fixed. Problem was the bad assumption that the name and path of a submodule will always be the same. This is fixed in master.

Not sure if this version is deployed live just yet (definitely in beta). Commit is here: https://phabricator.wikimedia.org/D82