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

Upgrade to Ruby 3.1 #32

Merged
merged 2 commits into from
May 1, 2023
Merged

Upgrade to Ruby 3.1 #32

merged 2 commits into from
May 1, 2023

Conversation

archanaserver
Copy link
Contributor

@archanaserver archanaserver commented Mar 10, 2023

Adding Ruby v3 supports.

Requires:

.rubocop.yml Outdated Show resolved Hide resolved
@@ -78,7 +78,7 @@ def set_downtime_host(host, author, comment, start_time, end_time, all_services:
private

def uri_encode_filter(filter)
URI.encode(filter)
CGI.escape(filter)
Copy link
Member

Choose a reason for hiding this comment

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

CGI.escape is quite a different API from URI.encode. I opened #30 and would prefer to investigate that path instead.

Copy link
Contributor Author

@archanaserver archanaserver Mar 21, 2023

Choose a reason for hiding this comment

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

I changed the required_ruby_version from '>= 2.5', '< 3' to '>= 2.7', '< 4' and we are not getting any URI.escape error any more. So I move back to the previous change. All checks green though.

Copy link
Member

Choose a reason for hiding this comment

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

You can see that the URL that's stubbed is changed, and it introduces a problem.

In the old version the parameters are separated by & but in the new version that's now escaped and represented as %26%26. This means only two parameters (filter and type) are sent, instead of all 4 (filter, author, comment, type).

smart_proxy_monitoring.gemspec Outdated Show resolved Hide resolved
Copy link
Member

@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.

Given it's a functionality change I'd suggest to include #30 as a separate commit. I think the easiest way is to use hub. Use hub pr checkout 30 to check out the branch and then git rebase $BRANCH.

@archanaserver
Copy link
Contributor Author

Given it's a functionality change I'd suggest to include #30 as a separate commit. I think the easiest way is to use hub. Use hub pr checkout 30 to check out the branch and then git rebase $BRANCH.

@ekohl Done! But wouldn't that be good to separate both the changes in diff PRs- like one is all about ruby 3 upgrdae and other one is about the functionality change. This way anyone can validate those changes and able to easily track it too. So if you can prefer to merge #30 first before switching to this PR?

@dgoetz
Copy link
Member

dgoetz commented Apr 19, 2023

Merged #30

archanaserver and others added 2 commits April 27, 2023 12:52
This avoids needing to URL encode the parameters and simplifies the
code. This removes the need for URI.encode, which is removed in Ruby 3.
@archanaserver
Copy link
Contributor Author

@ekohl I have rebased my changes on top of the #30.

@ehelms
Copy link
Member

ehelms commented Apr 28, 2023

This appears to still include a second commit that appears to be a modification of a previously merged change. I'd recommend dropping that commit and re-pushing.

@ekohl ekohl merged commit 8b924eb into theforeman:master May 1, 2023
@ekohl
Copy link
Member

ekohl commented May 1, 2023

I rebased & merged because I thought it would drop the commit, but looks like there was also a change in it so there is now 8b924eb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants