manageiq icon indicating copy to clipboard operation
manageiq copied to clipboard

Support ruby 3

Open jrafanie opened this issue 4 years ago • 20 comments

Let's upgrade to ruby 3

Need new gems:

  • [x] https://github.com/ManageIQ/jquery-rjs/pull/9 ~~Needs merge, release, then we can use that release~~ 0.1.1.3 released
  • [x] https://github.com/ManageIQ/foreman_api_client/pull/20 ~needs release, then, we can bump the provider to use this version~ 1.0.2 released
  • [x] https://github.com/ManageIQ/manageiq-providers-foreman/pull/107
  • [x] https://github.com/ruport/ruport/pull/64 merged, ~~needs release~~ released as 1.8.0

Dependencies:

  • [x] https://github.com/ManageIQ/foreman_api_client/pull/20
  • [x] https://github.com/ManageIQ/inventory_refresh/pull/109
  • [x] https://github.com/ManageIQ/manageiq-messaging/pull/71
  • [x] https://github.com/ManageIQ/manageiq-providers-amazon/pull/791
  • [x] https://github.com/ManageIQ/manageiq-providers-ansible_tower/pull/286
  • [x] https://github.com/ManageIQ/manageiq-providers-awx/pull/7
  • [x] https://github.com/ManageIQ/manageiq-providers-azure_stack/pull/86
  • [x] https://github.com/ManageIQ/manageiq-providers-google/pull/236
  • [x] https://github.com/ManageIQ/manageiq-providers-kubernetes/pull/471
  • [x] https://github.com/ManageIQ/manageiq-providers-openshift/pull/231
  • [x] https://github.com/ManageIQ/manageiq-providers-openstack/pull/825
  • [x] https://github.com/ManageIQ/manageiq-providers-oracle_cloud/pull/77
  • [x] https://github.com/ManageIQ/manageiq-providers-ovirt/pull/615
  • [x] https://github.com/ManageIQ/manageiq-providers-red_hat_virtualization/pull/11
  • [x] https://github.com/ManageIQ/manageiq/pull/21941
  • [x] https://github.com/ManageIQ/query_relation/issues/25
  • [x] https://github.com/ManageIQ/manageiq-providers-vmware/pull/822
  • [x] https://github.com/ManageIQ/manageiq-schema/pull/662
  • [x] https://github.com/ManageIQ/manageiq-ui-classic/pull/8443
  • [x] https://github.com/ManageIQ/manageiq-automation_engine/pull/509

After this PR is merged:

  • [ ] Update all workflows/ci.yaml for all repos to test with ruby 3
  • [ ] https://github.com/ManageIQ/manageiq-rpm_build/pull/304
  • [ ] https://github.com/ManageIQ/manageiq-pods/pull/891
  • [ ] https://github.com/ManageIQ/manageiq-appliance-build/pull/524

jrafanie avatar Oct 29 '21 21:10 jrafanie

@miq-bot cross-repo-tests /all ManageIQ/inventory_refresh#97

jrafanie avatar Jan 10 '22 19:01 jrafanie

@miq-bot cross-repo-tests /all ManageIQ/inventory_refresh#97

jrafanie avatar Jan 10 '22 19:01 jrafanie

@miq-bot cross_repo_tests https://github.com/ManageIQ/manageiq/pull/21531, /all including https://github.com/ManageIQ/manageiq/pull/21531, https://github.com/ManageIQ/inventory_refresh/pull/97

jrafanie avatar Jan 10 '22 20:01 jrafanie

@miq-bot cross_repo_tests #21531,/core including #21531, ManageIQ/inventory_refresh#97

jrafanie avatar Jan 11 '22 17:01 jrafanie

@miq-bot cross_repo_tests #21531,/all including #21531, ManageIQ/inventory_refresh#97

jrafanie avatar Jan 21 '22 20:01 jrafanie

I feel that the kwargs changes can just get merged into master and not be part of this PR (including the spec changes that split out the kwargs. Not sure about the message send with the last arg auto converted into a hash. I agree that we can hold off on that one until we figure out if there is another way)

kbrock avatar Feb 07 '22 15:02 kbrock

@miq-bot cross_repo_tests https://github.com/ManageIQ/manageiq/pull/21531,/all including https://github.com/ManageIQ/manageiq/pull/21531, https://github.com/ManageIQ/inventory_refresh/pull/97

agrare avatar Feb 09 '22 19:02 agrare

Opened https://github.com/ManageIQ/foreman_api_client/issues/19, because foreman_api_client doesn't work on Ruby 3.0

Fryguy avatar Apr 05 '22 20:04 Fryguy

