refactor(graph): rewrite builder as a multi stage compiler pipeline#1074
Open
a-hilaly wants to merge 1 commit intokubernetes-sigs:mainfrom
Open
refactor(graph): rewrite builder as a multi stage compiler pipeline#1074a-hilaly wants to merge 1 commit intokubernetes-sigs:mainfrom
a-hilaly wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: a-hilaly The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
0837d5a to
6e4fc6d
Compare
Member
Author
|
/test presubmits-integration-tests |
476544a to
9d1670b
Compare
The old Builder was a single ~2k+ line file that parsed, validated, resolved, linked, type-checked, compiled, and assembled a graph all in one pass. This made it hard to test individual concerns, hard to produce good error messages, and hard to reason about what data was available at which point in the process. This commit replaces it with a proper staged pipeline where each phase has a clear input, a clear output, and no hidden coupling to the others. The stages are `Parse`, `Validate`, `Resolve`, `Link`, `TypeCheck`, `Compile`, and `Assemble`. Each one produces a typed intermediate representation that the next stage consumes, so the builder itself becomes a short function that chains them together. Errors are now classified as terminal or retriable at the source, which lets the controller decide retry behavior without string matching. The outcome is better local reasoning, safer evolution, and clearer runtime behavior. Errors are produced at the phase where they originate and carry retry semantics from the source, allowing controllers to make deterministic requeue decisions without string matching.
9d1670b to
829214e
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The old Builder was a single ~2k+ line file that parsed, validated,
resolved, linked, type-checked, compiled, and assembled a graph all in
one pass. This made it hard to test individual concerns, hard to produce
good error messages, and hard to reason about what data was available at
which point in the process. This commit replaces it with a proper staged
pipeline where each phase has a clear input, a clear output, and no
hidden coupling to the others.
The stages are
Parse,Validate,Resolve,Link,TypeCheck,Generate, andAssemble. Each one produces a typed intermediate representation that thenext stage consumes, so the builder itself becomes a short function that
chains them together. Errors are now classified as terminal or retriable
at the source, which lets the controller decide retry behavior without
string matching.
The outcome is better local reasoning, safer evolution, and clearer runtime
behavior. Errors are produced at the phase where they originate and carry
retry semantics from the source, allowing controllers to make deterministic
requeue decisions without string matching.