Verified Commit 879e7955 authored by Agate's avatar Agate 💬

Tmeporary script to launch import

parent d3b43e90
Pipeline #2205 failed with stages
in 27 seconds
from contributions.sources import gitlab
def retrieve_issues(gitlab_url, project_id):
base_url = f"{gitlab_url}/api/v4/projects/{project_id}/issues"
url = f"{base_url}?per_page=100"
next_page = url
while next_page:
issues, next_page = gitlab.retrieve_issue_page(next_page)
for i in issues:
i["_links"] = {"self": f"{base_url}/{i['iid']}"}
yield i
gitlab_url = ""
project_id = 17
project_name = "funkwhale/funkwhale"
for i, issue in enumerate(retrieve_issues(gitlab_url, project_id)):
print("Importing issue in database", issue["iid"], issue["title"])
gitlab.import_issue_as_contribution(issue, project_name)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment