Skip to content
Snippets Groups Projects
Commit bbd7481f authored by Yannick DAYER's avatar Yannick DAYER
Browse files

[gitlab] Remove UserWarning for tags.list() method

parent 65e8d10f
No related branches found
No related tags found
1 merge request!304Fix the gitlab warning about list returning partial results
......@@ -60,7 +60,7 @@ def get_last_tag(package):
# according to the Gitlab API documentation, tags are sorted from the last
# updated to the first, by default - no need to do further sorting!
tag_list = package.tags.list()
tag_list = package.tags.list(page=1, per_page=1) # Silence userWarning on list()
if tag_list:
# there are tags, use these
......@@ -86,7 +86,7 @@ def get_last_tag_date(package):
# according to the Gitlab API documentation, tags are sorted from the last
# updated to the first, by default - no need to do further sorting!
tag_list = package.tags.list()
tag_list = package.tags.list(page=1, per_page=1) # Silence userWarning on list()
if tag_list:
# there are tags, use these
......@@ -235,7 +235,7 @@ def get_changes_since(gitpkg, since):
Parameters
----------
gitpkg : object
A gitlab pakcage object
A gitlab package object
since : object
A parsed date
......@@ -245,7 +245,7 @@ def get_changes_since(gitpkg, since):
mrs, tags, commits
"""
# get tags since release and sort them
tags = gitpkg.tags.list()
tags = gitpkg.tags.list(all=True)
# sort tags by date
tags = [k for k in tags if parse_date(k.commit["committed_date"]) >= since]
......
......@@ -21,7 +21,7 @@ def download_path(package, path, output=None, ref="master"):
"""Downloads paths from gitlab, with an optional recurse.
This method will download an archive of the repository from chosen
reference, and then it will search insize the zip blob for the path to be
reference, and then it will search inside the zip blob for the path to be
copied into output. It uses :py:class:`zipfile.ZipFile` to do this search.
This method will not be very efficient for larger repository references,
but works recursively by default.
......@@ -277,7 +277,7 @@ def update_files_with_mr(
files_dict: Dictionary of file names and their contents (as text)
message: Commit message
branch: The branch name to use for the merge request
automerge: If we should set the "merge if build suceeds" flag on the
automerge: If we should set the "merge if build succeeds" flag on the
created MR
dry_run: If True, nothing will be pushed to gitlab
user_id: The integer which numbers the user to attribute this MR to
......@@ -384,7 +384,7 @@ def get_last_pipeline(gitpkg):
gitpkg: gitlab package object
Returns: The gtilab object of the pipeline
Returns: The gitlab object of the pipeline
"""
# wait for 10 seconds to ensure that if a pipeline was just submitted,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment