-
Notifications
You must be signed in to change notification settings - Fork 441
Ruby Update
How to make a Ruby version update happening.
- Create a link to the ruby package you want to use from devel:languages:ruby
- Make sure it builds at least for the distribution we use on production
There is a ruby configuration section at the bottom of the prjconf. It defines which ruby version the rubygem packages in O:S:U are built for. We only ever build things for one ruby version.
- Adopt all the versioned macros
- rebuild of the rubygem packages, make sure they succeed
If you don't want to do all of the above directly in O:S:U you can create a temporary staging project anywhere and do this in there.
<project name="OBS:Server:Unstable:Ruby40">
<title/>
<description>Testing the ruby 4.0 update</description>
<link project="OBS:Server:Unstable"/>
<repository name="15.3" linkedbuild="all">
<path project="SUSE:SLE-15-SP3:GA" repository="standard"/>
<arch>x86_64</arch>
</repository>
</project>
Find (grep -Hril ruby.ruby2.5
) and replace all interpreter locations you find for the old version with the new version.
Install the new ruby interpreter in your dev-env and try to boot the app. Fix any problems...
docker compose run --rm --service-ports frontend /bin/bash -l
...
frontend@4757397d3caa:/obs/src/api> sudo zypper rm '*ruby*'
# You may need to install the following repo before installing ruby3.1-devel
frontend@4757397d3caa:/obs/src/api> sudo zypper ar -f https://download.opensuse.org/repositories/OBS:/Server:/Unstable:/Ruby31/15.3/OBS:Server:Unstable:Ruby31.repo
frontend@4757397d3caa:/obs/src/api> sudo zypper in ruby3.1-devel
frontend@4757397d3caa:/obs/src/api> bundle.ruby3.1 -v # Set this in Gemfile.lock "BUNDLED WITH"
frontend@4757397d3caa:/obs/src/api> bundle.ruby3.1 install
frontend@4757397d3caa:/obs/src/api> bundle.ruby.ruby3.1 exec rspec
Fix what needs to be fixed.
Once you are reasonably sure you have a working code base again:
- adopt the frontend container to use/setup the new Ruby interpreter version.
- send all your code changes from above as PR and get it merged, the CI will use the adopted container
Now comes the tricky part...
Adopt the Ruby interpreter version in
dist/obs-server.spec
dist/obs-bundled-gems.spec
and make them build.
Once obs-api is building, our test instance will automatically install it.
You need to adopt some files:
- Update the ruby version in
/etc/apache2/conf.d/mod_passenger.conf
- Update the ruby version in
/root/.bashrc
Once this works, move on to production.
Repeat what you had to do on the test instance and deploy everything. Good luck!
- Development Environment Overview
- Development Environment Tips & Tricks
- Spec-Tips
- Code Style
- Rubocop
- Testing with VCR
- Authentication
- Authorization
- Autocomplete
- BS Requests
- Events
- ProjectLog
- Notifications
- Feature Toggles
- Build Results
- Attrib classes
- Flags
- The BackendPackage Cache
- Maintenance classes
- Cloud uploader
- Delayed Jobs
- Staging Workflow
- StatusHistory
- OBS API
- Owner Search
- Search
- Links
- Distributions
- Repository
- Data Migrations
- next_rails
- Ruby Update
- Rails Profiling
- Installing a local LDAP-server
- Remote Pairing Setup Guide
- Factory Dashboard
- osc
- Setup an OBS Development Environment on macOS
- Run OpenQA smoketest locally
- Responsive Guidelines
- Importing database dumps
- Problem Statement & Solution
- Kickoff New Stuff
- New Swagger API doc
- Documentation and Communication
- GitHub Actions
- How to Introduce Software Design Patterns
- Query Objects
- Services
- View Components
- RFC: Core Components
- RFC: Decorator Pattern
- RFC: Backend models