From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id ADB7A3857815 for ; Mon, 2 May 2022 23:59:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ADB7A3857815 Received: by gnu.wildebeest.org (Postfix, from userid 1000) id DE6713000340; Tue, 3 May 2022 01:59:46 +0200 (CEST) From: Mark Wielaard To: overseers@sourceware.org Cc: Mark Wielaard Subject: [PATCH] Add revlinks and documentation Date: Tue, 3 May 2022 01:59:32 +0200 Message-Id: <1651535972-19986-1-git-send-email-mark@gnu.wildebeest.org> X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: overseers@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Overseers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2022 23:59:49 -0000 From: Mark Wielaard Note that only new changesets (after this commit) will get revlinks. Old changesets are already stored in the database without a revlink. --- README | 4 ++++ TODO | 3 --- builder/master.cfg | 29 ++++++++++++++++++++++++++++- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/README b/README index 3afc8f2..72779d1 100644 --- a/README +++ b/README @@ -11,6 +11,10 @@ htdocs: document root of https://builder.sourceware.org/ - Define a repourl to be used in the GitPoller and any Build Steps project_repourl = 'git://sourceware.org/git/project.git' + - If the repourl is "new" (not sourceware, gcc or wildebeest) + then add a revlink matches (at the end of master.cfg) so + changesets get an URL to the actual commit. + - Define a change source, e.g. a GitPoller and add it project_gitpoller = changes.GitPoller(repourl=project_repourl, branches=['main'], diff --git a/TODO b/TODO index fe82827..127edfd 100644 --- a/TODO +++ b/TODO @@ -27,9 +27,6 @@ https://docs.buildbot.net/current/manual/secretsmanagement.html - Prometheus Metrics: https://pypi.org/project/buildbot-prometheus/ -- Revlinks: -https://docs.buildbot.net/current/manual/configuration/global.html#revision-links - - Codebase generator: https://docs.buildbot.net/current/manual/configuration/global.html#codebase-generator diff --git a/builder/master.cfg b/builder/master.cfg index 864f4db..b0fa60a 100644 --- a/builder/master.cfg +++ b/builder/master.cfg @@ -202,7 +202,7 @@ debugedit_gitpoller = changes.GitPoller(repourl=debugedit_repourl, c['change_source'].append(debugedit_gitpoller) # Use a mirror to not hit github rate limiting -gccrust_repourl='https://code.wildebeest.org/git/mirror/gccrs/' +gccrust_repourl='https://code.wildebeest.org/git/mirror/gccrs' gccrust_gitpoller = changes.GitPoller(repourl=gccrust_repourl, branches=['master'], pollInterval=223, @@ -1787,3 +1787,30 @@ c['caches'] = { 'objectids' : 40, # number of object IDs 'usdicts' : 80, # number of rows from the users table } + +# revlinks +# http://docs.buildbot.net/current/manual/configuration/global.html#revision-links +# +sourcewareRevLink = util.RevlinkMatch( + repo_urls=[r'git://sourceware.org/git/(.*)', + r'https://sourceware.org/git/(.*)'], + revlink=r'https://sourceware.org/git?p=\1;a=commitdiff;h=%s') +gccRevLink = util.RevlinkMatch( + repo_urls=[r'git://gcc.gnu.org/git/(.*)', + r'https://gcc.gnu.org/git/(.*)'], + revlink=r'https://gcc.gnu.org/git?p=\1;a=commitdiff;h=%s') +wildebeestRevLink = util.RevlinkMatch( + repo_urls=[r'git://code.wildebeest.org/(.*).git', + r'https://code.wildebeest.org/git/(.*)'], + revlink=r'https://code.wildebeest.org/git/\1/commit/?id=%s') + +reflinks = [sourcewareRevLink, gccRevLink, wildebeestRevLink] + +def revlinkmultiplexer(rev,repo): + for revlink in reflinks: + url = revlink(rev, repo) + if url: + return url + return None + +c['revlink'] = revlinkmultiplexer -- 1.8.3.1