[!TIP] One quirk is that the shortest possible pattern expansion must be a valid ref name
thus ^refs/heads/.*/name will fail because refs/heads//name is not a valid reference
but ^refs/heads/.+/name will work.
About the refs/for namespace
[!TIP] references:
refs/for/* syntax is just a short name for refs/for/refs/*:
project.config
[access "refs/for/refs/heads/main"]
push = block group user/Marslo Jiao (marslo)
push = block group Registered Users
submit = block group Registered Users
submit = block group group user/Marslo Jiao (marslo)
addPatchSet = block group user/Marslo Jiao (marslo)
addPatchSet = block group Registered Users
pushMerge = block group user/Marslo Jiao (marslo)
pushMerge = block group Registered Users
[project]
description = Gerrit Code Review
[access "refs/*"]
owner = group google/gerritcodereview-maintainers@googlegroups.com
[access "refs/heads/*"]
label-Code-Review = -2..+2 group google/gerritcodereview-maintainers@googlegroups.com
label-Code-Review = -2..+2 group polygerrit-maintainers
label-Verified = -1..+1 group Change Owner
label-Verified = -1..+1 group gerrit-verifiers
label-Code-Style = -1..+1 group gerrit-verifiers
label-Verified-Notedb = -1..+1 group gerrit-verifiers
label-Library-Compliance = -1..+1 group gerrit-lib
label-Library-Compliance = -1..+0 group google/gerritcodereview-maintainers@googlegroups.com
submit = group Change Owner
submit = group google/gerritcodereview-maintainers@googlegroups.com
create = group google/gerritcodereview-maintainers@googlegroups.com
abandon = group gerrit-verifiers
editTopicName = +force group google/gerritcodereview-maintainers@googlegroups.com
removeReviewer = group google/gerritcodereview-maintainers@googlegroups.com
publishDrafts = group google/gerritcodereview-maintainers@googlegroups.com
[access "refs/tags/*"]
create = group gerrit-release-creators
create = group google/gerritcodereview-maintainers@googlegroups.com
createTag = group gerrit-release-creators
createTag = group google/gerritcodereview-maintainers@googlegroups.com
createSignedTag = group gerrit-release-creators
createSignedTag = group google/gerritcodereview-maintainers@googlegroups.com
[access]
inheritFrom = Public-Projects
[receive]
rejectImplicitMerges = true
[reviewer]
enableByEmail = true
[label "Verified"]
function = MaxNoBlock
copyAllScoresIfNoCodeChange = true
value = -1 Fails
value = 0 No score
value = +1 Verified
defaultValue = 0
[label "Code-Style"]
function = MaxWithBlock
copyAllScoresIfNoCodeChange = true
value = -1 Wrong Style or Formatting
value = 0 No score
value = +1 Style Verified
defaultValue = 0
[label "Library-Compliance"]
function = MaxWithBlock
copyAllScoresIfNoCodeChange = true
copyAllScoresOnTrivialRebase = true
value = -1 Do not submit
value = 0 No score
value = +1 Approved
defaultValue = 0
[access "refs/for/refs/meta/dashboards/*"]
push = group google/gerritcodereview-maintainers@googlegroups.com
[access "refs/meta/dashboards/*"]
label-Code-Review = -2..+2 group google/gerritcodereview-maintainers@googlegroups.com
label-Code-Review = -1..+1 group Registered Users
label-Verified = -1..+1 group gerrit-verifiers
label-Verified = -1..+1 group google/gerritcodereview-maintainers@googlegroups.com
submit = group google/gerritcodereview-maintainers@googlegroups.com
forgeAuthor = group google/gerritcodereview-maintainers@googlegroups.com
label-Code-Style = -1..+1 group google/gerritcodereview-maintainers@googlegroups.com
[access "refs/for/refs/meta/config"]
push = group gerrit-verifiers
[notify "polygerrit-reviews"]
email = polygerrit-reviews@google.com
type = all_comments
type = submitted_changes
header = cc
filter = file:polygerrit-ui
[access "refs/heads/infra/config"]
push = group gerrit-tricium-admins
Code-Review 1+1=2
[!NOTE|label:references:]
[label "Code-Review"]
function = NoOp
copyMinScore = true
value = -2 This shall not be merged
value = -1 I would prefer this is not merged as is
value = 0 No score
value = +1 Looks good to me, but someone else must approve
value = +2 Looks good to me, approved
defaultValue = 0
[submit-requirement "Code-Review"]
submittableIf = (label:Code-Review=+1,count>=2 OR label:Code-Review=MAX) AND -label:Code-Review=MIN
optional label vote
[!NOTE|label:references:]
MaxWithBlock ( default )
AnyWithBlock
MaxNoBlock
NoOp / NoBlock
PatchSetLock
[label "Klocwork"]
function = NoOp
value = -1 Fails
value = 0 No score
value = +1 Success
defaultValue = 0
copyAllScoresIfNoCodeChange = true
sections
[!NOTE|label:references:]
[commentlink "changeid"]
match = (I[0-9a-f]{8,40})
link = "/q/$1"
[commentlink "bugzilla"]
match = "(^|\\s)(bug\\s+#?)(\\d+)($|\\s)"
link = http://bugs.example.com/show_bug.cgi?id=$3
prefix = $1
suffix = $4
text = $2$3
[commentlink "its-jira"]
match = ^[ \\t]*([A-Za-z]*-[0-9]{1,5}):
link = https://jira.domain.com/browse/$1
[submit-requirement "Code-Style"]
description = Code is properly styled and formatted
applicableIf = -branch:refs/meta/config
submittableIf = label:Code-Style=+1 AND -label:Code-Style=-1
canOverrideInChildProjects = true
or setup in label: LABEL
[label "Verified"]
branch = refs/heads/release/*
# same as
[submit-requirement "Verified"]
submittableIf = label:Verified=MAX AND -label:Verified=MIN
applicableIf = branch:^refs/heads/release/.*
complex rule
[!NOTE|label:references:]
[submit-requirement "Core-Library-Review"]
description = "SDK core library changes need to be approved for each platform or have a 'CoreLibraryReviewExempt: <reason>' footer. See also: https://github.com/dart-lang/sdk/wiki/Gerrit-Submit-Requirements#core-library-review"
applicableIf = NOT ownerin:bots AND NOT is:pure-revert AND path:\"^sdk/lib/[^_].*\\.dart$\"
submittableIf = hasfooter:CoreLibraryReviewExempt OR ((label:Code-Review=+1,group=mdb/dart-core-library-change-approvers-api OR ownerin:mdb/dart-core-library-change-approvers-api) AND (label:Code-Review=+1,group=mdb/dart-core-library-change-approvers-vm OR ownerin:mdb/dart-core-library-change-approvers-vm) AND (label:Code-Review=+1,group=mdb/dart-core-library-change-approvers-wasm OR ownerin:mdb/dart-core-library-change-approvers-wasm) AND (label:Code-Review=+1,group=mdb/dart-core-library-change-approvers-web OR ownerin:mdb/dart-core-library-change-approvers-web))
canOverrideInChildProjects = false
[submit-requirement "Code-Review"]
description = A maximum vote from a non-uploader is required for the \
'Code-Review' label. A minimum vote is blocking.
submittableIf = label:Code-Review=MAX,user=non_uploader AND -label:Code-Review=MIN
canOverrideInChildProjects = true
[label "Code-Review"]
function = NoBlock
value = -2 This shall not be submitted
value = -1 I would prefer this is not merged as is
value = 0 No score
value = +1 Looks good to me, but someone else must approve
value = +2 Looks good to me, approved
defaultValue = 0
[submit-requirement "Code-Review"]
description = At least one maximum vote for label 'Code-Review' is required
submittableIf = label:Code-Review=MAX,user=non_uploader AND -label:Code-Review=MIN
canOverrideInChildProjects = true
Autogenerated copy of review notes for all changes in the git. Each log entry on the refs/notes/review branch also references the patch set on which the review is made. This functionality is provided by the review-notes plugin.
[!NOTE] Warning: The current implementation takes into account that 'Build Current Patches Only' with 'Abort new patch sets' and 'Abort patch sets with same topic' are enabled (see help for more).