summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYves Duhem <yves.duhem@mongodb.com>2018-06-01 17:40:24 -0400
committerYves Duhem <yves.duhem@mongodb.com>2018-07-11 15:53:22 -0400
commitcb2858e0bf0a95ee91536d4b1463ea46a64b8ec2 (patch)
tree32df190c2341d028571e88960afea956bcf0e379
parentbfcb5e357a55139042c560bee5e400c2674a811d (diff)
downloadmongo-cb2858e0bf0a95ee91536d4b1463ea46a64b8ec2.tar.gz
SERVER-34793 Add call to BF Suggestion server on task failure
(cherry picked from commit 2a86ca0c461b64144e274ec00dd36d3c860e2141)
-rw-r--r--etc/evergreen.yml25
1 files changed, 25 insertions, 0 deletions
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index 28972bc957e..fd27b1c45fe 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -161,6 +161,30 @@ functions:
build_phase='${task_name}_${execution}'
END_OF_CREDS
+ "call BF Suggestion service":
+ command: shell.exec
+ params:
+ working_dir: src
+ silent: true
+ script: |
+ report_file="report.json"
+ # Check if the report file exists and has failures.
+ if [ -f $report_file ] && grep -Eq "\"failures\": [1-9]" $report_file; then
+ # Calling the BF Suggestion server endpoint to start feature extraction.
+ payload="{\"task_id\": \"${task_id}\", \"execution\": ${execution}}"
+ echo "Sending task info to the BF suggestion service"
+ # The --user option is passed through stdin to avoid showing in process list.
+ user_option="--user ${bfsuggestion_user}:${bfsuggestion_password}"
+ curl --header "Content-Type: application/json" \
+ --data "$payload" \
+ --max-time 10 \
+ --silent \
+ --show-error \
+ --config - \
+ https://bfsuggestion.corp.mongodb.com/tasks <<< $user_option
+ echo "Request to BF Suggestion service status: $?"
+ fi
+
"upload debugsymbols" :
command: s3.put
params:
@@ -486,6 +510,7 @@ post:
- command: attach.results
params:
file_location: src/report.json
+ - func: "call BF Suggestion service"
- command: shell.exec
params:
silent: true