Skip to content

Commit

Permalink
MissingRemoteId: expand gitlab matching rules
Browse files Browse the repository at this point in the history
* Notably handles the particular case with gitlab package hosting.

Bug: #636
Signed-off-by: Alfred Wingate <parona@protonmail.com>
  • Loading branch information
parona-source committed Nov 27, 2023
1 parent d837ae2 commit be91dec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pkgcheck/checks/metadata_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,10 @@ class MissingRemoteIdCheck(Check):
_source = sources.PackageRepoSource
known_results = frozenset([MissingRemoteId])

_gitlab_match = r"(?P<value>(\w[^/]*/)*\w[^/]*/\w[^/]*)"
# https://docs.gitlab.com/ee/user/reserved_names.html
_gitlab_reserved_groups = [ "404.html", "422.html", "500.html", "502.html", "503.html", "admin", "api", "apple-touch-icon.png", "assets", "dashboard", "deploy.html", "explore", "favicon.ico", "favicon.png", "files", "groups", "health_check", "help", "import", "jwt", "login", "oauth", "profile", "projects", "public", "robots.txt", "s", "search", "sitemap", "sitemap.xml", "sitemap.xml.gz", "slash-command-logo.png", "snippets", "unsubscribes", "uploads", "users", "v2" ]
_gitlab_reserved_projects = [ "badges", "blame", "blob", "builds", "commits", "create", "create_dir", "edit", "environments/folders", "files", "find_file", "gitlab-lfs/objects", "info/lfs/objects", "new", "preview", "raw", "refs", "tree", "update", "wikis" ]
_gitlab_match = r"(?P<value>((?!{'|'.join(_gitlab_reserved_groups)}/)\w[^/]*/)+(?!{'|'.join(_gitlab_reserved_projects)}/)\w[^/]*)"

remotes_map = (
("bitbucket", r"https://bitbucket.org/(?P<value>[^/]+/[^/]+)"),
Expand Down

0 comments on commit be91dec

Please sign in to comment.