Uploaded image for project: 'Puppet Development Kit'
  1. Puppet Development Kit
  2. PDK-1190

PDK build inserts puppet 6.0 gem dependency



    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDK 1.8.0
    • Component/s: None
    • Environment:
    • Template:
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      {{pdk build}} no longer inadvertently modifies the {{Gemfile.lock}} in the module.
    • QA Risk Assessment:
      Needs Assessment


      pdk bulid inserts puppet 6.0 gem dependency that wasn't there before build command was run.

      Expected result
      Did not expect pdk build to not alter Gemfile.lock

      Also did not expect puppet 6.0 to appear as it is specifically excluded by metadata.json generated by pdk:

        "requirements": [
            "name": "puppet",
            "version_requirement": ">= 4.7.0 < 6.0.0"

      Steps to reproduce
      1. create new module
      2. pdk bundle install
      3. grep 6.0 Gemfile.lock (no match for puppet)
      3. pdk build
      4. grep 6.0 Gemfile.lock (matches puppet)

      Actual result

      geoff@computer:~/tmp$ pdk new module foo
      pdk (INFO): Creating new module: foo
      pdk (INFO): Module 'foo' generated at path '/home/geoff/tmp/foo', from template 'file:///opt/puppetlabs/pdk/share/cache/pdk-templates.git'.
      pdk (INFO): In your module directory, add classes with the 'pdk new class' command.
      geoff@computer:~/tmp$ cd foo
      geoff@computer:~/tmp/foo$ pdk bundle install
      pdk (INFO): Using Ruby 2.4.4
      pdk (INFO): Using Puppet 5.5.6
      The dependency puppet-module-win-default-r2.4 (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mswin32, x86-mingw32, x64-mingw32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mswin32 x86-mingw32 x64-mingw32`.
      The dependency puppet-module-win-dev-r2.4 (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mswin32, x86-mingw32, x64-mingw32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mswin32 x86-mingw32 x64-mingw32`.
      Fetching gem metadata from https://rubygems.org/........
      Resolving dependencies...
      Using rake 12.3.1
      Using public_suffix 3.0.3
      Using addressable 2.5.2
      Using ansi 1.5.0
      Using ast 2.4.0
      Using bundler 1.16.1
      Using json 2.0.4
      Using docile 1.3.1
      Using simplecov-html 0.10.2
      Using simplecov 0.16.1
      Using url 0.3.2
      Using codecov 0.1.10
      Using coderay 1.1.2
      Using diff-lcs 1.3
      Using unf_ext
      Using unf 0.1.4
      Using domain_name 0.5.20180417
      Using facter 2.5.1
      Using jgrep 1.5.0
      Using facterdb 0.5.2
      Using fast_gettext 1.1.2
      Using locale 2.1.2
      Using text 1.3.1
      Using gettext 3.2.9
      Using gettext-setup 0.30
      Using hiera 3.4.5
      Using hirb 0.7.3
      Using http-cookie 1.0.3
      Using json-schema 2.8.0
      Using stomp 1.4.4
      Using systemu 2.6.5
      Using mcollective-client 2.12.3
      Using metaclass 0.0.4
      Using spdx-licenses 1.2.0
      Using metadata-json-lint 2.2.0
      Using method_source 0.8.2
      Using mime-types-data 3.2018.0812
      Using mime-types 3.2.2
      Using mocha 1.1.0
      Using multi_json 1.13.1
      Using net-ssh 4.2.0
      Using net-scp 1.2.1
      Using net-telnet 0.2.0
      Using netrc 0.11.0
      Using parallel 1.12.1
      Using parallel_tests 2.14.2
      Using parser
      Using powerpack 0.1.2
      Using slop 3.6.0
      Using pry 0.10.4
      Using puppet 5.5.6
      Using rest-client 2.0.2
      Using puppet-blacksmith 4.1.2
      Using puppet-lint 2.3.6
      Using puppet-module-posix-default-r2.4 0.3.12
      Using rgen 0.8.2
      Using yard 0.9.16
      Using puppet-strings 2.1.0
      Using puppet-syntax 2.4.1
      Using puppet_pot_generator 1.0.1
      Using rspec-support 3.8.0
      Using rspec-core 3.8.0
      Using rspec-expectations 3.8.1
      Using rspec-mocks 3.8.0
      Using rspec 3.8.0
      Using rspec-puppet 2.6.15
      Fetching puppetlabs_spec_helper 2.11.0
      Installing puppetlabs_spec_helper 2.11.0
      Using rainbow 2.2.2
      Using rspec-puppet-facts 1.9.0
      Using rspec_junit_formatter 0.4.1
      Using ruby-progressbar 1.10.0
      Using unicode-display_width 1.4.0
      Using rubocop 0.49.1
      Using rubocop-i18n 1.2.0
      Using rubocop-rspec 1.16.0
      Using simplecov-console 0.4.2
      Using sfl 2.3
      Using specinfra 2.67.3
      Using puppet-module-posix-dev-r2.4 0.3.12
      Bundle complete! 7 Gemfile dependencies, 79 gems now installed.
      Use `bundle info [gemname]` to see where a bundled gem is installed.
      geoff@computer:~/tmp/foo$ grep 6.0 Gemfile.lock 
            rubocop-rspec (~> 1.16.0)
          rubocop-rspec (1.16.0)
          slop (3.6.0)
      geoff@computer:~/tmp/foo$ pdk build
      Metadata will be generated based on this information, continue? Yes
      pdk (INFO): Building test-foo version 0.1.0
      [✔] Cleaning up after running unit tests.
      pdk (INFO): Build of test-foo has completed successfully. Built package can be found here: /home/geoff/tmp/foo/pkg/test-foo-0.1.0.tar.gz
      geoff@computer:~/tmp/foo$ grep 6.0 Gemfile.lock 
          puppet (6.0.0)
            rubocop-rspec (~> 1.16.0)
          puppet-resource_api (1.6.0)
          rubocop-rspec (1.16.0)
          slop (3.6.0)

      1. Delete Gemfile.lock
      2. pdk bundle install

      Every time pdk build is run

      When integrating other systems, PDK seems to somehow be caching 'old' gemspec files and the above can causes pdk bundle install to fail 100% of the time after running pdk build. I'm hoping that releasing a new package with fixed metadata will fix my own end of this problem but wanted to document this behaviour for my own developer notes




            jean Jean Bond
            geoff@declarativesystems.com Geoff Williams
            0 Vote for this issue
            2 Start watching this issue



                Zendesk Support