Fix GitHub Actions Verify Action Using Wrong Version of Ruby for 3.0.x Tests #17419
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Ruby 3.0
, whereas other PRs onmaster
are statingRuby 3
as being tested. This indicates that the string wasn't being interpreted correctly due to the casting issue.Ruby 3.0
are now utilizing Ruby 3.0.5 for testing. You can see this under something like https://github.com/rapid7/metasploit-framework/actions/runs/3789002645/jobs/6442338931 in theSetup Ruby->Print Ruby Version
section.master
is using Ruby 3.2.0 for theRuby 3
testing atm. Can check this by looking at a PR such as Use .blank? instead of .empty? when handling SSH Key details to prevent crashes #17416 and following the same steps as above to look at one of theVerify / ubuntu-20.04 - Ruby 3
checks.