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

SAT-25518 - Change removed URI.escape to CGI.escape w Ruby3 #887

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

chris1984
Copy link
Member

@chris1984 chris1984 commented Jun 13, 2024

With the switch to Ruby3 we are getting the following traceback with inventory sync:

13:07:08 rails.1   | 2024-06-13T13:07:08 [W|bac|9b31bf0e] undefined method `encode' for URI:Module (NoMethodError)
13:07:08 rails.1   |  9b31bf0e | /home/vagrant/foreman_rh_cloud/lib/foreman_inventory_upload.rb:78:in `inventory_export_url'
13:07:08 rails.1   |  9b31bf0e | /home/vagrant/foreman_rh_cloud/lib/inventory_sync/async/query_inventory_job.rb:74:in `request_url'
13:07:08 rails.1   |  9b31bf0e | /home/vagrant/foreman_rh_cloud/lib/inventory_sync/async/query_inventory_job.rb:57:in `query_inventory'

According to Stack Overflow Ruby3 got rid of URI.escape and suggest using CGI.escape
https://stackoverflow.com/questions/68635238/undefined-method-encode-for-urimodule-with-gem-rspotify
https://stackoverflow.com/questions/68174351/undefined-method-escape-for-urimodule

After PR, sync runs fine.

I looked in the code and this was the only instance I could find of URI.escape

Copy link
Collaborator

@ColeHiggins2 ColeHiggins2 left a comment

Choose a reason for hiding this comment

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

Tested in downstream Satellite stream build, Inventory Sync works. Looks good to me!

@chris1984 chris1984 assigned chris1984 and unassigned chris1984 Jun 13, 2024
@chris1984 chris1984 added the bug Something isn't working label Jun 13, 2024
@chris1984 chris1984 merged commit 629ab94 into theforeman:v10 Jun 13, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants