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
28 changes: 13 additions & 15 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ ci_k8s_request() { # ci_k8s_request <workflow file>: start a CI k8s run of this
# that already has that region's label asks for a start too (see the needs_sandbox branch).
# Never fails the action.
#
# A regional label (`sandbox :australia:` from needs_sandbox:ap) passes its region, the
# A regional label (`sandbox :australia:` from needs_sandbox:ap) starts in its region, the
# needs_sandbox suffix (eu, ca, gov, uae, wu, ap). Which regions have a CI k8s sandbox is
# sandbox.yml's own list (its region input's options): it rejects any other (HTTP 422),
# which leaves the fleet's sandbox alone.
# which leaves the fleet's sandbox alone. stop_sandbox stops in every region at once (`all`).
sandbox_k8s_request() { # sandbox_k8s_request <start|stop> [region]: start or stop this PR's CI k8s sandbox
[[ "${SANDBOX_K8S_TRIGGER:-false}" == "true" ]] || return 0
local region="${2:-}" inputs ref
Expand Down Expand Up @@ -376,32 +376,25 @@ if [[ $comment_body == "stop_sandbox" ]]; then
case $label in
sandbox)
remove_label "sandbox"
sandbox_k8s_request stop
;;
"sandbox :eu:")
remove_label "sandbox%20:eu:"
sandbox_k8s_request stop eu
;;
"sandbox :maple_leaf:")
remove_label "sandbox%20:maple_leaf:"
sandbox_k8s_request stop ca
;;
"sandbox :classical_building:")
remove_label "sandbox%20:classical_building:"
sandbox_k8s_request stop gov
;;
"sandbox :united_arab_emirates:")
remove_label "sandbox%20:united_arab_emirates:"
sandbox_k8s_request stop uae
;;
remove_label "sandbox%20:united_arab_emirates:"
;;
"sandbox :us:")
remove_label "sandbox%20:us:"
sandbox_k8s_request stop wu
;;
remove_label "sandbox%20:us:"
;;
"sandbox :australia:")
remove_label "sandbox%20:australia:"
sandbox_k8s_request stop ap
;;
remove_label "sandbox%20:australia:"
;;
sandbox:${alternate_python_version})
remove_label "sandbox:${alternate_python_version}"
;;
Expand All @@ -428,4 +421,9 @@ if [[ $comment_body == "stop_sandbox" ]]; then
;;
esac
done
# The CI k8s sandbox is stopped in every region (sandbox.yml's region `all`), whatever labels
# were found above: a sandbox can be running with its label gone (removed by hand after its
# start was asked for), and those labels are the PR's when this run was created, not when the
# comment was posted. A region with nothing running is left as it is.
sandbox_k8s_request stop all
fi
Loading