Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
1 vote
0 answers
66 views

I have a problem ! I work on gitlab UI on python. I try to connect to gitlab like this: import requests import gitlab GITLAB_URL = 'MY_GITLAB_URL' PERSONAL_TOKEN = 'MY_PERSONAL_TOKEN' PROXIES = {&...
coincoin22's user avatar
0 votes
0 answers
328 views

For a project I am trying to retrieve every commit and for each updated file, I want to store the entire file (without the commit syntax, just the vanilla file) and which lines were updated. I am ...
AnnemarieWittig's user avatar
1 vote
1 answer
334 views

with that code I can create an issue in GitLab with python-gitlab issue = project.issues.create({'title': title, 'description': description}) issue.labels = ['label1', 'label2'] issue....
user3732793's user avatar
  • 1,990
0 votes
1 answer
256 views

I'm trying to perform a basic task of getting the logged in users GitLab personal access token using the python-gitlab library. The documentation here is what I am using in the code below - https://...
Eric27710's user avatar
  • 147
0 votes
1 answer
453 views

Im working on a small project which uses python-gitlab on its version 3.13.0 The project has a mixture of 2.x.x and 3.x.x features that i've been fixing, but there are a few methods for branches that ...
jarscs's user avatar
  • 5
1 vote
1 answer
220 views

I'm writing some script for gitlab and i wanna get urls of projects in gitlab by using only project ID so i read all docs about library python-gitlab but couldn't find some attributes for it. this is ...
Khassan Kambarov's user avatar
0 votes
1 answer
391 views

I have a source repository in gitlab and by forking that I've created destination repository. Now if in the source repository new commits are pushed I want to copy those commits in the destination ...
Chitrangda Pandya's user avatar
0 votes
1 answer
185 views

I have written a Python program using FastAPI and the python-gitlab library (https://python-gitlab.readthedocs.io/en/stable/ ) to provide the developer role on the GitLab project repository to the ...
vinod827's user avatar
  • 1,574
0 votes
1 answer
2k views

I have written a small Python code to get the Storage usage of a GitLab repository. However when I run my code then I get this 403 Forbidden error. This repo, say test_repo_1 is under a test_group_1. ...
vinod827's user avatar
  • 1,574
0 votes
1 answer
310 views

I use python-gitlab API call ProjectJob.trace (https://python-gitlab.readthedocs.io/en/stable/api/gitlab.v4.html#gitlab.v4.objects.ProjectJob.trace) to get the log of a GitlabCI pipeline Terraform job....
YAZ84's user avatar
  • 89
0 votes
0 answers
30 views

I am trying to push a jpg picture to a gitlab repo with python-gitlab. My code looks like gl = gitlab.Gitlab(GITLAB_URL, PRIVATE_TOKEN) project = gl.projects.get(PROJECT_ID) with open(file_path, 'rb')...
Limone's user avatar
  • 101
0 votes
2 answers
464 views

with python-gitlab I can create and update merge requests in GitLab. However there is not much documentation on how to tick the "Delete source branch" I tried with mr.attributes['...
user3732793's user avatar
  • 1,990
0 votes
1 answer
1k views

I am trying to create GitLab projects through GitLab CI pipeline by importing the GitLab export tar.gz file using python-gitlab library. The new project gets created but does not get initialized with ...
Ashmeet Pahwa's user avatar
0 votes
1 answer
315 views

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 ...
Ahmed Sayed Mousse's user avatar
0 votes
1 answer
1k views

Using python-gitlab I succeed to retrieve notes from a merge request. For example, I get: "1444097483": {"id": 1444097483, "type": "DiffNote", "body":...
mopfbm's user avatar
  • 3
0 votes
0 answers
463 views

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 ...
Mutagon's user avatar
  • 47
2 votes
1 answer
411 views

I am trying to mock the return value of the following method import gitlab from unittest.mock import patch def get_all_iters(): gl = gitlab.Gitlab(url='test_url', private_token) result = gl....
Song Tùng's user avatar
2 votes
0 answers
236 views

I have several files stored on my repository. Some are stored via LFS. I want to check that the file I am handling is stored via LFS without downloading it using python-gitlab. Is it possible to do so?...
vvvvv's user avatar
  • 32.9k
0 votes
1 answer
968 views

I know how to get to (some) attributes of runners setup for a gitlab project. I need though to list the tags each runner defines? Below is as far as I have gone. gl = gitlab.Gitlab(url=<my-gitlab-...
minice's user avatar
  • 81
0 votes
1 answer
532 views

Using python Gitlab API, how to list merge requests filtered by some attributes ? For instance, using curl I can use attributes in my request like ?author_username=MY_NAME&source_branch=MY_BRANCH. ...
flod's user avatar
  • 265
1 vote
0 answers
716 views

I want to identify all public repositories in Gitlab with a specific condition. For example, I want to identify all Java projects that has "AndoridManifest.xml" file and contains the word &...
Safwat's user avatar
  • 11
0 votes
1 answer
235 views

I try to request the number of stars and commits of a public software repository in GitLab using its Python client. However, I keep getting GitlabHttpError 503 if executing the following script. ...
Jimmy Zhao's user avatar
1 vote
0 answers
652 views

So I'm creating projects and deleting them by python script using the gitlab python API. That part is working. But a colleague started adding some avatars to some of my autoprojects that I found ...
J. Hein's user avatar
  • 21
1 vote
1 answer
1k views

I have been trying to make a git commit using gitlab python module and this code works fine when executed from main - private_token = "xxxxxx" gl = gitlab.Gitlab('https://gitlab.xyz.net/', ...
Sn_Srm's user avatar
  • 101
0 votes
1 answer
2k views

I have a python script where I have created an output file as an excel table. Now I would like to add/upload this file to my Gitlab project repository directly by using python-gitlab library. I have ...
OliAK's user avatar
  • 73
2 votes
1 answer
2k views

I am using Gitlab v4 api to list a project's variables, while the code returns vars for some projects, it also returns 403 forbidden response for some other projects. And the error is not very verbose ...
blackPanther's user avatar
0 votes
1 answer
451 views

I'm attempting to following the API example here, but it fails because apparently there is no ProjectReleaseManager on my project. >>> gl.api_version '4' >>> gl_project = gl.projects....
Edward Moyse's user avatar
0 votes
1 answer
1k views

I am attempting to use python-gitlab to create a script that automates the creation of branches. However, when I try to connect and get a specific group, I get the error: Exception has occurred: ...
web1connoisseur's user avatar
1 vote
1 answer
513 views

Im creating MR with python-gitlab. After creation i need to check for mr_conflicts and pipeline state. project = gl.projects.get(PROJECT_ID, lazy=False) create_mr = project.mergerequests.create({'id': ...
Dim's user avatar
  • 13
0 votes
1 answer
2k views

I want to retrieve all members in a project irrespective of their role. According to this documentation (https://docs.gitlab.com/ee/api/members.html) If i use this API : GET /projects/:id/members I ...
Nikil Lepcha's user avatar
0 votes
1 answer
815 views

In my python program, I am trying to dynamically set user credentials - GIT config for GIT. Repo.config_writer().set_value("user", "name", "username").release() Repo....
Kamal Baldawa's user avatar
1 vote
1 answer
545 views

In the previous version of Python-GitLab after creating the project and adding a user as a developer, we have been using: # Unprotect master branch = project.branches.get('master') branch.unprotect() ...
BlackWoxs's user avatar
2 votes
1 answer
2k views

I am trying to create a mock object of gitlab.v4.objects.ProjectCommit to perform integration tests between a tool I am developing with python-gitlab api. In order to create a ProjectCommit mock ...
farch's user avatar
  • 511
0 votes
2 answers
2k views

import gitlab gl = gitlab.Gitlab('http://gitlab.mycompany', private_token=access_token) gl.auth() projects = gl.projects.list() pres = projects[0] for project in projects: if 'myprojectname' in ...
Huy Le's user avatar
  • 1,979
1 vote
1 answer
4k views

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 ...
taube5's user avatar
  • 11
0 votes
1 answer
1k views

I want to find out who / what user pushed an image to the Gitlab Container registry. Optimally by using the gitlab-python package. When using the gitlab-python package I was able to get the object '...
Moritz's user avatar
  • 497
1 vote
1 answer
2k views

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 ...
André Fernandes's user avatar
0 votes
1 answer
827 views

Hi does anyone know if there is a way to get http status codes with python-gitlab? Or is there a way to use requests with python-gitlab to get the status codes? Like how in the requests library you ...
AllUser's user avatar
  • 13
2 votes
1 answer
5k views

We are trying to get the commits of each file in a Gitlab repository. We are using the Python Gitlab module. We could get the commits of a repository but couldn't get the commits of individual files ...
Shiny S U's user avatar
0 votes
1 answer
770 views

Need to pull information about metadata changes from the project in the git (there is a local copy), namely: The number of commits per file (code, metadata) for 2 weeks on a certain branch on the ...
Miekrif's user avatar
  • 85
1 vote
1 answer
5k views

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 ...
user3063045's user avatar
  • 2,219
0 votes
1 answer
276 views

I have a GitLab API (v4) that I need to call to get a project sub-directory (something apparently new in v.14.4, it seems not yet included python-gitlab libs), which in curl can be done with the ...
xCovelus's user avatar
  • 738
1 vote
1 answer
700 views

I'm creating a separate app for users to visualize GitLab issues without needing access to GitLab. We are using python-gitlab to retrieve the issue data for display on this separate site. Users will ...
Kellen's user avatar
  • 318
0 votes
3 answers
197 views

I am trying to extract the specific details like authored_date from the attribute which I am getting with help of python. What is my end goal: I want to extract the specific branches which are named ...
Sameer Atharkar's user avatar
0 votes
1 answer
1k views

I am extreme beginner in writing python scripts as I am learning it currently. I am writing a code where I am going to extract the branches which I have which are named something like ...
Sameer Atharkar's user avatar
2 votes
1 answer
3k views

I'm tasked with migrating repos to gitlab and I decided to automate the process using python-gitlab. Everything works fine except for binary or considered-binary files like compiled object files ( .o )...
Rad226's user avatar
  • 97
1 vote
4 answers
5k views

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 ...
Zozzoy's user avatar
  • 63
0 votes
1 answer
3k views

We are building an automation process using python in which we clone a base source code repository and add necessary changes to it and add the new code to a new git repository and push it to our ...
Sriram Arvind Lakshmanakumar's user avatar
1 vote
1 answer
1k views

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 ...
NoDataDumpNoContribution's user avatar
0 votes
2 answers
917 views

I'm trying to add a gitlab group to a project after the project is created. I can see in the Gitlab API documentation that it's possible to invite a MEMBER to a group to or a project (https://docs....
Martin Cronje's user avatar