Skip to content

Commit 283afd0

Browse files
Don't honor VERSION_QUALIFIER if set but empty (#17032) (#17069)
PR #17006 revealed that the `VERSION_QUALIFIER` env var gets honored in various scripts when present but empty. This shouldn't be the case as the DRA process is designed to gracefully ignore empty values for this variable. This commit changes various ruby scripts to not treat "" as truthy. Bash scripts (used by CI etc.) are already ok with this as part of refactorings done in #16907. --------- Co-authored-by: Andrea Selva <[email protected]> (cherry picked from commit c7204fd) Co-authored-by: Dimitrios Liappis <[email protected]>
1 parent 5379028 commit 283afd0

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

logstash-core-plugin-api/logstash-core-plugin-api.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if File.exist?(project_versions_yaml_path)
1313
# each time we build the logstash-core gem
1414
original_lines = IO.readlines(project_versions_yaml_path)
1515
# introduce the version qualifier (e.g. beta1, rc1) into the copied yml so it's displayed by Logstash
16-
if ENV['VERSION_QUALIFIER']
16+
unless ENV['VERSION_QUALIFIER'].to_s.strip.empty?
1717
logstash_version_line = original_lines.find {|line| line.match(/^logstash:/) }
1818
logstash_version_line.chomp!
1919
logstash_version_line << "-#{ENV['VERSION_QUALIFIER']}\n"

logstash-core/logstash-core.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if File.exist?(project_versions_yaml_path)
1818
# each time we build the logstash-core gem
1919
original_lines = IO.readlines(project_versions_yaml_path)
2020
# introduce the version qualifier (e.g. beta1, rc1) into the copied yml so it's displayed by Logstash
21-
if ENV['VERSION_QUALIFIER']
21+
unless ENV['VERSION_QUALIFIER'].to_s.strip.empty?
2222
logstash_version_line = original_lines.find {|line| line.match(/^logstash:/) }
2323
logstash_version_line.chomp!
2424
logstash_version_line << "-#{ENV['VERSION_QUALIFIER']}\n"

qa/docker/spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def version
1313
end
1414

1515
def qualified_version
16-
qualifier = ENV['VERSION_QUALIFIER']
16+
qualifier = ENV['VERSION_QUALIFIER'].to_s.strip.empty? ? nil : ENV['VERSION_QUALIFIER']
1717
qualified_version = qualifier ? [version, qualifier].join("-") : version
1818
ENV["RELEASE"] == "1" ? qualified_version : [qualified_version, "SNAPSHOT"].join("-")
1919
end

rakelib/artifacts.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
namespace "artifact" do
1919
SNAPSHOT_BUILD = ENV["RELEASE"] != "1"
20-
VERSION_QUALIFIER = ENV["VERSION_QUALIFIER"]
20+
VERSION_QUALIFIER = ENV["VERSION_QUALIFIER"].to_s.strip.empty? ? nil : ENV["VERSION_QUALIFIER"]
2121
LOCAL_ARTIFACTS = ENV["LOCAL_ARTIFACTS"] || "true"
2222
PACKAGE_SUFFIX = SNAPSHOT_BUILD ? "-SNAPSHOT" : ""
2323

0 commit comments

Comments
 (0)