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

Revert "(CONT-801) Deprecate uriescape.rb" #1402

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

traylenator
Copy link
Contributor

@traylenator traylenator commented Oct 17, 2023

Summary

This reverts commit 799d608.

While uriescape was deprecated for Puppet 8 in #1307 it was already fixed earlier for Puppet 8 and ruby 3 in #1195

It is unclear to me why this function was deprecated.

Additional Context

Add any additional context about the problem here.
Function was deprecated on Puppet 8.

Related Issues (if any)

Checklist

  • [x ] 🟢 Spec tests.
  • [x ] 🟢 Acceptance tests.
  • [x ] Manually verified. (For example puppet apply)

This reverts commit 799d608.

While uriescape was deprecated for Puppet 8 in puppetlabs#1307
it was already fixed earlier for Puppet 8 and ruby 3 in puppetlabs#1195

It is unclear to me why this function was deprecated.

* Fixes puppetlabs#1401
@CLAassistant
Copy link

CLAassistant commented Oct 17, 2023

CLA assistant check
All committers have signed the CLA.

@traylenator
Copy link
Contributor Author

CLA signed in agreement between CERN IT and Puppetlabs.

Copy link
Collaborator

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case that we do proceed with this: you need to update the comments on line 6 & 7.

On the question if we should proceed: I'm not sure if this is a good idea, I don't know. there's a good reason it was dropped in Ruby 3: the whole idea behind the function is sketchy. I'm more a fan of explicit URL construction where you pass the parameters unescaped and then it correctly constructs the URL.

@traylenator
Copy link
Contributor Author

Redundant comments removed.

I only use it one place to escape PS Scavenge and PS MarkSweep before we pass them as parameters to a
puppetserver beans endpoint.

java.lang:name=PS%20Scavenge

when pulling metrics out of PuppetServer.

Does a url from component function exist ?

@ekohl
Copy link
Collaborator

ekohl commented Oct 17, 2023

https://docs.knapsackpro.com/2020/uri-escape-is-obsolete-percent-encoding-your-query-string suggests URI.encode_www_form_component would be the proper replacement. It only escapes a URL parameter

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

Successfully merging this pull request may close these issues.

uriescape function deprecated on P7 - no alternative on P8
4 participants