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

Fix GitHub Actions Verify Action Using Wrong Version of Ruby for 3.0.x Tests #17419

Merged

Conversation

gwillcox-r7
Copy link
Contributor

@gwillcox-r7 gwillcox-r7 commented Dec 27, 2022

Overview - The Casting Issue

When we specified the versions for our Verify GitHub Action, we mistakenly specified the version numbers as floating point numbers vs as strings. This was fine for most numbers since they contained a non-zero number after the decimal point, such as 2.7, or 3.1, and so they would be converted into a string fine.

However for version 3.0 of Ruby, this would be interpreted as a float with a value of 3, so instead of using version 3.0 of Ruby, we would use the latest version 3 release of Ruby for testing, instead of the expected latest 3.0.X release.

This was explained in a solution at https://github.com/orgs/community/discussions/35109, though the specific issue r.e values and casting is based on my own speculation of what is going on behind the scenes, given this only affects the Ruby 3.0 releases.

But Why Did We Only Notice this Now?

Well as it turns out, Christmas Day was when Ruby 3.2.0 was released. This meant that any PR submitted before this day used the latest Ruby version at the time, which was 3.1.3. When Christmas rolled around, the latest Ruby 3 version suddenly became Ruby 3.2.0, which meant any PRs submitted on or after the time of release now started to use Ruby 3.2.0, which ended up breaking things due to Ruby 3.2 incompatibilities with Nokogiri (to be fixed as noted at sparklemotion/nokogiri#2740).

Verification

@gwillcox-r7 gwillcox-r7 changed the title Check if double quotes around ruby-version string fixes the issue Fix GitHub Actions Verify Action Using Wrong Version of Ruby for 3.0.x Tests Dec 27, 2022
This fixes issues where Ruby would interpret version strings as floats,
which could lead to casting errors. An example of this was when 3.0 would be interpreted
as the number 3, so instead of getting the latest Ruby 3.0.X release,
you would instead get the latest Ruby 3 release.
@gwillcox-r7 gwillcox-r7 force-pushed the fix-verify-using-wrong-ruby-version branch from e6ddc11 to 6057047 Compare December 27, 2022 18:33
@bwatters-r7 bwatters-r7 self-assigned this Dec 27, 2022
@bwatters-r7 bwatters-r7 merged commit 04f2db6 into rapid7:master Dec 27, 2022
@bwatters-r7 bwatters-r7 added the rn-no-release-notes no release notes label Dec 27, 2022
@gwillcox-r7 gwillcox-r7 deleted the fix-verify-using-wrong-ruby-version branch December 27, 2022 21:17
@adfoster-r7
Copy link
Contributor

this likely also means we were doing a bit of testing on Ruby 3.2 for some time

Ruby 3.2 was only just released on Christmas day - https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/

@gwillcox-r7
Copy link
Contributor Author

@adfoster-r7 Sorry my bad I got confused here when I was writing that and I noted above we were testing on 3.1.3, deleting that comment to avoid confusion.

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

Successfully merging this pull request may close these issues.

4 participants