Skip to content

ci(crates-io): make publish idempotent so it can resume after a partial failure - #49

Merged
mstuart merged 1 commit into
mainfrom
ci/idempotent-crates-publish
Aug 25, 2026
Merged

ci(crates-io): make publish idempotent so it can resume after a partial failure#49
mstuart merged 1 commit into
mainfrom
ci/idempotent-crates-publish

Conversation

@mstuart

@mstuart mstuart commented Aug 25, 2026

Copy link
Copy Markdown
Owner

The publish step ran a flat sequence of cargo publish commands. When crates.io rate-limited a new-crate publish partway through (the Aug 23 v0.2.0 release — tare-tokenize/cache/core/memory/cli published, then tare-proxy hit the new-crate rate limit and tare-mcp never ran), any re-run failed on the already-published crates.

This loops over the crates in dependency order and skips any whose current version is already on crates.io, so the workflow is safe to re-run to resume. Once merged, a workflow_dispatch will finish publishing tare-proxy and tare-mcp.

…al failure

The publish step ran a flat sequence of cargo publish commands. When
crates.io rate-limited a new-crate publish partway through, the already-
published crates made any re-run fail on duplicate versions. Loop over the
crates in dependency order and skip any whose current version is already on
crates.io, so the workflow is safe to re-run and resume.
@mstuart
mstuart merged commit 2eca2a3 into main Aug 25, 2026
7 checks passed
@mstuart
mstuart deleted the ci/idempotent-crates-publish branch August 25, 2026 19:30

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 219f7a5a9c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +42 to +43
curl -sf "https://crates.io/api/v1/crates/${crate}/${version}" \
-H "User-Agent: tare-ci-publish" >/dev/null 2>&1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Distinguish missing versions from API failures

When crates.io returns 429/5xx or the lookup encounters a network failure—a relevant scenario because this workflow is intended to recover from rate limiting—curl -sf exits nonzero and the if treats that exactly like a 404. The loop then attempts to publish an already-published crate and fails on the duplicate, defeating the promised resumability. As curl --help all documents, --fail fails on HTTP errors generally; capture the status and publish only on 404, while retrying or failing explicitly for other errors.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant