Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package helm-schema for openSUSE:Factory 
checked in at 2026-03-11 20:54:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/helm-schema (Old)
 and      /work/SRC/openSUSE:Factory/.helm-schema.new.8177 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "helm-schema"

Wed Mar 11 20:54:59 2026 rev:7 rq:1338203 version:0.22.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/helm-schema/helm-schema.changes  2026-03-09 
16:19:07.040132578 +0100
+++ /work/SRC/openSUSE:Factory/.helm-schema.new.8177/helm-schema.changes        
2026-03-11 20:56:50.189677170 +0100
@@ -1,0 +2,12 @@
+Wed Mar 11 06:04:18 UTC 2026 - Johannes Kastl 
<[email protected]>
+
+- Update to version 0.22.0:
+  * chore: version++
+  * feat: Add const-from-value support
+  * feat: Merge found values file
+  * chore(deps): update docker/setup-qemu-action action to v4
+  * chore(deps): update docker/setup-buildx-action action to v4
+  * chore(deps): update docker/login-action action to v4
+  * chore(deps): update crazy-max/ghaction-import-gpg action to v7
+
+-------------------------------------------------------------------

Old:
----
  helm-schema-0.21.3.obscpio

New:
----
  helm-schema-0.22.0.obscpio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ helm-schema.spec ++++++
--- /var/tmp/diff_new_pack.ooXxDj/_old  2026-03-11 20:56:51.377726185 +0100
+++ /var/tmp/diff_new_pack.ooXxDj/_new  2026-03-11 20:56:51.381726350 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           helm-schema
-Version:        0.21.3
+Version:        0.22.0
 Release:        0
 Summary:        Generate jsonschemas from helm charts
 License:        MIT

++++++ _service ++++++
--- /var/tmp/diff_new_pack.ooXxDj/_old  2026-03-11 20:56:51.433728496 +0100
+++ /var/tmp/diff_new_pack.ooXxDj/_new  2026-03-11 20:56:51.437728661 +0100
@@ -3,7 +3,7 @@
     <param name="url">https://github.com/dadav/helm-schema</param>
     <param name="scm">git</param>
     <param name="exclude">.git</param>
-    <param name="revision">0.21.3</param>
+    <param name="revision">0.22.0</param>
     <param name="versionformat">@PARENT_TAG@</param>
     <param name="changesgenerate">enable</param>
   </service>

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.ooXxDj/_old  2026-03-11 20:56:51.469729981 +0100
+++ /var/tmp/diff_new_pack.ooXxDj/_new  2026-03-11 20:56:51.473730146 +0100
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
                 <param name="url">https://github.com/dadav/helm-schema</param>
-              <param 
name="changesrevision">0a58fe0aefa69caed80bc25feb96a2068fa0a577</param></service></servicedata>
+              <param 
name="changesrevision">aa676429e4683d6d2704a9ca43ba82676439086e</param></service></servicedata>
 (No newline at EOF)
 

++++++ helm-schema-0.21.3.obscpio -> helm-schema-0.22.0.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helm-schema-0.21.3/CLAUDE.md 
new/helm-schema-0.22.0/CLAUDE.md
--- old/helm-schema-0.21.3/CLAUDE.md    2026-03-07 20:15:38.000000000 +0100
+++ new/helm-schema-0.22.0/CLAUDE.md    2026-03-10 20:33:49.000000000 +0100
@@ -81,10 +81,13 @@
 - Workers pull chart paths from a channel and process them independently
 - Each worker:
   1. Reads Chart.yaml
-  2. Finds values.yaml (tries multiple filenames from config)
-  3. Parses values into a Schema
+  2. For schema generation, finds all configured values files that exist for 
the chart and merges them in CLI order
+  3. Parses merged values into a Schema
   4. Sends Result to results channel
 
+- When multiple values files are present, later files override earlier files 
using Helm-style nested map merge precedence.
+- `--annotate` and `--add-schema-reference` still operate on the first 
matching values file only; they do not merge multiple files.
+
 #### Dependency Graph (`pkg/schema/toposort.go`)
 
 - **TopoSort()**: Uses DFS-based topological sorting to ensure dependencies 
are processed before dependents
@@ -227,6 +230,7 @@
 
 - `deprecated`, `readOnly`, `writeOnly`
 - `enum`, `const`
+- `const-from-value` copies the YAML value into the generated `const` keyword 
and must not be combined with explicit `const`
 
 ### Custom Annotations
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helm-schema-0.21.3/README.md 
new/helm-schema-0.22.0/README.md
--- old/helm-schema-0.21.3/README.md    2026-03-07 20:15:38.000000000 +0100
+++ new/helm-schema-0.22.0/README.md    2026-03-10 20:33:49.000000000 +0100
@@ -119,6 +119,7 @@
 
 ```sh
 Flags:
+  -A, --annotate                               "write inferred @schema type 
blocks into the first matching values file instead of generating schema"
   -r, --add-schema-reference                   "add reference to schema in 
values.yaml if not found"
   -w, --allow-circular-dependencies            "allow circular dependencies 
between charts (will log a warning instead of failing)"
   -a, --append-newline                         "append newline to generated 
jsonschema at the end of the file"
@@ -134,12 +135,26 @@
   -n, --no-dependencies                        "don't analyze dependencies"
   -o, --output-file string                     "jsonschema file path relative 
to each chart directory to which jsonschema will be written (default 
'values.schema.json')"
   -m, --skip-dependencies-schema-validation    "skip schema validation for 
dependencies by setting additionalProperties to true and removing from required"
-  -f, --value-files strings                    "filenames to check for chart 
values (default [values.yaml])"
+  -f, --value-files strings                    "filenames to look for chart 
values; schema generation merges all matches in the order provided (default 
[values.yaml])"
   -k, --skip-auto-generation strings           "skip the auto generation for 
these fields (default [])"
   -u, --uncomment                              "consider yaml which is 
commented out"
   -v, --version                                "version for helm-schema"
 ```
 
+For schema generation, `helm-schema` checks each `--value-files` entry for the 
chart, keeps the ones that exist, and merges them in the order provided. Later 
files take precedence over earlier files, following Helm's `-f/--values` 
behavior.
+
+`--annotate` does not merge multiple files. It only annotates the first 
matching values file.
+
+`--add-schema-reference` also targets the first matching values file.
+
+### Annotate mode
+
+Use `--annotate` to add inferred `# @schema` type blocks to a values file 
instead of generating `values.schema.json`.
+
+- Keys that already have `@schema` annotations are left unchanged.
+- With `-d, --dry-run`, the annotated file is printed to stdout instead of 
being written back.
+- When multiple `--value-files` entries are configured, annotate mode uses 
only the first matching file.
+
 ## Annotations
 
 The `jsonschema` must be between two entries of `# @schema` :
@@ -612,6 +627,18 @@
 maintainer: [email protected]
 ```
 
+#### `const-from-value`
+
+Copies the YAML value into the generated JSON Schema `const` without 
duplicating the payload in the annotation block.
+
+```yaml
+# @schema
+# const-from-value: true
+# @schema
+message: |
+  long message with {{ .gotemplate }}
+```
+
 #### `examples`
 
 Provides example values to the user when hovering the key in IDE, or by 
auto-completion mechanism.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helm-schema-0.21.3/cmd/helm-schema/version.go 
new/helm-schema-0.22.0/cmd/helm-schema/version.go
--- old/helm-schema-0.21.3/cmd/helm-schema/version.go   2026-03-07 
20:15:38.000000000 +0100
+++ new/helm-schema-0.22.0/cmd/helm-schema/version.go   2026-03-10 
20:33:49.000000000 +0100
@@ -1,3 +1,3 @@
 package main
 
-var version string = "0.21.3"
+var version string = "0.22.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helm-schema-0.21.3/pkg/schema/schema.go 
new/helm-schema-0.22.0/pkg/schema/schema.go
--- old/helm-schema-0.21.3/pkg/schema/schema.go 2026-03-07 20:15:38.000000000 
+0100
+++ new/helm-schema-0.22.0/pkg/schema/schema.go 2026-03-10 20:33:49.000000000 
+0100
@@ -263,6 +263,7 @@
        Else                 *Schema                `yaml:"else,omitempty"      
           json:"else,omitempty"`
        Pattern              string                 `yaml:"pattern,omitempty"   
           json:"pattern,omitempty"`
        Const                interface{}            `yaml:"const,omitempty"     
           json:"const,omitempty"`
+       ConstFromValue       bool                   
`yaml:"const-from-value,omitempty"     json:"-"`
        Ref                  string                 `yaml:"$ref,omitempty"      
           json:"$ref,omitempty"`
        Schema               string                 `yaml:"$schema,omitempty"   
           json:"$schema,omitempty"`
        Id                   string                 `yaml:"$id,omitempty"       
           json:"$id,omitempty"`
@@ -1703,6 +1704,20 @@
                                }
                        }
 
+                       if keyNodeSchema.ConstFromValue {
+                               if keyNodeSchema.constWasSet {
+                                       return nil, fmt.Errorf("error 
validating schema of key %s: const and const-from-value cannot be used 
together", keyNode.Value)
+                               }
+
+                               decodedValue, err := decodeNodeValue(valueNode)
+                               if err != nil {
+                                       return nil, fmt.Errorf("error decoding 
value for const-from-value on key %s: %w", keyNode.Value, err)
+                               }
+
+                               keyNodeSchema.Const = decodedValue
+                               keyNodeSchema.constWasSet = true
+                       }
+
                        if keyNodeSchema.HasData {
                                if err := keyNodeSchema.Validate(); err != nil {
                                        return nil, fmt.Errorf("error 
validating schema of key %s: %w", keyNode.Value, err)
@@ -1895,6 +1910,17 @@
        return rawValue
 }
 
+// decodeNodeValue converts a yaml.Node into a plain Go value suitable for 
JSON Schema keywords.
+// Aliases are expanded by yaml.v3 during Decode.
+func decodeNodeValue(node *yaml.Node) (interface{}, error) {
+       var value interface{}
+       if err := node.Decode(&value); err != nil {
+               return nil, err
+       }
+
+       return value, nil
+}
+
 // handleSchemaRefs processes and resolves JSON Schema references ($ref) 
within a schema.
 // It handles both direct schema references and references within 
patternProperties.
 // For each reference:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helm-schema-0.21.3/pkg/schema/schema_test.go 
new/helm-schema-0.22.0/pkg/schema/schema_test.go
--- old/helm-schema-0.21.3/pkg/schema/schema_test.go    2026-03-07 
20:15:38.000000000 +0100
+++ new/helm-schema-0.22.0/pkg/schema/schema_test.go    2026-03-10 
20:33:49.000000000 +0100
@@ -3,6 +3,7 @@
 import (
        "encoding/json"
        "fmt"
+       "reflect"
        "strings"
        "testing"
 
@@ -866,6 +867,100 @@
                        }
                })
        }
+}
+
+func TestYamlToSchemaConstFromValue(t *testing.T) {
+       tests := []struct {
+               name          string
+               yamlContent   string
+               expectedConst interface{}
+               expectedErr   string
+       }{
+               {
+                       name: "scalar string value",
+                       yamlContent: `# @schema
+# const-from-value: true
+# @schema
+message: |
+  long message with {{ .gotemplate }}`,
+                       expectedConst: "long message with {{ .gotemplate }}",
+               },
+               {
+                       name: "null value",
+                       yamlContent: `# @schema
+# const-from-value: true
+# @schema
+message: null`,
+                       expectedConst: nil,
+               },
+               {
+                       name: "mapping value",
+                       yamlContent: `# @schema
+# const-from-value: true
+# @schema
+message:
+  enabled: true
+  retries: 2`,
+                       expectedConst: map[string]interface{}{
+                               "enabled": true,
+                               "retries": 2,
+                       },
+               },
+               {
+                       name: "conflicts with explicit const",
+                       yamlContent: `# @schema
+# const: fixed
+# const-from-value: true
+# @schema
+message: fixed`,
+                       expectedErr: "const and const-from-value cannot be used 
together",
+               },
+       }
+
+       for _, tt := range tests {
+               t.Run(tt.name, func(t *testing.T) {
+                       var node yaml.Node
+                       if err := yaml.Unmarshal([]byte(tt.yamlContent), 
&node); err != nil {
+                               t.Fatalf("Failed to unmarshal YAML: %v", err)
+                       }
+
+                       skipConfig := &SkipAutoGenerationConfig{}
+                       schema, err := YamlToSchema("", &node, false, false, 
false, true, skipConfig, nil)
+                       if tt.expectedErr != "" {
+                               if err == nil {
+                                       t.Fatalf("Expected error containing %q, 
got nil", tt.expectedErr)
+                               }
+                               if !strings.Contains(err.Error(), 
tt.expectedErr) {
+                                       t.Fatalf("Expected error containing %q, 
got %v", tt.expectedErr, err)
+                               }
+                               return
+                       }
+                       if err != nil {
+                               t.Fatalf("YamlToSchema failed: %v", err)
+                       }
+
+                       property, ok := schema.Properties["message"]
+                       if !ok {
+                               t.Fatal("Expected schema to contain message 
property")
+                       }
+
+                       if !reflect.DeepEqual(property.Const, tt.expectedConst) 
{
+                               t.Fatalf("Expected const %#v, got %#v", 
tt.expectedConst, property.Const)
+                       }
+
+                       jsonData, err := property.ToJson()
+                       if err != nil {
+                               t.Fatalf("Failed to marshal property schema to 
JSON: %v", err)
+                       }
+
+                       if !strings.Contains(string(jsonData), `"const"`) {
+                               t.Fatalf("Expected JSON to contain const, got 
%s", string(jsonData))
+                       }
+                       if strings.Contains(string(jsonData), 
"const-from-value") {
+                               t.Fatalf("Did not expect JSON to contain 
const-from-value, got %s", string(jsonData))
+                       }
+               })
+       }
 }
 
 func TestGetPropertyAtPath(t *testing.T) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helm-schema-0.21.3/pkg/schema/values_merge.go 
new/helm-schema-0.22.0/pkg/schema/values_merge.go
--- old/helm-schema-0.21.3/pkg/schema/values_merge.go   1970-01-01 
01:00:00.000000000 +0100
+++ new/helm-schema-0.22.0/pkg/schema/values_merge.go   2026-03-10 
20:33:49.000000000 +0100
@@ -0,0 +1,140 @@
+package schema
+
+import (
+       "fmt"
+
+       "gopkg.in/yaml.v3"
+)
+
+// mergeValuesDocuments merges YAML documents using Helm-style precedence:
+// later files override earlier files, and nested mappings merge recursively.
+func mergeValuesDocuments(base *yaml.Node, overlay *yaml.Node) (*yaml.Node, 
error) {
+       if base == nil {
+               return cloneYAMLNode(overlay), nil
+       }
+       if overlay == nil {
+               return cloneYAMLNode(base), nil
+       }
+       if base.Kind != yaml.DocumentNode || overlay.Kind != yaml.DocumentNode {
+               return nil, fmt.Errorf("expected yaml document nodes, got %d 
and %d", base.Kind, overlay.Kind)
+       }
+       if len(base.Content) != 1 || len(overlay.Content) != 1 {
+               return nil, fmt.Errorf("unexpected yaml document structure 
while merging values")
+       }
+
+       merged := cloneYAMLNode(base)
+       merged.HeadComment = mergeCommentText(merged.HeadComment, 
overlay.HeadComment)
+       merged.LineComment = mergeCommentText(merged.LineComment, 
overlay.LineComment)
+       merged.FootComment = mergeCommentText(merged.FootComment, 
overlay.FootComment)
+
+       mergedContent, err := mergeValuesNodes(merged.Content[0], 
overlay.Content[0])
+       if err != nil {
+               return nil, err
+       }
+       merged.Content[0] = mergedContent
+
+       return merged, nil
+}
+
+func mergeValuesNodes(base *yaml.Node, overlay *yaml.Node) (*yaml.Node, error) 
{
+       if base == nil {
+               return cloneYAMLNode(overlay), nil
+       }
+       if overlay == nil {
+               return cloneYAMLNode(base), nil
+       }
+
+       if base.Kind == yaml.AliasNode && base.Alias != nil {
+               base = base.Alias
+       }
+       if overlay.Kind == yaml.AliasNode && overlay.Alias != nil {
+               overlay = overlay.Alias
+       }
+
+       if base.Kind == yaml.MappingNode && overlay.Kind == yaml.MappingNode {
+               return mergeMappingNodes(base, overlay)
+       }
+
+       replacement := cloneYAMLNode(overlay)
+       replacement.HeadComment = mergeCommentText(base.HeadComment, 
overlay.HeadComment)
+       replacement.LineComment = mergeCommentText(base.LineComment, 
overlay.LineComment)
+       replacement.FootComment = mergeCommentText(base.FootComment, 
overlay.FootComment)
+       return replacement, nil
+}
+
+func mergeMappingNodes(base *yaml.Node, overlay *yaml.Node) (*yaml.Node, 
error) {
+       merged := cloneYAMLNode(base)
+       merged.Content = nil
+       merged.HeadComment = mergeCommentText(base.HeadComment, 
overlay.HeadComment)
+       merged.LineComment = mergeCommentText(base.LineComment, 
overlay.LineComment)
+       merged.FootComment = mergeCommentText(base.FootComment, 
overlay.FootComment)
+
+       overlayIndex := make(map[string]int, len(overlay.Content)/2)
+       for i := 0; i+1 < len(overlay.Content); i += 2 {
+               overlayIndex[overlay.Content[i].Value] = i
+       }
+
+       usedOverlayKeys := make(map[string]bool, len(overlayIndex))
+
+       for i := 0; i+1 < len(base.Content); i += 2 {
+               baseKey := base.Content[i]
+               baseValue := base.Content[i+1]
+               overlayPos, exists := overlayIndex[baseKey.Value]
+               if !exists {
+                       merged.Content = append(merged.Content, 
cloneYAMLNode(baseKey), cloneYAMLNode(baseValue))
+                       continue
+               }
+
+               overlayKey := overlay.Content[overlayPos]
+               overlayValue := overlay.Content[overlayPos+1]
+               usedOverlayKeys[baseKey.Value] = true
+
+               mergedKey := cloneYAMLNode(baseKey)
+               mergedKey.HeadComment = mergeCommentText(baseKey.HeadComment, 
overlayKey.HeadComment)
+               mergedKey.LineComment = mergeCommentText(baseKey.LineComment, 
overlayKey.LineComment)
+               mergedKey.FootComment = mergeCommentText(baseKey.FootComment, 
overlayKey.FootComment)
+
+               mergedValue, err := mergeValuesNodes(baseValue, overlayValue)
+               if err != nil {
+                       return nil, err
+               }
+
+               merged.Content = append(merged.Content, mergedKey, mergedValue)
+       }
+
+       for i := 0; i+1 < len(overlay.Content); i += 2 {
+               overlayKey := overlay.Content[i]
+               if usedOverlayKeys[overlayKey.Value] {
+                       continue
+               }
+               merged.Content = append(merged.Content, 
cloneYAMLNode(overlayKey), cloneYAMLNode(overlay.Content[i+1]))
+       }
+
+       return merged, nil
+}
+
+func cloneYAMLNode(node *yaml.Node) *yaml.Node {
+       if node == nil {
+               return nil
+       }
+
+       cloned := *node
+       if node.Content != nil {
+               cloned.Content = make([]*yaml.Node, len(node.Content))
+               for i, child := range node.Content {
+                       cloned.Content[i] = cloneYAMLNode(child)
+               }
+       }
+       if node.Alias != nil {
+               cloned.Alias = cloneYAMLNode(node.Alias)
+       }
+
+       return &cloned
+}
+
+func mergeCommentText(base string, overlay string) string {
+       if overlay != "" {
+               return overlay
+       }
+       return base
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helm-schema-0.21.3/pkg/schema/worker.go 
new/helm-schema-0.22.0/pkg/schema/worker.go
--- old/helm-schema-0.21.3/pkg/schema/worker.go 2026-03-07 20:15:38.000000000 
+0100
+++ new/helm-schema-0.22.0/pkg/schema/worker.go 2026-03-10 20:33:49.000000000 
+0100
@@ -49,30 +49,39 @@
                result.Chart = &chart
 
                var valuesPath string
-               var valuesFound bool
+               valuesPaths := []string{}
                errorsWeMaybeCanIgnore := []error{}
 
                for _, possibleValueFileName := range valueFileNames {
-                       valuesPath = filepath.Join(chartBasePath, 
possibleValueFileName)
-                       _, err := os.Stat(valuesPath)
+                       candidatePath := filepath.Join(chartBasePath, 
possibleValueFileName)
+                       _, err := os.Stat(candidatePath)
                        if err != nil {
                                if !os.IsNotExist(err) {
                                        errorsWeMaybeCanIgnore = 
append(errorsWeMaybeCanIgnore, err)
                                }
                                continue
                        }
-                       valuesFound = true
-                       break
+                       valuesPaths = append(valuesPaths, candidatePath)
                }
 
-               if !valuesFound {
+               if len(valuesPaths) == 0 {
                        result.Errors = append(result.Errors, 
errorsWeMaybeCanIgnore...)
                        result.Errors = append(result.Errors, fmt.Errorf("no 
values file found (tried: %s)", strings.Join(valueFileNames, ", ")))
                        results <- result
                        continue
                }
+               valuesPath = valuesPaths[0]
                result.ValuesPath = valuesPath
 
+               // Annotate mode: write @schema annotations into values.yaml 
and skip schema generation
+               if annotate {
+                       if err := AnnotateValuesFile(valuesPath, dryRun); err 
!= nil {
+                               result.Errors = append(result.Errors, err)
+                       }
+                       results <- result
+                       continue
+               }
+
                valuesFile, err := os.Open(valuesPath)
                if err != nil {
                        result.Errors = append(result.Errors, err)
@@ -87,15 +96,6 @@
                        continue
                }
 
-               // Annotate mode: write @schema annotations into values.yaml 
and skip schema generation
-               if annotate {
-                       if err := AnnotateValuesFile(valuesPath, dryRun); err 
!= nil {
-                               result.Errors = append(result.Errors, err)
-                       }
-                       results <- result
-                       continue
-               }
-
                // Check if we need to add a schema reference
                if addSchemaReference && !dryRun {
                        schemaRef := `# yaml-language-server: 
