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
Ruby3 Upgrade #2837
Ruby3 Upgrade #2837
Conversation
|
Probably because we mock out the
😞 Of course now that keyword arguments are more strict the following expectation isn't entirely accurate: cloud_controller_ng/spec/unit/lib/cloud_controller/clock/clock_spec.rb Lines 113 to 119 in 2f2aa34
Because we know it wasn't receiving keyword arguments, it was receiving a hash. But the expectation didn't fail. I wonder if newer versions of rspec deal with the new keyword arguments better. |
edit: just saw your second comment. That makes sense. I'll try to look at what newer rspec does if anything. But wouldn't hold up this PR on newer rspec |
Seems like we are on newest Rspec already. |
This issue implies Rspec does make the distinction, so I'm not sure why it didn't trigger here: rspec/rspec-mocks#1438 |
.ruby-version
Outdated
@@ -1 +1 @@ | |||
2.7.5 | |||
3.0.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might as well go to 3.0.4, since that has been released since we first attempted the upgrade:
https://www.ruby-lang.org/en/news/2022/04/12/ruby-3-0-4-released/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, bumped it in capi-release pr
I pointed the rspec gems to the
What a bummer. See this branch: https://github.com/cloudfoundry/cloud_controller_ng/compare/rspec-on-main?expand=1 Upsetting that this is not released yet, would have saved us a large headache. I am going to try to run this on the rest of our units to see if we missed any other spots. |
The issue isn't the double, it's the |
@xandroc @moleske By pointing the rspec gems to main and removing conflicting dependencies indiscriminately, I was able to find one other potential issue:
It looks like it was just the test mocking that was mismatched, not the actual code, so not that alarming. But unfortunately I couldn't all specs to run since I had to remove a few dependencies that weren't compatible with rspec main branches. So it's possible there are a few remaining spots that got missed. |
This reverts commit 4971a57.
…ethod call Co-authored-by: David Alvarado <alvaradoda@vmware.com> Co-authored-by: Alex Rocha <alexr1@vmware.com>
Co-authored-by: Michael Oleske <moleske@pivotal.io> Co-authored-by: David Alvarado <alvaradoda@vmware.com>
/easycla |
Hmm, how can the EasyCLA check be re-run? Closing and re-opening the PR had no effect as well as commenting |
@dalvarado did sumbit it, cause I watched him do it. It seems to be stuck with VMware. If we're ready to merge and he's still not authorized we'll put his name second. EasyCLA seems to only check the first author |
IMHO we could cut a ruby-3.0 exclusive release (meaning it will be the only change in the capi release so easy rollback can be achieved). Any objections and news on the CLA issue @moleske ? : ) |
* we found these by running the latest branches of rspec--the currently released versions miss these when they are mismatched Co-authored-by: Seth Boyles <sboyles@pivotal.io> Co-authored-by: Michael Oleske <moleske@pivotal.io>
@moleske and I managed to bundle CCNG with the latest references to the rspec gems and ran bake. The tests uncovered a few more places where the specs were not expecting keywords or hash opts correctly. No cases of the actual code being incorrect, however. We did discover that it was still possible to get a false positive on a test, if the mocks overwrote the method expecting the keyword arguments/hash opts to match the way the offending caller miscalls the method. So unfortunately its not foolproof, but we have a little more confidence than before. We think this is probably the most we can do before merging this PR in again. @moleske and I will cut a release today and then merge in this PR to prepare for a Ruby3 only release. We are going to merge despite the CLA warming since we have eye-witness testimony that @dalvarado did indeed sign the CLA. |
* Revert "Revert "Merge pull request cloudfoundry#2703 from cloudfoundry/bump-ruby"" This reverts commit 4971a57. * Fixing ruby3 scheduler errors stemming from invalid ruby3 syntax in method call Co-authored-by: David Alvarado <alvaradoda@vmware.com> Co-authored-by: Alex Rocha <alexr1@vmware.com> * bump to ruby 3.0.4 Co-authored-by: Michael Oleske <moleske@pivotal.io> Co-authored-by: David Alvarado <alvaradoda@vmware.com> * Update specs that had mismatched keyword args/hash opts * we found these by running the latest branches of rspec--the currently released versions miss these when they are mismatched Co-authored-by: Seth Boyles <sboyles@pivotal.io> Co-authored-by: Michael Oleske <moleske@pivotal.io> Co-authored-by: M. Oleske <michael@oleske.engineer> Co-authored-by: David Alvarado <alvaradoda@vmware.com> Co-authored-by: Michael Oleske <moleske@pivotal.io> Co-authored-by: Seth Boyles <sboyles@pivotal.io>
Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:
An explanation of the use cases your change solves: Keep in sync with latest Ruby version and prepare for future features/upgrades
Links to any other associated PRs:
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
main
branchI have run all the unit tests using
bundle exec rake
I have run CF Acceptance Tests