Skip to content

CHEF-34831 - Use appbundler and codescan fixes#341

Open
nikhil2611 wants to merge 3 commits into
mainfrom
nikhil/CHEF-34831-scan-fix
Open

CHEF-34831 - Use appbundler and codescan fixes#341
nikhil2611 wants to merge 3 commits into
mainfrom
nikhil/CHEF-34831-scan-fix

Conversation

@nikhil2611
Copy link
Copy Markdown
Contributor

@nikhil2611 nikhil2611 commented May 26, 2026

Description

This pull request focuses on improving the packaging and installation process for chef-cli, particularly in Habitat environments, and updates some dependencies. The main changes include refining how binstubs are generated and patched for better compatibility, cleaning up vendored gems to avoid CVE false positives, updating a dependency version, and simplifying the Habitat install script.

Packaging and binstub improvements:

  • Overhauled the Habitat plan.sh to generate binstubs for chef-cli using appbundler, added a patch (binstub_patch.rb) to allow running binstubs directly, and replaced the previous wrapper function with a new runtime environment wrapper script. This ensures the correct Ruby and gem environment is set up when running chef-cli and improves compatibility. (habitat/plan.sh, binstub_patch.rb, [1] [2]
  • Applied the binstub_patch.rb automatically to all generated binstubs in the package. (habitat/plan.sh, habitat/plan.shL66-R114)

Vendored gem cleanup:

  • Added logic in both the Habitat plan.sh and Windows plan.ps1 to remove .github directories from vendored gems, reducing the risk of CVE false positives. (habitat/plan.sh, habitat/plan.ps1, [1] [2]

Dependency updates:

  • Updated the addressable gem dependency to require version >= 2.9.0 and < 3.0 (was < 2.9), improving compatibility and security. (chef-cli.gemspec, chef-cli.gemspecL48-R48)

Build/test process improvements:

  • Simplified the Habitat installation process in the Windows test script by removing the explicit version pinning and always installing the latest Habitat. (.expeditor/buildkite/artifact.habitat.test.ps1, [1] [2] [3]
  • Cleaned up the Windows test script by removing redundant project root logging. (.expeditor/buildkite/artifact.habitat.test.ps1, .expeditor/buildkite/artifact.habitat.test.ps1L84-L86)

Miscellaneous:

  • Added chef-cli to the list of gems whose Gemfile.lock files are cleaned up by the cleanup_lint_roller.rb script. (cleanup_lint_roller.rb, cleanup_lint_roller.rbL6-R6)

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • If Gemfile.lock has changed, I have used --conservative to do it and included the full output in the Description above.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

@nikhil2611 nikhil2611 requested review from a team as code owners May 26, 2026 09:08
@github-actions
Copy link
Copy Markdown

Simplecov Report

Covered Threshold
98.51% 90%

Signed-off-by: nikhil2611 <ngupta@progress.com>
@nikhil2611 nikhil2611 force-pushed the nikhil/CHEF-34831-scan-fix branch from 90f04a2 to 2232f48 Compare May 26, 2026 10:12
…windows test pipeline

Signed-off-by: nikhil2611 <ngupta@progress.com>
@nikhil2611 nikhil2611 changed the title CHEF-34831 - CodeScan fixes CHEF-34831 - May 27, 2026
@nikhil2611 nikhil2611 changed the title CHEF-34831 - CHEF-34831 - Use appbundler and codescan fixes May 27, 2026
- Simplified binstub_patch.rb to match chef/chef (only GEM_PATH + APPBUNDLER_ALLOW_RVM)
- Updated do_setup_environment to use push_runtime_env/set_runtime_env
- Fixed do_prepare to use proper /usr/bin/env symlink pattern with do_end cleanup
- Reordered do_install: fix_interpreter vendor/bin -> appbundler -> sed binstub_patch
- Reference external binstub_patch.rb file instead of inline generation
- Removed fix_interpreter on bin/* (not needed, matches chef pattern)

Signed-off-by: nikhil2611 <ngupta@progress.com>
@nikhil2611 nikhil2611 force-pushed the nikhil/CHEF-34831-scan-fix branch from 583403d to 45535b0 Compare May 29, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants