Repository navigation
chore: drop kcl 0.12.x evaluator workarounds - #37
Merged
Merged
Conversation
Now that kcl-lang/kcl#2130 is fixed upstream (commit 703b8ead: "fix(evaluator): restore local_vars after call, don't extend"), the workarounds introduced in PR kcl-lang#36 to keep the runtime usable against that bug are no longer required. Removes: - the inline `{}` fallback on labels/annotations in `models.kube/utils/metadata_builder.k` - the pre-computed `_singleService`/`_workloadType` locals in `models/kube/mixins/service_mixin.k` - the isolated `_spec` dict extraction in `models/kube/backend/server_backend.k` This restores the simpler, native dict-literal/merge-operator code that the library was originally written against. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Peefy <xpf6677@163.com>
Peefy
force-pushed
the
remove-kcl-012-workarounds
branch
from
August 24, 2026 10:57
d09854d to
feebef4
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.
Now that kcl-lang/kcl#2130 is fixed upstream (kcl-lang/kcl@703b8ead: "fix(evaluator): restore local_vars after call, don't extend"), the workarounds introduced in #36 to keep the runtime usable against that bug are no longer required.
Changes
models/kube/utils/metadata_builder.k: drop the{}fallback forlabels/annotations— bareconfig?.labels/config?.annotationsare correct now.models/kube/mixins/service_mixin.k: drop the pre-computed_singleService/_workloadTypelocals; readlen(config.services)/config.workloadTypeinline again.models/kube/backend/server_backend.k: drop the isolated_specdict and inline the spec construction back into theworkloadAttributesliteral.Test plan
cd examples/appops/guestbook/dev && kcl run— render must succeed without the earlier "invalid value 'UndefinedType' to load attribute 'workloadType'" panic../scripts/test.sh) against a KCL build containing kcl-lang/kcl@703b8ead.🤖 Generated with Claude Code