puppetlabs / puppet

Server automation framework and application
https://puppet.com/open-source/#osp
Apache License 2.0
7.46k stars 2.19k forks source link

Outdated docs links in deprecation warnings #9378

Open justinstoller opened 5 months ago

justinstoller commented 5 months ago

Describe the Bug

puppetserver 7.16 logs a deprecation warning with a broken URL:

2024-03-11T17:43:29.958-05:00 WARN [qtp1601237113-43] [puppetserver] Puppet The function 'hiera' is deprecated in favor of using 'lookup'. See https://puppet.com/docs/puppet/7.29/deprecated_language.html (file & line not available)

This convention of using Puppet's minor version (see https://github.com/puppetlabs/puppet/blob/main/lib/hiera/puppet_function.rb#L67) in a url doesn't seem to redirect properly (or maybe the language deprecation page has moved? I couldn't get any variant of the url to work or find the page I assumed it was linking to)

Expected Behavior

Deprecations with valid links

Steps to Reproduce

See linked ticket below

Environment

See linked ticket below

Additional Context

This was originally opened as a Puppet Server ticket here: https://github.com/puppetlabs/puppetserver/issues/2835

I'm happy to open a PR but I can't figured out what the links should be. I searched the Puppet 7.x codebase and found a couple other similarly constructed urls which are also broken:

➜  rg 'puppet\.com.*deprec' ruby/puppet/lib/
ruby/puppet/lib/hiera/puppet_function.rb
65:      message += ' '+ _("See https://puppet.com/docs/puppet/%{minor_version}/deprecated_language.html") %

ruby/puppet/lib/puppet/network/http/request.rb
68:    # YAML in network requests is not supported. See http://links.puppet.com/deprecate_yaml_on_network

ruby/puppet/lib/puppet/pops/issues.rb
599:    _("Use of 'import' has been discontinued in favor of a manifest directory. See http://links.puppet.com/puppet-import-deprecation")
631:    _("Node inheritance is not supported in Puppet >= 4.0.0. See http://links.puppet.com/puppet-node-inheritance-deprecation")

ruby/puppet/lib/puppet/type/file/ensure.rb
50:      [deprecated](https://docs.puppet.com/puppet/4.3/deprecated_language.html)

ruby/puppet/lib/puppet/parser/functions/hiera_array.rb
69:See https://puppet.com/docs/puppet/#{Puppet.minor_version}/deprecated_language.html.

ruby/puppet/lib/puppet/parser/functions/hiera_hash.rb
79:See  https://puppet.com/docs/puppet/#{Puppet.minor_version}/deprecated_language.html.

ruby/puppet/lib/puppet/parser/functions/hiera.rb
81:See https://puppet.com/docs/puppet/#{Puppet.minor_version}/deprecated_language.html.

ruby/puppet/lib/puppet/parser/ast/node.rb
7:      raise Puppet::DevError, _("Node inheritance is removed in Puppet 4.0.0. See http://links.puppet.com/puppet-node-inheritance-deprecation")
IngridaCazers commented 5 months ago

@justinstoller I've been investigating this issue. The Puppet 5.5 documentation had a topic named "Deprecated language features," which described the replacement of hiera functions with the lookup function:

https://www.puppet.com/docs/puppet/5.5/deprecated_language

The topic was not maintained in the documentation set in subsequent releases. Would it be helpful to update the software to point to this link?

AriaXLi commented 3 weeks ago

@justinstoller @IngridaCazers We think it would be most helpful to have the software point to this page: https://www.puppet.com/docs/puppet/8/hiera_migrate since it talks about upgrading to Hiera 5

IngridaCazers commented 3 weeks ago

@AriaXLi @justinstoller Thanks, Aria, for this input. Justin, if you agree that this link would be appropriate, the software could be updated to use that link. My only comment is that we could use the "latest" string in the link instead of mentioning Puppet 8 to help ensure that the link will still work in future releases. If we add "latest," the link will look like this: https://www.puppet.com/docs/puppet/latest/hiera_migrate