Skip to content

Conversation

@Stromweld
Copy link
Collaborator

@Stromweld Stromweld commented Dec 20, 2025

Description

  • Add support for inspec 7 in gemspec version constraints
  • Add GHA workflows for linting, unit, and integration testing
  • Add copilot instructions
  • Linting fixes

Check List

Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
@Stromweld Stromweld self-assigned this Dec 23, 2025
@Stromweld Stromweld added the Expeditor: Bump Version Minor Used by github.minor_bump_labels to bump the Minor version number. label Dec 23, 2025
@Stromweld Stromweld changed the title Corey test Modernize kitchen-inspec Dec 23, 2025
@Stromweld Stromweld marked this pull request as ready for review December 23, 2025 15:50
Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
spec.add_dependency "inspec-core", ">= 2.2.64", "< 8.0" # 2.2.64 is required for plugin v2 support & InSpec 6 included
spec.add_dependency "train"
spec.add_dependency "hashie", ">= 3.4", "< 6.0"
if ENV["CHEF_TEST_KITCHEN_ENTERPRISE"]

Choose a reason for hiding this comment

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

this will only work at build time and not at runtime is this expected?

Copy link
Collaborator Author

@Stromweld Stromweld Jan 7, 2026

Choose a reason for hiding this comment

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

yes, when building Chef Test-Kitchen Enterprise this gem will be pulled in and built and this will ensure CTKE satisfies it'd dependency, while maintaining backward compatibility with community test-kitchen.

spec.add_dependency "inspec", ">= 2.2.64", "< 7.0" # 2.2.64 is required for plugin v2 support & InSpec 6 included
spec.add_dependency "test-kitchen", ">= 2.7", "< 4" # 2.7 introduced no_parallel_for for verifiers
spec.add_dependency "hashie", ">= 3.4", "<= 5.0"
spec.add_dependency "inspec-core", ">= 2.2.64", "< 8.0" # 2.2.64 is required for plugin v2 support & InSpec 6 included

Choose a reason for hiding this comment

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

This could be a breaking change if you have previously relied on these trains https://github.com/inspec/inspec/blob/main/inspec.gemspec#L45 ( Line 45 - 48 )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

that's why the train dependency was added below it to enable the various connection mechanisms for containers, ssh, winrm etc...

Choose a reason for hiding this comment

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

but if you see the link I tagged above, it has resources other than core, like aws, habitat, winrm & kubernetes. If any user had been using them post this release they have to explicitly add those gems .. may be we should show that as a deprecation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

kitchen-inspec is a plugin for test-kitchen. It only works with VM's and containers. So it primarily needs ssh, winrm, and docker support. It's not running inspec profiles against an aws account, kubernetes, etc...

I've tested this and it's working. I also added the dokken tests to the GHA workflow for real integration tests with containers. Since kitchen-inspec is very limited to what it's working with to run inspec tests is why I switched this to inspec-core since it doesn't need all those extra features that aren't used.

.rubocop.yml Outdated
@@ -0,0 +1,8 @@
---
AllCops:
TargetRubyVersion: 3.4

Choose a reason for hiding this comment

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

Shouldn't we be using chefstyle?

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

chefstyle is dead and cookstyle is it's replacement. Cookstyle was extended to add --chefstyle flag to enable the same cops and settings chefstyle was using.

The targeted ruby version is for a more modern version for cookstyle but none of the changes introduced breaks functionality for older ruby versions so the gemspec ruby version is smaller. Modern rubocop versions also don't support anything less then 2.7.

That said if you think it's best to lower the target version I'm open to doing that as well.

Choose a reason for hiding this comment

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

wdyt of removing the target version completely?

Copy link
Collaborator Author

@Stromweld Stromweld Jan 9, 2026

Choose a reason for hiding this comment

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

I can do that. looking up what rubocop defaults to it'll then look at the gemspec and if it can't find anything then it will set it to 2.7. I think it makes sense to let it follow the gemspec required_ruby_version.

Signed-off-by: Stromweld <hemminger@hotmail.com>
@sathish-progress sathish-progress merged commit 1511f9d into main Jan 12, 2026
10 checks passed
@Stromweld Stromweld deleted the corey-test branch January 12, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Expeditor: Bump Version Minor Used by github.minor_bump_labels to bump the Minor version number.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants