From bb1485c40778555f7da06929d7f131bb790526e6 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 12 Sep 2025 15:23:40 +0200 Subject: [PATCH 1/9] CI: Run all tests on every PR This the past, the different jobs had filters and were only executed when specific files changed. This is error prone because we potentially forget to enable tests for specific changes. Since we've enough concurrent runners, we can run all jobs always. --- .github/workflows/apply.yaml | 17 +++++------------ .github/workflows/bolt_spec.yaml | 19 ++++++------------- .github/workflows/docker_transport.yaml | 1 + .github/workflows/linux.yaml | 17 +++++------------ .github/workflows/modules.yaml | 17 +++++------------ .github/workflows/pwsh.yaml | 12 +++++------- .github/workflows/schemas.yaml | 13 +++++-------- .github/workflows/ssh_transport.yaml | 17 +++++------------ .github/workflows/windows.yaml | 16 ++++------------ .github/workflows/winrm_transport.yaml | 17 +++++------------ 10 files changed, 46 insertions(+), 100 deletions(-) diff --git a/.github/workflows/apply.yaml b/.github/workflows/apply.yaml index 505553d24..ca5514ba9 100644 --- a/.github/workflows/apply.yaml +++ b/.github/workflows/apply.yaml @@ -1,18 +1,11 @@ +--- name: Apply on: - pull_request: - types: [opened, reopened, edited, synchronize] - paths: - - .github/workflows/apply.yaml - - bolt.gemspec - - Gemfile - - Puppetfile - - bolt-modules/** - - lib/bolt/** - - libexec/** - - rakelib/tests.rake - - spec/** + pull_request: {} + push: + branches: + - main permissions: contents: read diff --git a/.github/workflows/bolt_spec.yaml b/.github/workflows/bolt_spec.yaml index 2926ec98a..5c0576a1d 100644 --- a/.github/workflows/bolt_spec.yaml +++ b/.github/workflows/bolt_spec.yaml @@ -1,19 +1,12 @@ +--- + name: BoltSpec on: - pull_request: - types: [opened, reopened, edited, synchronize] - paths: - - .github/workflows/bolt_spec.yaml - - bolt.gemspec - - Gemfile - - Puppetfile - - bolt-modules/** - - lib/bolt/** - - lib/bolt_spec/** - - libexec/** - - rakelib/tests.rake - - spec/** + pull_request: {} + push: + branches: + - main permissions: contents: read diff --git a/.github/workflows/docker_transport.yaml b/.github/workflows/docker_transport.yaml index 61bdd6a3d..8205b771c 100644 --- a/.github/workflows/docker_transport.yaml +++ b/.github/workflows/docker_transport.yaml @@ -1,3 +1,4 @@ +--- name: Docker transport on: diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 16a05253e..6c60c537f 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -1,18 +1,11 @@ +--- name: Linux on: - pull_request: - types: [opened, reopened, edited, synchronize] - paths: - - .github/workflows/linux.yaml - - bolt.gemspec - - Gemfile - - Puppetfile - - bolt-modules/** - - lib/bolt/** - - libexec/** - - rakelib/tests.rake - - spec/** + pull_request: {} + push: + branches: + - main permissions: contents: read diff --git a/.github/workflows/modules.yaml b/.github/workflows/modules.yaml index 403a0145f..63a00831f 100644 --- a/.github/workflows/modules.yaml +++ b/.github/workflows/modules.yaml @@ -1,18 +1,11 @@ +--- name: Modules on: - pull_request: - types: [opened, reopened, edited, synchronize] - paths: - - .github/workflows/modules.yaml - - bolt.gemspec - - Gemfile - - Puppetfile - - bolt-modules/** - - bolt_spec_spec/** - - lib/bolt/** - - modules/** - - rakelib/tests.rake + pull_request: {} + push: + branches: + - main permissions: contents: read diff --git a/.github/workflows/pwsh.yaml b/.github/workflows/pwsh.yaml index 42dd47b48..4762c6bab 100644 --- a/.github/workflows/pwsh.yaml +++ b/.github/workflows/pwsh.yaml @@ -1,13 +1,11 @@ +--- name: pwsh on: - pull_request: - types: [opened, reopened, edited, synchronize] - paths: - - .github/workflows/pwsh.yaml - - pwsh_module/* - - lib/bolt/bolt_option_parser.rb - - rakelib/pwsh.rake + pull_request: {} + push: + branches: + - main permissions: contents: read diff --git a/.github/workflows/schemas.yaml b/.github/workflows/schemas.yaml index 701379061..0a50e565b 100644 --- a/.github/workflows/schemas.yaml +++ b/.github/workflows/schemas.yaml @@ -1,14 +1,11 @@ +--- name: Schemas on: - pull_request: - types: [opened, reopened, edited, synchronize] - paths: - - lib/bolt/config/options.rb - - lib/bolt/config/transport/** - - lib/bolt/inventory/options.rb - - rakelib/schemas.rake - - schemas/*.json + pull_request: {} + push: + branches: + - main permissions: contents: read diff --git a/.github/workflows/ssh_transport.yaml b/.github/workflows/ssh_transport.yaml index e226ca399..f8d65b41d 100644 --- a/.github/workflows/ssh_transport.yaml +++ b/.github/workflows/ssh_transport.yaml @@ -1,18 +1,11 @@ +--- name: SSH Transport on: - pull_request: - types: [opened, reopened, edited, synchronize] - paths: - - .github/workflows/ssh_transport.yaml - - bolt.gemspec - - Gemfile - - Puppetfile - - bolt-modules/** - - lib/bolt/** - - libexec/** - - rakelib/tests.rake - - spec/** + pull_request: {} + push: + branches: + - main permissions: contents: read diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 4577f2aaa..364d1551c 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -2,18 +2,10 @@ name: Windows on: - pull_request: - types: [opened, reopened, edited, synchronize] - paths: - - .github/workflows/windows.yaml - - bolt.gemspec - - Gemfile - - Puppetfile - - bolt-modules/** - - lib/bolt/** - - libexec/** - - rakelib/tests.rake - - spec/** + pull_request: {} + push: + branches: + - main env: BOLT_WINRM_USER: roddypiper diff --git a/.github/workflows/winrm_transport.yaml b/.github/workflows/winrm_transport.yaml index 748eef3b8..29e498df8 100644 --- a/.github/workflows/winrm_transport.yaml +++ b/.github/workflows/winrm_transport.yaml @@ -1,18 +1,11 @@ +--- name: WinRM Transport on: - pull_request: - types: [opened, reopened, edited, synchronize] - paths: - - .github/workflows/winrm_transport.yaml - - bolt.gemspec - - Gemfile - - Puppetfile - - bolt-modules/** - - lib/bolt/** - - libexec/** - - rakelib/tests.rake - - spec/** + pull_request: {} + push: + branches: + - main permissions: contents: read From 95e509b2b7f780d8b137e7a5bdb93de11bafb5f7 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 12 Sep 2025 14:40:41 +0200 Subject: [PATCH 2/9] CI: Adjust tests for GitHub runner The group within the github image is `runner`, not `docker`. --- spec/integration/transport/local_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/integration/transport/local_spec.rb b/spec/integration/transport/local_spec.rb index cde851aff..822a91c9a 100644 --- a/spec/integration/transport/local_spec.rb +++ b/spec/integration/transport/local_spec.rb @@ -83,7 +83,7 @@ def make_target expect(runner.upload(target, file.path, dest, run_as: user).message).to match(/Uploaded/) expect(runner.run_command(target, "cat #{dest}", run_as: user)['stdout']).to eq(contents) expect(runner.run_command(target, "stat -c %U #{dest}", run_as: user)['stdout'].chomp).to eq(user) - expect(runner.run_command(target, "stat -c %G #{dest}", run_as: user)['stdout'].chomp).to eq('docker') + expect(runner.run_command(target, "stat -c %G #{dest}", run_as: user)['stdout'].chomp).to eq('runner') end runner.run_command(target, "rm #{dest}", sudoable: true, run_as: user) From 6a3d0c3ae032e49a939095b99d6db2e06bc02db3 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 12 Sep 2025 15:33:35 +0200 Subject: [PATCH 3/9] bolt: Bump version from 5.0.0-rc2->5.1.0 -rc* makes the windows tests fail: ``` System.ArgumentException: The 'ModuleVersion' member is not valid in the module manifest file 'D:\a\openbolt\openbolt\pwsh_module\PuppetBolt\PuppetBolt.psd1': Cannot convert value "5.0.0-rc2" to type "System.Version". Error: "The input string '0-rc2' was not in a correct format." at , D:\a\openbolt\openbolt\pwsh_module\autogenerated.tests.ps1: line 1 at , C:\Users\runneradmin\Documents\PowerShell\Modules\Pester\5.7.1\Pester.psm1: line 3090 at Invoke-File, C:\Users\runneradmin\Documents\PowerShell\Modules\Pester\5.7.1\Pester.psm1: line 3099 at Invoke-BlockContainer, C:\Users\runneradmin\Documents\PowerShell\Modules\Pester\5.7.1\Pester.psm1: line 3008 at Discover-Test, C:\Users\runneradmin\Documents\PowerShell\Modules\Pester\5.7.1\Pester.psm1: line 1480 at Invoke-Test, C:\Users\runneradmin\Documents\PowerShell\Modules\Pester\5.7.1\Pester.psm1: line 2474 at Invoke-Pester, C:\Users\runneradmin\Documents\PowerShell\Modules\Pester\5.7.1\Pester.psm1: line 4960 at , D:\a\_temp\c04d9e53-3555-4e44-855d-5de95da6a5f0.ps1: line 2 at , : line 1 ``` --- lib/bolt/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bolt/version.rb b/lib/bolt/version.rb index b75833635..be6696259 100644 --- a/lib/bolt/version.rb +++ b/lib/bolt/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Bolt - VERSION = '5.0.0-rc2' + VERSION = '5.1.0' end From e516ad16062acd6263555a11bdbe4491486ca3bf Mon Sep 17 00:00:00 2001 From: Sebastian Rakel Date: Fri, 12 Sep 2025 21:19:02 +0200 Subject: [PATCH 4/9] CI: WinRM: Ignore ProgressAction parameter We have a test that verifies all the parameters that bolt subcommands offer in powershell. Besides the bolt-provided parameters, Powershell adds own/internals parameters as well. Powershell 7.5 introduced a new parameter, ProgressAction, which we need to add to the exclude list. https://learn.microsoft.com/de-de/powershell/module/microsoft.powershell.core/about/about_commonparameters?view=powershell-7.5 --- pwsh_module/command.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pwsh_module/command.tests.ps1 b/pwsh_module/command.tests.ps1 index ef7070b89..07c242cf8 100644 --- a/pwsh_module/command.tests.ps1 +++ b/pwsh_module/command.tests.ps1 @@ -14,7 +14,7 @@ BeforeAll { $common = @( 'Version', 'Debug', 'ErrorAction', 'ErrorVariable', 'InformationAction', 'InformationVariable', 'OutBuffer', 'OutVariable', 'PipelineVariable', - 'Verbose', 'WarningAction', 'WarningVariable', 'Confirm', 'Whatif' + 'Verbose', 'WarningAction', 'WarningVariable', 'Confirm', 'Whatif', 'ProgressAction' ) } From 3006f0faf579a68faf5eb6d8680b09026f5f9d93 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 12 Sep 2025 16:55:09 +0200 Subject: [PATCH 5/9] CI: Add some powershell debugging options --- pwsh_module/command.tests.ps1 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pwsh_module/command.tests.ps1 b/pwsh_module/command.tests.ps1 index 07c242cf8..dc98d8b9a 100644 --- a/pwsh_module/command.tests.ps1 +++ b/pwsh_module/command.tests.ps1 @@ -71,9 +71,14 @@ Describe "test bolt command syntax" { } It "has correct number of parameters" { - ($command.Parameters.Values | Where-Object { - $_.name -notin $common - } | measure-object).Count | Should -Be 35 + $customParams = $command.Parameters.Values | Where-Object { + $_.Name -notin $common + } + + Write-Host "Custom parameters:" + $customParams | ForEach-Object { Write-Host " - $($_.Name)" } + + ($customParams | Measure-Object).Count | Should -Be 35 } } From ec2369fdac835b84e4905334c1e9e6167a675959 Mon Sep 17 00:00:00 2001 From: Sebastian Rakel Date: Fri, 12 Sep 2025 21:19:02 +0200 Subject: [PATCH 6/9] Ignore ProgressAction parameter --- pwsh_module/command.tests.ps1 | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pwsh_module/command.tests.ps1 b/pwsh_module/command.tests.ps1 index dc98d8b9a..07c242cf8 100644 --- a/pwsh_module/command.tests.ps1 +++ b/pwsh_module/command.tests.ps1 @@ -71,14 +71,9 @@ Describe "test bolt command syntax" { } It "has correct number of parameters" { - $customParams = $command.Parameters.Values | Where-Object { - $_.Name -notin $common - } - - Write-Host "Custom parameters:" - $customParams | ForEach-Object { Write-Host " - $($_.Name)" } - - ($customParams | Measure-Object).Count | Should -Be 35 + ($command.Parameters.Values | Where-Object { + $_.name -notin $common + } | measure-object).Count | Should -Be 35 } } From fae9aa2a739460ba707a42384e917f94e23b7799 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 12 Sep 2025 23:57:54 +0200 Subject: [PATCH 7/9] Revert "Allow ruby_smb 2.x and 3.x" This reverts commit 460e413039f81fbb4dabd0b0f0e5c98dd6f865e3. the CI passed in https://github.com/OpenVoxProject/openbolt/pull/41/. but the CI was flawed and the related winrm_transport check wasn't triggered, because it only runs when specific files changed. --- openbolt.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbolt.gemspec b/openbolt.gemspec index d3be7da01..ac762cc94 100644 --- a/openbolt.gemspec +++ b/openbolt.gemspec @@ -61,7 +61,7 @@ Gem::Specification.new do |spec| spec.add_dependency "puppetfile-resolver", ">= 0.6.2", "< 1.0" spec.add_dependency "puppet-resource_api", ">= 1.8.1" spec.add_dependency "r10k", ">= 3.10", "< 5" - spec.add_dependency "ruby_smb", ">= 1.0", "< 4.0.0" + spec.add_dependency "ruby_smb", "~> 1.0" spec.add_dependency "terminal-table", "~> 3.0" spec.add_dependency "winrm", "~> 2.0" spec.add_dependency "winrm-fs", "~> 1.3" From 0d38f0a506f27a7bed848d6bb7d17eabe556a2af Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 13 Sep 2025 10:32:30 +0200 Subject: [PATCH 8/9] CI: Cleanup linux integration tests This fixes a regression introduced in 573cdb5454f360306bd5ebd6aa88256724f07a3c / https://github.com/OpenVoxProject/openbolt/pull/28. We run bolt on a couple of containers and valid the resultset. A Puppet 6 container was removed, but the test still expected the result from that. This wasn't noticed in CI, because the tests were only executed when specific files changed, and that wasn't triggered in this specific case. We cleaned up CI and all jobs now run always. --- spec/integration/container_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/integration/container_spec.rb b/spec/integration/container_spec.rb index ef3a28a08..b1eba2522 100644 --- a/spec/integration/container_spec.rb +++ b/spec/integration/container_spec.rb @@ -38,7 +38,7 @@ users = result.map do |hash| hash.dig('value', 'report', 'resource_statuses').keys end.flatten - expect(users).to eq(["Notify[root\n]", "Notify[root\n]"]) + expect(users).to eq(["Notify[root\n]"]) end end end From d702e37a4751e8479bebd0e08ea0beaadd87139e Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 13 Sep 2025 10:58:39 +0200 Subject: [PATCH 9/9] CI: Use splat operator for hash validation --- spec/integration/parallel_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/integration/parallel_spec.rb b/spec/integration/parallel_spec.rb index 3a50ab40f..9c5580c2c 100644 --- a/spec/integration/parallel_spec.rb +++ b/spec/integration/parallel_spec.rb @@ -262,7 +262,7 @@ "exit_code" => 1 } } } }] } }] result = run_cli_json(%w[plan run parallel::error] + config_flags) - expect(result).to include(expected_err) + expect(result).to include(**expected_err) expect(result['details']).to include(expected_details) expect(expected_results - result['details']['results']).to eq([]) end