xorpaul / g10k

my r10k fork in Go
Apache License 2.0
125 stars 50 forks source link

add option to inform about deprecated modules #148

Closed rwaffen closed 5 years ago

rwaffen commented 5 years ago

r10k gives you warnings like that

WARN     -> Puppet Forge module 'arioch-redis' has been deprecated, visit https://forge.puppet.com/arioch/redis for more information.

it would be nice to have this also in g10k.

xorpaul commented 5 years ago

Which g10k version are you using or are you using g10k with -quiet by any change?

g10k has this since v.0.4.8 (https://github.com/xorpaul/g10k/releases/tag/v0.4.8), but doesn't report it when using -quiet

https://github.com/xorpaul/g10k/commit/22b628c07471032b1a79970b591852d22e5e9877

Resolving Git modules (1/1)    0s [====================================================================] 100%
Resolving Forge modules (1/1)    0s [====================================================================] 100%
Synced ./Puppetfile with 1 git repositories and 1 Forge modules in 0.5s with git (0.5s sync, I/O 0.0s) and Forge (0.0s query+download, I/O 0.0s) using 50 resolv and 20 extract workers

Otherwise if g10k fails to detect this please post an example Puppetfile for me to debug.

rwaffen commented 5 years ago

Puppetfile:

mod 'arioch/redis', '3.3.0'

g10k

g10k -version
g10k version 0.7.3 Build time: 2019-09-12_16:14:21 UTC

g10k -puppetfile -verbose
2019/09/13 15:11:42 GETing https://forgeapi.puppetlabs.com/v3/files/arioch-redis-3.3.0.tar.gz took 1.03976s
2019/09/13 15:11:42 Extracting /tmp/g10k/arioch-redis-3.3.0.tar.gz took 0.94164s
Need to sync modules/redis/
2019/09/13 15:11:43 Populating modules/redis/ took 0.01984s
Synced ./Puppetfile with 0 git repositories and 1 Forge modules in 2.0s with git (0.0s sync, I/O 0.0s) and Forge (2.0s query+download, I/O 1.0s) using 50 resolv and 20 extract workers

r10k 3.3.1

    WARN     -> Puppet Forge module 'arioch-redis' has been deprecated, visit https://forge.puppet.com/arioch/redis for more information.
xorpaul commented 5 years ago

Ah, when you specify a version g10k would try to load this out of it's cache without contacting the Puppetlabs Forge in any way.

Seems like r10k did always query the Forge API and not use a cache like g10k did.

With v0.7.4 I've added this query to check for deprecation notices. https://github.com/xorpaul/g10k/releases/tag/v0.7.4

If you're using many Puppetlabs Forge modules in your Puppetfile I suggest specifying a cache for that metadata/deprecation information query by adding

forge.cacheTtl 8h

or something similar to your Puppetfile(s).