Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-10014

Unvendor deep_merge



    • Task
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • PUP 6.11.0
    • None
    • Coremunity
    • Platform Core KANBAN
    • Bug Fix
    • De-vendors deep_merge from puppet and adds a runtime gem dependency on the deep_merge gem.
    • Needs Assessment


      Puppet vendors the deep_merge gem version 1.0.1. Puppet also implements deep_merge logic (https://github.com/puppetlabs/puppet/blob/34b208f04f7415f9a99bf6eafd6d101b303b920d/lib/puppet/vendor/load_deep_merge.rb#L1). And there are other places where we should deeply merging objects.

      This ticket is to update calls sites to use the deep_merge gem, and unvendor the gem. It will need to be added as a runtime dependency to .gemspec and ext/project_data.yaml. To avoid breaking CI, we need to work backwards from the consumers of the puppet gem to puppet itself:

      1. add deep_merge gem to artifactory with kermintor in release-new-new
      2. add deep_merge gem component to puppet-runtime - at this point you need to know if it's client-side only, or both client and server, and whether the gem is pure ruby or contains native extensions:

      if you're adding a pure-ruby gem that must be available everywhere see (https://github.com/puppetlabs/puppet-runtime/blob/6d8fb954c44f3d6c79c3756b2372b0dcc2136aca/configs/components/rubygem-semantic_puppet.rb#L17). This prefers settings[:puppet_gem_vendor_dir] if set, for example /opt/puppetlabs/puppet/lib/ruby/vendor_gems/gems, otherwise falls back to settings[:gem_home], for example /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/.

      If you're adding client-side gem (eg for a provider) or a gem with native extensions, see https://github.com/puppetlabs/puppet-runtime/blob/master/configs/components/rubygem-CFPropertyList.rb

      3. add component to the different projects in puppet-runtime repo, see https://github.com/puppetlabs/puppet-runtime/blob/master/configs/projects/_shared-agent-components.rb, https://github.com/puppetlabs/puppet-runtime/blob/master/configs/projects/bolt-runtime.rb, https://github.com/puppetlabs/puppet-runtime/blob/master/configs/projects/pdk-runtime.rb, etc

      4. dockerfile in puppet-agent installs the gem when building the puppet-agent docker image (https://github.com/puppetlabs/puppet-agent/blob/master/docker/puppet-agent-alpine/windows-build/Dockerfile.build#L41)

      5. add your gem to test to make sure it gets installed correctly: https://github.com/puppetlabs/puppet-agent/blob/master/acceptance/tests/validate_vendored_ruby.rb#L154

      6. If the gem isn't client-only, add it to: jruby: https://github.com/puppetlabs/puppetserver/blob/e87fbaf09112aa7ffa9f31c192d879d12c9562ff/resources/ext/build-scripts/jruby-gem-list.txt

      7. Once it has been added everywhere it needs to be, actually remove vendored code from Puppet


        Issue Links



              jorie Jorie Tappa
              josh Josh Cooper
              0 Vote for this issue
              4 Start watching this issue



                Zendesk Support