{"action":"created","issue":{"url":"https://api.github.com/repos/dry-rb/dry-component/issues/2","repository_url":"https://api.github.com/repos/dry-rb/dry-component","labels_url":"https://api.github.com/repos/dry-rb/dry-component/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/dry-rb/dry-component/issues/2/comments","events_url":"https://api.github.com/repos/dry-rb/dry-component/issues/2/events","html_url":"https://github.com/dry-rb/dry-component/pull/2","id":124532729,"number":2,"title":"Import containers when accessing dependencies via `import_module`","user":{"login":"timriley","id":3134,"avatar_url":"https://avatars.githubusercontent.com/u/3134?v=3","gravatar_id":"","url":"https://api.github.com/users/timriley","html_url":"https://github.com/timriley","followers_url":"https://api.github.com/users/timriley/followers","following_url":"https://api.github.com/users/timriley/following{/other_user}","gists_url":"https://api.github.com/users/timriley/gists{/gist_id}","starred_url":"https://api.github.com/users/timriley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timriley/subscriptions","organizations_url":"https://api.github.com/users/timriley/orgs","repos_url":"https://api.github.com/users/timriley/repos","events_url":"https://api.github.com/users/timriley/events{/privacy}","received_events_url":"https://api.github.com/users/timriley/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-01-01T06:01:46Z","updated_at":"2016-07-19T07:47:26Z","closed_at":"2016-07-19T07:47:26Z","pull_request":{"url":"https://api.github.com/repos/dry-rb/dry-component/pulls/2","html_url":"https://github.com/dry-rb/dry-component/pull/2","diff_url":"https://github.com/dry-rb/dry-component/pull/2.diff","patch_url":"https://github.com/dry-rb/dry-component/pull/2.patch"},"body":"I found this bug when working on icelab/alpinist#2 – while the app would work properly when run via the web server, my unit specs were failing because the \"core\" dependencies (i.e. the ones imported into the `Main::Container` from `Alpinist::Container`) were not being loaded properly. This was because in the unit  specs were (rightly) not finalizing `Main::Container`, in order to test things in isolation and to avoid spuriously loading the whole application environment.\r\n\r\nTo address this, I've made it so that any imported containers are imported when auto-imported dependencies are accessed from a container's `.import_module`.\r\n\r\n_(I'm not 100% sure if this is the approach you'd like to take, @solnic, so I was going to push this up into a branch directly on the dryrb repo so you could potentially make adjustments, but dry-container isn't included in the list of repos I can write to, so I've put it up on a personal fork instead. Let me know if you'd like me to push this anywhere else)._\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dry-rb/dry-component/issues/comments/233556386","html_url":"https://github.com/dry-rb/dry-component/pull/2#issuecomment-233556386","issue_url":"https://api.github.com/repos/dry-rb/dry-component/issues/2","id":233556386,"user":{"login":"timriley","id":3134,"avatar_url":"https://avatars.githubusercontent.com/u/3134?v=3","gravatar_id":"","url":"https://api.github.com/users/timriley","html_url":"https://github.com/timriley","followers_url":"https://api.github.com/users/timriley/followers","following_url":"https://api.github.com/users/timriley/following{/other_user}","gists_url":"https://api.github.com/users/timriley/gists{/gist_id}","starred_url":"https://api.github.com/users/timriley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timriley/subscriptions","organizations_url":"https://api.github.com/users/timriley/orgs","repos_url":"https://api.github.com/users/timriley/repos","events_url":"https://api.github.com/users/timriley/events{/privacy}","received_events_url":"https://api.github.com/users/timriley/received_events","type":"User","site_admin":false},"created_at":"2016-07-19T07:47:26Z","updated_at":"2016-07-19T07:47:26Z","body":"Closing this since #3 is implementing the alternative approach I suggested in the final comment (I hope to loop back to #3 and get it merged at some point soon)."}}
{"actor":{"display_login":"timriley"}}