Skip to content

Commit

Permalink
gitlab_release_notes/generate.py: Silence gitlab module warnings abou…
Browse files Browse the repository at this point in the history
…t how to use the list() method (get_all=True vs. get_all=False).
  • Loading branch information
sunweaver committed Jul 3, 2023
1 parent 2723c21 commit a7c9710
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gitlab_release_notes/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,20 @@ def generate_release_notes(project_id, endstr = ' <br>', **config):
gl = gitlab.Gitlab(**config)
project = gl.projects.get(project_id)

if not project.mergerequests.list(state='merged'):
if not project.mergerequests.list(get_all=False,state='merged'):
raise ValueError(f"There is not merged merge request for project {project_id} {project.name}")

if not project.releases.list():
if not project.releases.list(get_all=False):
log = f"Changelog of {project.name}:{endstr}"
last_date = '0000-01-01T00:00:00Z'
else:
last_release = project.releases.list()[0]
last_release = project.releases.list(get_all=False)[0]
log = f"Changelog since release {last_release.name} of {project.name}:{endstr}"
last_date = last_release.released_at

page = 1
list_mrs = project.mergerequests.list(state='merged',
get_all=False,
order_by='updated_at',
updated_after=last_date,
page=page)
Expand All @@ -57,6 +58,7 @@ def generate_release_notes(project_id, endstr = ' <br>', **config):

page += 1
list_mrs = project.mergerequests.list(state='merged',
get_all=False,
order_by='updated_at',
updated_after=last_date,
page=page
Expand Down

0 comments on commit a7c9710

Please sign in to comment.