From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1577543-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 51BC7158013
	for <garchives@archives.gentoo.org>; Fri,  8 Dec 2023 18:38:06 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 8F9A92BC019;
	Fri,  8 Dec 2023 18:38:05 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 6FA3B2BC019
	for <gentoo-commits@lists.gentoo.org>; Fri,  8 Dec 2023 18:38:05 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 7136B33E02F
	for <gentoo-commits@lists.gentoo.org>; Fri,  8 Dec 2023 18:38:04 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id BE7D2146E
	for <gentoo-commits@lists.gentoo.org>; Fri,  8 Dec 2023 18:38:02 +0000 (UTC)
From: "Arthur Zamarin" <arthurzam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Arthur Zamarin" <arthurzam@gentoo.org>
Message-ID: <1702060362.26f4edff6c429ff7b0d6583683a1a1d1954817e1.arthurzam@gentoo>
Subject: [gentoo-commits] proj/pkgcore/pkgcheck:master commit in: src/pkgcheck/checks/
X-VCS-Repository: proj/pkgcore/pkgcheck
X-VCS-Files: src/pkgcheck/checks/metadata_xml.py
X-VCS-Directories: src/pkgcheck/checks/
X-VCS-Committer: arthurzam
X-VCS-Committer-Name: Arthur Zamarin
X-VCS-Revision: 26f4edff6c429ff7b0d6583683a1a1d1954817e1
X-VCS-Branch: master
Date: Fri,  8 Dec 2023 18:38:02 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 94388e1f-8b96-4145-8828-1634a66947ac
X-Archives-Hash: 12ccf153c92d22394f3cf8bb032525d6

commit:     26f4edff6c429ff7b0d6583683a1a1d1954817e1
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Mon Nov 27 10:04:35 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Dec  8 18:32:42 2023 +0000
URL:        https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=26f4edff

MissingRemoteId: expand gitlab matching rules

* Notably handles the particular case with gitlab package hosting.

Bug: https://github.com/pkgcore/pkgcheck/issues/636
Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Closes: https://github.com/pkgcore/pkgcheck/pull/637
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/pkgcheck/checks/metadata_xml.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/pkgcheck/checks/metadata_xml.py b/src/pkgcheck/checks/metadata_xml.py
index a3a7b643..fb574c0e 100644
--- a/src/pkgcheck/checks/metadata_xml.py
+++ b/src/pkgcheck/checks/metadata_xml.py
@@ -645,7 +645,9 @@ class MissingRemoteIdCheck(Check):
     _source = sources.PackageRepoSource
     known_results = frozenset([MissingRemoteId])
 
-    _gitlab_match = r"(?P<value>(\w[^/]*/)*\w[^/]*/\w[^/]*)"
+    # Exclude api groups and raw project names to conform with https://docs.gitlab.com/ee/user/reserved_names.html
+    # with the URI's which are most likely to end up in SRC_URI
+    _gitlab_match = r"(?P<value>((?!api/)\w[^/]*/)+(?!raw/)\w[^/]*)"
 
     remotes_map = (
         ("bitbucket", r"https://bitbucket.org/(?P<value>[^/]+/[^/]+)"),