{"action":"created","issue":{"url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/600","repository_url":"https://api.github.com/repos/testcontainers/testcontainers-java","labels_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/600/labels{/name}","comments_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/600/comments","events_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/600/events","html_url":"https://github.com/testcontainers/testcontainers-java/pull/600","id":303320699,"number":600,"title":"Support for WaitStrategy on DockerComposeContainer - alternative approach","user":{"login":"barrycommins","id":19176452,"avatar_url":"https://avatars2.githubusercontent.com/u/19176452?v=4","gravatar_id":"","url":"https://api.github.com/users/barrycommins","html_url":"https://github.com/barrycommins","followers_url":"https://api.github.com/users/barrycommins/followers","following_url":"https://api.github.com/users/barrycommins/following{/other_user}","gists_url":"https://api.github.com/users/barrycommins/gists{/gist_id}","starred_url":"https://api.github.com/users/barrycommins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barrycommins/subscriptions","organizations_url":"https://api.github.com/users/barrycommins/orgs","repos_url":"https://api.github.com/users/barrycommins/repos","events_url":"https://api.github.com/users/barrycommins/events{/privacy}","received_events_url":"https://api.github.com/users/barrycommins/received_events","type":"User","site_admin":false},"labels":[{"id":393754416,"url":"https://api.github.com/repos/testcontainers/testcontainers-java/labels/docker-compose","name":"docker-compose","color":"fef2c0","default":false},{"id":198678881,"url":"https://api.github.com/repos/testcontainers/testcontainers-java/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":819284860,"url":"https://api.github.com/repos/testcontainers/testcontainers-java/labels/feature","name":"feature","color":"a0e585","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/testcontainers/testcontainers-java/milestones/31","html_url":"https://github.com/testcontainers/testcontainers-java/milestone/31","labels_url":"https://api.github.com/repos/testcontainers/testcontainers-java/milestones/31/labels","id":3071410,"number":31,"title":"next","description":"","creator":{"login":"bsideup","id":1050762,"avatar_url":"https://avatars3.githubusercontent.com/u/1050762?v=4","gravatar_id":"","url":"https://api.github.com/users/bsideup","html_url":"https://github.com/bsideup","followers_url":"https://api.github.com/users/bsideup/followers","following_url":"https://api.github.com/users/bsideup/following{/other_user}","gists_url":"https://api.github.com/users/bsideup/gists{/gist_id}","starred_url":"https://api.github.com/users/bsideup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsideup/subscriptions","organizations_url":"https://api.github.com/users/bsideup/orgs","repos_url":"https://api.github.com/users/bsideup/repos","events_url":"https://api.github.com/users/bsideup/events{/privacy}","received_events_url":"https://api.github.com/users/bsideup/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":10,"state":"open","created_at":"2018-01-29T13:15:22Z","updated_at":"2018-03-08T06:59:38Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2018-03-08T01:18:24Z","updated_at":"2018-03-08T09:29:08Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/testcontainers/testcontainers-java/pulls/600","html_url":"https://github.com/testcontainers/testcontainers-java/pull/600","diff_url":"https://github.com/testcontainers/testcontainers-java/pull/600.diff","patch_url":"https://github.com/testcontainers/testcontainers-java/pull/600.patch"},"body":"@bsideup, just wanted to continue the conversation from #598 \r\n\r\nI didn't want to update that pull request for now, as this is a much bigger change.\r\n\r\nI've implemented an alternative approach, involving breaking out all of the methods that apply after startup from the ` Container`  interface into a new interface `ContainerState`.\r\n\r\nI've also moved the functionality implemented in the various `WaitStrategy` classes into classes with the same names, but in a sub-package `org.testcontainer.wait.strategy` and updated the current implementations to delegate to the new ones. I have also deprecated the use of the current classes in favour of the new ones.\r\n\r\nFor each instance of a service started by docker-compose, I'm instantiating a class called `DockerComposeServiceInstance`, which implements `ContainerState`, and applying the new `WaitStrategy` implementation to them.\r\n\r\nFor example:\r\n```java\r\nnew DockerComposeContainer(new File(\"docker-compose.yml\")\r\n.withExposedService(\"redis_1\", REDIS_PORT, Wait.forListeningPort())\r\n.withExposedService(\"elasticsearch_1\", ELASTICSEARCH_PORT, Wait.forListeningPort());\r\n```\r\nwould create two instance, and apply a `WaitStartegy` to each.\r\n\r\nThis is a considerably larger change than the other pull request, and might not gel with the future plans for interface changes, so I thought I'd request feedback at this point. There's still work required on it, but all tests are passing.\r\n\r\nIf this is too large a change, or doesn't feel like the right approach, please let me know. If that's the case, maybe we should revisit after the planned changes for splitting configuration and state are done."},"comment":{"url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/comments/371431149","html_url":"https://github.com/testcontainers/testcontainers-java/pull/600#issuecomment-371431149","issue_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/600","id":371431149,"user":{"login":"bsideup","id":1050762,"avatar_url":"https://avatars3.githubusercontent.com/u/1050762?v=4","gravatar_id":"","url":"https://api.github.com/users/bsideup","html_url":"https://github.com/bsideup","followers_url":"https://api.github.com/users/bsideup/followers","following_url":"https://api.github.com/users/bsideup/following{/other_user}","gists_url":"https://api.github.com/users/bsideup/gists{/gist_id}","starred_url":"https://api.github.com/users/bsideup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsideup/subscriptions","organizations_url":"https://api.github.com/users/bsideup/orgs","repos_url":"https://api.github.com/users/bsideup/repos","events_url":"https://api.github.com/users/bsideup/events{/privacy}","received_events_url":"https://api.github.com/users/bsideup/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T09:29:08Z","updated_at":"2018-03-08T09:29:08Z","author_association":"MEMBER","body":"@barrycommins Docker client is always available as `DockerClientFactory.instance().client()`, so it's not a problem\r\n\r\nRe `HttpWaitStrategy` - actually, DockerComposeContainer should handle it instead of a strategy itself because socat-based exposing is a detail of an implementation of it and strategies should be agnostic to it. \r\n\r\nMaybe need a \"proxying\" object, something like `WaitStrategyTarget`, with `Info` **plus** everything related to the host, like `getMappedPort`."}}
{"actor":{"display_login":"bsideup"}}