Skip to content

Add include subgroup arg, and move the user names request to outside of the for loop

Douglas Araujo requested to merge E3-613_add_include_subgroups_arg into master

Add arg include_subgroups as parameter in the main function. And also move the user name (API request), used only for logging to outside of for loop.

eligible_approvers_names = [gl.users.get(item).name for item in reviewers_uids]

In the last version, I got error when try to apply the rule for all projects inside the main E3 group.

  File "tools/apply_merge_approvalrules.py", line 33, in <listcomp>
    eligible_approvers = [gl.users.get(item).name for item in reviewers_uids]
  File "/home/douglas.araujo/.local/lib/python3.6/site-packages/gitlab/exceptions.py", line 281, in wrapped_f
    raise error(e.error_message, e.response_code, e.response_body) from e
gitlab.exceptions.GitlabGetError: 429: {'error': 'This endpoint has been requested too many times. Try again later.'}

Merge request reports