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

kcl-lang / kcl-openapi / 35564743446
65%

Build:
DEFAULT BRANCH: main
Ran 21 Sep 2026 05:34AM 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

21 Sep 2026 05:30AM UTC coverage: 64.723% (+0.4%) from 64.293%
35564743446

push

github

web-flow
feat(generator): short, organized schema names for CRD imports (#180)

Fixes #179. Importing a CRD used to produce schema names glued from the
full property path, e.g.
ArgoprojIoV1alpha1ClusterWorkflowTemplateSpecAffinityNodeAffinity...
PreferredDuringSchedulingIgnoredDuringExecutionItems0PreferenceMatchFieldsItems0.

The names came from the code generator naming anonymous inline objects
after their property path within the root definition. This change adds a
post-flatten pass (pkg/swagger/generator/names.go) that:

- renames each CRD root definition (group.version.Kind) after its Kind,
  appending the version when several versions share the Kind;
- hoists every inline complex object below the roots into its own named
  definition, named after the short root plus at most two trailing
  meaningful path segments, dropping noise segments such as array
  "items"/"0" (e.g. ClusterWorkflowTemplatePreferenceMatchFields); on
  collision the name extends towards the root (capped) and then takes a
  numeric suffix, all assigned deterministically from a shared registry;
- rewrites every local $ref accordingly. Hoisted definitions render as
  their own model file with plain same-package references.

CRD-derived definitions are recognized by an x-kcl-crd-root marker set
during CRD->swagger conversion, so bundled k8s types and plain OpenAPI
specs are untouched. --long-names restores the previous behavior.

Two related optional modes:

- --crd-dedupe-k8s (dedupe.go): CRD definitions that are structurally
  identical to a bundled k8s type (e.g. a PodSpec inlined by
  argo-workflows) become x-kcl-type aliases to the official k8s module
  instead of duplicated local schemas (166 aliases on the argo CRD from
  the issue). Structures are compared canonically: descriptions and
  ordering annotations ignored, $refs resolved recursively, required
  sorted, x-kubernetes-* extensions and constraints kept; when several
  k8s API versions collide, the shortest (stable) import p... (continued)

532 of 703 new or added lines in 8 files covered. (75.68%)

60 existing lines in 3 files now uncovered.

3141 of 4853 relevant lines covered (64.72%)

0.73 hits per line

Uncovered Changes

Lines Coverage ∆ File
76
71.85
pkg/swagger/generator/dedupe.go
76
77.71
pkg/swagger/generator/names.go
7
78.79
pkg/swagger/generator/import_registry.go
3
4.05
-0.17% pkg/cmds/kcl-openapi.go
3
54.66
1.09% pkg/kube_resource/generator/generator.go
3
83.61
-0.78% pkg/swagger/generator/spec.go
2
57.89
-3.55% pkg/swagger/generator/model.go
1
81.9
1.47% pkg/swagger/generator/support.go

Coverage Regressions

Lines Coverage ∆ File
58
57.89
-3.55% pkg/swagger/generator/model.go
1
56.41
-1.28% pkg/swagger/generator/structs.go
1
65.77
-0.27% pkg/swagger/generator/template_repo.go
Jobs
ID Job ID Ran Files Coverage
1 35564743446.1 21 Sep 2026 05:34AM UTC 21
64.72
GitHub Action Run
Source Files on build 35564743446
  • Tree
  • List 21
  • Changed 8
  • Source Changed 0
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 4f65c59a on github
  • Prev Build on main (#33465196655)
  • 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