public inbox for overseers@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@gnu.wildebeest.org>
To: overseers@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>
Subject: [PATCH] Add revlinks and documentation
Date: Tue,  3 May 2022 01:59:32 +0200	[thread overview]
Message-ID: <1651535972-19986-1-git-send-email-mark@gnu.wildebeest.org> (raw)

From: Mark Wielaard <mark@klomp.org>

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


                 reply	other threads:[~2022-05-02 23:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1651535972-19986-1-git-send-email-mark@gnu.wildebeest.org \
    --to=mark@gnu.wildebeest.org \
    --cc=mark@klomp.org \
    --cc=overseers@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).