#3103 Implement an optimized Gitolite3PythonAuth backend
Closed by bkabrda. Opened by bkabrda.
bkabrda/pagure gitolite-py  into  master

Download 3103.patch

This PR implements a new Gitolite backend that achieves major speedup by implementing subset of Gitolite functionality in the Python code. To borrow from the docstring of the new Gitolite3PythonAuth:

Replaces gitolite compile && gitolite trigger POST_COMPILE calls by implementing used subset of gitolite's functionality in Python to achieve a major speedup with some limitations:

  • This implementation can only work with exactly the subset of gitolite functionality that Pagure uses.
  • Currently it doesn't respect GITOLITE_PRE_CONFIG and GITOLITE_POST_CONFIG configuration settings.
  • This implementation doesn't support:

    • specifying repos with templates/wildcards
    • groups being members of other groups
    • specifying access rights to specific branches
    • anything that gitolite trigger POST_COMPILE does, other than handling ssh keys uploaded by users
    • probably most gitolite.rc non-default options

FTR, I do know that this is missing unit tests, documentation, an entry in setup.py etc. I opened it to see if it's a viable way of approaching gitolite performance issues. If so, I'll work on all these things.

From the discussion this seems fine to me, I kind of wonder if we shouldn't split the code into another file though.

I also wonder what the impact will be on pagure-dist-git should we subclass this one and tweak it a little ?
Would it require lot of work?

From what I can tell, pagure-dist-git does three extra things that I don't have covered in this patch:

  • it uses RW+C kind of permissions, which require adding a %one_config section to gl-conf, if used - this would not be hard
  • it uses the R refs/something/something = someone syntax, not just R = someone - this would not be hard either (it just adds another perms in gl-conf with the specified refs)
  • it uses - to blacklist some permissions - this would not be hard, it may even work right now (I haven't tested though)

I can work on all of these and add another PR implementing this functionality + adding tests etc.

As discussed in person, I'm closing this since it seems to be pretty hacky and would make much better sense to move upstream to gitolite if possible.

Pull-Request has been closed by bkabrda

Metadata