Gitlab:通过 Python API 绑定获取项目的祖先组
Gitlab: Get ancestor groups of a project via Python API bindings
我正在使用 https://github.com/python-gitlab/python-gitlab to automate several tasks over multiple Gitlab repositories / projects. This worked fine up until now: I have a Gitlab project and want to get its parent group. According to https://docs.gitlab.com/13.12/ee/api/projects.html#list-a-projects-groups 这应该是可能的,但我在 Python 绑定中找不到该功能。
我错过了什么吗? Python 绑定中是否缺少该功能?有没有人知道一个解决方法,它不会强迫我进入“纯”REST?
阅读代码后,似乎缺少该功能,但我找到了解决方法:
p = ... project instance ...
path = "/projects/%s/groups" % p.get_id()
groups = p.manager.gitlab.http_get(path)
我正在使用 https://github.com/python-gitlab/python-gitlab to automate several tasks over multiple Gitlab repositories / projects. This worked fine up until now: I have a Gitlab project and want to get its parent group. According to https://docs.gitlab.com/13.12/ee/api/projects.html#list-a-projects-groups 这应该是可能的,但我在 Python 绑定中找不到该功能。
我错过了什么吗? Python 绑定中是否缺少该功能?有没有人知道一个解决方法,它不会强迫我进入“纯”REST?
阅读代码后,似乎缺少该功能,但我找到了解决方法:
p = ... project instance ...
path = "/projects/%s/groups" % p.get_id()
groups = p.manager.gitlab.http_get(path)