Skip to content

Conversation

@mhashizume
Copy link
Contributor

This PR both updates the minimum Ruby version for Facter to Ruby 2.5 (removing all instances of Ruby 2.3 and 2.4 in the codebase) and increments the next Facter version to 4.3.0.

@mhashizume mhashizume requested a review from a team as a code owner December 8, 2022 19:57
@mhashizume
Copy link
Contributor Author

I've also updated the branch protection rules to use the Ruby 2.5 version of unit tests instead of Ruby 2.3.

@mhashizume mhashizume force-pushed the FACT-3147/main/min-ruby-25 branch from 1e72f68 to dfa41b9 Compare December 8, 2022 21:20
This commit replaces all instances in which Ruby 2.3 or 2.4 are
referenced with Ruby 2.5 and sets Ruby 2.5 as the minimum Ruby
version in the Gemspec and other relevant locations.
Due to increasing the minimum Ruby version to Ruby 2.5, this commit
sets the next Facter release version to the next minor/Y version,
4.3.0.
@mhashizume mhashizume force-pushed the FACT-3147/main/min-ruby-25 branch 3 times, most recently from b488a45 to e832c61 Compare December 8, 2022 22:00

it 'loads date' do
pending 'There is a bug in newer versions of Psych and Timecop' if RUBY_VERSION =~ /^3\.2/
pending 'There is a bug in newer versions of Psych and Timecop' if RUBY_VERSION.match?(/3.2/)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pending 'There is a bug in newer versions of Psych and Timecop' if RUBY_VERSION.match?(/3.2/)
pending 'There is a bug in newer versions of Psych and Timecop' if RUBY_VERSION.to_f == 3.2 && Gem::Version.new(Timecop::VERSION) < Gem::Version.new("0.9.6")

@mhashizume mhashizume force-pushed the FACT-3147/main/min-ruby-25 branch 3 times, most recently from 9e8b96c to 56ac1a2 Compare December 8, 2022 23:16
An issue with earlier versions of timecop caused the 'when yaml
contains Date formatted fields' test to fail with the version of
Psych included with Ruby 3.2.0.

With the release of timecop 0.9.6, this issue has been resolved
and we can remove the test from its conditial pending state when
that version of timecop is present.
@mhashizume mhashizume force-pushed the FACT-3147/main/min-ruby-25 branch from 56ac1a2 to 8e9a670 Compare December 8, 2022 23:19
@joshcooper
Copy link
Contributor

Not sure what's up with the acceptance test? Maybe we're expecting 20.04 but ubuntu-latest is 22.04?

Expected /Ubuntu (?-mix:20.04)/ to match "Ubuntu 22.04.1 LTS".>
    Test line: tests/facts/os_processors_and_kernel.rb:15:in `block (6 levels) in run_test'

@mhashizume
Copy link
Contributor Author

Not sure what's up with the acceptance test? Maybe we're expecting 20.04 but ubuntu-latest is 22.04?

Expected /Ubuntu (?-mix:20.04)/ to match "Ubuntu 22.04.1 LTS".>
    Test line: tests/facts/os_processors_and_kernel.rb:15:in `block (6 levels) in run_test'

Yeah, looks like you're right: actions/runner-images#6399

I'll put up another commit that just hard codes 20.04 for now

The ubuntu-latest GitHub Actions runner currently translates to
Ubuntu 20.04, but will migrate to 22.04 next year:
actions/runner-images#6399

Because platform translation is necessary in the presuit.rb file,
this commit changes all instances of "ubuntu-latest" in our
GitHub Actions configuration to "ubuntu-20.04".
@mhashizume mhashizume force-pushed the FACT-3147/main/min-ruby-25 branch from 1e078bd to 37d0f59 Compare December 9, 2022 18:04
@mhashizume
Copy link
Contributor Author

I updated the branch protection rules to reflect the change in the Ubuntu runner.

@joshcooper joshcooper merged commit 114d3ef into puppetlabs:main Dec 9, 2022
@mhashizume mhashizume deleted the FACT-3147/main/min-ruby-25 branch December 12, 2022 18:11
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