{"action":"created","comment":{"url":"https://api.github.com/repos/issuu/sure-deploy/pulls/comments/169991090","pull_request_review_id":98603816,"id":169991090,"diff_hunk":"@@ -0,0 +1,75 @@\n+open Core\n+\n+module Service = Swarm_types.Service\n+module Image = Swarm_types.Image\n+\n+type service_spec = {\n+  name: Service.t;\n+  image: Image.t;\n+}\n+\n+let environment () =\n+  Unix.environment ()\n+  |> Array.map ~f:(String.lsplit2_exn ~on:'=')\n+  |> Array.to_list\n+  |> String.Map.of_alist_exn\n+\n+let load_file : string -> Yaml.value Or_error.t =\n+  fun filename ->\n+  match In_channel.read_all filename with\n+  | exception Sys_error e -> Or_error.errorf \"%s\" e\n+  | v ->\n+      v\n+      |> Yaml.of_string\n+      |> function\n+        | Ok v -> Or_error.return v\n+        | Error (`Msg s) -> Or_error.errorf \"%s\" s\n+\n+let parse_service : (string * Yaml.value) -> service_spec Or_error.t =\n+  fun (name, definition) ->\n+    match definition with\n+      | `O defs -> (\n+        match List.Assoc.find defs ~equal:String.equal \"image\" with\n+        | None -> Or_error.errorf \"Definition of service '%s' has no 'image' field\" name\n+        | Some (`String image) ->\n+          let name = Service.of_string name in\n+          let image = Image.of_string image in","path":"src/lib/composefile.ml","position":26,"original_position":36,"commit_id":"5b9dc104f7045792c4c1f2ebd2705ef5674addd9","original_commit_id":"12aedc07a01259dc019b1866a93ee0e4009b59d7","user":{"login":"Leonidas-from-XIV","id":121531,"avatar_url":"https://avatars0.githubusercontent.com/u/121531?v=4","gravatar_id":"","url":"https://api.github.com/users/Leonidas-from-XIV","html_url":"https://github.com/Leonidas-from-XIV","followers_url":"https://api.github.com/users/Leonidas-from-XIV/followers","following_url":"https://api.github.com/users/Leonidas-from-XIV/following{/other_user}","gists_url":"https://api.github.com/users/Leonidas-from-XIV/gists{/gist_id}","starred_url":"https://api.github.com/users/Leonidas-from-XIV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Leonidas-from-XIV/subscriptions","organizations_url":"https://api.github.com/users/Leonidas-from-XIV/orgs","repos_url":"https://api.github.com/users/Leonidas-from-XIV/repos","events_url":"https://api.github.com/users/Leonidas-from-XIV/events{/privacy}","received_events_url":"https://api.github.com/users/Leonidas-from-XIV/received_events","type":"User","site_admin":false},"body":"I don't consider shadowing local identifiers crucial as it prevents me from mis-using the previous value of `image`, if this were shadowing some module it would be a different thing.","created_at":"2018-02-22T15:20:39Z","updated_at":"2018-02-22T15:20:40Z","html_url":"https://github.com/issuu/sure-deploy/pull/1#discussion_r169991090","pull_request_url":"https://api.github.com/repos/issuu/sure-deploy/pulls/1","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/issuu/sure-deploy/pulls/comments/169991090"},"html":{"href":"https://github.com/issuu/sure-deploy/pull/1#discussion_r169991090"},"pull_request":{"href":"https://api.github.com/repos/issuu/sure-deploy/pulls/1"}},"in_reply_to_id":169961299},"pull_request":{"url":"https://api.github.com/repos/issuu/sure-deploy/pulls/1","id":170503253,"html_url":"https://github.com/issuu/sure-deploy/pull/1","diff_url":"https://github.com/issuu/sure-deploy/pull/1.diff","patch_url":"https://github.com/issuu/sure-deploy/pull/1.patch","issue_url":"https://api.github.com/repos/issuu/sure-deploy/issues/1","number":1,"state":"open","locked":false,"title":"Add support for verifying against a docker-compose.yml","user":{"login":"Leonidas-from-XIV","id":121531,"avatar_url":"https://avatars0.githubusercontent.com/u/121531?v=4","gravatar_id":"","url":"https://api.github.com/users/Leonidas-from-XIV","html_url":"https://github.com/Leonidas-from-XIV","followers_url":"https://api.github.com/users/Leonidas-from-XIV/followers","following_url":"https://api.github.com/users/Leonidas-from-XIV/following{/other_user}","gists_url":"https://api.github.com/users/Leonidas-from-XIV/gists{/gist_id}","starred_url":"https://api.github.com/users/Leonidas-from-XIV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Leonidas-from-XIV/subscriptions","organizations_url":"https://api.github.com/users/Leonidas-from-XIV/orgs","repos_url":"https://api.github.com/users/Leonidas-from-XIV/repos","events_url":"https://api.github.com/users/Leonidas-from-XIV/events{/privacy}","received_events_url":"https://api.github.com/users/Leonidas-from-XIV/received_events","type":"User","site_admin":false},"body":"This allows for way more acurate varifications which check that the services deployed are exactly what was specified, different images per service.\n\nThere are still bits missing, like documenting the feature, deprecating the previous verification implementation, testing it against our production environment and code cleanup, but now I have hooked up all necessary parts to get this part to work.\n\nI would really like to fix the crappy error handling in the parser and uhm, maybe remove the parser altogether since it is not doing anything complicated a simple `List.map` couldn't do.","created_at":"2018-02-21T15:30:20Z","updated_at":"2018-02-22T15:20:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"deb9d0de9382a6a849ea483ba2722ecd10c885e2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/issuu/sure-deploy/pulls/1/commits","review_comments_url":"https://api.github.com/repos/issuu/sure-deploy/pulls/1/comments","review_comment_url":"https://api.github.com/repos/issuu/sure-deploy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/issuu/sure-deploy/issues/1/comments","statuses_url":"https://api.github.com/repos/issuu/sure-deploy/statuses/5b9dc104f7045792c4c1f2ebd2705ef5674addd9","head":{"label":"issuu:mku/parse-composefile","ref":"mku/parse-composefile","sha":"5b9dc104f7045792c4c1f2ebd2705ef5674addd9","user":{"login":"issuu","id":27296,"avatar_url":"https://avatars0.githubusercontent.com/u/27296?v=4","gravatar_id":"","url":"https://api.github.com/users/issuu","html_url":"https://github.com/issuu","followers_url":"https://api.github.com/users/issuu/followers","following_url":"https://api.github.com/users/issuu/following{/other_user}","gists_url":"https://api.github.com/users/issuu/gists{/gist_id}","starred_url":"https://api.github.com/users/issuu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/issuu/subscriptions","organizations_url":"https://api.github.com/users/issuu/orgs","repos_url":"https://api.github.com/users/issuu/repos","events_url":"https://api.github.com/users/issuu/events{/privacy}","received_events_url":"https://api.github.com/users/issuu/received_events","type":"Organization","site_admin":false},"repo":{"id":116236307,"name":"sure-deploy","full_name":"issuu/sure-deploy","owner":{"login":"issuu","id":27296,"avatar_url":"https://avatars0.githubusercontent.com/u/27296?v=4","gravatar_id":"","url":"https://api.github.com/users/issuu","html_url":"https://github.com/issuu","followers_url":"https://api.github.com/users/issuu/followers","following_url":"https://api.github.com/users/issuu/following{/other_user}","gists_url":"https://api.github.com/users/issuu/gists{/gist_id}","starred_url":"https://api.github.com/users/issuu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/issuu/subscriptions","organizations_url":"https://api.github.com/users/issuu/orgs","repos_url":"https://api.github.com/users/issuu/repos","events_url":"https://api.github.com/users/issuu/events{/privacy}","received_events_url":"https://api.github.com/users/issuu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/issuu/sure-deploy","description":"What `docker stack deploy` should actually have been","fork":false,"url":"https://api.github.com/repos/issuu/sure-deploy","forks_url":"https://api.github.com/repos/issuu/sure-deploy/forks","keys_url":"https://api.github.com/repos/issuu/sure-deploy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/issuu/sure-deploy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/issuu/sure-deploy/teams","hooks_url":"https://api.github.com/repos/issuu/sure-deploy/hooks","issue_events_url":"https://api.github.com/repos/issuu/sure-deploy/issues/events{/number}","events_url":"https://api.github.com/repos/issuu/sure-deploy/events","assignees_url":"https://api.github.com/repos/issuu/sure-deploy/assignees{/user}","branches_url":"https://api.github.com/repos/issuu/sure-deploy/branches{/branch}","tags_url":"https://api.github.com/repos/issuu/sure-deploy/tags","blobs_url":"https://api.github.com/repos/issuu/sure-deploy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/issuu/sure-deploy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/issuu/sure-deploy/git/refs{/sha}","trees_url":"https://api.github.com/repos/issuu/sure-deploy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/issuu/sure-deploy/statuses/{sha}","languages_url":"https://api.github.com/repos/issuu/sure-deploy/languages","stargazers_url":"https://api.github.com/repos/issuu/sure-deploy/stargazers","contributors_url":"https://api.github.com/repos/issuu/sure-deploy/contributors","subscribers_url":"https://api.github.com/repos/issuu/sure-deploy/subscribers","subscription_url":"https://api.github.com/repos/issuu/sure-deploy/subscription","commits_url":"https://api.github.com/repos/issuu/sure-deploy/commits{/sha}","git_commits_url":"https://api.github.com/repos/issuu/sure-deploy/git/commits{/sha}","comments_url":"https://api.github.com/repos/issuu/sure-deploy/comments{/number}","issue_comment_url":"https://api.github.com/repos/issuu/sure-deploy/issues/comments{/number}","contents_url":"https://api.github.com/repos/issuu/sure-deploy/contents/{+path}","compare_url":"https://api.github.com/repos/issuu/sure-deploy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/issuu/sure-deploy/merges","archive_url":"https://api.github.com/repos/issuu/sure-deploy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/issuu/sure-deploy/downloads","issues_url":"https://api.github.com/repos/issuu/sure-deploy/issues{/number}","pulls_url":"https://api.github.com/repos/issuu/sure-deploy/pulls{/number}","milestones_url":"https://api.github.com/repos/issuu/sure-deploy/milestones{/number}","notifications_url":"https://api.github.com/repos/issuu/sure-deploy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/issuu/sure-deploy/labels{/name}","releases_url":"https://api.github.com/repos/issuu/sure-deploy/releases{/id}","deployments_url":"https://api.github.com/repos/issuu/sure-deploy/deployments","created_at":"2018-01-04T08:43:14Z","updated_at":"2018-02-22T13:07:46Z","pushed_at":"2018-02-22T15:17:59Z","git_url":"git://github.com/issuu/sure-deploy.git","ssh_url":"git@github.com:issuu/sure-deploy.git","clone_url":"https://github.com/issuu/sure-deploy.git","svn_url":"https://github.com/issuu/sure-deploy","homepage":"https://issuu.com","size":54,"stargazers_count":6,"watchers_count":6,"language":"OCaml","has_issues":true,"has_projects":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":1,"watchers":6,"default_branch":"master"}},"base":{"label":"issuu:master","ref":"master","sha":"cee7f68873b5ec607e067da6c2c06c7ce48c9455","user":{"login":"issuu","id":27296,"avatar_url":"https://avatars0.githubusercontent.com/u/27296?v=4","gravatar_id":"","url":"https://api.github.com/users/issuu","html_url":"https://github.com/issuu","followers_url":"https://api.github.com/users/issuu/followers","following_url":"https://api.github.com/users/issuu/following{/other_user}","gists_url":"https://api.github.com/users/issuu/gists{/gist_id}","starred_url":"https://api.github.com/users/issuu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/issuu/subscriptions","organizations_url":"https://api.github.com/users/issuu/orgs","repos_url":"https://api.github.com/users/issuu/repos","events_url":"https://api.github.com/users/issuu/events{/privacy}","received_events_url":"https://api.github.com/users/issuu/received_events","type":"Organization","site_admin":false},"repo":{"id":116236307,"name":"sure-deploy","full_name":"issuu/sure-deploy","owner":{"login":"issuu","id":27296,"avatar_url":"https://avatars0.githubusercontent.com/u/27296?v=4","gravatar_id":"","url":"https://api.github.com/users/issuu","html_url":"https://github.com/issuu","followers_url":"https://api.github.com/users/issuu/followers","following_url":"https://api.github.com/users/issuu/following{/other_user}","gists_url":"https://api.github.com/users/issuu/gists{/gist_id}","starred_url":"https://api.github.com/users/issuu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/issuu/subscriptions","organizations_url":"https://api.github.com/users/issuu/orgs","repos_url":"https://api.github.com/users/issuu/repos","events_url":"https://api.github.com/users/issuu/events{/privacy}","received_events_url":"https://api.github.com/users/issuu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/issuu/sure-deploy","description":"What `docker stack deploy` should actually have been","fork":false,"url":"https://api.github.com/repos/issuu/sure-deploy","forks_url":"https://api.github.com/repos/issuu/sure-deploy/forks","keys_url":"https://api.github.com/repos/issuu/sure-deploy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/issuu/sure-deploy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/issuu/sure-deploy/teams","hooks_url":"https://api.github.com/repos/issuu/sure-deploy/hooks","issue_events_url":"https://api.github.com/repos/issuu/sure-deploy/issues/events{/number}","events_url":"https://api.github.com/repos/issuu/sure-deploy/events","assignees_url":"https://api.github.com/repos/issuu/sure-deploy/assignees{/user}","branches_url":"https://api.github.com/repos/issuu/sure-deploy/branches{/branch}","tags_url":"https://api.github.com/repos/issuu/sure-deploy/tags","blobs_url":"https://api.github.com/repos/issuu/sure-deploy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/issuu/sure-deploy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/issuu/sure-deploy/git/refs{/sha}","trees_url":"https://api.github.com/repos/issuu/sure-deploy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/issuu/sure-deploy/statuses/{sha}","languages_url":"https://api.github.com/repos/issuu/sure-deploy/languages","stargazers_url":"https://api.github.com/repos/issuu/sure-deploy/stargazers","contributors_url":"https://api.github.com/repos/issuu/sure-deploy/contributors","subscribers_url":"https://api.github.com/repos/issuu/sure-deploy/subscribers","subscription_url":"https://api.github.com/repos/issuu/sure-deploy/subscription","commits_url":"https://api.github.com/repos/issuu/sure-deploy/commits{/sha}","git_commits_url":"https://api.github.com/repos/issuu/sure-deploy/git/commits{/sha}","comments_url":"https://api.github.com/repos/issuu/sure-deploy/comments{/number}","issue_comment_url":"https://api.github.com/repos/issuu/sure-deploy/issues/comments{/number}","contents_url":"https://api.github.com/repos/issuu/sure-deploy/contents/{+path}","compare_url":"https://api.github.com/repos/issuu/sure-deploy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/issuu/sure-deploy/merges","archive_url":"https://api.github.com/repos/issuu/sure-deploy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/issuu/sure-deploy/downloads","issues_url":"https://api.github.com/repos/issuu/sure-deploy/issues{/number}","pulls_url":"https://api.github.com/repos/issuu/sure-deploy/pulls{/number}","milestones_url":"https://api.github.com/repos/issuu/sure-deploy/milestones{/number}","notifications_url":"https://api.github.com/repos/issuu/sure-deploy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/issuu/sure-deploy/labels{/name}","releases_url":"https://api.github.com/repos/issuu/sure-deploy/releases{/id}","deployments_url":"https://api.github.com/repos/issuu/sure-deploy/deployments","created_at":"2018-01-04T08:43:14Z","updated_at":"2018-02-22T13:07:46Z","pushed_at":"2018-02-22T15:17:59Z","git_url":"git://github.com/issuu/sure-deploy.git","ssh_url":"git@github.com:issuu/sure-deploy.git","clone_url":"https://github.com/issuu/sure-deploy.git","svn_url":"https://github.com/issuu/sure-deploy","homepage":"https://issuu.com","size":54,"stargazers_count":6,"watchers_count":6,"language":"OCaml","has_issues":true,"has_projects":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":1,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/issuu/sure-deploy/pulls/1"},"html":{"href":"https://github.com/issuu/sure-deploy/pull/1"},"issue":{"href":"https://api.github.com/repos/issuu/sure-deploy/issues/1"},"comments":{"href":"https://api.github.com/repos/issuu/sure-deploy/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/issuu/sure-deploy/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/issuu/sure-deploy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/issuu/sure-deploy/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/issuu/sure-deploy/statuses/5b9dc104f7045792c4c1f2ebd2705ef5674addd9"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"Leonidas-from-XIV"}}