Merge "feat(Gerrit) Adding Verified Label functionality"

This commit is contained in:
Zuul 2021-02-16 21:21:38 +00:00 committed by Gerrit Code Review
commit 0cef6abcbe
4 changed files with 51 additions and 0 deletions

View File

@ -41,6 +41,21 @@ spec:
"finished": "$(date --utc '+%F %T.%N')"
}
EOF
curl \
--netrc-file /run/jarvis/gerrit-netrc \
--fail \
--insecure \
-L \
-H "Content-Type: application/json; charset=UTF-8" \
$(params.repoRoot)/a/changes/$(params.changeNumber)/revisions/$(params.patchSetNumber)/review/ \
--data-binary @- << EOF
{
"labels": {
"Verified": "-1"
}
}
EOF
volumes:
- name: gerrit-netrc
secret:

View File

@ -46,6 +46,21 @@ spec:
"message": "Jarvis has started to process the run for change #$(params.changeNumber) ps #$(params.patchSetNumber) to the $(params.project) repo"
}
EOF
curl \
--netrc-file /run/jarvis/gerrit-netrc \
--fail \
--insecure \
-L \
-H "Content-Type: application/json; charset=UTF-8" \
$(params.repoRoot)/a/changes/$(params.changeNumber)/revisions/$(params.patchSetNumber)/review/ \
--data-binary @- << EOF
{
"labels": {
"Verified": "0"
}
}
EOF
volumes:
- name: gerrit-netrc
secret:

View File

@ -40,6 +40,21 @@ spec:
"message": "Jarvis has successfully processed the run for change #$(params.changeNumber) ps #$(params.patchSetNumber) to the $(params.project) repo"
}
EOF
curl \
--netrc-file /run/jarvis/gerrit-netrc \
--fail \
--insecure \
-L \
-H "Content-Type: application/json; charset=UTF-8" \
$(params.repoRoot)/a/changes/$(params.changeNumber)/revisions/$(params.patchSetNumber)/review/ \
--data-binary @- << EOF
{
"labels": {
"Verified": "+1"
}
}
EOF
volumes:
- name: gerrit-netrc
secret:

View File

@ -68,4 +68,10 @@ EOF
exit 1
fi
done
# Ensure that the patch set has been labelled `Verified` by the Jarvis System
VERIFIED="$(curl -L https://gerrit.jarvis.local/changes/${change_id}/revisions/1/review/ | tail -1 | jq -r .labels.Verified.all[0].value)"
if [ "$VERIFIED" -ne 1 ]; then
exit 1
fi
done