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

Add support for ruby 3.0.x #32

Merged
merged 5 commits into from
Jan 3, 2022
Merged

Add support for ruby 3.0.x #32

merged 5 commits into from
Jan 3, 2022

Conversation

alachaum
Copy link
Member

@alachaum alachaum commented May 31, 2021

  • Refactor positional/keyword arguments to support ruby 3.0.x
  • Separate test environments for ruby 2.5/2.6 / 2.7 / 3.x
  • Skip Rails-specific tests when Rails in not in context

@alachaum alachaum added the enhancement New feature or request label May 31, 2021
@alachaum alachaum force-pushed the ruby-3 branch 5 times, most recently from 34a9647 to 7a0be4b Compare May 31, 2021 11:41
@alachaum alachaum mentioned this pull request May 31, 2021
@alachaum alachaum force-pushed the ruby-3 branch 6 times, most recently from 7da068d to d8a789f Compare December 31, 2021 12:21
@vovimayhem
Copy link
Contributor

Oh great!!!! I was actually bumping my head with this one when upgrading an app to ruby 3... what else is needed?

@vovimayhem
Copy link
Contributor

vovimayhem commented Jan 2, 2022

I'm still getting an error when setting up a queue on Ruby 3.0.3, right where we're checking if the queue exists or not:

require 'cloudtasker/backend/google_cloud_task'
require 'cloudtasker/config'
Cloudtasker::Backend::GoogleCloudTask.setup_queue(name: "default")

Throws:

/usr/local/bundle/gems/google-cloud-tasks-1.5.1/lib/google/cloud/tasks/v2beta3/cloud_tasks_client.rb:523:in `create_queue': wrong number of arguments (given 1, expected 2) (ArgumentError)
/usr/local/bundle/gems/google-gax-1.8.2/lib/google/gax/api_callable.rb:369:in `rescue in block in retryable': GaxError Exception occurred in retry method that was not classified as transient, caused by 5:Queue does not exist. If you just created the queue, wait at least a minute for the queue to initialize.. debug_error_string:{"created":"@1641166932.545747842","description":"Error received from peer ipv4:142.250.65.138:443","file":"src/core/lib/surface/call.cc","file_line":1063,"grpc_message":"Queue does not exist. If you just created the queue, wait at least a minute for the queue to initialize.","grpc_status":5} (Google::Gax::RetryError)
/usr/local/bundle/gems/grpc-1.42.0/src/ruby/lib/grpc/generic/active_call.rb:29:in `check_status': 5:Queue does not exist. If you just created the queue, wait at least a minute for the queue to initialize.. debug_error_string:{"created":"@1641166932.545747842","description":"Error received from peer ipv4:142.250.65.138:443","file":"src/core/lib/surface/call.cc","file_line":1063,"grpc_message":"Queue does not exist. If you just created the queue, wait at least a minute for the queue to initialize.","grpc_status":5} (GRPC::NotFound)

This is the call that is throwing the error:

client.create_queue(
client.location_path(config.gcp_project_id, config.gcp_location_id),
name: full_queue_name,
retry_config: { max_attempts: retries },
rate_limits: { max_concurrent_dispatches: concurrency }
)

And this is the method being called on google-cloud-tasks gem:

https://github.com/googleapis/google-cloud-ruby/blob/0615bcf5c99deb027f465e91081931654ef57a62/google-cloud-tasks/lib/google/cloud/tasks/v2beta3/cloud_tasks_client.rb#L523-L534

@vovimayhem
Copy link
Contributor

vovimayhem commented Jan 3, 2022

The specs are not catching this because of rspec/rspec-mocks#1425 (comment)

@alachaum
Copy link
Member Author

alachaum commented Jan 3, 2022

Thanks for the testing @vovimayhem ! I was actually planning to do another round of testing over the next couple of days. Ideally I want to merge this PR this week and make a release candidate.

@alachaum alachaum merged commit b567c21 into keypup-io:master Jan 3, 2022
@alachaum
Copy link
Member Author

alachaum commented Jan 3, 2022

@vovimayhem release candidate v0.13.rc1 has been pushed to rubygems! Feel free to provide feedback on the original issue

@vovimayhem
Copy link
Contributor

I tried to make the specs detect that, but had no luck - I guess that rspec has yet to get the hash vs keywords thing right...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants