-
Notifications
You must be signed in to change notification settings - Fork 955
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation of GitLab statistics (#15931)
* Initial implementation of GitLab statistics Issue: #12789 Signed-off-by: Yuri Konotopov <[email protected]> * project-data: fixed Gitlab's repository icon * csp: limit Gitlab urls to /api/ * gitlab: use "starrers" term instead of "stargazers" and "followers" * gitlab: `MR` abbreviation revealed * gitlab: log errors to console instead of hiding them completely --------- Signed-off-by: Yuri Konotopov <[email protected]>
- Loading branch information
Showing
9 changed files
with
338 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -977,6 +977,52 @@ def test_verified_github_open_issueo_info_url_is_none_without_verified_url( | |
release = DBReleaseFactory.create() | ||
assert release.verified_github_open_issue_info_url is None | ||
|
||
@pytest.mark.parametrize( | ||
("url", "expected"), | ||
[ | ||
( | ||
"https://gitlab.com/someuser/someproject", | ||
"someuser/someproject", | ||
), | ||
( | ||
"https://gitlab.com/someuser/someproject/", | ||
"someuser/someproject", | ||
), | ||
( | ||
"https://gitlab.com/someuser/someproject/-/tree/stable-9", | ||
"someuser/someproject", | ||
), | ||
( | ||
"https://www.gitlab.com/someuser/someproject", | ||
"someuser/someproject", | ||
), | ||
("https://gitlab.com/someuser/", None), | ||
("https://google.com/pypi/warehouse/tree/main", None), | ||
("https://google.com", None), | ||
("incorrect url", None), | ||
( | ||
"https://gitlab.com/someuser/someproject.git", | ||
"someuser/someproject", | ||
), | ||
( | ||
"https://www.gitlab.com/someuser/someproject.git/", | ||
"someuser/someproject", | ||
), | ||
("[email protected]:definex/dsgnutils.git", None), | ||
], | ||
) | ||
def test_verified_gitlab_repository(self, db_session, url, expected): | ||
release = DBReleaseFactory.create() | ||
release.project_urls["Homepage"] = {"url": url, "verified": True} | ||
assert release.verified_gitlab_repository == expected | ||
|
||
def test_verified_gitlab_repository_is_none_without_verified_url( | ||
self, | ||
db_session, | ||
): | ||
release = DBReleaseFactory.create() | ||
assert release.verified_gitlab_repository is None | ||
|
||
def test_trusted_published_none(self, db_session): | ||
release = DBReleaseFactory.create() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.