-
Notifications
You must be signed in to change notification settings - Fork 2
[1/N] doc(runway): add workflow RFC for runway domain #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+80
−0
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8a06001
doc(runway): add workflow RFC for runway domain
kevinlnew 86929ac
fix(rfc): clean up workflow diagram box-drawing characters
kevinlnew 612b77d
docs(rfc): revise runway workflow to match existing RFC style
kevinlnew 7d0e00a
docs(rfc): update runway workflow for landed queue contract
kevinlnew 511ca6b
docs(rfc): add promote (ff-only push) operation to runway workflow
kevinlnew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # Runway Workflow | ||
|
|
||
| Runway is the landing service: it owns VCS operations — mergeability checking and landing — on behalf of SubmitQueue. The orchestrator subscribes to two inbound topics (`merge-conflict-checker`, `merger`) and publishes results to two outbound topics (`merge-conflict-checker-signal`, `merger-signal`). It is a consumer-only service with no gateway; work arrives via topic queues and results leave via topic queues. | ||
|
|
||
| ## Merge-conflict check and merge | ||
|
|
||
| The two queues operate at different granularities: | ||
|
|
||
| - **merge-conflict-check** is request-level. A merge request carries an ordered sequence of steps (changes + merge strategy). Runway performs a read-only trial merge and publishes per-step mergeability results back. | ||
|
|
||
| - **merge** is batch-level. A merge request carries the same payload but Runway commits the result and reports the revisions it produced (per-step output IDs). | ||
|
|
||
| A third operation — **promote** — pushes a commit to a ref as-is (`--ff-only`). The primary use case is forwarding a landed SHA from `main` to `verified/main` without creating a new merge commit. Promote reuses the merge queue with the `PROMOTE` merge strategy; Runway fast-forwards the target ref and reports the same SHA back as the output ID. | ||
|
|
||
| These are independent input-output flows. A merge-conflict check can run without a merge ever running, and a merge does not depend on a prior check. | ||
|
|
||
| ## Branch serialization | ||
|
|
||
| The partition key `repo/target` on both inbound topics serializes all VCS operations for a given branch. The message queue delivers messages with the same partition key to the same consumer in order, so at most one merge-conflict check or merge operation is in flight for any given branch at any time. | ||
|
|
||
| The outbound topics partition by SubmitQueue queue name, matching SubmitQueue's fan-out model where state updates for the same queue are serialized. | ||
|
|
||
| ## Workflow | ||
|
|
||
| ``` | ||
| ┌─────────────────────────────────────────────────────┐ | ||
| │ submitqueue orchestrator │ | ||
| └──────────┬───────────────────────────┬──────────────┘ | ||
| │ │ | ||
| MergeRequest (dry run) MergeRequest (commit) | ||
| │ │ | ||
| ▼ ▼ | ||
| [merge-conflict-checker] [merger] | ||
| │ │ | ||
| merge-conflict-check ctrl merge ctrl | ||
| (read-only) (apply + commit) | ||
| │ │ | ||
| MergeResult MergeResult | ||
| │ │ | ||
| ▼ ▼ | ||
| [merge-conflict-checker-signal] [merger-signal] | ||
| │ │ | ||
| ▼ ▼ | ||
| ┌──────────┬───────────────────────────┬──────────────┐ | ||
| │ merge-conflict-check- merge-signal ctrl │ | ||
| │ signal ctrl (update batch state, │ | ||
| │ (update request fan out to conclude) │ | ||
| │ mergeability) │ | ||
| │ submitqueue orchestrator │ | ||
| └─────────────────────────────────────────────────────┘ | ||
| ``` | ||
|
|
||
| ## Per-controller summary | ||
|
|
||
| | Controller | In | Out | One-line role | | ||
| |---|---|---|---| | ||
| | **merge-conflict-check** | MergeRequest | MergeResult -> merge-conflict-checker-signal | Dry-run merge: check mergeability of ordered steps against the target branch (read-only) | | ||
| | **merge** | MergeRequest | MergeResult -> merger-signal | Apply, commit, and report per-step output IDs | | ||
|
|
||
| The merge-conflict-check controller always publishes a result — even when all steps are mergeable — so SubmitQueue receives a definitive answer. On infrastructure error it nacks for retry. | ||
|
|
||
| The merge controller publishes a conflict result (and acks) when the merge detects a conflict; SubmitQueue handles rebatching. On infrastructure error it nacks for retry. On success it publishes per-step outcomes (output IDs of the revisions produced) so SubmitQueue can update its request state. | ||
|
|
||
| ## Idempotency | ||
|
|
||
| Runway has no persistent state — no request store, no job store, no database. Idempotency is achieved through the VCS contract: merge detects already-pushed changes (revisions reachable from HEAD) and treats them as already-landed. Merge-conflict check is read-only and naturally idempotent. | ||
|
|
||
| ## Ownership by service | ||
|
|
||
| ### Orchestrator | ||
|
|
||
| The orchestrator is the only service. It subscribes to two inbound topics (`merge-conflict-checker`, `merger`), performs VCS operations through a pluggable extension, and publishes results to two outbound topics (`merge-conflict-checker-signal`, `merger-signal`). It owns no persistent data. | ||
|
|
||
| ### Shared: the messaging queue | ||
|
|
||
| Runway communicates with SubmitQueue only through the messaging queue. The inbound topics are owned by runway; the outbound topics are owned by SubmitQueue. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.