From b0963776f16d1cc0be86e445b1ab29e497dd0216 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 16 Mar 2023 13:36:26 +1100 Subject: [PATCH] gerrit/acl : check for capital booleans in normalize We got caught out with this in All-Projects; let's just make sure we keep capital booleans everywhere for consistency. Change-Id: I7a1e528c620c07ecbb2def3d743ab4bba46a20df --- tools/normalize_acl.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/normalize_acl.py b/tools/normalize_acl.py index 775ddea523..d59ac5c297 100755 --- a/tools/normalize_acl.py +++ b/tools/normalize_acl.py @@ -247,6 +247,17 @@ if '9' in transformations: if value != 'NoBlock': newsection.append( '# XXX: The only supported function type is NoBlock') + + # Gerrit 3.6 takes lower-case "and/or" literally -- as in + # you literally need to have and/or in the commit string. + # Gerrit 3.7 fixes this, but let's standarise on capital + # booleans + if key in ('copyCondition', 'submittableIf', 'applicableIf'): + value = value.replace(' and ', ' AND ') + value = value.replace(' or ', ' OR ') + newsection.append("%s = %s" % (key, value)) + continue + newsection.append(option) acl[section] = newsection acl.update(missing_sr)