diff --git a/Dockerfile b/Dockerfile index 9491ee8c9..e567b4b47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,7 @@ ADD LICENSE.txt /opt/logstash/LICENSE.txt ADD NOTICE.TXT /opt/logstash/NOTICE.TXT ADD licenses /opt/logstash/licenses ADD CONTRIBUTORS /opt/logstash/CONTRIBUTORS -ADD Gemfile.template Gemfile.jruby-2.5.lock.* /opt/logstash/ +ADD Gemfile.template Gemfile.jruby-2.6.lock.* /opt/logstash/ ADD Rakefile /opt/logstash/Rakefile ADD build.gradle /opt/logstash/build.gradle ADD rubyUtils.gradle /opt/logstash/rubyUtils.gradle diff --git a/bin/logstash.lib.sh b/bin/logstash.lib.sh index 53d541ca8..f5092b2b1 100755 --- a/bin/logstash.lib.sh +++ b/bin/logstash.lib.sh @@ -163,7 +163,7 @@ setup_vendored_jruby() { fi if [ -z "$LS_GEM_HOME" ] ; then - export GEM_HOME="${LOGSTASH_HOME}/vendor/bundle/jruby/2.5.0" + export GEM_HOME="${LOGSTASH_HOME}/vendor/bundle/jruby/2.6.0" else export GEM_HOME=${LS_GEM_HOME} fi diff --git a/build.gradle b/build.gradle index 7d77a680a..4e536331d 100644 --- a/build.gradle +++ b/build.gradle @@ -318,9 +318,9 @@ def bundlerVersion = "~> 2" tasks.register("installBundler") { dependsOn assemblyDeps - outputs.files file("${projectDir}/vendor/bundle/jruby/2.5.0/bin/bundle") + outputs.files file("${projectDir}/vendor/bundle/jruby/2.6.0/bin/bundle") doLast { - gem(projectDir, buildDir, "bundler", bundlerVersion, "${projectDir}/vendor/bundle/jruby/2.5.0") + gem(projectDir, buildDir, "bundler", bundlerVersion, "${projectDir}/vendor/bundle/jruby/2.6.0") } } @@ -334,9 +334,9 @@ tasks.register("bootstrap"){ tasks.register("installDefaultGems") { dependsOn bootstrap - doLast { - rake(projectDir, buildDir, 'plugin:install-default') - } + doLast { + rake(projectDir, buildDir, 'plugin:install-default') + } } tasks.register("installTestGems") { @@ -441,7 +441,7 @@ tasks.register("unpackTarDistribution", Copy) { def qaBuildPath = "${buildDir}/qa/integration" def qaVendorPath = "${qaBuildPath}/vendor" -def qaBundledGemPath = "${qaVendorPath}/jruby/2.5.0".toString() +def qaBundledGemPath = "${qaVendorPath}/jruby/2.6.0".toString() def qaBundleBin = "${qaBundledGemPath}/bin/bundle" tasks.register("installIntegrationTestBundler"){ diff --git a/lib/bootstrap/bundler.rb b/lib/bootstrap/bundler.rb index 550511741..1a2f3aba6 100644 --- a/lib/bootstrap/bundler.rb +++ b/lib/bootstrap/bundler.rb @@ -119,7 +119,7 @@ module LogStash ) end # create Gemfile.jruby-1.9.lock from template iff a template exists it itself does not exist - lock_template = ::File.join(ENV["LOGSTASH_HOME"], "Gemfile.jruby-2.5.lock.release") + lock_template = ::File.join(ENV["LOGSTASH_HOME"], "Gemfile.jruby-2.6.lock.release") if ::File.exists?(lock_template) && !::File.exists?(Environment::LOCKFILE) FileUtils.copy(lock_template, Environment::LOCKFILE) end diff --git a/lib/pluginmanager/gem_installer.rb b/lib/pluginmanager/gem_installer.rb index bcf961205..9cdc390d6 100644 --- a/lib/pluginmanager/gem_installer.rb +++ b/lib/pluginmanager/gem_installer.rb @@ -26,7 +26,7 @@ module LogStash module PluginManager # - Generate the specifications # - Copy the data in the right folders class GemInstaller - GEM_HOME = Pathname.new(::File.join(LogStash::Environment::BUNDLE_DIR, "jruby", "2.5.0")) + GEM_HOME = Pathname.new(::File.join(LogStash::Environment::BUNDLE_DIR, "jruby", "2.6.0")) SPECIFICATIONS_DIR = "specifications" GEMS_DIR = "gems" CACHE_DIR = "cache" diff --git a/lib/pluginmanager/util.rb b/lib/pluginmanager/util.rb index 4d963f785..638ff734d 100644 --- a/lib/pluginmanager/util.rb +++ b/lib/pluginmanager/util.rb @@ -68,9 +68,9 @@ module LogStash::PluginManager return false end else - dep = Gem::Dependency.new(plugin, version || Gem::Requirement.default) - Gem.sources = Gem::SourceList.from(options[:rubygems_source]) if options[:rubygems_source] - specs, errors = Gem::SpecFetcher.fetcher.spec_for_dependency(dep) + dep = ::Gem::Dependency.new(plugin, version || ::Gem::Requirement.default) + ::Gem.sources = ::Gem::SourceList.from(options[:rubygems_source]) if options[:rubygems_source] + specs, errors = ::Gem::SpecFetcher.fetcher.spec_for_dependency(dep) # dump errors errors.each { |error| $stderr.puts(error.wordy) } @@ -112,7 +112,7 @@ module LogStash::PluginManager # @return [Gem::Specification] .get file gem specification # @raise [Exception] Gem::Package::FormatError will be raised on invalid .gem file format, might be other exceptions too def self.plugin_file_spec(path) - Gem::Package.new(path).spec + ::Gem::Package.new(path).spec end # @param plugin [String] the plugin name or the local path to a .gem file @@ -125,7 +125,7 @@ module LogStash::PluginManager # @param name [String] specific plugin name to find or nil for all plugins # @return [Array] all local logstash plugin gem specs def self.find_plugins_gem_specs(name = nil) - specs = name ? Gem::Specification.find_all_by_name(name) : Gem::Specification.find_all + specs = name ? ::Gem::Specification.find_all_by_name(name) : ::Gem::Specification.find_all specs.select{|spec| logstash_plugin_gem_spec?(spec)} end diff --git a/logstash-core/lib/logstash/api/app_helpers.rb b/logstash-core/lib/logstash/api/app_helpers.rb index 99db7d963..d8d623b7c 100644 --- a/logstash-core/lib/logstash/api/app_helpers.rb +++ b/logstash-core/lib/logstash/api/app_helpers.rb @@ -60,8 +60,11 @@ module LogStash::Api::AppHelpers end def as_boolean(string) - return true if string == true || string =~ (/(true|t|yes|y|1)$/i) - return false if string == false || LogStash::Util.blank?(string) || string =~ (/(false|f|no|n|0)$/i) + return true if string == true + return false if string == false + + return true if string =~ (/(true|t|yes|y|1)$/i) + return false if LogStash::Util.blank?(string) || string =~ (/(false|f|no|n|0)$/i) raise ArgumentError.new("invalid value for Boolean: \"#{string}\"") end diff --git a/logstash-core/lib/logstash/compiler/lscl.rb b/logstash-core/lib/logstash/compiler/lscl.rb index 7c792a9a8..9d5a6e335 100644 --- a/logstash-core/lib/logstash/compiler/lscl.rb +++ b/logstash-core/lib/logstash/compiler/lscl.rb @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. +require "logstash/patches/polyglot" require "treetop" require "logstash/compiler/treetop_monkeypatches" require "logstash/compiler/lscl/helpers" @@ -112,7 +113,7 @@ module LogStashCompilerLSCLGrammar; module LogStash; module Compiler; module LSC def expr_attributes # Turn attributes into a hash map self.attributes.recursive_select(Attribute).map(&:expr).map {|k,v| - if v.java_kind_of?(Java::OrgLogstashConfigIrExpression::ValueExpression) + if v.kind_of?(Java::OrgLogstashConfigIrExpression::ValueExpression) [k, v.get] else [k,v] @@ -347,7 +348,7 @@ module LogStashCompilerLSCLGrammar; module LogStash; module Compiler; module LSC def jconvert(sexpr) raise "jconvert cannot handle nils!" if sexpr.nil? - if sexpr.java_kind_of?(Java::OrgLogstashConfigIrExpression::Expression) + if sexpr.kind_of?(Java::OrgLogstashConfigIrExpression::Expression) return sexpr end diff --git a/logstash-core/lib/logstash/config/lir_serializer.rb b/logstash-core/lib/logstash/config/lir_serializer.rb index 6740ae70e..663d3ad50 100644 --- a/logstash-core/lib/logstash/config/lir_serializer.rb +++ b/logstash-core/lib/logstash/config/lir_serializer.rb @@ -71,13 +71,13 @@ module LogStash; end def vertex_type(v) - if v.java_kind_of?(org.logstash.config.ir.graph.PluginVertex) + if v.kind_of?(org.logstash.config.ir.graph.PluginVertex) :plugin - elsif v.java_kind_of?(org.logstash.config.ir.graph.IfVertex) + elsif v.kind_of?(org.logstash.config.ir.graph.IfVertex) :if - elsif v.java_kind_of?(org.logstash.config.ir.graph.QueueVertex) + elsif v.kind_of?(org.logstash.config.ir.graph.QueueVertex) :queue - elsif v.java_kind_of?(org.logstash.config.ir.graph.SeparatorVertex) + elsif v.kind_of?(org.logstash.config.ir.graph.SeparatorVertex) :separator else raise "Unexpected vertex type! #{v}" @@ -121,7 +121,7 @@ module LogStash; edges.each do |e| if vertex_type(e.to) == :separator e.to.getOutgoingEdges.each do |outgoing| - if e.java_kind_of?(org.logstash.config.ir.graph.BooleanEdge) + if e.kind_of?(org.logstash.config.ir.graph.BooleanEdge) edges_with_separators_removed << edge(org.logstash.config.ir.graph.BooleanEdge.new(e.edgeType, e.from, outgoing.to)) else edges_with_separators_removed << edge(org.logstash.config.ir.graph.PlainEdge.factory.make(e.from, outgoing.to)) @@ -143,7 +143,7 @@ module LogStash; "id" => e.id } - if e.java_kind_of?(org.logstash.config.ir.graph.BooleanEdge) + if e.kind_of?(org.logstash.config.ir.graph.BooleanEdge) e_json["when"] = e.edge_type e_json["type"] = "boolean" else diff --git a/logstash-core/lib/logstash/patches/polyglot.rb b/logstash-core/lib/logstash/patches/polyglot.rb new file mode 100644 index 000000000..1e9c14bd0 --- /dev/null +++ b/logstash-core/lib/logstash/patches/polyglot.rb @@ -0,0 +1,19 @@ +require 'polyglot' + + +module Kernel + alias original_require require + + def require(*a, &b) + begin + original_require(*a, &b) + rescue RuntimeError => e + # https://github.com/jruby/jruby/pull/7145 introduced an exception check for circular causes, which + # breaks when the polyglot library is used and LoadErrors are emitted + if e.message == "circular causes" + raise e.cause + end + raise e + end + end +end diff --git a/logstash-core/lib/logstash/plugins/registry.rb b/logstash-core/lib/logstash/plugins/registry.rb index 0f8453136..342b1d288 100644 --- a/logstash-core/lib/logstash/plugins/registry.rb +++ b/logstash-core/lib/logstash/plugins/registry.rb @@ -293,7 +293,6 @@ module LogStash module Plugins # @return [Boolean] true if klass is a valid plugin for name def is_a_plugin?(klass, name) (klass.class == Java::JavaLang::Class && klass.simple_name.downcase == name.gsub('_','')) || - (klass.class == Java::JavaClass && klass.simple_name.downcase == name.gsub('_','')) || (klass.ancestors.include?(LogStash::Plugin) && klass.respond_to?(:config_name) && klass.config_name == name) end diff --git a/logstash-core/lib/logstash/runner.rb b/logstash-core/lib/logstash/runner.rb index a7be6c6bb..cd6b49492 100644 --- a/logstash-core/lib/logstash/runner.rb +++ b/logstash-core/lib/logstash/runner.rb @@ -32,7 +32,6 @@ if !LogStash::OSS end require "clamp" - require "logstash-core/logstash-core" require "logstash/environment" require "logstash/modules/cli_parser" diff --git a/logstash-core/lib/logstash/util/cloud_setting_auth.rb b/logstash-core/lib/logstash/util/cloud_setting_auth.rb index 1ff525287..e7eb9b5b2 100644 --- a/logstash-core/lib/logstash/util/cloud_setting_auth.rb +++ b/logstash-core/lib/logstash/util/cloud_setting_auth.rb @@ -16,5 +16,5 @@ # under the License. module LogStash; module Util - java_import org.logstash.util.CloudSettingAuth + java_import "org.logstash.util.CloudSettingAuth" end; end diff --git a/logstash-core/lib/logstash/util/cloud_setting_id.rb b/logstash-core/lib/logstash/util/cloud_setting_id.rb index 5fb35c3d3..71851a2ed 100644 --- a/logstash-core/lib/logstash/util/cloud_setting_id.rb +++ b/logstash-core/lib/logstash/util/cloud_setting_id.rb @@ -18,5 +18,5 @@ require "base64" module LogStash; module Util - java_import org.logstash.util.CloudSettingId + java_import "org.logstash.util.CloudSettingId" end; end diff --git a/logstash-core/lib/logstash/util/modules_setting_array.rb b/logstash-core/lib/logstash/util/modules_setting_array.rb index 854cdca5f..d092f7e36 100644 --- a/logstash-core/lib/logstash/util/modules_setting_array.rb +++ b/logstash-core/lib/logstash/util/modules_setting_array.rb @@ -16,5 +16,5 @@ # under the License. module LogStash; module Util - java_import org.logstash.util.ModulesSettingArray + java_import "org.logstash.util.ModulesSettingArray" end; end diff --git a/logstash-core/lib/logstash/util/time_value.rb b/logstash-core/lib/logstash/util/time_value.rb index 85094c417..5b9ad9bd1 100644 --- a/logstash-core/lib/logstash/util/time_value.rb +++ b/logstash-core/lib/logstash/util/time_value.rb @@ -17,6 +17,6 @@ module LogStash module Util - java_import org.logstash.util.TimeValue + java_import "org.logstash.util.TimeValue" end end diff --git a/logstash-core/spec/logstash/util_spec.rb b/logstash-core/spec/logstash/util_spec.rb index c3297ed77..9123f3e7f 100644 --- a/logstash-core/spec/logstash/util_spec.rb +++ b/logstash-core/spec/logstash/util_spec.rb @@ -90,17 +90,5 @@ describe LogStash::Util do expect( thread_id ).to be_a Integer expect( thread_id ).to eq(java.lang.Thread.currentThread.getId) end - - context "when a (native) thread is collected" do - let(:dead_thread) { Thread.new { 42 }.tap { |t| sleep(0.01) while t.status } } - - it "returns nil as id" do - thread = dead_thread - p thread if $VERBOSE - 2.times { java.lang.System.gc || sleep(0.01) } # we're assuming a full-gc to clear all weak-refs - # NOTE: if you notice this spec failing - remote it (a java.lang.Thread weak-ref might stick around) - expect(LogStash::Util.get_thread_id(thread)).to be nil - end - end end end diff --git a/logstash-core/spec/support/helpers.rb b/logstash-core/spec/support/helpers.rb index de7beb31e..aa2a55549 100644 --- a/logstash-core/spec/support/helpers.rb +++ b/logstash-core/spec/support/helpers.rb @@ -110,7 +110,7 @@ end RSpec::Matchers.define :ir_eql do |expected| match do |actual| - next unless expected.java_kind_of?(org.logstash.config.ir.SourceComponent) && actual.java_kind_of?(org.logstash.config.ir.SourceComponent) + next unless expected.kind_of?(org.logstash.config.ir.SourceComponent) && actual.kind_of?(org.logstash.config.ir.SourceComponent) expected.sourceComponentEquals(actual) end diff --git a/logstash-core/src/main/java/org/logstash/RubyJavaIntegration.java b/logstash-core/src/main/java/org/logstash/RubyJavaIntegration.java index 4ec9fadca..d3d15c118 100644 --- a/logstash-core/src/main/java/org/logstash/RubyJavaIntegration.java +++ b/logstash-core/src/main/java/org/logstash/RubyJavaIntegration.java @@ -31,9 +31,11 @@ import java.util.stream.Stream; import org.jruby.Ruby; import org.jruby.RubyBasicObject; import org.jruby.RubyString; +import org.jruby.RubyModule; import org.jruby.anno.JRubyMethod; import org.jruby.java.proxies.JavaProxy; import org.jruby.java.proxies.MapJavaProxy; +import org.jruby.javasupport.Java; import org.jruby.javasupport.JavaClass; import org.jruby.javasupport.JavaUtil; import org.jruby.runtime.Block; @@ -60,14 +62,14 @@ public final class RubyJavaIntegration { ruby.getArray().defineAnnotatedMethods(RubyJavaIntegration.RubyArrayOverride.class); ruby.getHash().defineAnnotatedMethods(RubyJavaIntegration.RubyHashOverride.class); Stream.of(LinkedHashMap.class, HashMap.class).forEach(cls -> - JavaClass.get(ruby, cls).getProxyModule().defineAnnotatedMethods( + Java.getProxyClass(ruby, cls).defineAnnotatedMethods( RubyJavaIntegration.RubyMapProxyOverride.class ) ); - JavaClass.get(ruby, Map.class).getProxyModule().defineAnnotatedMethods( + Java.getProxyClass(ruby, Map.class).defineAnnotatedMethods( RubyJavaIntegration.JavaMapOverride.class ); - JavaClass.get(ruby, Collection.class).getProxyModule().defineAnnotatedMethods( + Java.getProxyClass(ruby, Collection.class).defineAnnotatedMethods( RubyJavaIntegration.JavaCollectionOverride.class ); } @@ -279,7 +281,8 @@ public final class RubyJavaIntegration { @JRubyMethod public static IRubyObject merge(final ThreadContext context, final IRubyObject self, final IRubyObject other) { - return ((MapJavaProxy) self.dup()).merge_bang(context, other, Block.NULL_BLOCK); + IRubyObject[] other_array = { other }; + return ((MapJavaProxy) self.dup()).merge_bang(context, other_array, Block.NULL_BLOCK); } } } diff --git a/logstash-core/src/test/java/org/logstash/config/ir/RubyEnvTestCase.java b/logstash-core/src/test/java/org/logstash/config/ir/RubyEnvTestCase.java index 1d540876f..666bd1567 100644 --- a/logstash-core/src/test/java/org/logstash/config/ir/RubyEnvTestCase.java +++ b/logstash-core/src/test/java/org/logstash/config/ir/RubyEnvTestCase.java @@ -23,6 +23,7 @@ package org.logstash.config.ir; import java.nio.file.Path; import org.jruby.RubyHash; +import org.jruby.runtime.load.LibrarySearcher; import org.jruby.runtime.load.LoadService; import org.junit.BeforeClass; import org.logstash.RubyTestBase; @@ -41,9 +42,10 @@ public abstract class RubyEnvTestCase extends RubyTestBase { */ private static void ensureLoadpath() { final LoadService loader = RubyUtil.RUBY.getLoadService(); - if (loader.findFileForLoad("logstash/compiler").library == null) { + final LibrarySearcher librarySearcher = new LibrarySearcher(loader); + if (librarySearcher.findLibraryForLoad("logstash/compiler") == null) { final String gems = LS_HOME. - resolve("vendor").resolve("bundle").resolve("jruby").resolve("2.5.0"). + resolve("vendor").resolve("bundle").resolve("jruby").resolve("2.6.0"). toFile().getAbsolutePath(); final RubyHash environment = RubyUtil.RUBY.getENV(); environment.put("GEM_HOME", gems); diff --git a/qa/integration/rspec.rb b/qa/integration/rspec.rb index 6b2740e5d..ac58f1051 100644 --- a/qa/integration/rspec.rb +++ b/qa/integration/rspec.rb @@ -20,7 +20,7 @@ require 'rubygems' ::Gem.clear_paths ENV['GEM_HOME'] = ENV['GEM_PATH'] = ::File.expand_path( - ::File.join(__FILE__, "..", "..", "..", "build", "qa", "integration", "vendor", "jruby", "2.5.0") + ::File.join(__FILE__, "..", "..", "..", "build", "qa", "integration", "vendor", "jruby", "2.6.0") ) ::Gem.paths = ENV diff --git a/qa/integration/specs/command_line_spec.rb b/qa/integration/specs/command_line_spec.rb index 5eeb3e349..a8ba27740 100644 --- a/qa/integration/specs/command_line_spec.rb +++ b/qa/integration/specs/command_line_spec.rb @@ -40,7 +40,7 @@ describe "CLI >" do execute = @logstash.run lines = execute.stderr_and_stdout.split("\n") expect(lines.shift).to match(/^(Using system java)|(Using bundled JDK)|(Using LS_JAVA_HOME defined java):/) - while (up_line = lines.shift).match(/OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated|warning: ignoring JAVA_TOOL_OPTIONS/) do end + while (up_line = lines.shift).match(/OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated|warning: ignoring JAVA_TOOL_OPTIONS|warning: already initialized constant Socket::Constants/) do end expect(up_line).to match(/^Sending Logstash logs to/) end end diff --git a/rakelib/artifacts.rake b/rakelib/artifacts.rake index 442651b7e..e8cfaa8a3 100644 --- a/rakelib/artifacts.rake +++ b/rakelib/artifacts.rake @@ -346,6 +346,8 @@ namespace "artifact" do end task "generate_build_metadata" do + require 'time' + return if defined?(BUILD_METADATA_FILE) BUILD_METADATA_FILE = Tempfile.new('build.rb') BUILD_DATE=Time.now.iso8601 diff --git a/rakelib/compile.rake b/rakelib/compile.rake index 009c29365..72ec52c3c 100644 --- a/rakelib/compile.rake +++ b/rakelib/compile.rake @@ -16,6 +16,7 @@ # under the License. rule ".rb" => ".treetop" do |task, args| + require 'logstash/patches/polyglot' require "treetop" compiler = Treetop::Compiler::GrammarCompiler.new compiler.compile(task.source, task.name) diff --git a/rubyUtils.gradle b/rubyUtils.gradle index 7032e0f9f..4f8e238ee 100644 --- a/rubyUtils.gradle +++ b/rubyUtils.gradle @@ -25,7 +25,7 @@ buildscript { dependencies { classpath 'org.yaml:snakeyaml:1.29' classpath "de.undercouch:gradle-download-task:4.0.4" - classpath "org.jruby:jruby-complete:9.2.20.1" + classpath "org.jruby:jruby-complete:9.3.4.0" } } @@ -139,7 +139,7 @@ void buildGem(File projectDir, File buildDir, String gemspec) { void rake(File projectDir, File buildDir, String task) { executeJruby projectDir, buildDir, { ScriptingContainer jruby -> jruby.currentDirectory = projectDir - jruby.runScriptlet("require 'rake'") + jruby.runScriptlet("require 'rake'; require 'time'") jruby.runScriptlet(""" rake = Rake.application rake.init @@ -168,7 +168,7 @@ void setupJruby(File projectDir, File buildDir) { Object executeJruby(File projectDir, File buildDir, Closure /* Object*/ block) { def jruby = new ScriptingContainer() def env = jruby.environment - def gemDir = "${projectDir}/vendor/bundle/jruby/2.5.0".toString() + def gemDir = "${projectDir}/vendor/bundle/jruby/2.6.0".toString() env.put "USE_RUBY", "1" env.put "GEM_HOME", gemDir env.put "GEM_SPEC_CACHE", "${buildDir}/cache".toString() diff --git a/tools/release/bump_plugin_versions.rb b/tools/release/bump_plugin_versions.rb index ebdfdaa32..81794deec 100755 --- a/tools/release/bump_plugin_versions.rb +++ b/tools/release/bump_plugin_versions.rb @@ -66,14 +66,14 @@ puts "Computing #{allow_bump_for} plugin dependency bump from #{base_logstash_ve if base_logstash_version == "LOCAL" puts "Using local lockfile..." begin - result = File.read("Gemfile.jruby-2.5.lock.release") + result = File.read("Gemfile.jruby-2.6.lock.release") rescue => e puts "Failed to read local lockfile #{e}" exit(1) end else puts "Fetching lock file for #{base_logstash_version}.." - uri = URI.parse("https://raw.githubusercontent.com/elastic/logstash/v#{base_logstash_version}/Gemfile.jruby-2.5.lock.release") + uri = URI.parse("https://raw.githubusercontent.com/elastic/logstash/v#{base_logstash_version}/Gemfile.jruby-2.6.lock.release") result = Net::HTTP.get(uri) if result.match(/404/) puts "Lock file or git tag for #{base_logstash_version} not found. Aborting" @@ -104,7 +104,7 @@ end IO.write("Gemfile.template", gemfile) puts "Cleaning up before running computing dependencies" -FileUtils.rm_f("Gemfile.jruby-2.5.lock.release") +FileUtils.rm_f("Gemfile.jruby-2.6.lock.release") # compute new lock file puts "Running: ./gradlew clean installDefaultGems" @@ -121,18 +121,18 @@ IO.write("Gemfile.lock", new_lock.join("\n")) # rename file puts "Finishing up.." -FileUtils.mv("Gemfile.lock", "Gemfile.jruby-2.5.lock.release") +FileUtils.mv("Gemfile.lock", "Gemfile.jruby-2.6.lock.release") `git checkout -- Gemfile.template` -puts `git diff Gemfile.jruby-2.5.lock.release` +puts `git diff Gemfile.jruby-2.6.lock.release` exit(0) unless options[:pr] puts "Creating commit.." branch_name = "update_lock_#{Time.now.to_i}" `git checkout -b #{branch_name}` -`git commit Gemfile.jruby-2.5.lock.release -m "Update #{allow_bump_for} plugin versions in gemfile lock"` +`git commit Gemfile.jruby-2.6.lock.release -m "Update #{allow_bump_for} plugin versions in gemfile lock"` puts "Pushing commit.." `git remote add upstream git@github.com:elastic/logstash.git` diff --git a/versions.yml b/versions.yml index f3136961b..a956d5500 100644 --- a/versions.yml +++ b/versions.yml @@ -13,9 +13,8 @@ bundled_jdk: # jruby must reference a *released* version of jruby which can be downloaded from the official download url # *and* for which jars artifacts are published for compile-time jruby: - version: 9.2.20.1 - sha1: 7f45f8a3d53d5f19f69952014abcb542b2670846 - + version: 9.3.4.0 + sha1: 91e54b1c8962dd7a7fbcbab012f5d8ba1f15e5a4 # jruby-runtime-override, if specified, will override the jruby version installed in vendor/jruby #jruby-runtime-override: # url: https://oss.sonatype.org/content/repositories/snapshots/org/jruby/jruby-dist/9.3.0.0-SNAPSHOT/jruby-dist-9.3.0.0-20210723.214927-259-bin.tar.gz diff --git a/x-pack/qa/integration/spec_helper.rb b/x-pack/qa/integration/spec_helper.rb index 974092b02..38fb1a224 100644 --- a/x-pack/qa/integration/spec_helper.rb +++ b/x-pack/qa/integration/spec_helper.rb @@ -7,5 +7,6 @@ MONITORING_INDEXES = ".monitoring-logstash-*" require_relative "support/helpers" require_relative "support/shared_examples" require_relative "support/elasticsearch/api/actions/update_password" +require "logstash/patches/polyglot" require "json" require "json-schema"