From 5d0a0d1bce100403b0a415cdef78aec6fba85f3a Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Fri, 10 Jun 2022 10:56:59 -0700 Subject: docs(gerrit): document various things Change-Id: I79075be119258eb8ee28bf99f404480a646d2583 Reviewed-on: https://cl.fcuny.net/c/world/+/402 Tested-by: CI Reviewed-by: Franck Cuny --- docs/gerrit.org | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/docs/gerrit.org b/docs/gerrit.org index 1b48395..fa993c7 100644 --- a/docs/gerrit.org +++ b/docs/gerrit.org @@ -16,3 +16,62 @@ The file =/var/lib/gerrit/etc/secure.config= is not (yet) managed by nix. The fi [plugin "gerrit-oauth-provider-google-oauth"] client-secret = #+end_src +* Notes +The [[https://gerrit.googlesource.com/plugins/reviewnotes/][review notes]] plugin is enabled. The plugin stores into the notes the information about the reviews. + +When cloning the repo, run the following: +#+begin_src sh +git config --add remote.origin.fetch refs/notes/review:refs/notes/review +git fetch +#+end_src + +Then running =git log --show-notes=review= will show these notes. + +More information can be found at [[https://cl.fcuny.net/plugins/reviewnotes/Documentation/refs-notes-review.md][this URL]]. +* Repositories configuration +Gerrit stores information about repositories in a git repository. To get the configuration, run: +#+begin_src sh +git clone "https://fcuny@cl.fcuny.net/a/All-Projects" && (cd "All-Projects" && mkdir -p .git/hooks && cu +https://fcuny@cl.fcuny.net/tools/hooks/commit-msg; chmod +x `git rev-parse --git-dir`/hooks/commit-msg) +cd All-Projects +git fetch origin refs/meta/config:refs/remotes/origin/meta/config +git checkout meta/config +#+end_src + +Then the file =project.config= can be edited. +* Labels +** Verified +The label verified is typically used for CI. Relevant diffs to add the label: +#+begin_src diff +diff --git a/project.config b/project.config +index eb13426..9d504c7 100644 +--- a/project.config ++++ b/project.config +@@ -63,6 +63,11 @@ + value = 0 No score + value = +1 Looks good to me, but someone else must approve + value = +2 Looks good to me, approved ++[label "Verified"] ++ function = MaxWithBlock ++ value = -1 Fails ++ value = 0 No score ++ value = +1 Verified + [capability] + administrateServer = group Administrators + priority = batch group Service Users +#+end_src + +#+begin_src diff +diff --git a/project.config b/project.config +index 9d504c7..5f9352d 100644 +--- a/project.config ++++ b/project.config +@@ -26,6 +26,7 @@ + label-Code-Review = -2..+2 group Administrators + label-Code-Review = -2..+2 group Project Owners + label-Code-Review = -1..+1 group Registered Users ++ label-Verified = -1..+1 group Service Users + push = group Administrators + push = group Project Owners + read = group Anonymous Users +#+end_src -- cgit 1.4.1