Skip to content

fix(ci): handle git push race condition in Rust CI/CD release#260

Merged
konard merged 5 commits into
mainfrom
issue-259-c0df50994403
Apr 13, 2026
Merged

fix(ci): handle git push race condition in Rust CI/CD release#260
konard merged 5 commits into
mainfrom
issue-259-c0df50994403

Conversation

@konard
Copy link
Copy Markdown
Contributor

@konard konard commented Apr 13, 2026

Summary

Fixes #259

The Rust CI/CD auto-release pipeline was failing when merging PRs to main because the JS CI/CD pipeline would push a version commit concurrently, causing a non-fast-forward rejection.

Root Causes (from CI log analysis)

  1. Git push race condition (CI run 24331934514): rust-version-and-commit.mjs did a plain git push without pulling remote changes first. When the JS release job pushed to main concurrently, the Rust push was rejected.

  2. CARGO_REGISTRY_TOKEN not set (CI run 24328743522): Previously fixed in commit f675128 by adding CARGO_TOKEN fallback.

Changes

  • scripts/rust-version-and-commit.mjs: Added git fetch origin main + rebase before committing, and push retry loop (up to 3 attempts) with git pull --rebase on failure
  • .github/workflows/rust.yml: Added concurrency: { group: release-main, cancel-in-progress: false } to auto-release and manual-release jobs
  • .github/workflows/js.yml: Added same concurrency group to release and instant-release jobs
  • docs/case-studies/issue-259/: Case study with timeline, root cause analysis, and template comparison
  • Changelog fragments: Added for both Rust and JS changes

Template Repo Issue Filed

The same race condition bug exists in the template: link-foundation/rust-ai-driven-development-pipeline-template#31

Test plan

  • Scripts parse without errors (node --check)
  • Working tree is clean
  • CI passes on this PR branch
  • After merge, verify auto-release job succeeds on main (when both Rust and JS pipelines trigger)

🤖 Generated with Claude Code

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

Issue: #259
@konard konard self-assigned this Apr 13, 2026
konard and others added 2 commits April 13, 2026 08:04
The Rust auto-release job was failing with "non-fast-forward" rejection
when the JS CI/CD pipeline pushed a version commit to main concurrently.

Changes:
- Add fetch/rebase before committing in rust-version-and-commit.mjs
- Add push retry with pull --rebase on failure (up to 3 attempts)
- Add shared concurrency group (release-main) across Rust and JS
  release jobs to serialize pushes to main

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Case study with timeline, root cause analysis, and template comparison
- CI logs preserved for reference
- Changelog fragments for both Rust and JS changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard konard changed the title [WIP] Version bump for Rust CI/CD not working fix(ci): handle git push race condition in Rust CI/CD release Apr 13, 2026
@konard konard marked this pull request as ready for review April 13, 2026 08:07
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@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: $4.732787

📊 Context and tokens usage:

Claude Opus 4.6:

  • Context window: 104.9K / 1M (10%) input tokens, 20.2K / 128K (16%) output tokens

Total: (93.2K + 6.6M cached) input tokens, 20.2K output tokens, $4.389263 cost

Claude Haiku 4.5:

Total: (99.5K + 1.7M cached) input tokens, 10.0K / 64K (16%) output tokens, $0.343524 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 (3308KB)


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 17d23c7 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.

Version bump for Rust CI/CD not working

1 participant