{"action":"created","issue":{"url":"https://api.github.com/repos/PagerDuty/chef-monit/issues/1","repository_url":"https://api.github.com/repos/PagerDuty/chef-monit","labels_url":"https://api.github.com/repos/PagerDuty/chef-monit/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/PagerDuty/chef-monit/issues/1/comments","events_url":"https://api.github.com/repos/PagerDuty/chef-monit/issues/1/events","html_url":"https://github.com/PagerDuty/chef-monit/pull/1","id":238656130,"number":1,"title":"Use 'use_inline_resources' to ensure notifications propagate correctly","user":{"login":"wlonkly","id":1545955,"avatar_url":"https://avatars0.githubusercontent.com/u/1545955?v=3","gravatar_id":"","url":"https://api.github.com/users/wlonkly","html_url":"https://github.com/wlonkly","followers_url":"https://api.github.com/users/wlonkly/followers","following_url":"https://api.github.com/users/wlonkly/following{/other_user}","gists_url":"https://api.github.com/users/wlonkly/gists{/gist_id}","starred_url":"https://api.github.com/users/wlonkly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wlonkly/subscriptions","organizations_url":"https://api.github.com/users/wlonkly/orgs","repos_url":"https://api.github.com/users/wlonkly/repos","events_url":"https://api.github.com/users/wlonkly/events{/privacy}","received_events_url":"https://api.github.com/users/wlonkly/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-26T20:13:57Z","updated_at":"2017-06-26T21:11:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/PagerDuty/chef-monit/pulls/1","html_url":"https://github.com/PagerDuty/chef-monit/pull/1","diff_url":"https://github.com/PagerDuty/chef-monit/pull/1.diff","patch_url":"https://github.com/PagerDuty/chef-monit/pull/1.patch"},"body":"[PR #69](https://github.com/phlipper/chef-monit/pull/69) (upstream) updated the monit provider to use run_action on the provided resources to make external notifications propagate (i.e., so that a 'notifies' in a monit_monitrc's block would run). But run_action, by virtue of running the action in the compile phase instead of the exeuction phase, has the side effect of not firing the 'notifies' inside the monit_monitrc resource, and thus monit never reloads when a monit_monitrc resource is updated.\r\n\r\nThis change uses `use_inline_resources` to evaluate the monit template in its own context, so that that context will fire notifications declared on the monit_monitrc resource, while still firing the notification on the template itself inside the resource.\r\n\r\n(`use_inline_resources` automatically sets the updated flag on the LWRP resource if any resource used in the action method is updated.)\r\n\r\n... For a bit more clarity, for a resource instance like\r\n```\r\nmonit_monitrc 'foo' do\r\n  notifies :reload, 'service[bar]'\r\ndone\r\n```\r\n- Prior to upstream PR #69, the updated flag was not set on the lw resource, so notifications in the resource instance's block would not fire: `monit` would reload but `bar` would not\r\n- in upstream PR #69, setting `updated_by_last_action` and calling `run_action` meant that the updated flag was set, but since the template was run at compile time, the notify inside the lw resource's template block would never fire: `bar` would reload but `monit` would not\r\n- with this PR, the update flag is set _and_ the resource runs at execution time, so both `monit` and `bar` reload.\r\n\r\nSee notes on updated_by_last_action here:\r\n  https://docs.chef.io/custom_resources_notes.html\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/PagerDuty/chef-monit/issues/comments/311183170","html_url":"https://github.com/PagerDuty/chef-monit/pull/1#issuecomment-311183170","issue_url":"https://api.github.com/repos/PagerDuty/chef-monit/issues/1","id":311183170,"user":{"login":"wlonkly","id":1545955,"avatar_url":"https://avatars0.githubusercontent.com/u/1545955?v=3","gravatar_id":"","url":"https://api.github.com/users/wlonkly","html_url":"https://github.com/wlonkly","followers_url":"https://api.github.com/users/wlonkly/followers","following_url":"https://api.github.com/users/wlonkly/following{/other_user}","gists_url":"https://api.github.com/users/wlonkly/gists{/gist_id}","starred_url":"https://api.github.com/users/wlonkly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wlonkly/subscriptions","organizations_url":"https://api.github.com/users/wlonkly/orgs","repos_url":"https://api.github.com/users/wlonkly/repos","events_url":"https://api.github.com/users/wlonkly/events{/privacy}","received_events_url":"https://api.github.com/users/wlonkly/received_events","type":"User","site_admin":false},"created_at":"2017-06-26T21:11:32Z","updated_at":"2017-06-26T21:11:32Z","body":"@margueritepd I believe that is correct!"}}
{"actor":{"display_login":"wlonkly"}}