• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In
Warning: This build has drifted.
The coverage report for this pull request build may be inaccurate because its base commit is no longer the HEAD of its target branch.
This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

    • Learn more: For more information on this, see Tracking coverage changes for pull request builds.
    • Fix now: For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
    • Prevent going forward: To avoid this issue with future PRs, see these Recommended CI Configurations.
New Repo Setting:
INCLUDE COVERAGE % WITH WARNINGS ABOUT DRIFTED BUILDS?

Enabling this setting will include a (potentially inaccurate) coverage % with warning messages in status updates for drifted builds.

Adjust setting

kcl-lang / kcl-openapi / 33316822068
64%
main: 64%

Build:
Build:
LAST BUILD BRANCH: dependabot/go_modules/github.com/stretchr/testify-1.12.1
DEFAULT BRANCH: main
Ran 30 Aug 2026 02:26PM UTC
Jobs 1
Files 18
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

30 Aug 2026 02:25PM UTC coverage: 64.293% (+0.2%) from 64.044%
33316822068

Pull #167

github

claude
fix(generator): emit valid KCL from CEL `x-kubernetes-validations`

The translator introduced in #161 produced `check:` blocks that did not
compile under KCL: every `self.X` reference was left intact (KCL `check:`
blocks have no `self` in scope), `has(self.X)` was rendered as the
unsupported `(has self.X)` form, and `cond ? a : b` was emitted as
`a if cond else b` — which KCL's parser rejects inside a schema check
(the `else` token is treated as a bare name there).

Reported downstream by kcl-lang/modules PR #401, where the workaround
was to drop the whole `check:` block on regen. This commit makes the
translation faithful enough to keep the rules:

- Strip `self.` from field accesses (`emitSelect`).
- Map `has(self.X)` to `(X != None)`; `has(m.X)` for non-`self`
  operands is now unsupported because KCL cannot express it.
- Map `size(self)` to unsupported (KCL has no handle on the schema
  instance inside `check:`); `size(self.x)` still becomes `len(x)`.
- Surface CEL ternary inside `check:` as unsupported (the caller drops
  the rule).

The propagated `regex` import for `.matches(...)` rules is also fixed
so the header carries `import regex` and `_regex_match = regex.match`
whenever a CEL check uses `matches()` (previously only triggered by
JSON Schema `pattern`, leaving `check:` blocks referencing an undefined
identifier).

The `TestGenerate_OAI2KCL_K8sValidations` e2e test now also invokes
`kcl` on the generated file (via a new `lookupKCLBinary` helper that
falls back through `$KCL_BIN`, `$PATH`, and the homebrew install path)
so any future regression to invalid KCL fails CI rather than passing
on string-substring matches alone.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pull Request #167: fix(generator): emit valid KCL from CEL x-kubernetes-validations

34 of 37 new or added lines in 2 files covered. (91.89%)

2690 of 4184 relevant lines covered (64.29%)

0.72 hits per line

Uncovered Changes

Lines Coverage ∆ File
3
65.19
2.73% pkg/swagger/generator/cel.go
Jobs
ID Job ID Ran Files Coverage
1 33316822068.1 30 Aug 2026 02:26PM UTC 18
64.29
GitHub Action Run
Source Files on build 33316822068
  • Tree
  • List 18
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #167
  • PR Base - main (#33304187079)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc