Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/evergreen/retry-evergreen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [ -z "${EVERGREEN_API_KEY}" ]; then
fi

EVERGREEN_API="https://evergreen.mongodb.com/api"
MAX_RETRIES="${EVERGREEN_MAX_RETRIES:-3}"
Copy link
Collaborator Author

@Julien-Ben Julien-Ben Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had this env variable set to 2 in the Evergreen project settings, for some reason it was not picked up by the script, so I just left an hardcoded value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to have it inside an include_expansions_in_env block for the task?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, do we think we need an env variable for that ?

MAX_RETRIES=1

# Define build variants to exclude
# We ignore openshift because they only run one test at a time.
Expand All @@ -49,7 +49,7 @@ BUILD_IDS=($(curl -s -H "Api-User: ${EVERGREEN_USER}" -H "Api-Key: ${EVERGREEN_A
for BUILD_ID in "${BUILD_IDS[@]}"; do
echo "Finding failed tasks in BUILD ID: ${BUILD_ID}"
# shellcheck disable=SC2207
TASK_IDS=($(curl -s -H "Api-User: ${EVERGREEN_USER}" -H "Api-Key: ${EVERGREEN_API_KEY}" ${EVERGREEN_API}/rest/v2/builds/"${BUILD_ID}"/tasks | jq ".[] | select(.status == \"failed\" and .execution <= ${MAX_RETRIES})" | jq -r '.task_id'))
TASK_IDS=($(curl -s -H "Api-User: ${EVERGREEN_USER}" -H "Api-Key: ${EVERGREEN_API_KEY}" ${EVERGREEN_API}/rest/v2/builds/"${BUILD_ID}"/tasks | jq ".[] | select(.status == \"failed\" and .execution < ${MAX_RETRIES})" | jq -r '.task_id'))
Copy link
Collaborator Author

@Julien-Ben Julien-Ben Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.execution is the id from the last failing task. Executions are 0-indexed


for TASK_ID in "${TASK_IDS[@]}"; do
echo "Retriggering TASK ID: ${TASK_ID}"
Expand Down
Loading