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.
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.
a86f796 to
04b27dd
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 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>
04b27dd to
b30219c
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 no new comments.
Comments suppressed due to low confidence (2)
internal/util/render/executor.go:799
- In
runMutators, several failure paths occur beforemutation.Execute()(e.g., errors fromGetPkgPathAnnotation,GetFileAnnotations,SetResourceIDs,SelectInput). Those currentlyreturnwithout appending aPipelineStepResult, so the newstatus.renderStatus.mutationStepscan be missing the step that was being prepared/executed when render failed. Consider recording a failure step forpl.Mutators[i](e.g., viapreExecFailureStepor a dedicated helper) before returning on these pre-exec errors so RenderStatus remains complete/diagnostic.
internal/util/render/executor.go:855 - In
runValidators, ifSelectInputfails (or any other pre-run setup error happens beforeNewRunner/Filter), the code returns immediately without appending aPipelineStepResulttohctx.validationSteps. This can leavestatus.renderStatus.validationStepsincomplete on failure. Consider capturing a failure step for the currentfunction(similar to the--allow-exec/NewRunnererror paths) before returning.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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