• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kcl-lang / kcl-openapi / 37961329110
67%

Build:
DEFAULT BRANCH: main
Ran 09 Oct 2026 04:49PM UTC
Jobs 1
Files 21
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

09 Oct 2026 04:44PM UTC coverage: 66.742% (+2.0%) from 64.723%
37961329110

push

github

web-flow
fix(generator): keep version in CRD schema names and merge multi-document CRDs into one spec (#182)

* fix(generator): keep version in CRD schema names and merge multi-document CRDs into one spec

Fixes #181. Since #180, importing a CRD with exactly one version produced
schema names after the bare Kind (e.g. Widget), dropping the version
qualifier. Two defects, one root cause:

A. kcl import groups the generated files into per-version directories by
   extracting the version from the file name (_v1, _v1alpha1, ...). A
   single-version CRD rendered as models/unknown/widget.k instead of
   models/v1/example_com_v1_widget.k, silently changing the import path
   of published modules (e.g. strimzi_kafka_operator.v1 -> ...unknown).

B. Two CRDs sharing a Kind across different API groups both rendered as
   models/widget.k: the CLI converts each YAML document of the input file
   into its own spec and generates each separately, so the second file
   silently overwrote the first with exit code 0.

Fixes:

- pkg/swagger/generator/names.go: append the version to the short root
  name unconditionally (Widget -> WidgetV1), so the file name always
  carries the version. When the same Kind+Version is declared by several
  API groups, every root of that class is additionally qualified with its
  group segments (example.com/other.com Widget -> ExampleComWidgetV1 /
  OtherComWidgetV1), keeping both definitions and preserving the group
  identity #180 removed.
- pkg/kube_resource/generator/generator.go: GetSpecs/GetSpec now merge
  all YAML documents of one file into a single swagger spec, so every CRD
  of the file is generated in one run against a shared name registry
  instead of one overwrite-prone generation per document. As a side
  effect the standalone binary handles multi-document files too instead
  of silently converting only the first document.
- pkg/swagger/generator/{model,language}.go: make the rendered default
  and example values deterministic. Recove... (continued)

79 of 97 new or added lines in 5 files covered. (81.44%)

1 existing line in 1 file now uncovered.

3267 of 4895 relevant lines covered (66.74%)

0.76 hits per line

Uncovered Changes

Lines Coverage ∆ File
17
72.91
18.25% pkg/kube_resource/generator/generator.go
1
74.43
-0.24% pkg/swagger/generator/language.go

Coverage Regressions

Lines Coverage ∆ File
1
72.91
18.25% pkg/kube_resource/generator/generator.go
Jobs
ID Job ID Ran Files Coverage
1 37961329110.1 09 Oct 2026 04:49PM UTC 21
66.74
GitHub Action Run
Source Files on build 37961329110
  • Tree
  • List 21
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 96f08afb on github
  • Prev Build on main (#35564743446)
  • 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