Specify which Ruby version to build via RUBY_VERSION, or FULL_RUBY_VERSION?
Current status
Omnibus takes RUBY_VERSION
like 3.2.3
with patch level number.
However, GitLab uses RUBY_VERSION
slightly differently, omitting patch level number like 3.2
.
This disparity caused the introduction of FULL_RUBY_VERSION
defined in GitLab, which matches Omnibus' RUBY_VERSION
.
Problems to solve
- This is a bit inconsistent and confusing. It would be better if we can align the meaning of the same variable
- Since in GitLab we never indicated the patch level, the patch level is coming from the build image directly: gitlab-build-images!788 (merged) To generate
FULL_RUBY_VERSION
, we'll have to run Ruby to print the Ruby version to get the patch level to pass to Omnibus. This means we can't just forwardRUBY_VERSION
and can be more difficult to do, since we need to run a script and it'll be dynamic. We handled this intrigger-omnibus-env
job.
In short, nothing really broken we need to fix, but it's making it more difficult than it should be. If we use a more consistent variable with the same meaning, then we can just forward the variables, which will be much simpler.
Options
- In GitLab, rename
RUBY_VERSION
toSHORT_RUBY_VERSION
. Pros: No changes to Omnibus. Omnibus is free to useSHORT_RUBY_VERSION
if needed. Cons: We'll need to change a lot of things. Things can break. - In Omnibus, use
FULL_RUBY_VERSION
instead ofRUBY_VERSION
. Pros: GitLab only needs to passFULL_RUBY_VERSION
, no need to have mixed meaning. Cons: Omnibus will need to change and can break things. We still need to dynamically generateFULL_RUBY_VERSION
. - In Omnibus, use
RUBY_VERSION
without patch level number. This means Omnibus probably needs to decide which patch level it wants to use, because GitLab will no longer specify that. Pros: Perhaps this will be easier to use? Cons: It can happen that GitLab and Omnibus do not use the same patch level because it never communicates about that.
There can have other options mixing the 3 above. The goal is to use the same variable RUBY_VERSION
in the same way, to make things more clear.
Background
Context is: !7474 (comment 1806126144)
And then gitlab!145521 (comment 1813713287)