Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/lib/dependabot/shared/utils/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
module Dependabot
module Shared
module Utils
HELM_REGEXP = /values[\-a-zA-Z_0-9]*\.ya?ml$/i
HELM_REGEXP = %r{(^|/)values(?:\.[\w-]+)?\.ya?ml$}i

extend T::Sig

Expand Down
2 changes: 1 addition & 1 deletion helm/lib/dependabot/helm/file_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class FileParser < Dependabot::Shared::SharedFileParser

CHART_YAML = /.*chart\.ya?ml$/i
CHART_LOCK = /.*chart\.lock$/i
VALUES_YAML = /.*values\.ya?ml$/i
VALUES_YAML = %r{.*(^|/)values(?:\.[\w-]+)?\.ya?ml$}i
DEFAULT_REPOSITORY = "https://charts.helm.sh/stable"

sig { returns(Ecosystem) }
Expand Down
28 changes: 28 additions & 0 deletions helm/spec/dependabot/helm/file_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,34 @@
expect(dependency.version).to eq("1.25.3")
end
end

context "with environment-specific values file (values.cass.yaml)" do
let(:helmfile_fixture_name) { "values_environment_specific.yaml" }
let(:helmfile) do
Dependabot::DependencyFile.new(
name: "values.cass.yaml",
content: helmfile_body
)
end

it "is able to parse environment-specific values files" do
expect(dependencies.length).to eq(3)

mdsd_dependency = dependencies.find { |d| d.name == "linuxgeneva-microsoft.azurecr.io/distroless/genevamdsd" }
expect(mdsd_dependency).to be_a(Dependabot::Dependency)
expect(mdsd_dependency.version).to eq("1.35.9-20250722-2")

mdm_dependency = dependencies.find { |d| d.name == "linuxgeneva-microsoft.azurecr.io/distroless/genevamdm" }
expect(mdm_dependency).to be_a(Dependabot::Dependency)
expect(mdm_dependency.version).to eq("2.202507220956.0-20250722-1")

fluentd_dependency = dependencies.find do |d|
d.name == "linuxgeneva-microsoft.azurecr.io/distroless/genevafluentd"
end
expect(fluentd_dependency).to be_a(Dependabot::Dependency)
expect(fluentd_dependency.version).to eq("1.18.0-20250722-2")
end
end
end
end

Expand Down
15 changes: 15 additions & 0 deletions helm/spec/fixtures/helm/v3/values_environment_specific.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Test fixture for environment-specific values file like values.cass.yaml
mdsd:
image:
repository: linuxgeneva-microsoft.azurecr.io/distroless/genevamdsd
tag: 1.35.9-20250722-2

mdm:
image:
repository: linuxgeneva-microsoft.azurecr.io/distroless/genevamdm
tag: 2.202507220956.0-20250722-1

fluentd:
image:
repository: linuxgeneva-microsoft.azurecr.io/distroless/genevafluentd
tag: 1.18.0-20250722-2
Loading