Skip to content

Commit 6d87432

Browse files
committed
fix UPLOAD_ID parsing, remove debug logging and retry logic
1 parent 1a22bda commit 6d87432

File tree

1 file changed

+3
-38
lines changed

1 file changed

+3
-38
lines changed

step.sh

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -111,46 +111,11 @@ ${is_ignore_sha_check:+--ignore-sha-check} \
111111
echo "$OUTPUT"
112112

113113
# Extract upload ID from console URL
114-
UPLOAD_ID=$(echo "$OUTPUT" | grep -o 'https://console\.devicecloud\.dev/results?upload=[a-zA-Z0-9-]*' | cut -d= -f2)
114+
UPLOAD_ID=$(echo "$OUTPUT" | grep -o 'upload=[a-zA-Z0-9-]*' | cut -d= -f2 | head -n1)
115115

116116
if [ -n "$UPLOAD_ID" ]; then
117-
# Get test status using the status command with retries
118-
MAX_RETRIES=5
119-
RETRY_COUNT=0
120-
RETRY_DELAY=5
121-
122-
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
123-
echo "Fetching test status (attempt $((RETRY_COUNT + 1))/$MAX_RETRIES)..."
124-
echo "Running command: npx --yes \"$DCD_VERSION\" status --json --upload-id \"$UPLOAD_ID\" --api-key \"$api_key\" ${api_url:+--api-url \"$api_url\"}"
125-
STATUS_OUTPUT=$(npx --yes "$DCD_VERSION" status --json --upload-id "$UPLOAD_ID" --api-key "$api_key" ${api_url:+--api-url "$api_url"})
126-
STATUS_CODE=$?
127-
128-
echo "Status command exit code: $STATUS_CODE"
129-
echo "Status command output: $STATUS_OUTPUT"
130-
131-
if [ $STATUS_CODE -eq 0 ] && [ -n "$STATUS_OUTPUT" ]; then
132-
echo "Status command succeeded with valid output"
133-
break
134-
else
135-
if [ $STATUS_CODE -ne 0 ]; then
136-
echo "Status command failed with exit code $STATUS_CODE"
137-
fi
138-
if [ -z "$STATUS_OUTPUT" ]; then
139-
echo "Status command returned empty output"
140-
fi
141-
fi
142-
143-
RETRY_COUNT=$((RETRY_COUNT + 1))
144-
if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
145-
echo "Status not available yet, waiting ${RETRY_DELAY} seconds... ($RETRY_COUNT/$MAX_RETRIES attempts made)"
146-
sleep $RETRY_DELAY
147-
fi
148-
done
149-
150-
if [ -z "$STATUS_OUTPUT" ]; then
151-
echo "Error: Failed to get test status after $MAX_RETRIES attempts"
152-
exit 1
153-
fi
117+
# Get test status using the status command
118+
STATUS_OUTPUT=$(npx --yes "$DCD_VERSION" status --json --upload-id "$UPLOAD_ID" --api-key "$api_key" ${api_url:+--api-url "$api_url"})
154119

155120
# Extract values from status JSON using grep and sed
156121
# Console URL

0 commit comments

Comments
 (0)