voxpupuli / metadata-json-lint

Tool to check the validity of Puppet metadata.json files
Apache License 2.0
29 stars 27 forks source link

strict_dependencies = false doesn't work #76

Closed cdenneen closed 7 years ago

cdenneen commented 7 years ago

Default should be false for looking at open ended dependencies but with 1.2.2 it's complaining and failing. Tried to set the following in Rakefile

require 'metadata-json-lint/rake_task'
MetadataJsonLint.options.strict_dependencies = false

as per the README but still errors on the open ended dependencies.

Output:

# be rake test; echo $?
(WARN) dependencies: Dependency puppetlabs-stdlib has an open ended dependency version requirement >= 4.15.0
(WARN) dependencies: Dependency puppetlabs-firewall has an open ended dependency version requirement >= 1.8.2
(WARN) dependencies: Dependency puppetlabs-ntp has an open ended dependency version requirement >= 6.0.0
(WARN) dependencies: Dependency puppetlabs-inifile has an open ended dependency version requirement >= 1.6.0
(WARN) dependencies: Dependency puppetlabs-accounts has an open ended dependency version requirement >= 1.1.0
(WARN) dependencies: Dependency bashtoni-timezone has an open ended dependency version requirement >= 1.0.0
(WARN) dependencies: Dependency razorsedge-snmp has an open ended dependency version requirement >= 3.6.0
(WARN) dependencies: Dependency saz-sudo has an open ended dependency version requirement >= 4.1.0
(WARN) dependencies: Dependency puppet-selinux has an open ended dependency version requirement >= 0.8.0
(WARN) dependencies: Dependency sensu-puppet has an open ended dependency version requirement >= 2.1.0
(WARN) dependencies: Dependency puppet-yum has an open ended dependency version requirement >= 1.0.0
(WARN) dependencies: Dependency pcfens-ca_cert has an open ended dependency version requirement >= 1.6.1
(WARN) dependencies: Dependency puppetlabs-apt has an open ended dependency version requirement >= 2.3.0
(WARN) dependencies: Dependency lwf-remote_file has an open ended dependency version requirement >= 1.1.3
(WARN) dependencies: Dependency pcfens-filebeat has an open ended dependency version requirement >= 0.10.2
(WARN) dependencies: Dependency razorsedge-openvmtools has an open ended dependency version requirement >= 1.0.0
(WARN) dependencies: Dependency razorsedge-vmwaretools has an open ended dependency version requirement >= 6.0.0
(WARN) dependencies: Dependency stahnma-epel has an open ended dependency version requirement >= 1.2.2
(WARN) dependencies: Dependency treydock-yum_cron has an open ended dependency version requirement >= 2.0.0
(WARN) dependencies: Dependency herculesteam-augeasproviders_shellvar has an open ended dependency version requirement >= 2.2.1
(WARN) dependencies: Dependency herculesteam-augeasproviders_core has an open ended dependency version requirement >= 2.1.3
Warnings found in metadata.json
1
domcleal commented 7 years ago

I think this is a similar case to #69, I should probably fix it in the same way by having it warn by default and then not check at all when the strict_dependencies option is off.

You can make the check pass by disabling both strict_dependencies and fail on warnings.

cdenneen commented 7 years ago

@domcleal but the default is off... so since 1.2.x it's not working... 1.1.0 worked fine.

domcleal commented 7 years ago

Yep, it is a regression, I was just making notes on how is best to fix it.

1.2.0 had some changes to this and another check that used to issue warnings but without affecting the exit code, but this was changed to issue a standard warning which did affect the exit code. The strict_dependencies setting still should override that behaviour.

cdenneen commented 7 years ago

When I realized it was failing I tried to add the strict_dependencies and it didn't work. I don't think this option does anything currently. On Wed, Jun 14, 2017 at 3:18 AM Dominic Cleal notifications@github.com wrote:

Yep, it is a regression, I was just making notes on how is best to fix it.

1.2.0 had some changes to this and another check that used to issue warnings but without affecting the exit code, but this was changed to issue a standard warning which did affect the exit code. The strict_dependencies setting still should override that behaviour.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/voxpupuli/metadata-json-lint/issues/76#issuecomment-308341872, or mute the thread https://github.com/notifications/unsubscribe-auth/AAr84duen8L1TFREVvf7wRukJ1qOf413ks5sD4k9gaJpZM4N0hIw .