Opened https://github.com/ManageIQ/manageiq-messaging/issues/70 to support 3.0 in manageiq-messaging

Fryguy avatar Apr 06 '22 18:04 Fryguy

Opened https://github.com/ManageIQ/query_relation/issues/24 to support 3.0 in query_relation

Fryguy avatar Apr 06 '22 20:04 Fryguy

update:

  • rebased to master (to fix merge issues)
  • rebased to accept the kwargs changes
  • just pulled out another PR... we'll see how that goes

kbrock avatar Jun 16 '22 21:06 kbrock

update:

  • rebased master (kwargs was merged in separate PR and had a few changes)

kbrock avatar Jun 27 '22 18:06 kbrock

@miq-bot cross_repo_tests https://github.com/ManageIQ/manageiq/pull/21531,/all including https://github.com/ManageIQ/manageiq/pull/21531, https://github.com/ManageIQ/inventory_refresh/pull/97

jrafanie avatar Aug 30 '22 21:08 jrafanie

@miq-bot cross_repo_tests https://github.com/ManageIQ/manageiq/pull/21531, /all including https://github.com/ManageIQ/manageiq/pull/21531

jrafanie avatar Aug 30 '22 21:08 jrafanie

@agrare is this is valid test now that we use kwargs on inventory refresh master branch:

https://github.com/ManageIQ/manageiq/blob/e0864dbb4fad6fefae3074a519f1619f49519a7f/spec/models/manageiq/providers/inventory/persister/finders_spec.rb#L61-L75

I can't get this to pass on both ruby 2.7 and ruby 3.

  1) ManageIQ::Providers::Inventory::Persister checks that we recognize first argument vs passed kwargs
     Failure/Error:
       expect do
         persister.vms.lazy_find({:name => "name"}, :ref => :by_name)
       end.to(raise_error(expected_error))

       expected Exception with "Finder has missing keys for index :manager_ref, missing indexes are: [:ems_ref]" but nothing was raised
     # ./spec/models/manageiq/providers/inventory/persister/finders_spec.rb:70:in `block (2 levels) in <top (required)>'

I noticed you deleted a very similar test in the PR that's on master: https://github.com/ManageIQ/inventory_refresh/pull/112/files

jrafanie avatar Sep 02 '22 15:09 jrafanie

is this is valid test now that we use kwargs on inventory refresh master branch:

@jrafanie correct that is no longer a valid test as this case works now. I'm not sure why we were testing that something that should probably have worked all along didn't work :shrug:

agrare avatar Sep 02 '22 15:09 agrare

I'm not sure why we were testing that something that should probably have worked all along didn't work 🤷

Originally it didn't work, which is why Ladas added the workaround code and a spec for it (so that if Ruby fixed it in the future we would know). Somewhere in the Ruby 3 journey it started to work (probably after we changed inventory_refresh to support both params and kwargs.)

Fryguy avatar Sep 06 '22 14:09 Fryguy

Checked commits https://github.com/jrafanie/manageiq/compare/2e2c64d7044b3b2334bf4dbfe4b3a7829266cdc8~...a5088bb7f814c0d7434375f032fa5da32b2dfe0d with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint 21 files checked, 60 offenses detected

spec/models/authenticator/database_spec.rb

spec/models/authenticator/httpd_spec.rb

spec/models/authenticator/ldap_spec.rb

spec/models/miq_provision_spec.rb

spec/models/resource_action_workflow_spec.rb

spec/models/service_template_provision_task_spec.rb

spec/models/service_template_spec.rb

miq-bot avatar Sep 16 '22 13:09 miq-bot

I'm finished suggested changes and restarted the cross repo tests: https://github.com/ManageIQ/manageiq-cross_repo-tests/pull/706

I think we're ready to merge when things are green.

jrafanie avatar Sep 21 '22 13:09 jrafanie

Checked commits https://github.com/jrafanie/manageiq/compare/04e062273c357e2e60660ccc9be84edb1e5d81b3~...f9469b708811a302b89f5f1c28d71c97bc415129 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint 21 files checked, 0 offenses detected Everything looks fine. :star:

miq-bot avatar Sep 21 '22 13:09 miq-bot

@agrare @bdunne @kbrock @Fryguy Ok, this is green, the 3.0 results are the same as the 2.7 ones (ui-service and api fail in the same way): https://github.com/ManageIQ/manageiq-cross_repo-tests/pull/706

I think we're ready to merge this and start building pods and appliances and ensuring all the repositories are testing with 3.0 going forward.

jrafanie avatar Sep 21 '22 14:09 jrafanie