#2991 Clarification of *_FOLDER settings values
Closed: Fixed Opened by bkabrda.

Hi, I've been running a (non-public) Pagure instance for a while and noticed a weird thing about how the repositories are being created. I think this is ultimately either an issue with how the *_FOLDER settings values are documented (and perhaps also how they're used) or I'm missing something crucial about configuration.

Here's what to put in Pagure config file to reproduce:

STORAGE_ROOT = '/var/pagure'
DATA_ROOT = os.path.join(STORAGE_ROOT, 'pagure_data')
GIT_FOLDER = os.path.join(DATA_ROOT, 'repos')
DOCS_FOLDER = os.path.join(DATA_ROOT, 'docs')
# tickets/requests and other folders are also set up to be under DATA_ROOT

It's also necessary to specify GL_REPO_BASE explicitly in gitolite.rc to be /var/pagure/pagure_data.

With the above config, when I create a repository test, two test.git repos actually get created - one in GIT_FOLDER and one in DATA_ROOT. The one in GIT_FOLDER gets created by Pagure worker and doesn't have gl-conf, the one under DATA_ROOT gets created by gitolite itself and has gl-conf. When I clone the repo from Pagure, I get the one created by gitolite and I can push there, but the pushed files are not displayed in Pagure web UI, as Pagure is looking at the repo under GIT_FOLDER, which didn't get the commits.

The reason for this is that gitolite constructs paths to repos by joining GL_REPO_BASE and the repo <name> entry from gitolite.conf.

I haven't really noticed this for quite some time, since the problem in my prod instance was reversed - the repos themselves were fine, but all the docs, tickets and requests were duplicated, since I had pointed GL_REPO_BASE to GIT_FOLDER. This meant that I had docs/tickets/requests both under GIT_FOLDER (those were the one that gitolite knew about) and under DATA_ROOT (created by Pagure worker).

Assuming this is not a stupid mistake of mine, there are some implications that I think this has:

  • First of all, there should be only one configuration value, e.g. REPO_FOLDER, under which all repos, including docs, tickets and requests should go. It shouldn't be possible to specify directories for docs/tickets/requests.
  • Second, it should be documented that GL_REPO_BASE must point to this directory.
  • Third, I think this is also means that docs, tickets and requests should probably be blacklisted as namespaces, since creating a group docs with repo test would conflict with documentation repo for project test created without a namespace.

Thanks for reading through this and I hope this makes sense. I'll be glad to clarify if it doesn't.


Commit adea204d fixes this issue

Metadata