Skip to content
Snippets Groups Projects
Verified Commit c803fc2b authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

Allow gitlab lister's name to be overriden by task arguments

This will allow to dedicate the heptapod instances into its their own stats.

Related to T3581
parent fdb42023
No related branches found
Tags v1.8.0
1 merge request!239Allow gitlab lister's name to be overriden by task arguments
......@@ -97,16 +97,17 @@ class GitLabLister(Lister[GitLabListerState, PageResult]):
"""
LISTER_NAME = "gitlab"
def __init__(
self,
scheduler,
url: str,
name: Optional[str] = "gitlab",
instance: Optional[str] = None,
credentials: Optional[CredentialsType] = None,
incremental: bool = False,
):
if name is not None:
self.LISTER_NAME = name
super().__init__(
scheduler=scheduler,
url=url.rstrip("/"),
......
......@@ -57,11 +57,16 @@ def test_lister_gitlab(datadir, swh_scheduler, requests_mock):
def test_lister_gitlab_heptapod(datadir, swh_scheduler, requests_mock):
"""Gitlab lister ignores some vcs_type
"""Heptapod lister happily lists hg, hg_git as hg and git origins
"""
name = "heptapod"
instance = "foss.heptapod.net"
lister = GitLabLister(swh_scheduler, url=api_url(instance), instance=instance)
lister = GitLabLister(
swh_scheduler, url=api_url(instance), name=name, instance=instance
)
assert lister.LISTER_NAME == name
response = gitlab_page_response(datadir, instance, 1)
requests_mock.get(
......
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