Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor Report for @jsonmp-k8
|
Contributor
Author
|
/ok-to-tws |
Contributor
Author
|
/ok-to-test |
2 tasks done
Contributor
Author
|
/ok-to-test |
jeffspahr
reviewed
Oct 31, 2026
…mpiler lookup errors. Part of kubeflow#13966 The v2 compiler visits the pipeline's root DAG under the name "root", but a user component could also be called "root". Referencing it was then reported as a circular reference ("root -> root"), and an unreferenced one was accepted. Reject the name up front with an error that says it is reserved. When a task referenced an undefined component, or a component named an undefined executor, the error only gave the component being processed. Include the task name, and for a missing executor the component that contains the task, so the broken reference can be found in the spec. Signed-off-by: Jaison Paul <paul.jaison@gmail.com>
TaskInfo.name is a display label that can be empty or differ from the task's key in the DAG's tasks map, so errors could read `task ""`. Name the task by its key, which locates it in the spec, and add the display name when it differs. Applies to undefined component refs, empty component refs and undefined executors. Signed-off-by: Jaison Paul <paul.jaison@gmail.com>
jsonmp-k8
force-pushed
the
fix/compiler-reserve-root-component
branch
from
October 31, 2026 23:39
bab7138 to
bbde079
Compare
This branch has not been deployed
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.
Problem
Two more items from #13966, following #15268 (circular references):
rootis not reserved. The compiler visits the pipeline's root DAG under the nameroot(RootComponentName), but nothing stops a user component from having the same name (TODO(Bobgy): reserve root as a keyword). Referencing such a component is reported as a circular reference,root -> root, which points at the wrong problem. An unreferencedrootcomponent is accepted silently.error processing component name="comp-a": cannot find component ref name="comp-missing". The task holding the broken reference isn't mentioned.The remaining #13966 item, removing the JSON round trip in
GetPipelineSpec/GetDeploymentConfig, is not included.Part of #13966
Description of your changes:
Acceptrejects a pipeline spec whosecomponentscontainroot:component name "root" is reserved for the pipeline's root DAG. Rename the component. The SDK names componentscomp-<name>, so compiled SDK pipelines are unaffected. All 315 compiler golden specs pass unchanged.task "task-comp-missing" references component "comp-missing", which is not defined in the pipeline spec's components. Add the component or fix the task's componentRef.executor(label="exec-missing") not found in deployment config, used by task "task-comp-leaf" in component "comp-a". Add the executor to deploymentSpec.executors or fix the component's executorLabel. If the root itself is an executor component (a malformed spec with no enclosing task), the usage clause is omitted instead of indexing past the path.Reproducer
A spec with
root.dag.tasks.task-root.componentRef.name: rootand acomponents.rootcontainer component:circular component reference detected: root -> root. Remove the task that references an enclosing componentcomponent name "root" is reserved for the pipeline's root DAG. Rename the componentflowchart LR subgraph Before B_spec["components: {root: ...}"] --> B_dfs["DFS visits root DAG as 'root'"] B_dfs --> B_err["'circular reference: root -> root'<br/>or accepted if unreferenced"] end subgraph After A_spec["components: {root: ...}"] --> A_check["Accept checks reserved name"] A_check --> A_err["'component name "root" is reserved'"] endRegression tests
In
backend/src/v2/compiler/visitor_test.go:TestAccept_RejectsComponentNamedRoot: referenced from the root DAG, referenced from a nested DAG, not referencedTestAccept_MissingReferencesNameTheTask: undefined component, undefined executor, undefined executor on the rootCommand:
Before the fix:
(The
undefined executor on the rootcase was added with the fix to cover the guard.)After the fix:
Also run locally:
go test ./backend/src/v2/compiler/... ./backend/src/apiserver/template/...: passginkgo ./backend/test/compiler -- -createGoldenFiles=false: 315 passed, 0 failed, 4 skipped (no golden changes)golangci-lint run --new-from-rev upstream/master ./backend/src/v2/compiler/...(v2.15.0): 0 issuesRelease notes / user impact:
Pipeline specs that define a component named
rootare rejected with an error saying the name is reserved. SDK-compiled pipelines never use that name. Errors for undefined component refs and executors now name the task holding the reference.Checklist:
🤖 Generated with Claude Code