Add RenderStatus to the Kptfile for per-function pipeline result tracking#4437
Add RenderStatus to the Kptfile for per-function pipeline result tracking#4437aravindtga wants to merge 2 commits intokptdev:mainfrom
Conversation
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
e9f6347 to
3c93572
Compare
Signed-off-by: aravind.est <aravindhan.a@est.tech>
3c93572 to
13ed78f
Compare
There was a problem hiding this comment.
Pull request overview
This PR extends the root Kptfile status to include a structured renderStatus after kpt fn render, enabling per-function pipeline step result tracking (mutation + validation) and updating E2E fixtures accordingly.
Changes:
- Add
status.renderStatus(mutationSteps/validationSteps/errorSummary) to theKptfilev1 API types. - Track and persist per-step execution details during render, and write them into the root
Kptfilefor in-place renders. - Make E2E diff comparisons more resilient by allowing regex-based stripping/normalization of diff output.
Reviewed changes
Copilot reviewed 137 out of 138 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
pkg/api/kptfile/v1/types.go |
Adds Status.RenderStatus and supporting status/result schema types. |
internal/util/render/executor.go |
Captures per-function step results during render and writes renderStatus into the root Kptfile on in-place renders. |
internal/util/render/executor_test.go |
Adds unit tests for renderStatus building and result capture/conversion. |
pkg/test/runner/config.go |
Adds diffStripRegEx test config knob for diff normalization. |
pkg/test/runner/runner.go |
Normalizes diffs (strip + header normalization) before comparing expected vs actual diffs. |
e2e/testdata/fn-render/**/.expected/diff.patch (many files) |
Updates expected diffs to include the new status.renderStatus output. |
e2e/testdata/fn-render/**/.expected/config.yaml (some files) |
Adjusts expected configs to use diffStripRegEx (and related stderr matching changes). |
e2e/testdata/fn-render/**/starlark-fn-failure.yaml (some files) |
Adds fixtures to reliably force function failure for renderStatus failure-path expectations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 137 out of 138 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
904e674 to
a86f796
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 137 out of 138 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| func executionErrorStep(fn kptfilev1.Function, err error) kptfilev1.PipelineStepResult { | ||
| return kptfilev1.PipelineStepResult{ | ||
| Name: fn.Name, | ||
| Image: fn.Image, | ||
| ExecPath: fn.Exec, | ||
| ExecutionError: err.Error(), | ||
| } |
There was a problem hiding this comment.
PipelineStepResult records executionError for pre-execution failures, but exitCode is still serialized (defaulting to 0). This can be misleading to consumers because the step appears to have succeeded by exit code even though it never executed. Consider omitting exitCode when executionError is set (e.g., make ExitCode optional/omitempty or a pointer) or otherwise represent an “unknown/not-run” exit code distinctly so the schema is unambiguous.
After every kpt fn render execution, a structured renderStatus is now recorded in the root Kptfile alongside the existing Rendered condition, providing per-function pipeline result tracking.
Note
76 of the 79 changed files are E2E test fixture updates
(e2e/testdata/fn-render/**/.expected/diff.patch). The core implementation changes are in 3 files.What
Fixes: #4390
Success case:
Failure case:
Behaviour
Tests