$schema=values.schema.json`
@@ -109,26 +109,49 @@
                        }
                }
 
-               // Optional preprocessing
-               if uncomment {
-                       // Remove comments from valid yaml
-                       content, err = 
util.RemoveCommentsFromYaml(bytes.NewReader(content))
+               var mergedValues *yaml.Node
+               for _, currentValuesPath := range valuesPaths {
+                       valuesFile, err := os.Open(currentValuesPath)
                        if err != nil {
                                result.Errors = append(result.Errors, err)
-                               results <- result
-                               continue
+                               break
                        }
-               }
 
-               var values yaml.Node
-               err = yaml.Unmarshal(content, &values)
-               if err != nil {
-                       result.Errors = append(result.Errors, err)
+                       currentContent, err := 
util.ReadFileAndFixNewline(valuesFile)
+                       valuesFile.Close()
+                       if err != nil {
+                               result.Errors = append(result.Errors, err)
+                               break
+                       }
+
+                       if uncomment {
+                               // Remove comments from valid yaml before 
parsing.
+                               currentContent, err = 
util.RemoveCommentsFromYaml(bytes.NewReader(currentContent))
+                               if err != nil {
+                                       result.Errors = append(result.Errors, 
err)
+                                       break
+                               }
+                       }
+
+                       var currentValues yaml.Node
+                       err = yaml.Unmarshal(currentContent, &currentValues)
+                       if err != nil {
+                               result.Errors = append(result.Errors, err)
+                               break
+                       }
+
+                       mergedValues, err = mergeValuesDocuments(mergedValues, 
&currentValues)
+                       if err != nil {
+                               result.Errors = append(result.Errors, err)
+                               break
+                       }
+               }
+               if len(result.Errors) > 0 {
                        results <- result
                        continue
                }
 
-               schema, err := YamlToSchema(valuesPath, &values, 
keepFullComment, helmDocsCompatibilityMode, dontRemoveHelmDocsPrefix, 
dontAddGlobal, skipAutoGenerationConfig, nil)
+               schema, err := YamlToSchema(valuesPath, mergedValues, 
keepFullComment, helmDocsCompatibilityMode, dontRemoveHelmDocsPrefix, 
dontAddGlobal, skipAutoGenerationConfig, nil)
                if err != nil {
                        result.Errors = append(result.Errors, err)
                        results <- result
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helm-schema-0.21.3/pkg/schema/worker_test.go 
new/helm-schema-0.22.0/pkg/schema/worker_test.go
--- old/helm-schema-0.21.3/pkg/schema/worker_test.go    2026-03-07 
20:15:38.000000000 +0100
+++ new/helm-schema-0.22.0/pkg/schema/worker_test.go    2026-03-10 
20:33:49.000000000 +0100
@@ -192,3 +192,84 @@
        assert.NoError(t, err)
        assert.NotContains(t, string(updated), "yaml-language-server: 
$schema=values.schema.json")
 }
+
+func TestWorker_MergesMultipleValuesFilesWithRightmostPrecedence(t *testing.T) 
{
+       tmpDir := t.TempDir()
+
+       chartPath := filepath.Join(tmpDir, "Chart.yaml")
+       baseValuesPath := filepath.Join(tmpDir, "values.base.yaml")
+       overrideValuesPath := filepath.Join(tmpDir, "values.prod.yaml")
+
+       err := os.WriteFile(chartPath, []byte("apiVersion: v2\nname: 
test-chart\nversion: 1.0.0\n"), 0o644)
+       assert.NoError(t, err)
+
+       err = os.WriteFile(baseValuesPath, []byte(`
+image:
+  repository: nginx
+  tag: stable
+# @schema
+# description: base replicas
+# @schema
+replicas: 1
+`), 0o644)
+       assert.NoError(t, err)
+
+       err = os.WriteFile(overrideValuesPath, []byte(`
+image:
+  tag: latest
+  pullPolicy: Always
+# @schema
+# description: production replicas
+# @schema
+replicas: "two"
+`), 0o644)
+       assert.NoError(t, err)
+
+       queue := make(chan string, 1)
+       results := make(chan Result, 1)
+       queue <- chartPath
+       close(queue)
+
+       Worker(
+               false, // dryRun
+               false, // uncomment
+               false, // addSchemaReference
+               false, // keepFullComment
+               false, // helmDocsCompatibilityMode
+               false, // dontRemoveHelmDocsPrefix
+               false, // dontAddGlobal
+               false, // annotate
+               []string{"values.base.yaml", "values.prod.yaml"},
+               &SkipAutoGenerationConfig{},
+               "values.schema.json",
+               queue,
+               results,
+       )
+
+       result := <-results
+       assert.Empty(t, result.Errors)
+
+       replicasSchema := result.Schema.Properties["replicas"]
+       if assert.NotNil(t, replicasSchema) {
+               assert.Equal(t, "production replicas", 
replicasSchema.Description)
+               assert.Equal(t, "two", replicasSchema.Default)
+       }
+
+       imageSchema := result.Schema.Properties["image"]
+       if assert.NotNil(t, imageSchema) {
+               repositorySchema := imageSchema.Properties["repository"]
+               if assert.NotNil(t, repositorySchema) {
+                       assert.Equal(t, "nginx", repositorySchema.Default)
+               }
+
+               tagSchema := imageSchema.Properties["tag"]
+               if assert.NotNil(t, tagSchema) {
+                       assert.Equal(t, "latest", tagSchema.Default)
+               }
+
+               pullPolicySchema := imageSchema.Properties["pullPolicy"]
+               if assert.NotNil(t, pullPolicySchema) {
+                       assert.Equal(t, "Always", pullPolicySchema.Default)
+               }
+       }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helm-schema-0.21.3/plugin.yaml 
new/helm-schema-0.22.0/plugin.yaml
--- old/helm-schema-0.21.3/plugin.yaml  2026-03-07 20:15:38.000000000 +0100
+++ new/helm-schema-0.22.0/plugin.yaml  2026-03-10 20:33:49.000000000 +0100
@@ -1,6 +1,6 @@
 ---
 name: "schema"
-version: "0.21.3"
+version: "0.22.0"
 usage: "generate jsonschemas for your helm charts"
 description: "generate jsonschemas for your helm charts"
 command: "$HELM_PLUGIN_DIR/bin/helm-schema"

++++++ helm-schema.obsinfo ++++++
--- /var/tmp/diff_new_pack.ooXxDj/_old  2026-03-11 20:56:51.725740543 +0100
+++ /var/tmp/diff_new_pack.ooXxDj/_new  2026-03-11 20:56:51.729740708 +0100
@@ -1,5 +1,5 @@
 name: helm-schema
-version: 0.21.3
-mtime: 1772910938
-commit: 0a58fe0aefa69caed80bc25feb96a2068fa0a577
+version: 0.22.0
+mtime: 1773171229
+commit: aa676429e4683d6d2704a9ca43ba82676439086e
 

++++++ vendor.tar.gz ++++++

Reply via email to