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

Chained notifies don't work when the notifies are defined in different recipes #319

Open
pocke opened this issue Jun 30, 2020 · 0 comments

Comments

@pocke
Copy link
Contributor

pocke commented Jun 30, 2020

Chained notifies don't work when they are defined in different recipes.
For example:

# a.rb
execute '1' do
  command 'true'
  notifies :run, 'execute[2]'
end
# b.rb
execute '2' do
  action :nothing
  command 'true'
  notifies :run, 'execute[3]'
end

execute '3' do
  action :nothing
  command 'true'
end

With these recipes, I expect itamae executes 1, 2, and 3.
But I got an unexpected result, which depends on file order.

# It is the expected result.
# 1, 2, and 3 are executed.

$ RUBYLIB=./lib bin/itamae local a.rb b.rb 
 INFO : Starting Itamae... 
 INFO : Recipe: /home/pocke/ghq/github.com/itamae-kitchen/itamae/a.rb
 INFO :   execute[1] executed will change from 'false' to 'true'
 INFO :   Notifying run to execute resource '2' (delayed)
 INFO :   execute[2] executed will change from 'false' to 'true'
 INFO :   Notifying run to execute resource '3' (delayed)
 INFO : Recipe: /home/pocke/ghq/github.com/itamae-kitchen/itamae/b.rb
 INFO :   execute[3] executed will change from 'false' to 'true'
# It is unexpected behavior.
# 1 and 2 are executed, and 3 is enqueued,
# but 3 is not executed.

$ RUBYLIB=./lib bin/itamae local b.rb a.rb 
 INFO : Starting Itamae... 
 INFO : Recipe: /home/pocke/ghq/github.com/itamae-kitchen/itamae/b.rb
 INFO : Recipe: /home/pocke/ghq/github.com/itamae-kitchen/itamae/a.rb
 INFO :   execute[1] executed will change from 'false' to 'true'
 INFO :   Notifying run to execute resource '2' (delayed)
 INFO :   execute[2] executed will change from 'false' to 'true'
 INFO :   Notifying run to execute resource '3' (delayed)
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

1 participant