Skip to content
Merged
Show file tree
Hide file tree
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
32 changes: 19 additions & 13 deletions .github/workflows/release-xmemo-skill.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,24 +205,30 @@ jobs:
echo "Announcement accepted: HTTP $http_code"
break
;;
4*)
echo "Announcement rejected with HTTP $http_code; not retrying." >&2
000 | 408 | 429 | 5*)
# A transport failure, a timeout, a rate limit, or a server
# error can each succeed later, so these share the retry
# handling below.
: ;;
*)
# Any other answer will not become a 2xx on retry, so it is
# reported at once instead of retried until the step times out.
echo "Announcement rejected with HTTP ${http_code:-none}; not retrying." >&2
head -c 500 "$response_body" >&2 || true
echo >&2
exit 1
;;
*)
if [[ "$attempt" -ge "$max_attempts" ]]; then
echo "Announcement failed after $attempt attempts (last status: ${http_code:-none})." >&2
head -c 500 "$response_body" >&2 || true
echo >&2
exit 1
fi
echo "Announcement attempt $attempt failed (status: ${http_code:-none}); retrying." >&2
sleep "$((attempt * 3))"
attempt=$((attempt + 1))
;;
esac

if [[ "$attempt" -ge "$max_attempts" ]]; then
echo "Announcement failed after $attempt attempts (last status: ${http_code:-none})." >&2
head -c 500 "$response_body" >&2 || true
echo >&2
exit 1
fi
echo "Announcement attempt $attempt failed (status: ${http_code:-none}); retrying." >&2
sleep "$((attempt * 3))"
attempt=$((attempt + 1))
done

- name: Verify xmemo.dev serves this release
Expand Down
7 changes: 6 additions & 1 deletion test/release-workflow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ test('the Skill release announcement fails fast instead of retrying a rejection'
const workflow = await readFile(workflowPath, 'utf8');

assert.doesNotMatch(workflow, /--retry-all-errors/);
assert.match(workflow, /Announcement rejected with HTTP \$http_code; not retrying\./);
assert.match(workflow, /Announcement rejected with HTTP \$\{http_code:-none\}; not retrying\./);

// Retrying every error turned one rejection into four identical rejections
// followed by an opaque failure. Only answers that can plausibly change on a
// second attempt are retried.
assert.match(workflow, /000 \| 408 \| 429 \| 5\*\)/);
});

test('the Skill release is verified against the public endpoint before it is called done', async () => {
Expand Down
Loading