#5 Adjust the generation of the configuration with the change made to groups
Merged 7 years ago by pingou. Opened 7 years ago by pingou.

file modified
+4 -11
@@ -66,7 +66,7 @@ 

      """ A dist-git's gitolite authentication module. """

  

      @classmethod

-     def _process_project(cls, project, config, groups, global_pr_only):

+     def _process_project(cls, project, config, global_pr_only):

          """ Generate the gitolite configuration for the specified project.

  

          :arg project: the project to generate the configuration for
@@ -74,22 +74,15 @@ 

          :arg config: a list containing the different lines of the

              configuration file

          :type config: list

-         :arg groups: a dictionary containing the group name as key and the

-             users member of the group as values

-         :type groups: dict(str: list)

          :arg global_pr_only: boolean on whether the pagure instance enforces

              the PR workflow only or not

          :type global_pr_only: bool

-         :return: a tuple containing the updated config and groups variables

-         :return type: tuple(list, dict(str: list))

+         :return: the updated config

+         :return type: list

  

          """

  

          _log.debug('    Processing project: %s', project.fullname)

-         for group in project.committer_groups:

-             if group.group_name not in groups:

-                 groups[group.group_name] = [

-                     user.username for user in group.users]

  

          # Check if the project or the pagure instance enforce the PR

          # only development model.
@@ -156,4 +149,4 @@ 

                                 deploykey.id))

              config.append('')

  

-         return (groups, config)

+         return config

This relies on https://pagure.io/pagure/pull-request/2403 which just
got merged and simplify how the configuration of groups is handled.

Fixes https://pagure.io/pagure-dist-git/issue/3
Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

LGTM, though it seems that there might not be tests on this function. I am assuming that since the tests weren't altered and it's return type changed. If that's true, I recommend writing test coverage for this function.

There are tests but it's testing the entire output not just this function that's why the output of the tests haven't changed while the output of this function did.

Pull-Request has been merged by pingou

7 years ago
Metadata