Skip to content

Commit

Permalink
Release 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jul 4, 2024
1 parent bb8c520 commit 0ae3e99
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 13 deletions.
62 changes: 50 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## [5.0.0](https://github.com/voxpupuli/rspec-puppet-facts/tree/5.0.0) (2024-07-04)

[Full Changelog](https://github.com/voxpupuli/rspec-puppet-facts/compare/4.0.0...5.0.0)

5.0.0 release summary [\#194](https://github.com/voxpupuli/rspec-puppet-facts/issues/194)
For a long long time, the first level of keys in a factsets were symbols. This was fine before there were structured facts, but structured facts ended up as nested hashes that always had strings. This doesn't make sense and easy to get wrong. The original data contains only strings so conversion actually cost performance.

We now flip the default to increase performance, make code more readable and remove some footguns. This major release also switched to FacterDB 3, which doesn't contain [legacy facts](https://www.puppet.com/docs/puppet/7/core_facts.html) nor factset for EoL operating systems or EoL facter versions.

**Breaking changes:**

- Switch to FacterDB 3 / drop legacy facts [\#187](https://github.com/voxpupuli/rspec-puppet-facts/pull/187) ([bastelfreak](https://github.com/bastelfreak))

**Implemented enhancements:**

- Deprecate symbolized facts [\#193](https://github.com/voxpupuli/rspec-puppet-facts/pull/193) ([bastelfreak](https://github.com/bastelfreak))

**Fixed bugs:**

- handle stringified facterversion properly [\#191](https://github.com/voxpupuli/rspec-puppet-facts/pull/191) ([bastelfreak](https://github.com/bastelfreak))

**Merged pull requests:**

- Update voxpupuli-rubocop requirement from ~\> 2.7.0 to ~\> 2.8.0 [\#192](https://github.com/voxpupuli/rspec-puppet-facts/pull/192) ([dependabot[bot]](https://github.com/apps/dependabot))

## [4.0.0](https://github.com/voxpupuli/rspec-puppet-facts/tree/4.0.0) (2024-06-10)

[Full Changelog](https://github.com/voxpupuli/rspec-puppet-facts/compare/3.0.0...4.0.0)
Expand Down Expand Up @@ -27,28 +52,41 @@

**symbolized facts deprecation**

With the release of rspec-puppet-facts 4.0.0 we will remove support for symbolized facts. At the moment people typically use this in their unit files:
With the release of rspec-puppet-facts 6.0.0 we will remove support for symbolized facts. At the moment people typically use this in their unit files:

```ruby
case facts[:os]['name']
when 'Archlinux'
context 'on Archlinux' do
it { is_expected.to contain_package('borg') }
on_supported_os.each do |os, os_facts|
case os_facts[:os]['name']
when 'Archlinux'
context 'on Archlinux' do
it { is_expected.to contain_package('borg') }
end
when 'Ubuntu'
end
when 'Ubuntu'
end
```

For history reasons the first level of facts were symbols. You will have to update it to strings with the 4.0.0 release:
For history reasons the first level of facts were symbols. You will have to update it to strings with the 6.0.0 release:

```ruby
case facts['os']['name']
when 'Archlinux'
context 'on Archlinux' do
it { is_expected.to contain_package('borg') }
on_supported_os.each do |os, os_facts|
case os_facts['os']['name']
when 'Archlinux'
context 'on Archlinux' do
it { is_expected.to contain_package('borg') }
end
when 'Ubuntu'
end
when 'Ubuntu'
end
```

As an alternative you can configure the old behaviour:

```ruby
RSpec.configure do |c|
c.facterdb_string_keys = false
end
```

**Breaking changes:**

Expand Down
2 changes: 1 addition & 1 deletion lib/rspec-puppet-facts/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module RspecPuppetFacts
# This module contains the current version constant
module Version
# The current version of this gem
STRING = '4.0.0'
STRING = '5.0.0'
end
end

0 comments on commit 0ae3e99

Please sign in to comment.