CHEF-34003: Support ~/.chef/ruby/<version>/gems for Habitat gem persistence#343
Open
sanghinitin wants to merge 3 commits into
Open
CHEF-34003: Support ~/.chef/ruby/<version>/gems for Habitat gem persistence#343sanghinitin wants to merge 3 commits into
sanghinitin wants to merge 3 commits into
Conversation
Signed-off-by: nitin sanghi <nsanghi@progress.com>
Simplecov Report
|
3c0c9e1 to
bf99b54
Compare
…stence Modify the chef gem command to use ~/.chef/ruby/<ruby_version>/gems as the default GEM_HOME when running inside a Habitat-based Workstation environment. This ensures all user-installed gems persist across Workstation package upgrades. Changes: - GemForwarder sets GEM_HOME/GEM_PATH to user gem dir in Habitat mode - habitat_user_gem_dir helper returns version-specific path - habitat_env updated to include user gem dir in PATH/GEM_PATH - plan.sh wrapper resolves Ruby ABI version at runtime - plan.ps1 sets CHEF_GEM_HOME_ENABLED for Ruby-level handling - binstub_patch.rb includes user gem dir in GEM_PATH - plan.sh adds bundle config unset with to avoid build conflicts Signed-off-by: nitin sanghi <nsanghi@progress.com>
bf99b54 to
2123f42
Compare
Signed-off-by: nitin sanghi <nsanghi@progress.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
chef gemcommand to use~/.chef/ruby/<ruby_version>/gemsas the defaultGEM_HOMEwhen running inside a Habitat-based Workstation environment. This ensures user-installed gems persist across Workstation package upgrades (previously lost when/hab/pkgs/...path changed on each upgrade).chef gem installwere being lost on every Workstation upgrade because the Habitat package path changes. This aligns Habitat behavior with the existing omnibus approach that already usesGem.user_dir.lib/chef-cli/command/gem.rb— Addedsetup_gem_environmentfor Habitat detectionlib/chef-cli/helpers.rb— Addedhabitat_user_gem_dir, updatedhabitat_envhabitat/plan.sh— Updated wrapper script for runtime GEM_HOME/GEM_PATH resolution; addedbundle config unset withhabitat/plan.ps1— AddedCHEF_GEM_HOME_ENABLEDruntime env markerbinstub_patch.rb— Prepends user gem dir to GEM_PATH in all binstubsspec/unit/command/gem_spec.rb— New spec (15 examples)spec/unit/helpers_spec.rb— Updated habitat env testsEvidence
bundle exec cookstyle lib/chef-cli/command/gem.rb spec/unit/command/gem_spec.rb→ 0 offensesRisk & Rollback
habitat_install?check; non-Habitat installs are completely unaffectedgit revert 49d250a8or remove thesetup_gem_environmentcall ingem.rbReview Focus
habitat_user_gem_dirpath convention (~/.chef/ruby/<version>/gems) aligns with team expectationsplan.shwrapper correctly resolves Ruby ABI version at runtimebinstub_patch.rbchange does not break appbundler-generated binstubs in omnibus installs (gated byunless ENV["APPBUNDLER_ALLOW_RVM"])Test Cases Run With Evidence