Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable_legacy_facts: true includes deprecated puppet-lint-legacy_facts-check gem #501

Closed
danielparks opened this issue Mar 17, 2023 · 5 comments · Fixed by #502
Closed
Labels

Comments

@danielparks
Copy link

Describe the Bug

Enabling disable_legacy_facts creates a Gemfile that specifies contradictory version requirements. Specifically, it includes the
puppet-lint-legacy_facts-check gem and voxpupuli-puppet-lint-plugins ~> 4.0. The voxpupuli gem requires puppet-lint ~> 3.1, but puppet-lint-legacy_facts-check is incompatible with that version.

Note: puppet-lint-legacy_facts-check has been merged into puppet-lint (puppetlabs/puppet-lint#85, mmckinst/puppet-lint-legacy_facts-check#41), so the way this works probably needs to change regardless.

Expected Behavior

Setting disable_legacy_facts to true should result in a Gemfile that allows normal usage. Running lints should check for legacy facts.

Steps to Reproduce

❯ pdk new module --template-url https://github.com/puppetlabs/pdk-templates --skip-interview dp-foobar foobar
❯ cd foobar
❯ pdk validate
[ ...success... ]
❯ { echo 'common:' ; echo '    disable_legacy_facts: true' ; } >.sync.yml
❯ pdk update --force
[ ...success... ]
❯ pdk validate
pdk (INFO): Using Ruby 2.7.7
pdk (INFO): Using Puppet 7.22.0
pdk (INFO): Running all available validators...
pdk (FATAL): Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies....

The dependency rb-readline (= 0.5.5) 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`.
Bundler could not find compatible versions for gem "puppet":
  In Gemfile:
    puppet (= 7.22.0)

    puppet_litmus (< 1.0.0) was resolved to 0.34.6, which depends on
      bolt (~> 3.0) was resolved to 3.27.1, which depends on
        puppet (>= 6.18.0)

    puppet-debugger (~> 1.0) was resolved to 1.3.0, which depends on
      puppet (>= 5.5)

    rspec-puppet-facts (~> 2.0) was resolved to 2.0.5, which depends on
      puppet

Bundler could not find compatible versions for gem "puppet-lint":
  In Gemfile:
    puppet-lint-legacy_facts-check was resolved to 1.0.2, which depends on
      puppet-lint (~> 2.0)

    voxpupuli-puppet-lint-plugins (~> 4.0) was resolved to 4.0.0, which depends on
      puppet-lint (~> 3.1)

Bundler could not find compatible versions for gem "r10k":
  In Gemfile:
    puppet_litmus (< 1.0.0) was resolved to 0.34.6, which depends on
      bolt (~> 3.0) was resolved to 3.27.1, which depends on
        r10k (~> 3.10)

    puppet_litmus (< 1.0.0) was resolved to 0.34.6, which depends on
      r10k (= 3.15.1)

Bundler could not find compatible versions for gem "rubocop":
  In Gemfile:
    rubocop (= 1.6.1)

    rubocop-performance (= 1.9.1) was resolved to 1.9.1, which depends on
      rubocop (>= 0.90.0, < 2.0)

    rubocop-rspec (= 2.0.1) was resolved to 2.0.1, which depends on
      rubocop (~> 1.0)

pdk (FATAL): Unable to resolve Gemfile dependencies.

Environment

  • PDK 2.6.1
  • macOS 13.2.1

Tangentially related open PR: #460

@danielparks
Copy link
Author

Hm. Looks like I linked the wrong PR for the merge of the legacy facts check into puppet-lint. I’m out of time right now, but I’ll try to track this down later.

@chelnak
Copy link
Contributor

chelnak commented Mar 17, 2023

@danielparks Thanks! Really good catch.

I will get this sorted!

chelnak added a commit that referenced this issue Mar 18, 2023
This change removes the template logic that adds
`puppet-lint_legacy_facts-checl` based on `common:disable_legacy_facts`
config and fixes #501.

The legacy facts check is now part of puppet-lint which means including
this gem is no longer required.

Additionally, users that currently have `disable_legacy_facts` set to
`true` in their `.sync` file may encounter breaking dependency
conflicts.
jordanbreen28 added a commit that referenced this issue Mar 20, 2023
@jordanbreen28
Copy link
Contributor

Hey @danielparks - A fix for this has been merged into main from #502, so I'll go ahead and close this issue.
Please do re-open if you find the issue still persists!

@chelnak
Copy link
Contributor

chelnak commented Mar 20, 2023

To avoid having to pull from main we will need to tag pdk-templates before it's properly available.

@chelnak
Copy link
Contributor

chelnak commented Mar 20, 2023

Tagged pdk-templates @ 2.7.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants