Skip to content

fix(ci): handle crates.io propagation delays and already-exists as success#262

Merged
konard merged 4 commits into
mainfrom
issue-261-71e2fe0bd25b
Apr 13, 2026
Merged

fix(ci): handle crates.io propagation delays and already-exists as success#262
konard merged 4 commits into
mainfrom
issue-261-71e2fe0bd25b

Conversation

@konard
Copy link
Copy Markdown
Contributor

@konard konard commented Apr 13, 2026

Summary

Fixes #261 - The Rust CI/CD auto-release pipeline was successfully publishing to crates.io but then failing verification due to propagation delays, which prevented GitHub Release creation.

Root Cause

In CI run #24334488286, cargo publish succeeded on attempt 1, but the 5-second verification delay was insufficient for crates.io API propagation. The retry then got error: crate link-assistant-agent@0.9.2 already exists on crates.io index, which the script incorrectly treated as a failure (matching the generic error: pattern). This caused exit code 1, blocking GitHub Release creation.

Changes

  • scripts/publish-to-crates.mjs: Recognize "already exists" patterns as successful publish, increase verification delay from 5s to 15s with 3 retry attempts, trust cargo exit code 0 even if API verification times out
  • scripts/create-github-release.mjs: Handle "release already exists" gracefully (skip instead of fail)
  • .github/workflows/rust.yml: Decouple GitHub Release step from strict publish output — run if publish step succeeded OR output says published
  • Case study: Full timeline and root cause analysis in docs/case-studies/issue-261/
  • Test: Experiment script verifying "already exists" detection logic

Best Practices Applied

Referenced from rust-ai-driven-development-pipeline-template and mem-rs:

  • Treat "already exists" as success (following mem-rs graceful pattern)
  • Trust cargo publish exit code 0 as authoritative
  • Idempotent release creation (handle existing releases gracefully)
  • Verification with retries for crates.io propagation

Test plan

  • Experiment script experiments/test-publish-logic.mjs — all 6 test cases pass
  • CI workflow runs on this branch
  • Next push to main with Rust changes triggers successful auto-release

🤖 Generated with Claude Code

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #261
@konard konard self-assigned this Apr 13, 2026
…success

The Rust CI/CD auto-release pipeline was failing because:
1. cargo publish succeeded but crates.io API verification failed after only 5s
2. Retry got "already exists on crates.io index" which matched "error: " failure pattern
3. Script exited with error, blocking GitHub Release creation

Fixes:
- Recognize "already exists" patterns as successful publish (not failure)
- Increase verification delay from 5s to 15s with 3 retry attempts
- Trust cargo publish exit code 0 even if API verification times out
- Handle "release already exists" gracefully in create-github-release.mjs
- Decouple GitHub Release step from strict publish output dependency

Fixes #261

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard konard changed the title [WIP] Something wrong with CI/CD for Rust (no crates release, no GitHub release) fix(ci): handle crates.io propagation delays and already-exists as success Apr 13, 2026
@konard konard marked this pull request as ready for review April 13, 2026 10:01
@konard
Copy link
Copy Markdown
Contributor Author

konard commented Apr 13, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost: $2.965482

📊 Context and tokens usage:

Claude Opus 4.6:

  • Context window: 91.8K / 1M (9%) input tokens, 17.5K / 128K (14%) output tokens

Total: (82.1K + 3.4M cached) input tokens, 17.5K output tokens, $2.667077 cost

Claude Haiku 4.5:

Total: (118.7K + 965.5K cached) input tokens, 11.0K / 64K (17%) output tokens, $0.298405 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Main model: Claude Opus 4.6 (claude-opus-4-6)
  • Additional models:
    • Claude Haiku 4.5 (claude-haiku-4-5-20251001)

📎 Log file uploaded as Gist (2515KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented Apr 13, 2026

🔄 Auto-restart triggered (iteration 1)

Reason: CI failures detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. Will continue until PR becomes mergeable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard
Copy link
Copy Markdown
Contributor Author

konard commented Apr 13, 2026

🔄 Auto-restart-until-mergeable Log (iteration 1)

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost: $0.658482

📊 Context and tokens usage:

  • Context window: 43.8K / 1M (4%) input tokens, 3.2K / 128K (2%) output tokens

Total: (32.0K + 758.0K cached) input tokens, 3.2K output tokens, $0.658482 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.6 (claude-opus-4-6)

📎 Log file uploaded as Gist (4066KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented Apr 13, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard konard merged commit 3834853 into main Apr 13, 2026
16 checks passed
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.

Something wrong with CI/CD for Rust (no crates release, no GitHub release)

1 participant