diff --git a/swh/lister/sourceforge/lister.py b/swh/lister/sourceforge/lister.py --- a/swh/lister/sourceforge/lister.py +++ b/swh/lister/sourceforge/lister.py @@ -90,7 +90,7 @@ # `project`: Project name, e.g. `seedai`. Can be a subproject, e.g `backapps/website`. # `mount_point`: url path used by the repo. For example, the Code::Blocks project uses # `git` (https://git.code.sf.net/p/codeblocks/git). -CLONE_URL_FORMAT = "{vcs}.code.sf.net/{namespace}/{project}/{mount_point}" +CLONE_URL_FORMAT = "https://{vcs}.code.sf.net/{namespace}/{project}/{mount_point}" PROJ_URL_RE = re.compile( r"^https://sourceforge.net/(?P[^/]+)/(?P[^/]+)/(?P.*)?" diff --git a/swh/lister/sourceforge/tests/test_lister.py b/swh/lister/sourceforge/tests/test_lister.py --- a/swh/lister/sourceforge/tests/test_lister.py +++ b/swh/lister/sourceforge/tests/test_lister.py @@ -68,15 +68,15 @@ scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).results res = {o.url: (o.visit_type, str(o.last_update.date())) for o in scheduler_origins} assert res == { - "svn.code.sf.net/p/backapps/website/code": ("svn", "2021-02-11"), - "git.code.sf.net/p/os3dmodels/git": ("git", "2017-03-31"), - "svn.code.sf.net/p/os3dmodels/svn": ("svn", "2017-03-31"), - "git.code.sf.net/p/mramm/files": ("git", "2019-04-04"), - "git.code.sf.net/p/mramm/git": ("git", "2019-04-04"), - "svn.code.sf.net/p/mramm/svn": ("svn", "2019-04-04"), - "git.code.sf.net/p/mojunk/git": ("git", "2017-12-31"), - "git.code.sf.net/p/mojunk/git2": ("git", "2017-12-31"), - "svn.code.sf.net/p/mojunk/svn": ("svn", "2017-12-31"), + "https://svn.code.sf.net/p/backapps/website/code": ("svn", "2021-02-11"), + "https://git.code.sf.net/p/os3dmodels/git": ("git", "2017-03-31"), + "https://svn.code.sf.net/p/os3dmodels/svn": ("svn", "2017-03-31"), + "https://git.code.sf.net/p/mramm/files": ("git", "2019-04-04"), + "https://git.code.sf.net/p/mramm/git": ("git", "2019-04-04"), + "https://svn.code.sf.net/p/mramm/svn": ("svn", "2019-04-04"), + "https://git.code.sf.net/p/mojunk/git": ("git", "2017-12-31"), + "https://git.code.sf.net/p/mojunk/git2": ("git", "2017-12-31"), + "https://svn.code.sf.net/p/mojunk/svn": ("svn", "2017-12-31"), } @@ -177,57 +177,57 @@ ListedOrigin( lister_id=lister.lister_obj.id, visit_type="git", - url="git.code.sf.net/p/mramm/files", + url="https://git.code.sf.net/p/mramm/files", last_update=iso8601.parse_date("2019-01-01"), ), ListedOrigin( lister_id=lister.lister_obj.id, visit_type="git", - url="git.code.sf.net/p/mramm/git", + url="https://git.code.sf.net/p/mramm/git", last_update=iso8601.parse_date("2019-01-01"), ), ListedOrigin( lister_id=lister.lister_obj.id, visit_type="svn", - url="svn.code.sf.net/p/mramm/svn", + url="https://svn.code.sf.net/p/mramm/svn", last_update=iso8601.parse_date("2019-01-01"), ), # stayed the same, even though its subsitemap has changed ListedOrigin( lister_id=lister.lister_obj.id, visit_type="git", - url="git.code.sf.net/p/os3dmodels/git", + url="https://git.code.sf.net/p/os3dmodels/git", last_update=iso8601.parse_date("2017-03-31"), ), ListedOrigin( lister_id=lister.lister_obj.id, visit_type="svn", - url="svn.code.sf.net/p/os3dmodels/svn", + url="https://svn.code.sf.net/p/os3dmodels/svn", last_update=iso8601.parse_date("2017-03-31"), ), # others: stayed the same, should be skipped ListedOrigin( lister_id=lister.lister_obj.id, visit_type="git", - url="git.code.sf.net/p/mojunk/git", + url="https://git.code.sf.net/p/mojunk/git", last_update=iso8601.parse_date("2017-12-31"), ), ListedOrigin( lister_id=lister.lister_obj.id, visit_type="git", - url="git.code.sf.net/p/mojunk/git2", + url="https://git.code.sf.net/p/mojunk/git2", last_update=iso8601.parse_date("2017-12-31"), ), ListedOrigin( lister_id=lister.lister_obj.id, visit_type="svn", - url="svn.code.sf.net/p/mojunk/svn", + url="https://svn.code.sf.net/p/mojunk/svn", last_update=iso8601.parse_date("2017-12-31"), ), ListedOrigin( lister_id=lister.lister_obj.id, visit_type="svn", - url="svn.code.sf.net/p/backapps/website/code", + url="https://svn.code.sf.net/p/backapps/website/code", last_update=iso8601.parse_date("2021-02-11"), ), ] @@ -315,15 +315,15 @@ scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).results assert {o.url: o.visit_type for o in scheduler_origins} == { - "svn.code.sf.net/p/backapps/website/code": "svn", - "git.code.sf.net/p/os3dmodels/git": "git", - "svn.code.sf.net/p/os3dmodels/svn": "svn", - "git.code.sf.net/p/mramm/files": "git", - "git.code.sf.net/p/mramm/git": "git", - "svn.code.sf.net/p/mramm/svn": "svn", - "git.code.sf.net/p/mojunk/git": "git", - "git.code.sf.net/p/mojunk/git2": "git", - "svn.code.sf.net/p/mojunk/svn": "svn", + "https://svn.code.sf.net/p/backapps/website/code": "svn", + "https://git.code.sf.net/p/os3dmodels/git": "git", + "https://svn.code.sf.net/p/os3dmodels/svn": "svn", + "https://git.code.sf.net/p/mramm/files": "git", + "https://git.code.sf.net/p/mramm/git": "git", + "https://svn.code.sf.net/p/mramm/svn": "svn", + "https://git.code.sf.net/p/mojunk/git": "git", + "https://git.code.sf.net/p/mojunk/git2": "git", + "https://svn.code.sf.net/p/mojunk/svn": "svn", } # Test `time.sleep` is called with exponential retries @@ -399,10 +399,10 @@ res = {o.url: (o.visit_type, str(o.last_update.date())) for o in scheduler_origins} # Ensure no `mramm` origins are listed, but all others are. assert res == { - "svn.code.sf.net/p/backapps/website/code": ("svn", "2021-02-11"), - "git.code.sf.net/p/os3dmodels/git": ("git", "2017-03-31"), - "svn.code.sf.net/p/os3dmodels/svn": ("svn", "2017-03-31"), - "git.code.sf.net/p/mojunk/git": ("git", "2017-12-31"), - "git.code.sf.net/p/mojunk/git2": ("git", "2017-12-31"), - "svn.code.sf.net/p/mojunk/svn": ("svn", "2017-12-31"), + "https://svn.code.sf.net/p/backapps/website/code": ("svn", "2021-02-11"), + "https://git.code.sf.net/p/os3dmodels/git": ("git", "2017-03-31"), + "https://svn.code.sf.net/p/os3dmodels/svn": ("svn", "2017-03-31"), + "https://git.code.sf.net/p/mojunk/git": ("git", "2017-12-31"), + "https://git.code.sf.net/p/mojunk/git2": ("git", "2017-12-31"), + "https://svn.code.sf.net/p/mojunk/svn": ("svn", "2017-12-31"), }