Skip to content

[WIP] When multiple pipelines run in parallel against the same repo, they crea - #291

Closed
bamdadd wants to merge 1 commit into
mainfrom
lintel/fix/9944cc35-when-multiple-pipelines-run-in-parallel
Closed

[WIP] When multiple pipelines run in parallel against the same repo, they crea#291
bamdadd wants to merge 1 commit into
mainfrom
lintel/fix/9944cc35-when-multiple-pipelines-run-in-parallel

Conversation

@bamdadd

@bamdadd bamdadd commented Apr 7, 2026

Copy link
Copy Markdown
Owner

⚠️ This is a draft PR created by Lintel after a pipeline failure.
The automated workflow could not complete successfully. An engineer should review the changes, fix any issues, and mark the PR as ready.

Summary

Resolve parallel pipeline repo conflicts by adding a rebase_node before raise_pr (with needs_rebase re-queue on conflict), serialising per-repo execution via PostgreSQL advisory locks, storing repo lock state in pipeline metadata, and propagating all new statuses/events through contracts, projections, and the settings API.

Changes

  • Add contracts: needs_rebase status, new events, rebase_branch Protocol method
  • Implement rebase_branch in GitHub repo adapter with typed conflict error
  • Add repo-scoped advisory lock helper to coordination package
  • Add repo_concurrency_limit setting to settings API
  • Update pipeline store to support repo_id queries, needs_rebase status, and repo_lock metadata
  • Add rebase_node to LangGraph workflow and wire graph edges
  • Update projections to handle PipelineNeedsRebase and PipelineRequeued events
  • Write tests for contracts, repos rebase, coordination lock, pipelines-api store changes
  • Write tests for rebase_node workflow and end-to-end conflict resolution flow

Context

When multiple pipelines run in parallel against the same repo, they create branches from the same base. The second PR to merge will have conflicts with the first. This causes silent failures or broken PRs.

Implementation:

  1. Before raise_pr stage, rebase the working branch on latest main and re-run tests
  2. If rebase conflicts, mark the pipeline as needs_rebase and re-queue it
  3. Add an optional per-repo concurrency limit (default 1) so pipelines targeting the same repo are serialised
  4. Store repo lock state in the pipeline metadata so the executor can check before starting implement

Raised by Lintel 🤖

@bamdadd
bamdadd force-pushed the lintel/fix/9944cc35-when-multiple-pipelines-run-in-parallel branch from 30bb155 to 2a4b3e6 Compare April 7, 2026 17:27
@bamdadd

bamdadd commented Apr 7, 2026

Copy link
Copy Markdown
Owner Author

Closing stub PR — implement stage failed, will retry with fix.

@bamdadd bamdadd closed this Apr 7, 2026
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