coinbase / temporal-ruby

Ruby SDK for Temporal
Apache License 2.0
213 stars 81 forks source link

Expose count_workflow_executions on the temporal client #272

Closed harsh-stripe closed 7 months ago

harsh-stripe commented 8 months ago

Summary

This change exposes a count_workflow_executions method on the Temporal client so that users can invoke it using code such as:

client = Temporal::Client.new(config)
result = client.count_workflow_executions(namespace: 'ruby-samples', query: 'WorkflowType="TestingWorkflow"')

Test Plan

Unit test:

bundle exec rspec spec/unit/lib/temporal/client_spec.rb:1106
harsh-stripe commented 8 months ago

@DeRauk - Addressed your feedback to return the count value directly instead of as a wrapped object.

harsh-stripe commented 7 months ago

@DeRauk - it looks like the GitHub actions for this project sets up a temporal-server instance which does not use advanced visibility.

Ultimately, I think it might just be worth removing the example spec for count_workflow_executions since the spec relies on a visibility backend store, and it is also reliant on timing since the data push to the visibility store happens async. The spec would've been nice to have, but I don't believe it's critical, so I've removed it.

DeRauk commented 7 months ago

Thank you!