fix: Improve CEL conditional execution consistency and test coverage - #4713
Open
aravindtga wants to merge 2 commits into
Open
fix: Improve CEL conditional execution consistency and test coverage#4713aravindtga wants to merge 2 commits into
aravindtga wants to merge 2 commits into
Conversation
Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
Aligns CEL conditional execution terminology across CLI and YAML, simplifies resource conversion, and expands E2E coverage.
Changes:
- Renames
fn eval --conditionto--when. - Refactors CEL and GVK handling using existing APIs.
- Adds render/eval condition and validator-exclusion tests.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
thirdparty/cmdconfig/commands/cmdeval/cmdeval.go |
Adds the --when flag. |
pkg/test/runner/runner.go |
Passes conditions to eval tests. |
pkg/test/runner/config.go |
Adds eval when configuration. |
pkg/live/rgstream.go |
Simplifies GroupKind construction. |
pkg/live/load.go |
Uses direct GVK comparisons. |
pkg/lib/runneroptions/celenv.go |
Uses RNode.Map() and clarifies CEL documentation. |
pkg/fn/runtime/condition_test.go |
Renames condition test fields. |
e2e/testdata/fn-render/validator-excludes-own-fnconfig/starlark-val.yaml |
Defines validator exclusion assertion. |
e2e/testdata/fn-render/validator-excludes-own-fnconfig/Kptfile |
Configures the validator test. |
e2e/testdata/fn-render/validator-excludes-own-fnconfig/deployment.yaml |
Supplies validator test input. |
e2e/testdata/fn-render/validator-excludes-own-fnconfig/.expected/diff.patch |
Records expected render status. |
e2e/testdata/fn-render/condition/condition-mixed/resources.yaml |
Supplies mixed-condition input. |
e2e/testdata/fn-render/condition/condition-mixed/Kptfile |
Defines matching and nonmatching conditions. |
e2e/testdata/fn-render/condition/condition-mixed/.krmignore |
Excludes expected fixtures. |
e2e/testdata/fn-render/condition/condition-mixed/.expected/diff.patch |
Verifies run and skipped statuses. |
e2e/testdata/fn-render/condition/condition-mixed/.expected/config.yaml |
Verifies mixed-condition output. |
e2e/testdata/fn-eval/condition-not-met/resources.yaml |
Supplies nonmatching eval input. |
e2e/testdata/fn-eval/condition-not-met/.krmignore |
Excludes expected fixtures. |
e2e/testdata/fn-eval/condition-not-met/.expected/config.yaml |
Verifies skipped eval behavior. |
e2e/testdata/fn-eval/condition-met/resources.yaml |
Supplies matching eval input. |
e2e/testdata/fn-eval/condition-met/.krmignore |
Excludes expected fixtures. |
e2e/testdata/fn-eval/condition-met/.expected/config.yaml |
Verifies successful conditional eval. |
e2e/testdata/fn-eval/condition-invalid-cel/resources.yaml |
Supplies invalid-CEL test input. |
e2e/testdata/fn-eval/condition-invalid-cel/.krmignore |
Excludes expected fixtures. |
e2e/testdata/fn-eval/condition-invalid-cel/.expected/config.yaml |
Verifies CEL compilation failure. |
documentation/content/en/book/04-using-functions/_index.md |
Updates documented skipped output. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
aravindtga
force-pushed
the
cel-condition-consistency
branch
from
August 20, 2026 15:10
7eec6ae to
14e0389
Compare
aravindtga
marked this pull request as ready for review
August 20, 2026 15:23
aravindtga
requested review from
efiacor,
kispaljr,
liamfallon and
mozesl-nokia
as code owners
August 20, 2026 15:23
|
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.



Description
--when), fixed documentation output examples, refactored internal CEL utilities to use existing kyaml APIs, and added E2E test coverage forkpt fn eval --whenand validator fn-config exclusion.kpt fn evalCLI flag was named--conditionwhile the Kptfile field iswhen, creating a user-facing inconsistency. The eval path lacked E2E test coverage, and there was no E2E test verifying that validators don't receive their ownfn-config in the input resource list.
--when, updated documentation to match actual output, refactoredresourceToMapto delegate toRNode.Map(), corrected stale comments, and added E2E tests for eval/render condition scenarios and validator fn-config exclusion.Type of Change
Checklist
AI Disclosure
If so, please describe how:
- Kiro CLI to review, implement fixes, create E2E tests, and perform black-box validation of the CEL condition feature.