From 4ecd1f9c3b15201edc84061eead44a140565d064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Thu, 20 Mar 2025 10:29:30 -1000 Subject: [PATCH 1/3] Fix missing requirement for uri When loading configuration from an option file (using OpenSearch::CLI#load, which rely on OptionParser#load) and `uri` is not loaded, an undefined method exception is raised when an `url` option is parsed, but that exception is captured by the OptionParser logic resulting in the option file to be completely ignored. While #load return false to indicate the failure, consumers of the library are unlikely to check it because end users may or may not rely on option files. Unconditionally require uri to avoid this issue. --- lib/opensearch/cli.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/opensearch/cli.rb b/lib/opensearch/cli.rb index 07ad239..f63808c 100644 --- a/lib/opensearch/cli.rb +++ b/lib/opensearch/cli.rb @@ -2,6 +2,7 @@ require "openssl" require "optparse" +require "uri" module OpenSearch class CLI < OptionParser From da0eaaf9f098bd539bb61cd772b63795e79a89b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Thu, 20 Mar 2025 10:43:19 -1000 Subject: [PATCH 2/3] Fix standard complaint about calling super Style/SuperArguments: Call `super` without arguments and parentheses when all positional and keyword arguments are forwarded. --- lib/opensearch/cli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/opensearch/cli.rb b/lib/opensearch/cli.rb index f63808c..8a3b3e9 100644 --- a/lib/opensearch/cli.rb +++ b/lib/opensearch/cli.rb @@ -13,7 +13,7 @@ def initialize(banner = nil, width = 32, indent = " " * 4, &block) host: "https://localhost:9200", transport_options: {ssl: {}} } - super(banner, width, indent) {} + super {} add_opensearch_options From f0c570db646c22085bf609ba63c1909922f59dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Thu, 20 Mar 2025 11:00:42 -1000 Subject: [PATCH 3/3] Use an older version of steep Newer versions of steep can detect issues that the standard gem does not allow us to ignore at the moment. --- Gemfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 5a38c04..59f86ce 100644 --- a/Gemfile +++ b/Gemfile @@ -14,5 +14,8 @@ gem "rspec", "~> 3.0" gem "standard", "~> 1.3" group :development do - gem "steep", require: false + # FIXME: Relax this version when the stardand gem can cope with empty collection annotations + # https://github.com/soutaro/steep/pull/1338 + # https://github.com/standardrb/standard/pull/656 + gem "steep", "< 1.9.0", require: false end