Skip to content

[CHEF-19103] Added support for Ruby 3.4 #439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .expeditor/verify.pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ steps:
docker:
image: ruby:3.1

- label: run-specs-ruby-3.4
command:
- .expeditor/run_linux_tests.sh rake
expeditor:
executor:
docker:
image: ruby:3.4

- label: run-specs-ruby-3.1-windows
command:
- .expeditor/run_windows_tests.ps1
Expand All @@ -33,3 +41,19 @@ steps:
- FORCE_FFI_YAJL=ext
- EXPIRE_CACHE=true
- CHEF_LICENSE=accept-no-persist

- label: run-specs-ruby-3.4-windows
command:
- .expeditor/run_windows_tests.ps1
expeditor:
executor:
docker:
host_os: windows
shell: ["powershell", "-Command"]
image: rubydistros/windows-2019:3.4
user: 'NT AUTHORITY\SYSTEM'
environment:
- FORCE_FFI_YAJL=ext
- EXPIRE_CACHE=true
- CHEF_LICENSE=accept-no-persist

4 changes: 2 additions & 2 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Set up ruby 3.1
- name: Set up Ruby 3.4
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.4
bundler-cache: true
- name: run specs
run: bundle exec rake spec --trace
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ source "https://rubygems.org"

gemspec

gem "syslog"

group :development do
gem "chefstyle"
gem "rake"
Expand Down
5 changes: 5 additions & 0 deletions features/step_definitions/chef-vault.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,8 @@

expect(encrypted_vault_item).to eq(@saved_encrypted_vault_item)
end

Then(%r{^the combined output should match /(.+)/}) do |expected|
output = last_command_started.stdout.to_s + "\n" + last_command_started.stderr.to_s
expect(output).to match(/#{expected}/)
end
2 changes: 1 addition & 1 deletion features/wrong_private_key.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Feature: Wrong private key during decrypt
And I create a vault item 'test/item' containing the JSON '{"foo": "bar"}' encrypted for 'one,two'
And I regenerate the client key for the node 'one'
And I try to decrypt the vault item 'test/item' as 'one'
Then the output should match /is encrypted for you, but your private key failed to decrypt the contents/
Then the combined output should match /is encrypted for you, but your private key failed to decrypt the contents/
3 changes: 3 additions & 0 deletions lib/chef-vault/item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ def self.load(vault, name, opts = {})
rescue Chef::Exceptions::ValidationFailed
raise ChefVault::Exceptions::ItemNotFound,
"#{vault}/#{name} could not be found"
rescue Chef::EncryptedDataBagItem::DecryptionFailure
raise ChefVault::Exceptions::SecretDecryption,
"#{vault}/#{name} is encrypted for you, but your private key failed to decrypt the contents."
end
format_output(opts[:values], item) if opts[:values]
item
Expand Down
Loading