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

Listing all workflows #45

Open
matti opened this issue Nov 4, 2017 · 4 comments
Open

Listing all workflows #45

matti opened this issue Nov 4, 2017 · 4 comments

Comments

@matti
Copy link

matti commented Nov 4, 2017

In Rails, Gush::Client.new.all_workflows explodes in params TypeError: no implicit conversion of Symbol into Integer (and so does gush list)

class MyWorkflow < Gush::Workflow
  def configure(opts={})
    run MyJob1, {
      params: {
        project_id: opts[:project_id],
        version: opts[:version]
      }
    }
    run MyJob2, {
      after: MyJob1,
      params: {
        project_id: opts[:project_id]
      }
    }
  end
end
@matti
Copy link
Author

matti commented Nov 4, 2017

What's the correct usage of Gush client in Rails?

@matti
Copy link
Author

matti commented Nov 4, 2017

Changing opts to arguments configure(project_id, version) works...

@pokonski
Copy link
Contributor

pokonski commented Nov 4, 2017

Hmm sounds like a bug. can you paste the stack trace?

@matti
Copy link
Author

matti commented Nov 4, 2017

$ gush list
/Users/ben/railsapp/workflows/my_workflow.rb:5:in `[]': no implicit conversion of Symbol into Integer (TypeError)
	from /Users/ben/railsapp/app/workflows/my_workflow.rb:5:in `configure'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/gush-1.0.0/lib/gush/workflow.rb:194:in `setup'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/gush-1.0.0/lib/gush/workflow.rb:15:in `initialize'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/gush-1.0.0/lib/gush/client.rb:157:in `new'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/gush-1.0.0/lib/gush/client.rb:157:in `workflow_from_hash'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/gush-1.0.0/lib/gush/client.rb:91:in `block in find_workflow'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/connection_pool-2.2.1/lib/connection_pool.rb:64:in `block (2 levels) in with'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/connection_pool-2.2.1/lib/connection_pool.rb:63:in `handle_interrupt'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/connection_pool-2.2.1/lib/connection_pool.rb:63:in `block in with'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/connection_pool-2.2.1/lib/connection_pool.rb:60:in `handle_interrupt'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/connection_pool-2.2.1/lib/connection_pool.rb:60:in `with'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/gush-1.0.0/lib/gush/client.rb:84:in `find_workflow'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/gush-1.0.0/lib/gush/client.rb:78:in `block (2 levels) in all_workflows'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/gush-1.0.0/lib/gush/client.rb:76:in `map'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/gush-1.0.0/lib/gush/client.rb:76:in `block in all_workflows'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/connection_pool-2.2.1/lib/connection_pool.rb:64:in `block (2 levels) in with'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/connection_pool-2.2.1/lib/connection_pool.rb:63:in `handle_interrupt'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/connection_pool-2.2.1/lib/connection_pool.rb:63:in `block in with'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/connection_pool-2.2.1/lib/connection_pool.rb:60:in `handle_interrupt'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/connection_pool-2.2.1/lib/connection_pool.rb:60:in `with'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/gush-1.0.0/lib/gush/client.rb:75:in `all_workflows'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/gush-1.0.0/lib/gush/cli.rb:70:in `list'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/gems/gush-1.0.0/bin/gush:13:in `<top (required)>'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/bin/gush:23:in `load'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/bin/gush:23:in `<main>'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/bin/ruby_executable_hooks:15:in `eval'
	from /Users/ben/.rvm/gems/ruby-2.4.1@railsapp/bin/ruby_executable_hooks:15:in `<main>'

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

No branches or pull requests

2 participants