-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build and install the gem during the release workflow #238
Comments
Thanks, @Earlopain. Are you also working on a fix? |
I was kinda betting on #234 working and would have done the changes I explained here, yes. However with the jenkins pipeline still using 2.6 (https://build.ci.opensearch.org/blue/organizations/jenkins/opensearch-ruby-gems-release/detail/opensearch-ruby-gems-release/32/pipeline/) I'm at a bit of a loss here. I checked if maybe the version used here doesn't support this argument but as far as I can tell 5.7.1 is more than enough. I have never used jenkins, I'm much more familiar with github/gitlab CI. I don't think I will be able to figure this one out myself. |
I could install
|
Yeah, that works fine. I can reproduce this problem by first doing $ ruby --version
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
$ gem build
WARNING: open-ended dependency on multi_json (>= 1.0) is not recommended
if multi_json is semantically versioned, use:
add_runtime_dependency "multi_json", "~> 1.0"
WARNING: See https://guides.rubygems.org/specification-reference/ for help
Successfully built RubyGem
Name: opensearch-ruby
Version: 3.2.0
File: opensearch-ruby-3.2.0.gem
$ gem install opensearch-ruby-3.2.0.gem
Successfully installed opensearch-ruby-3.2.0
Parsing documentation for opensearch-ruby-3.2.0
Installing ri documentation for opensearch-ruby-3.2.0
Done installing documentation for opensearch-ruby after 5 seconds
1 gem installed
As you can see, for ruby 2.6 it is trying to install the latest faraday version (currently There has been a bug at one point that makes bundle install ignore This does coincide with the general timeline. faraday 2.8.1 still supported ruby 2.6, faraday 2.9.0 was released only after the last successful release. |
somehow works for me
|
Tho Jenkins is using 2.6.0 while I'm using 2.6.10 |
Nah, I don't think that is it. I was also using |
This could be why It was built with Ruby 3.1. But it has always been like that 🤷 |
I don't think that would be revelant. A build gem doesn't contain resolved dependency versions, it just has the version ranges from the gemspec. I noticed you were able to |
|
Yeah, so I think this is pretty much about the issue I linked above (rubygems/rubygems#4263, and its linked issue rubygems/bundler#2721) The warning being shown by bundler the following: Bundler.ui.warn \
"Your RubyGems version (#{Gem::VERSION}) has a bug that prevents " \
"`required_ruby_version` from working for Bundler. Any scripts that use " \
"`gem install bundler` will break as soon as Bundler drops support for " \
"your Ruby version. Please upgrade RubyGems to avoid future breakage " \
"and silence this warning by running `gem update --system 3.2.3`" So I think you just ran that at some point since the versions match exactly. I installed ruby 2.6 just now again and never did that. Still I do not know why 2.6 is stil being used by jenkins. |
Another thing to note is that Jenkins ran successfully last time with ruby 2.6.0. in Dec 2023 https://rubygems.org/gems/faraday-net_http/versions/3.1.0 was released Jan 2024 |
Yeah, I touched on that earlier with the faraday releases. At that time Dec 12 2023 the latest faraday version was 2.7.12 which had a ruby version requirement of Similar things apply to |
Thanks for all of this work, @Earlopain. As of right now the |
That is not necessary and blocks people from upgrading their own dependencies. There is no problem with how the gem itself dependens on faraday/faraday-net_http. If you run Ruby 2.5 it will simply pick the latest versions that match these constraint, that doesn't have to correspond to the latest version. For ruby 2.5, it would pick faraday I do think I have found the root cause for jenkins not picking the correct ruby version. It's quite simple and I'm a bit bad mad I haven't noticed it sooner:
It looks like rvm is just not available there |
I'm not well versed in rvm. How did we get this error then if the current ruby version is not 2.6.0?
|
Previously successful run also didn't have rvm either |
I'm not quite sure what you mean here. The error message looks right to me and what I would expect in this situation.
Yes, previous run has no rvm, ruby 2.6 must be what is available on jenkins by default The script has no pipefail so it just ignores the failed command and continues on. But when wanting to use something else it must be there, otherwise we'll find us in the situation we are in currently. Here is a workflow that presumably works: https://github.com/opensearch-project/logstash-output-opensearch/blob/d60a58f382ac3c772cd70ad52c79aecb0d085d25/jenkins/release.jenkinsFile The only thing I can think of that might make a differencfe is the |
Thanks @Earlopain. I've created issue in opensearch-project/opensearch-build. Someone from the build team will give us a hand. |
I'm not sure in which version of rubygems this was resolved with, I skimmed the changelog but didn't really find anything. Ruby 2.5 might contain a rubygems version without this error, or it might. I don't really know. It's easy to check but also not really relevant. The version of Ruby a gem is build with is not important. A gem may support rubies from 2.0 all the way to 3.3 and you could choose any version inbetween. It is really just very unfortunate that 2.6 contains this bug. Even just running The important thing here is that a ruby environment without this rubygems error is available. You might even be able to use the jruby version I found earlier? Though I don't know anything about that, a "normal" ruby would certainly be more welcome to me at least. The latest patch version of 3.0 definitly works. I'll follow that issue you openend and chime in if I've got something useful to add. |
I'll go ahead and close this, now that a new version has successfully been released. After more understanding I don't think there's much value in doing what I initially proposed in this issue. Thanks @nhtruong for all the conversation around this, got me learning about a bunch of new things (: |
Thank you @Earlopain for all your help and I've learned quite a few things myself too. Also I don't see an email on your profile. Are you happen to be on our slack workspace? |
I'm not really in the slack, no. I didn't even know that was a thing until you pointed that out to me just now. Are you asking because of something specific or just in general? |
@Earlopain Hi sorry it took some time to go through the process to nominate a new maintainer. Please shoot me an email to [email protected] so that I can send you the invite :) |
Ah ok, I see. I'll hit you up tomorrow |
What are you proposing?
The release pipeline broke because the jenkins workflow used Ruby 2.6 by default. Most workflows in the repo use a more modern version like 3.1.
The release workflow should try to build and install the gem before asking for approval so that failures are quick to be noticed. In addition, jenkins should use the same ruby version as the github action. I bumped it to 3.0 since that was the first to work but it should have been 3.1. At the minimum it requires a comment to keep it in sync.
The text was updated successfully, but these errors were encountered: