Using foremandist in non-foreman/katello dependencies

Due to the ruby25 vs ruby27 changes, we can’t tag back builds from katello 4.1 to 4.0. It was brought up in this pr rebuild pulp-rpm-client against ruby 2.5 by evgeni · Pull Request #6693 · theforeman/foreman-packaging · GitHub to utilize foremandist for these dependencies as well to help avoid upgrade collisions as we create separate builds for the two environments.

This post lacks a bit of context for those not familiar with RPM packaging.

In our RPM packaging we define our own macro foremandist. This is the .fm2_5 bit you can see in some package names (notably Foreman plugins). This guarantees that the NVR (Name Version Release) is unique between 2 different branches.

Normally you would have as the NVR tfm-rubygem-dynflow-1.4.7-2.el7. If you want to use 1.4.7-2 in both Foreman 2.4 (which uses Ruby 2.5) and Foreman 2.5 (which uses Ruby 2.7) then there’s no way to store this.

One option would be to introduce versioning inside the SCL, so tfm1- and tfm2- but that makes a lot of operations harder (packaging, other tooling). So we have a foremandist macro included in the release. This makes the NVR tfm-rubygem-dynflow-1.4.7-2.fm2_4.el7 vs tfm-rubygem-dynflow-1.4.7-2.fm2_5.el7. Now Koji can store two builds and yum understands that one is newer than the other.

Side note: obal ignores foremandist in some logic which means we don’t rebuild all packages if we bump foremandist. This is why you can see some installed packages installed with .fm2_3 even if you’re on .fm2_4.

Overall, I think that every package that uses some Ruby bits should use it.