Skip to content

CHEF-35087 - Use appbundler in hab packaging and install latest Habitat in Windows test#341

Merged
nikhil2611 merged 6 commits into
mainfrom
nikhil/CHEF-34831-scan-fix
Jun 3, 2026
Merged

CHEF-35087 - Use appbundler in hab packaging and install latest Habitat in Windows test#341
nikhil2611 merged 6 commits into
mainfrom
nikhil/CHEF-34831-scan-fix

Conversation

@nikhil2611

@nikhil2611 nikhil2611 commented May 26, 2026

Copy link
Copy Markdown
Contributor

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

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)

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)

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%

@nikhil2611 nikhil2611 force-pushed the nikhil/CHEF-34831-scan-fix branch from 90f04a2 to 2232f48 Compare May 26, 2026 10:12
@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
@nikhil2611 nikhil2611 force-pushed the nikhil/CHEF-34831-scan-fix branch from 583403d to 45535b0 Compare May 29, 2026 11:32
@nikhil2611 nikhil2611 changed the title CHEF-34831 - Use appbundler and codescan fixes CHEF-34831 - Use appbundler in packaging Jun 1, 2026
@nikhil2611 nikhil2611 changed the title CHEF-34831 - Use appbundler in packaging CHEF-34831 - Use appbundler in hab packaging Jun 1, 2026
@nikhil2611 nikhil2611 changed the title CHEF-34831 - Use appbundler in hab packaging CHEF-34831 - Use appbundler in hab packaging and install latest Habitat in Windows test Jun 2, 2026
@nikhil2611 nikhil2611 changed the title CHEF-34831 - Use appbundler in hab packaging and install latest Habitat in Windows test CHEF-35087 - Use appbundler in hab packaging and install latest Habitat in Windows test Jun 2, 2026
nikhil2611 and others added 4 commits June 3, 2026 18:56
…windows test pipeline

Signed-off-by: nikhil2611 <ngupta@progress.com>
- 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>
Reverts addressable version bump, cleanup_lint_roller chef-cli addition,
and .github directory removal logic from this PR as they are handled
separately in PR #342.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: nikhil2611 <ngupta@progress.com>
sed is already available in the Habitat Studio base environment,
so an explicit dependency is not required.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: nikhil2611 <ngupta@progress.com>
@nikhil2611 nikhil2611 force-pushed the nikhil/CHEF-34831-scan-fix branch from da90000 to a14d1d4 Compare June 3, 2026 13:27
- Restore .github directories removal from vendored gems in plan.ps1
- Restore addressable dependency to >= 2.9.0, < 3.0 in gemspec
  (these changes were already merged and should not be reverted)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: nikhil2611 <ngupta@progress.com>
…roller.rb

cleanup_lint_roller.rb does not exist in this repo. The equivalent
script is cleanup_gem_lockfiles.rb which removes stray Gemfile.lock
files from vendored gems.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: nikhil2611 <ngupta@progress.com>
neha-p6 pushed a commit to chef/ohai that referenced this pull request Jun 3, 2026
Mirror chef/chef-cli#341 changes in Ohai (excluding dependency updates).

- Simplify Habitat install script usage in Buildkite artifact test

- Update habitat plans to use appbundler-generated binstubs and runtime wrapper

- Remove vendored .github directories to reduce scanner false positives

- Generalize lockfile cleanup and add binstub patch helper

Signed-off-by: Sachin Jain <Sachin.jain@chef.io>
Co-authored-by: Sachin Jain <Sachin.jain@chef.io>
@nikhil2611 nikhil2611 merged commit 5de1dea into main Jun 3, 2026
36 checks passed
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.

4 participants