From d99e8ed4738329f04ce89a018c544c785e6db129 Mon Sep 17 00:00:00 2001 From: Phil Prasek Date: Thu, 25 Jan 2024 08:58:09 -0800 Subject: [PATCH] fix rover error handling (#763) Signed-off-by: Phil Prasek --- .scripts/publish.sh | 10 +++++++++- .scripts/unpublish.sh | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.scripts/publish.sh b/.scripts/publish.sh index 4a2074289..bd6cf01ab 100755 --- a/.scripts/publish.sh +++ b/.scripts/publish.sh @@ -9,12 +9,20 @@ echo "=======================================" source "$(dirname $0)/subgraphs.sh" source "$(dirname $0)/graph-api-env.sh" + +# note: use --allow-invalid-routing-url to allow localhost without confirmation prompt + for subgraph in ${subgraphs[@]}; do echo "---------------------------------------" echo "subgraph: ${subgraph}" echo "---------------------------------------" url="url_$subgraph" schema="schema_$subgraph" - (set -x; ${ROVER_BIN:-'rover'} subgraph publish ${APOLLO_GRAPH_REF} --routing-url "${!url}" --schema "${!schema}" --name ${subgraph} --convert) + (set -x; ${ROVER_BIN:-'rover'} subgraph publish ${APOLLO_GRAPH_REF} \ + --routing-url "${!url}" \ + --schema "${!schema}" \ + --name ${subgraph} \ + --allow-invalid-routing-url \ + --convert) echo "" done diff --git a/.scripts/unpublish.sh b/.scripts/unpublish.sh index 3e7c254d9..e1bc40825 100755 --- a/.scripts/unpublish.sh +++ b/.scripts/unpublish.sh @@ -17,6 +17,10 @@ if grep -Eq 'error:(.+) Graph has no implementing services' unpublish.log; then echo "Success, all subgraphs removed!" rm unpublish.log exit 0 +elif grep -Eq 'error:(.+) invalid input syntax for uuid: ""' unpublish.log; then + echo "Success, no subgraphs found!" + rm unpublish.log + exit 0 else cat unpublish.log rm unpublish.log