Skip to content

Conversation

@smortex
Copy link
Member

@smortex smortex commented Mar 20, 2025

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.

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.
@smortex smortex requested a review from a team as a code owner March 20, 2025 20:39
@smortex smortex added the bug Something isn't working label Mar 20, 2025
smortex added 2 commits March 20, 2025 10:43
Style/SuperArguments: Call `super` without arguments and parentheses when all positional and keyword arguments are forwarded.
Newer versions of steep can detect issues that the standard gem does not
allow us to ignore at the moment.
@smortex smortex merged commit 0b5f344 into main Mar 20, 2025
7 checks passed
@smortex smortex deleted the fix-require-uri branch March 20, 2025 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants