Skip to content

fix(workspace): publish revisions under the push lock - #181

Open
PiquelChips wants to merge 1 commit into
fix/refuse-a-repository-with-a-remotefrom
fix/publish-revisions-under-the-push-lock
Open

PiquelChips wants to merge 1 commit into
fix/refuse-a-repository-with-a-remotefrom
fix/publish-revisions-under-the-push-lock

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

Before it publishes a rebase, the landing queue checks, under the push lock, that the head it rebases is still the change's only head. A workspace wrote revisions without taking that lock. So a revision evolving from the head (a describe, say) could be written between the queue's check and its rebase, and the change diverged.

Workspace::write now takes the push lock to publish a revision. While holding it, it refuses with "behind" (the error that already says to run origin pull) if the queue rebased a revision the new one evolves from since the command looked. Divergence that agents create on purpose, by revising the same revision, is still allowed. Only a successor of a revision the queue rebased is refused.

The new test holds the push lock as the queue would, starts origin describe, publishes a rebase of the head, then releases the lock. Without the fix, describe succeeds and the change has two heads. With it, describe waits for the lock, then refuses.

Part of #166.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 19466fab-b05f-42ff-b3fd-4a8d3fbbaebb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@PiquelChips
PiquelChips added this pull request to stack #185 November 22, 2026 20:21
@PiquelChips
PiquelChips removed this pull request from stack #185 November 22, 2026 20:22
The landing queue checks, under the push lock, that the head it rebases
is still its change's only one, then publishes the rebase. A workspace
wrote revisions without that lock, so one evolving from the head could
come in between, and the change diverged. The workspace now takes the
lock to publish a revision, and refuses, as behind its change, if the
queue rebased one the revision evolves from since the command looked.
@PiquelChips
PiquelChips force-pushed the fix/publish-revisions-under-the-push-lock branch from c4e7bcc to b957dc2 Compare November 22, 2026 20:22
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