Page MenuHomePhabricator

scap configuration in puppet defaults to forge the git repo name with 'mediawiki/services/'
Closed, ResolvedPublic

Description

When configuring scap for integration/docroot deployment (T256005) I went with:

hieradata/role/common/deployment_server.yaml
scap::sources:
  integration/docroot: {}

Copy pasted from graphoid/deploy a few lines above. I assumed that the default will be just fine, and actually have read the code and it looked like the git url will be properly forged.

Eventually that caused Puppet to fail to initialize the repository:

Error: Execution of '/usr/bin/git -c core.sharedRepository=group clone --recurse-submodules
  https://gerrit.wikimedia.org/r/mediawiki/services/integration/docroot.git /srv/deployment/integration/docroot' returned 128

It was not obvious but the issue is the repository name being prefixed: mediawiki/services/integration/docroot.

The fix was to make the repository name explicit f13690ff171c08a53205f8c364653f3e44da3682 :

hieradata/role/common/deployment_server.yaml
-  integration/docroot: {}
+  integration/docroot:
+    repository: integration/docroot

I guess that comes from MediaWiki services being the first adopter of scap and the default probably made sense at the time to avoid repeating mediawiki/services everywhere. Years later, that is starting to hurt.

This task is to remove the default prefix, and adjust the existing configs for mediawiki/services and/or drop the redundant repository parameter.

Event Timeline

Change 610254 had a related patch set uploaded (by Hashar; owner: Hashar):
[operations/puppet@production] Explicitly mentions the repository in scap::sources

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

Change 610267 had a related patch set uploaded (by Hashar; owner: Hashar):
[operations/puppet@production] scap::sources stop assuming mediawiki/services as a prefix

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

hashar triaged this task as Medium priority.Jul 27 2020, 12:33 PM

I have rebased the two Gerrit changes and poked our internal ops list to have them reviewed/deployed.

Change 610254 merged by Alexandros Kosiaris:
[operations/puppet@production] Explicitly mentions the repository in scap::sources

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

Change 610267 merged by Alexandros Kosiaris:
[operations/puppet@production] scap::sources stop assuming mediawiki/services as a prefix

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

Our configuration no more use mediawiki/services/ as a prefix \o/