Fixes for info votes 01/15201/3
authorAric Gardner <agardner@linuxfoundation.org>
Thu, 4 Apr 2019 19:56:01 +0000 (15:56 -0400)
committerAric Gardner <agardner@linuxfoundation.org>
Mon, 8 Apr 2019 19:44:12 +0000 (15:44 -0400)
gerrit trigger is not working in opnfv.
we had this happen to some of the read the docs jobs...
An updgrade of gerrit is planned to hopefully resolve this.

Not sure were to test to approval category stuff.
That said I think the mistake is that the value is an int.

            approval-category: 'WHATEVER'
            approval-value: 2

I dont actually want the script to exit on first error, need to output
the vote verdict.

not sure why I thought that JENKINS_SSH_CREDENTIAL
was the correct var for the ssh user.
switched to $USER

Change-Id: I6714361423948eb1764e9c18da699dafd4cd24a9
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
jjb/lf-info-vote.yaml
releasenotes/notes/lf-info-vote-74329a41dfea62be.yaml
shell/check-info-votes.sh

index 012400f..3c421aa 100644 (file)
     gerrit_verify_triggers:
       - comment-added-contains-event:
           comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(vote)$'
-      - comment-added:
+      - comment-added-event:
           approval-category: 'CRVW'
-          approval-value: '+2'
+          approval-value: 2
       - comment-added:
           approval-category: 'Code-Review'
-          approval-value: '+2'
+          approval-value: 2
 
     #####################
     # Job Configuration #
index e94e31d..0b7a963 100644 (file)
@@ -2,6 +2,6 @@
 features:
   - |
     New ``info-vote-verify`` macro
-    Will count votes against an INFO.yaml change and sumbit
-    automatically if a majority of committers and tsc mebers
-    vote +1 or +2 on the change.
+    Will count votes against an INFO.yaml change and sumbit automatically
+    if a majority of committers vote +1 or +2 on the change.
+    Job is triggered by +2 votes or a comment of "vote"
index 892dd89..72dec3b 100644 (file)
@@ -9,7 +9,7 @@
 # http://www.eclipse.org/legal/epl-v10.html
 ##############################################################################
 echo "---> check-info-votes.sh"
-set -xe -o pipefail
+set -u unset
 
 ref=$(echo "$GERRIT_REFSPEC" | awk -F"/" '{ print $4 }')
 pip="pip3"
@@ -45,5 +45,5 @@ if [[ "$exit_status" -ne 0 ]]; then
   exit "$exit_status"
 else
   echo "Vote completed submitting review"
-  ssh -p "$GERRIT_PORT" "$JENKINS_SSH_CREDENTIAL"@"$GERRIT_HOST" gerrit review "$change" --submit
+  ssh -p "$GERRIT_PORT" "$USER"@"$GERRIT_HOST" gerrit review "$change" --submit
 fi