Skip to content

Comments

(MAINT) Fixing issue with OS not being in FacterDB's fact set#83

Closed
Tu2607 wants to merge 2 commits intomainfrom
update-facterdb-ver
Closed

(MAINT) Fixing issue with OS not being in FacterDB's fact set#83
Tu2607 wants to merge 2 commits intomainfrom
update-facterdb-ver

Conversation

@Tu2607
Copy link
Contributor

@Tu2607 Tu2607 commented Feb 10, 2026

This commit updates the pinned version for facterdb so that there is support for Ubuntu 24.04. This is the latest version of facterdb before it diverged from supporting open-source Puppet. Also added failsafes for the event of a new OS being supported by sce_linux and sce_windows but FacterDB does not have fact set for it.

@Tu2607 Tu2607 requested a review from a team as a code owner February 10, 2026 22:53
@Tu2607 Tu2607 requested a review from hsnodgrass February 10, 2026 22:53
@Tu2607 Tu2607 force-pushed the update-facterdb-ver branch 2 times, most recently from 5764471 to 24d5c34 Compare February 10, 2026 23:30
This commit updates the pinned version for facterdb so that there
is support for Ubuntu 24.04. This is the latest version of facterdb
before it diverged from supporting open-source Puppet.
@Tu2607 Tu2607 force-pushed the update-facterdb-ver branch 15 times, most recently from 5825903 to 1f6744a Compare February 17, 2026 20:34
@Tu2607 Tu2607 force-pushed the update-facterdb-ver branch 4 times, most recently from 4961e79 to e501219 Compare February 19, 2026 17:59
…d OS

This commit removes the dependency on facterdb in the Benchmark class
and instead uses its own hardcoded mapping of suported OSes of
sce_linux and sce_windows modules.
@Tu2607 Tu2607 force-pushed the update-facterdb-ver branch from e501219 to 187f173 Compare February 19, 2026 18:01
Comment on lines -8 to +9
spec_task.pattern = 'spec/abide_dev_utils_spec.rb,spec/abide_dev_utils/**/*_spec.rb'
spec_task.pattern = ['spec/abide_dev_utils_spec.rb',
'spec/abide_dev_utils/**/*_spec.rb']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pattern needs to be a string, I believe.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried as a string and then an array. Both didn't make the command bundle exec rake spec happy. Currently trying to figure out why.

Comment on lines +57 to +58
# Going to use `rpsec` instead of `bundle exec rake spec` and manually feed it the pattern of spec files to run.
# `bundle exec rake spec` is running into some issue with the pattern defined in the Rakefle and was only running 8 tests.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically want to include the error name and context when you comment stuff like this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a strange error. Not even a name to it. Just this

AMER-Tu-Vu:abide_dev_utils tuvu$ bundle exec rake spec
3ede072ed4e5c4a829aa377f788ff268e800cc92        HEAD
dae6cce198b012e2ebcd71b676e8997afb10be71        HEAD
/Users/tuvu/.asdf/installs/ruby/3.3.6/bin/ruby -I/Users/tuvu/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.6/lib:/Users/tuvu/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rspec-support-3.13.7/lib /Users/tuvu/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.6/exe/rspec spec/abide_dev_utils/cli_spec.rb spec/abide_dev_utils/ppt/facter_utils_spec.rb spec/abide_dev_utils/ppt/new_obj_spec.rb spec/abide_dev_utils/sce/benchmark_spec.rb spec/abide_dev_utils/xccdf/diff/benchmark_spec.rb spec/abide_dev_utils/xccdf/parser/objects_spec.rb spec/abide_dev_utils/xccdf/parser_spec.rb spec/abide_dev_utils/xccdf_spec.rb spec/abide_dev_utils_spec.rb
/Users/tuvu/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/puppet-8.16.0-universal-darwin/lib/puppet.rb:38: warning: syslog was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.4.0.
You can add syslog to your Gemfile or gemspec to silence this warning.
.......

Finished in 0.03705 seconds (files took 16.6 seconds to load)
8 examples, 0 failures

/Users/tuvu/.asdf/installs/ruby/3.3.6/bin/ruby -I/Users/tuvu/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.6/lib:/Users/tuvu/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rspec-support-3.13.7/lib /Users/tuvu/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.6/exe/rspec spec/abide_dev_utils/cli_spec.rb spec/abide_dev_utils/ppt/facter_utils_spec.rb spec/abide_dev_utils/ppt/new_obj_spec.rb spec/abide_dev_utils/sce/benchmark_spec.rb spec/abide_dev_utils/xccdf/diff/benchmark_spec.rb spec/abide_dev_utils/xccdf/parser/objects_spec.rb spec/abide_dev_utils/xccdf/parser_spec.rb spec/abide_dev_utils/xccdf_spec.rb spec/abide_dev_utils_spec.rb failed

Looked like it did not like the spec pattern provided through the Rakefile so I poke around but haven't yet find the accurate fix. Doing bundle exec rspec and passed the pattern in worked so it's a bit confusing.

Comment on lines +416 to +432
OS_FAMILY_MAP = {
'redhat' => 'RedHat',
'oraclelinux' => 'RedHat',
'almalinux' => 'RedHat',
'rocky' => 'RedHat',
'ubuntu' => 'Debian',
'windows' => 'Windows',
}.freeze

SUPPORT_OS_MAJ_VER_MAP = {
"redhat" => ['7', '8', '9'],
"oraclelinux" => ['7', '8', '9'],
"almalinux" => ['8', '9'],
"rocky" => ['8', '9'],
"ubuntu" => ['20.04', '22.04', '24.04'],
"windows" => ['2016', '10', '2019', '2022', '2025']
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the best place for this information. This stuff will need to be updated relatively frequently, and should probably not be buried in a large file full of other stuff.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a bunch of workarounds in this specific file, would it be better to look at adding failsafes to FacterUtils instead? Something like providing stubbed fact sets if FacterDB doesn't have the facts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did think of that at first but then concluded it would take more time and effort to spin up a VM and generate facts for a new OS and then format it to Facterdb's format so that our existing code would work. I settled with this approach because it just pulled from the latest mappings and resource data from sce_linux and sce_windows and replicate the objects that we use to load the mapping files and the resource data. I'm open to work on expanding FacterUtils once we have the Ubuntu 24.04 release out of the way since it is a way less hacky way fixing the issue we have with facterdb.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I'm getting at is couldn't we put this workaround code into FacterUtils instead of this file? We don't need to return full fact sets, just the facts that we use here.

@hsnodgrass
Copy link
Collaborator

@Tu2607 You should really update the PR title and message to reflect all the changes in this PR

@Tu2607 Tu2607 changed the title (MAINT) Bump facterdb version up to support Ubuntu 24.04 (MAINT) Fixing issue with OS not being in FacterDB's fact set Feb 19, 2026
@Tu2607 Tu2607 closed this Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants