Skip to content

fix: accept large numeric config values in TestWorkflow CRDs - #8076

Open
dejanzele wants to merge 1 commit into
mainfrom
tkc-6402/large-config-values
Open

fix: accept large numeric config values in TestWorkflow CRDs#8076
dejanzele wants to merge 1 commit into
mainfrom
tkc-6402/large-config-values

Conversation

@dejanzele

@dejanzele dejanzele commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

A TestWorkflow with a numeric config.default above the int32 range, for example 873760302410822, breaks every client that reads the CRD with intstr.IntOrString. The whole informer list fails to decode, the agent stops the sync of all workflows, and the UI shows none. (TKC-6402)

How:

  • The config fields of the TestWorkflow CRDs (config.default, config.example, and the config maps on template refs, steps, cron jobs, and execution requests) now use a new ConfigValue type. The type keeps the raw scalar text, so a number of any size decodes without loss. The CRD schema stays x-kubernetes-int-or-string.
  • ConfigValue emits a JSON number only when the value is a canonical integer in the int32 range. A larger number becomes a string, so an older client that still decodes with intstr.IntOrString does not fail on data from a new agent.
  • The clone helper in the expressions engine now keeps the named type of a string value, so template resolution can write the result back into a map[string]ConfigValue.

Resource limits and requests, count and maxCount, and the service port still use intstr.IntOrString and have the same failure mode. This change does not cover them.

@dejanzele
dejanzele requested a review from a team as a code owner August 6, 2026 11:00
@dejanzele
dejanzele requested a review from vsukhin August 6, 2026 11:00
@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR introduces a raw-text ConfigValue scalar for TestWorkflow configuration, preserving large numeric values while encoding them compatibly for older clients.

  • Migrates configuration defaults, examples, template references, workflow steps, cron jobs, and execution requests to the new type.
  • Updates resolver and API mappings while retaining configuration values as strings end-to-end.
  • Preserves named string types during expression cloning so resolved values remain assignable to typed maps and slices.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete production or compatibility defects identified in the changed paths.

Large numeric configuration values are preserved through CRD decoding, mapping, expression resolution, and API serialization, while older IntOrString clients receive out-of-range values as strings.

Important Files Changed

Filename Overview
api/testworkflows/v1/config_value.go Implements lossless scalar decoding and backward-compatible JSON encoding for configuration values; no blocking issue found.
api/testworkflows/v1/parameter_types.go Migrates parameter defaults and examples to ConfigValue while preserving the generated integer-or-string CRD contract.
pkg/expressions/generic.go Preserves named string types during cloning, keeping reflection assignments valid for ConfigValue maps, slices, and pointers.
pkg/mapper/testworkflows/kube_openapi.go Converts ConfigValue fields to the existing API string representation without losing large numeric text.
pkg/mapper/testworkflows/openapi_kube.go Converts API strings into ConfigValue without reintroducing int32 parsing or truncation.
pkg/testworkflows/testworkflowresolver/config.go Resolves and casts ConfigValue through its preserved scalar text, maintaining existing parameter semantics.
k8s/crd/testworkflows.testkube.io_testworkflows.yaml Generated schema remains integer-or-string; the visible changes only reorder generated description metadata.

Reviews (1): Last reviewed commit: "fix: accept large numeric config values ..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants