Questions tagged [python-gitlab]

The python-gitlab library is a Python library that provides bindings for interacting with GitLab, an open-source git repository manager that features multiple features such as issue tracking, wikis, and continuous integration features.

python-gitlab is a Python library that provides bindings for the GitLab API v4 for interacting with GitLab, an open-source git repository manager that features multiple features such as issue tracking, wikis, and continuous integration features.

See the python-gitlab repo on Github.

See read-the-docs

68 questions
1
vote
1 answer

Is there a way to get specific jobs by name of the last week with python-gitlab?

What I want to do: To create reports from gitlab artifacts, I want to look at all recent jobs (the past week or so) with a certain name (lighthouse in my example) and extract all artifacts. The problem: I got to a point where I can extract artifacts…
taube5
  • 11
  • 2
1
vote
1 answer

python-gitlab - how to modify project settings?

I'm writing a python module to create projects in gitlab, but I can't figure out how to change the default project settings, like remove_source_branch_after_merge. I've tried passing the argument to the projects.create() call, but it seems to be…
André Fernandes
  • 2,335
  • 3
  • 25
  • 33
1
vote
1 answer

GitLab Python Clone Everything with Structure

I want to clone all of the projects in my GitLab environment. There are a number of groups and subgroups with their own projects. I'd like to clone the projects while maintaining the structure of the groups locally. For example: Group1 Subgroup1 …
user3063045
  • 2,019
  • 2
  • 22
  • 35
1
vote
4 answers

Python Gitlab API - list shared projects of a group/subgroup

I need to find all projects and shared projects within a Gitlab group with subgroups. I managed to list the names of all projects like this: group = gl.groups.get(11111, lazy=True) # find all projects, also in…
Zozzoy
  • 63
  • 6
1
vote
1 answer

How to get all starred projects by a user from the Gitlab API

I want to get a list of all projects that a certain user on Gitlab has starred using the Gitlab API and Python (via python-gitlab). The documentation from python-gitlab on users does not mention starred projects. It may be a user activity, but the…
NoDataDumpNoContribution
  • 10,591
  • 9
  • 64
  • 104
1
vote
2 answers

How to update a protected branch in python-gitlab?

I am using python-gitlab to help configure projects. I'm trying to automate going into GitLab Settings > Repository > Protected branches, then for the existing master branch, changing "Allowed to merge" from "Maintainers" to "Developers +…
mbells
  • 3,668
  • 3
  • 22
  • 21
1
vote
1 answer

how to use python login GitLab through LDAP? (with version ce-8.1.4)

My code is below: domain = "https://git.mydomian.com" SIGN_IN_URL = '{domain}/users/sign_in'.format(domain=domain) LOGIN_URL = '{domain}/users/auth/ldapmain/callback'.format(domain=domain) session = requests.Session() session.verify =…
MigoL
  • 31
  • 4
1
vote
1 answer

Python-gitlab API V4

Does anyone know if Python-GitLab is still supported? I am trying to simply print the list of my project from GitLab but it doesn't work. Example: projects = gl.projects.list() for project in projects: print(project) I tried many things and it…
Tea Worth
  • 47
  • 2
  • 3
1
vote
0 answers

Can I get the image id of a docker image without building or pulling it from the repo?

I would like to get the images and image ids of a number of docker images (over 100+). I can't pull all these images on my local machine to fetch the image ids. Is there a way using docker api or python gitlab api this would be possible to do? I was…
1
vote
1 answer

python-gitlab how to get page source?

I have accessed a gitlab page using private_token. I now have a Gitlab object. >>> gl How can I retrieve the page source content of the page I'm currently on? I can't find anything in the documentation...…
Alichino
  • 1,668
  • 2
  • 16
  • 25
1
vote
0 answers

Is it possible to login to Gitlab using python-gitlab using username/email and password anymore?

I tried using the following code: import re import sys import requests import gitlab URL = 'https://gitlab.com' SIGN_IN_URL = 'https://gitlab.com/users/sign_in' LOGIN_URL = 'https://gitlab.com/users/sign_in' session =…
Saurav Saha
  • 745
  • 1
  • 11
  • 30
0
votes
0 answers

Python-gitlab Creating a project in a subgroup

My namespace structure is something like https://gitlab.com/ES/BSK/Projectx I'm trying to create a project under the BSK subgroup like projectx. Each time I try to create a project using the attribute "namespace_id" : "group_id" it ends creating the…
0
votes
0 answers

Get source from where the member's access has been inherited in a gitlab repo via python-gitlab module

Using python-gitlab module, I am able to get the list of members from a gitlab repo. Below is the example code for the same - #!/usr/bin/env python import gitlab from utils.secrets import gitlab_token import csv gl =…
Shobit Jain
  • 308
  • 2
  • 14
0
votes
1 answer

How to get discussion threads from merge request using python-gitlab on gitlab?

Using python-gitlab I succeed to retrieve notes from a merge request. For example, I get: "1444097483": {"id": 1444097483, "type": "DiffNote", "body": "rezrezrezr", "attachment": null, "author": {"id": 14931486, "username": "trap.francois", "name":…
mopfbm
  • 3
  • 2
0
votes
0 answers

How can a GitLab issue be promoted to an epic programmatically?

I am supporting a set of teams that have a large number of issues that need to be promoted to epics. I am working on a Python 3 script to do this using python-gitlab v3.14.0. However, i do not see a function offered for promoting an issue. (I do…
Mutagon
  • 47
  • 1
  • 7