Skip to content

fix(autopublish): rebase before push so chained release jobs don't race - #184

Merged
thedavidmeister merged 1 commit into
mainfrom
2026-05-26-autopublish-push-race
May 26, 2026
Merged

thedavidmeister merged 1 commit into
mainfrom
2026-05-26-autopublish-push-race

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented May 26, 2026 •

Copy link
Copy Markdown
Contributor

Repos with multiple crates wire several rainix-autopublish callers chained via needs: (e.g. rain.metadata's bindings → metaboard). Each job checks out main at the workflow-trigger sha, so once an earlier job pushes its version-bump commit, the next job's git push is rejected non-fast-forward.

Observed in rain.metadata#120: rain-metadata-bindings published but rain-metaboard-subgraph failed at the push step every time.

Since the jobs are sequential (needs:), the fix is to fetch + rebase our bump onto the latest main before tagging/pushing. The only file both bumps touch is the shared Cargo.lock; if that's the sole conflict, regenerate it deterministically and continue. Tags are created after the rebase so they point at the final commit shas.

Closes rainlanguage/rain.metadata#120 (once consumers pick up @main).

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

No user-facing changes. This release contains internal workflow infrastructure updates to improve build reliability and consistency. These changes are not visible to end-users and do not affect product functionality.

Review Change Stack

Repos with multiple crates wire several rainix-autopublish callers chained
via needs:. Each job checks out main at the workflow-trigger sha, so once an
earlier job pushes its version-bump commit, the next job's push is rejected
non-fast-forward (observed: rain-metaboard-subgraph never published while
rain-metadata-bindings did). Since the jobs are sequential, fetch + rebase our
bump onto the latest main before tagging/pushing; regenerate the shared
Cargo.lock if it is the only conflict.

Refs rainlanguage/rain.metadata#120

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this May 26, 2026
@coderabbitai

coderabbitai Bot commented May 26, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The PR enhances the CI/CD autopublish workflow to handle concurrent publish attempts across multiple crates. The Tag and push step now fetches the remote branch state, rebases the current branch, and automatically resolves Cargo.lock conflicts by regenerating it deterministically before completing the rebase and pushing tags.

Changes

Autopublish rebase and conflict handling

Layer / File(s) Summary
Tag and push rebase workflow with Cargo.lock conflict resolution
.github/workflows/rainix-autopublish.yaml
The Tag and push step now explicitly fetches origin, rebases onto origin/${{ github.ref_name }}, and implements error handling that regenerates Cargo.lock via cargo generate-lockfile when rebase conflicts occur, then continues the rebase before creating and pushing tags. Comments explain the multi-crate sequential workflow behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

🐰 A rabbit hops through merge conflicts with care,
Regenerating locks from the midnight air,
Rebase, then push, in sequential grace,
No race condition can win this chase! 🏃‍♂️✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly describes the main change: adding a rebase step before push to prevent race conditions in chained release jobs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-05-26-autopublish-push-race

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@thedavidmeister
thedavidmeister merged commit 1516b8f into main May 26, 2026
12 of 13 checks passed
@github-actions

Copy link
Copy Markdown

@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment:

S/M/L PR Classification Guidelines:

This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed.

Small (S)

Characteristics:

  • Simple bug fixes, typos, or minor refactoring
  • Single-purpose changes affecting 1-2 files
  • Documentation updates
  • Configuration tweaks
  • Changes that require minimal context to review

Review Effort: Would have taken 5-10 minutes

Examples:

  • Fix typo in variable name
  • Update README with new instructions
  • Adjust configuration values
  • Simple one-line bug fixes
  • Import statement cleanup

Medium (M)

Characteristics:

  • Feature additions or enhancements
  • Refactoring that touches multiple files but maintains existing behavior
  • Breaking changes with backward compatibility
  • Changes requiring some domain knowledge to review

Review Effort: Would have taken 15-30 minutes

Examples:

  • Add new feature or component
  • Refactor common utility functions
  • Update dependencies with minor breaking changes
  • Add new component with tests
  • Performance optimizations
  • More complex bug fixes

Large (L)

Characteristics:

  • Major feature implementations
  • Breaking changes or API redesigns
  • Complex refactoring across multiple modules
  • New architectural patterns or significant design changes
  • Changes requiring deep context and multiple review rounds

Review Effort: Would have taken 45+ minutes

Examples:

  • Complete new feature with frontend/backend changes
  • Protocol upgrades or breaking changes
  • Major architectural refactoring
  • Framework or technology upgrades

Additional Factors to Consider

When deciding between sizes, also consider:

  • Test coverage impact: More comprehensive test changes lean toward larger classification
  • Risk level: Changes to critical systems bump up a size category
  • Team familiarity: Novel patterns or technologies increase complexity

Notes:

  • the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR
  • the assessment output must be exactly one of: S, M or L (single-line comment) in format of: SIZE={S/M/L}
  • do not include any additional text, only the size classification
  • your assessment comment must not include tips or additional sections
  • do NOT tag me or anyone else on your comment

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.

Package Release: sequential autopublish jobs race on git push to main

1 participant