From 8f9b1f2c9c81f2bf8df178b62270e27a8158308a Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Fri, 20 Oct 2023 14:04:18 -0700 Subject: [PATCH] Convert commentlinks to new no html system Gerrit 3.8 drops support for html in commentlinks entirely. Gerrit 3.7 supports both html and the new non html system. Update our 3.7 installation to the new system on 3.7 so that we are ready for the Gerrit 3.8 upgrade later. Most of our comment links did not use html entries so we drop the html lines entirely. A single commentlink does use html and there we convert it to the new prefix, link, text, suffix system. More details can be found here: https://gerrit.googlesource.com/gerrit/+/refs/tags/v3.8.2/tools/migration/html_to_link_commentlink.md This should be a 1:1 mapping for our config and not change any behavior. Change-Id: I0b87aac7b90814d242338be8fd03cfc9a76200f7 --- playbooks/roles/gerrit/templates/gerrit.config.j2 | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/playbooks/roles/gerrit/templates/gerrit.config.j2 b/playbooks/roles/gerrit/templates/gerrit.config.j2 index bd311ad57b..e3a53216bd 100644 --- a/playbooks/roles/gerrit/templates/gerrit.config.j2 +++ b/playbooks/roles/gerrit/templates/gerrit.config.j2 @@ -99,35 +99,30 @@ [commentlink "bugheader"] match = "([Cc]loses|[Pp]artial|[Rr]elated)-[Bb]ug:\\s*#?(\\d+)" link = https://launchpad.net/bugs/$2 - html = [commentlink "bug"] match = "\\b[Bb]ug:? #?(\\d+)" link = https://launchpad.net/bugs/$1 - html = [commentlink "story"] match = "\\b[Ss]tory:? #?(\\d+)" link = "{{ gerrit_storyboard_url }}/#!/story/$1" - html = [commentlink "task"] match = "\\b[Tt]ask:? #?(\\d+)" link = "{{ gerrit_storyboard_url }}/#!/task/$1" - html = [commentlink "its-storyboard"] match = "\\b[Tt]ask:? #?(\\d+)" link = task: $1 - html = [commentlink "blueprint"] match = "(\\b[Bb]lue[Pp]rint\\b|\\b[Bb][Pp]\\b)[ \\t#:]*([A-Za-z0-9\\-]+)" link = https://blueprints.launchpad.net/openstack/?searchtext=$2 - html = [commentlink "changeid"] match = (I[0-9a-f]{8,40}) link = "/#/q/$1" - html = [commentlink "gitsha"] match = "(

|[\\s(])([0-9a-f]{40})(

|[\\s.,;:)])" - link = - html = "$1$2$3" + link = "/#/q/$2" + prefix = $1 + text = $2 + suffix = $3 [its-storyboard] url = {{ gerrit_storyboard_url }} [trackingid "launchpad-bug"]