Skip to content

fix(release): resume partial crates.io publishes with bounded rate-limit retries - #254

Open
dmtrKovalenko wants to merge 2 commits into
mainfrom
codex/resume-crates-io-releases
Open

dmtrKovalenko wants to merge 2 commits into
mainfrom
codex/resume-crates-io-releases

Conversation

@dmtrKovalenko

@dmtrKovalenko dmtrKovalenko commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

The v1.4.1 release run published five companion crates before crates.io returned HTTP 429 for fframes. A retry of the old script would fail on the first existing version.

The publisher now reads each package name from its manifest, checks the exact version on crates.io, and skips confirmed non-yanked versions. It retries Cargo 429 errors up to five attempts with exponential backoff and honors the server retry date. Registry lookups fail closed and retry transient errors. A post-error registry check handles uploads that succeeded despite Cargo reporting failure. Existing dependency order and Cargo index waiting remain intact.

Each Cargo invocation now has a 10-minute timeout. On timeout, captured output is retained and the exact registry version is checked before reporting failure; unconfirmed uploads are not retried automatically. Four additional tests cover timeout outcomes and output handling.

Adds Python 3.12 setup, an offline regression job required before release publishing, and recovery notes. npm and GitHub-release idempotency are outside this change.

Validation: 19 offline unittest tests passed, including the real eleven manifests/order with five versions already uploaded and a sixth-crate 429; bash syntax and git diff whitespace checks passed. just clippy was attempted but cannot run: this environment has neither Just nor Cargo. No crates were published and no release workflow was rerun.

Recovery caveat: rerunning the historical v1.4.1 workflow still uses the old tagged scripts. Recovery needs separate authorization to use the original release sources with this corrected publisher. Merging to main itself triggers the repository's existing nightly publication.

Evidence: https://github.com/dmtrKovalenko/fframes/actions/runs/41380690387/job/125070638849

Summary by CodeRabbit

  • Release Improvements
    • Crate publishing verifies the requested version, recognizes versions already on the registry, and retries certain temporary failures within set limits. Upload timeouts are checked against the registry before the release proceeds.
  • Documentation
    • Added guidance for recovering partial crate releases, including registry checks and limits on retrying an uncertain upload.
  • Tests
    • Added offline checks for crate-publishing behavior and release-script syntax, which run before the release job.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The release script now uses a Python helper to check crates.io before publishing each crate and to retry selected transient failures. The workflow runs offline publisher tests and a shell syntax check before release. The release guide documents helper behavior and partial-release recovery steps.

Changes: Crate release flow

Layer / File(s) Summary
Registry checks and publishing retries
scripts/publish_crate.py, scripts/test_publish_crate.py
The helper checks exact crate versions, skips confirmed non-yanked versions, and publishes versions that are absent. It retries registry network errors, HTTP 429 and 5xx responses, and Cargo HTTP 429 failures within defined limits. The tests cover registry responses, retry delays, publication outcomes, and error cases.
Shell integration and recovery instructions
scripts/publish.sh, scripts/RELEASING.md
The shell script delegates each crate’s publication to the helper. The release guide documents helper behavior, offline checks, partial-release recovery, and which release steps remain outside the resumable Rust publishing process.
Release workflow checks
.github/workflows/main.yml
A new job runs the publisher tests and checks shell syntax. The release job depends on this job and sets up Python 3.12.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant publish.sh
  participant publish_crate.py
  participant crates.io
  participant Cargo
  publish.sh->>publish_crate.py: pass manifest and version
  publish_crate.py->>crates.io: check exact crate version
  crates.io-->>publish_crate.py: return version status
  publish_crate.py->>Cargo: publish when version is absent
  Cargo-->>publish_crate.py: return publish result
  publish_crate.py->>crates.io: recheck after failed publish
Loading

Possibly related PRs

  • dmtrKovalenko/fframes#245: Adds fframes-dylib to the workspace release order and scripts/publish.sh, which this change updates to use the publishing helper.
Merge Risk: Minimal · up to 65ecc

The release can resume partial crate publication, and failures stop later release steps. No concrete merge-blocking risk remains established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: resuming partial crates.io publishes with bounded rate-limit retries.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 8 functions across 3 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5e396bcd-6728-48d3-8c5f-2aaba935875f
Commits

Reviewing files that changed from the base of the PR and between b387a2b and 65eccee.

Files selected for processing: 3
  • scripts/RELEASING.md
  • scripts/publish_crate.py
  • scripts/test_publish_crate.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://codex-resume-crates-io-releases-fframes.dmitriy-86d.workers.dev (commit 65eccee)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://84a688dd-fframes.dmitriy-86d.workers.dev 65eccee 2026-11-03T18:43:15.681Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://80cb15cb-fframes.dmitriy-86d.workers.dev b387a2b 2026-11-03T10:41:09.715Z Visit the dashboard ↗

@dmtrKovalenko
dmtrKovalenko marked this pull request as ready for review November 3, 2026 18:05

@coderabbitai coderabbitai 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.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread scripts/publish_crate.py Resolved
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