diff options
author | Vratko Polak <vrpolak@cisco.com> | 2020-06-17 12:36:01 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2020-06-17 12:36:01 +0000 |
commit | 5803a44153a0b430741e6534afa3faba8e76c11d (patch) | |
tree | c128b561414e6811df48a514019ebb4947ff647f /jjb | |
parent | c4620aeefea7ef32cccde3ed5d1060d17d1190d0 (diff) | |
parent | e04cb57e6a3808dd59bf2c28792ed513360bc930 (diff) |
Merge "vpp-checkstyle-verify-{stream}: add the step to API check"
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/scripts/vpp/api-checkstyle.sh | 30 | ||||
-rw-r--r-- | jjb/vpp/vpp.yaml | 9 |
2 files changed, 39 insertions, 0 deletions
diff --git a/jjb/scripts/vpp/api-checkstyle.sh b/jjb/scripts/vpp/api-checkstyle.sh new file mode 100644 index 00000000..90740337 --- /dev/null +++ b/jjb/scripts/vpp/api-checkstyle.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +VPP_CRC_CHECKER="extras/scripts/crcchecker.py" +VPP_CRC_CHECKER_CMD="$VPP_CRC_CHECKER --check-patchset" + +send_notify() { + # 'roomId' field from the response of: + # curl https://api.ciscospark.com/v1/memberships -H "Authorization: Bearer ${SECRET_WEBEX_TEAMS_ACCESS_TOKEN}" + WEBEX_TEAMS_ROOM_ID='Y2lzY29zcGFyazovL3VzL1JPT00vMzUzZmI3OTAtYTVjNS0xMWVhLWI4ZjYtMDUxN2I4NzFmOWU5' + curl https://api.ciscospark.com/v1/messages -X POST -H "Authorization: Bearer ${SECRET_WEBEX_TEAMS_ACCESS_TOKEN}" -H "Content-Type: application/json" --data '{"roomId":"'${WEBEX_TEAMS_ROOM_ID}'", "markdown": "'"${WEBEX_TEAMS_MESSAGE}"'" }' || true +} + +if [ -f $VPP_CRC_CHECKER ]; then + echo "Running $VPP_CRC_CHECKER_CMD" + if $VPP_CRC_CHECKER_CMD; then + echo "API check successful" + + # for now - notify the same room during the monitoring period about the successes as well + WEBEX_TEAMS_MESSAGE="API check successful for $GERRIT_REFSPEC - see $BUILD_URL" + send_notify + else + RET_CODE=$? + echo "API check failed: ret code $RET_CODE; please read https://wiki.fd.io/view/VPP/ApiChangeProcess and discuss with ayourtch@gmail.com if unsure how to proceed" + WEBEX_TEAMS_MESSAGE="API check FAILED for $GERRIT_REFSPEC - see $BUILD_URL" + send_notify + exit $RET_CODE + fi +else + echo "Cannot find $VPP_CRC_CHECKER - skipping API compatibility check" +fi diff --git a/jjb/vpp/vpp.yaml b/jjb/vpp/vpp.yaml index 216ec400..dacd6850 100644 --- a/jjb/vpp/vpp.yaml +++ b/jjb/vpp/vpp.yaml @@ -531,6 +531,7 @@ os: '{os}' - repo-name-parameter: repo-name: '{repo-stream-part}.ubuntu.bionic.main' + - gerrit-refspec-parameter scm: - gerrit-trigger-scm: @@ -541,6 +542,11 @@ wrappers: - fdio-infra-wrappers: build-timeout: '{build-timeout}' + - credentials-binding: + - text: + credential-id: VppApiCompatNotify + variable: SECRET_WEBEX_TEAMS_ACCESS_TOKEN + triggers: - gerrit: @@ -602,6 +608,9 @@ - ../scripts/vpp/test-checkstyle.sh - shell: !include-raw-escape: + - ../scripts/vpp/api-checkstyle.sh + - shell: + !include-raw-escape: - ../scripts/vpp/commitmsg.sh publishers: |