{"action":"created","comment":{"url":"https://api.github.com/repos/wercker/wercker/pulls/comments/178841866","pull_request_review_id":108877609,"id":178841866,"diff_hunk":"@@ -52,8 +55,45 @@ const (\n \t// so the value can be anything so long as it's not empty.\n \tDefaultDockerRegistryUsername = \"token\"\n \tDefaultDockerCommand          = `/bin/sh -c \"if [ -e /bin/bash ]; then /bin/bash; else /bin/sh; fi\"`\n+\tNoPushConfirmationInStatus    = \"Docker push failed to complete.Please check logs for any error condition\"\n )\n \n+//TODO: The current fsouza/go-dockerclient does not contain structs for status messages emitted\n+// from docker in case of push - therefore had to explicitly create these structs for better\n+// usablity of code (instead of unmarshalling json to a map). Official docker client should contain\n+// these structs(or equivalents) already and this code should be refactored to use those instead\n+// having to maintain our own.\n+\n+//PushStatusAux : The \"aux\" component of status message\n+type PushStatusAux struct {\n+\tTag    string `json:\"Tag,omitempty\"`","path":"docker/docker.go","position":35,"original_position":35,"commit_id":"6f2564d0a3d6174d11d955e55e14d7e8ea1bc875","original_commit_id":"6f2564d0a3d6174d11d955e55e14d7e8ea1bc875","user":{"login":"hatchan","id":202981,"avatar_url":"https://avatars1.githubusercontent.com/u/202981?v=4","gravatar_id":"","url":"https://api.github.com/users/hatchan","html_url":"https://github.com/hatchan","followers_url":"https://api.github.com/users/hatchan/followers","following_url":"https://api.github.com/users/hatchan/following{/other_user}","gists_url":"https://api.github.com/users/hatchan/gists{/gist_id}","starred_url":"https://api.github.com/users/hatchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hatchan/subscriptions","organizations_url":"https://api.github.com/users/hatchan/orgs","repos_url":"https://api.github.com/users/hatchan/repos","events_url":"https://api.github.com/users/hatchan/events{/privacy}","received_events_url":"https://api.github.com/users/hatchan/received_events","type":"User","site_admin":false},"body":"Are you sure the keys are with capital letters? None of the other structs in this file have that.","created_at":"2018-04-03T14:24:27Z","updated_at":"2018-04-03T14:26:35Z","html_url":"https://github.com/wercker/wercker/pull/371#discussion_r178841866","pull_request_url":"https://api.github.com/repos/wercker/wercker/pulls/371","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/wercker/wercker/pulls/comments/178841866"},"html":{"href":"https://github.com/wercker/wercker/pull/371#discussion_r178841866"},"pull_request":{"href":"https://api.github.com/repos/wercker/wercker/pulls/371"}}},"pull_request":{"url":"https://api.github.com/repos/wercker/wercker/pulls/371","id":178819855,"html_url":"https://github.com/wercker/wercker/pull/371","diff_url":"https://github.com/wercker/wercker/pull/371.diff","patch_url":"https://github.com/wercker/wercker/pull/371.patch","issue_url":"https://api.github.com/repos/wercker/wercker/issues/371","number":371,"state":"open","locked":false,"title":"Fix #1741 Correct status reporting from docker push by parsing status messages from docker","user":{"login":"lake-of-dreams","id":18029655,"avatar_url":"https://avatars2.githubusercontent.com/u/18029655?v=4","gravatar_id":"","url":"https://api.github.com/users/lake-of-dreams","html_url":"https://github.com/lake-of-dreams","followers_url":"https://api.github.com/users/lake-of-dreams/followers","following_url":"https://api.github.com/users/lake-of-dreams/following{/other_user}","gists_url":"https://api.github.com/users/lake-of-dreams/gists{/gist_id}","starred_url":"https://api.github.com/users/lake-of-dreams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lake-of-dreams/subscriptions","organizations_url":"https://api.github.com/users/lake-of-dreams/orgs","repos_url":"https://api.github.com/users/lake-of-dreams/repos","events_url":"https://api.github.com/users/lake-of-dreams/events{/privacy}","received_events_url":"https://api.github.com/users/lake-of-dreams/received_events","type":"User","site_admin":false},"body":"**What this PR does / why we need it:**\r\nFixes [1741](https://github.com/wercker/backlog/issues/1741) \r\nBoth internal/docker-scratch-push and internal-push steps invoke tagAndPush method which further invokes DockerClient.PushImage().In a situation where docker push call will fail due to any reason - one of which being incorrect username/password for the repository, the error is not correctly captured as the REST api call for push to docker daemon immediately returns without any error. The error message is in-fact present in progress status messages from the daemon but we were not looking at those status messages to check whether a push was indeed successful. In case of a successful push, the tag, size and SHA digest of image being pushed is present in status progress messages. In this PR - logic has been changed to not just rely on the error returned by docker client, but look for the actual successful status message in streamed statuses.\r\n\r\n**Summary of changes**\r\n\r\n1. in docker/docker.go - parse status messages from docker daemon for a push call. Relevant structs were created to correctly marshal the message ( The current client we use does not have structs to marshal these messages directly - We should probably refactor this code once we upgrade to official docker client in [1698](https://github.com/wercker/backlog/issues/1698) - a comment has been added to reflect this.\r\n2. Added unit tests to docker/docker_push_test.go\r\n3. Added -v to govendor test in wercker.yml to be able to see what tests are being run during the build\r\n4. Moved call to cleanupImage a bit up\r\n\r\n","created_at":"2018-04-02T11:08:18Z","updated_at":"2018-04-03T14:26:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fde872acd444f2c25d0f125bfadba378cbd4090d","assignee":null,"assignees":[],"requested_reviewers":[{"login":"nigeldeakin","id":6053562,"avatar_url":"https://avatars2.githubusercontent.com/u/6053562?v=4","gravatar_id":"","url":"https://api.github.com/users/nigeldeakin","html_url":"https://github.com/nigeldeakin","followers_url":"https://api.github.com/users/nigeldeakin/followers","following_url":"https://api.github.com/users/nigeldeakin/following{/other_user}","gists_url":"https://api.github.com/users/nigeldeakin/gists{/gist_id}","starred_url":"https://api.github.com/users/nigeldeakin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nigeldeakin/subscriptions","organizations_url":"https://api.github.com/users/nigeldeakin/orgs","repos_url":"https://api.github.com/users/nigeldeakin/repos","events_url":"https://api.github.com/users/nigeldeakin/events{/privacy}","received_events_url":"https://api.github.com/users/nigeldeakin/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/wercker/wercker/pulls/371/commits","review_comments_url":"https://api.github.com/repos/wercker/wercker/pulls/371/comments","review_comment_url":"https://api.github.com/repos/wercker/wercker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wercker/wercker/issues/371/comments","statuses_url":"https://api.github.com/repos/wercker/wercker/statuses/6f2564d0a3d6174d11d955e55e14d7e8ea1bc875","head":{"label":"wercker:issue-1741","ref":"issue-1741","sha":"6f2564d0a3d6174d11d955e55e14d7e8ea1bc875","user":{"login":"wercker","id":1695193,"avatar_url":"https://avatars3.githubusercontent.com/u/1695193?v=4","gravatar_id":"","url":"https://api.github.com/users/wercker","html_url":"https://github.com/wercker","followers_url":"https://api.github.com/users/wercker/followers","following_url":"https://api.github.com/users/wercker/following{/other_user}","gists_url":"https://api.github.com/users/wercker/gists{/gist_id}","starred_url":"https://api.github.com/users/wercker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wercker/subscriptions","organizations_url":"https://api.github.com/users/wercker/orgs","repos_url":"https://api.github.com/users/wercker/repos","events_url":"https://api.github.com/users/wercker/events{/privacy}","received_events_url":"https://api.github.com/users/wercker/received_events","type":"Organization","site_admin":false},"repo":{"id":50553550,"name":"wercker","full_name":"wercker/wercker","owner":{"login":"wercker","id":1695193,"avatar_url":"https://avatars3.githubusercontent.com/u/1695193?v=4","gravatar_id":"","url":"https://api.github.com/users/wercker","html_url":"https://github.com/wercker","followers_url":"https://api.github.com/users/wercker/followers","following_url":"https://api.github.com/users/wercker/following{/other_user}","gists_url":"https://api.github.com/users/wercker/gists{/gist_id}","starred_url":"https://api.github.com/users/wercker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wercker/subscriptions","organizations_url":"https://api.github.com/users/wercker/orgs","repos_url":"https://api.github.com/users/wercker/repos","events_url":"https://api.github.com/users/wercker/events{/privacy}","received_events_url":"https://api.github.com/users/wercker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wercker/wercker","description":"The Wercker CLI can be used to execute pipelines locally for both local development and easy introspection.","fork":false,"url":"https://api.github.com/repos/wercker/wercker","forks_url":"https://api.github.com/repos/wercker/wercker/forks","keys_url":"https://api.github.com/repos/wercker/wercker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wercker/wercker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wercker/wercker/teams","hooks_url":"https://api.github.com/repos/wercker/wercker/hooks","issue_events_url":"https://api.github.com/repos/wercker/wercker/issues/events{/number}","events_url":"https://api.github.com/repos/wercker/wercker/events","assignees_url":"https://api.github.com/repos/wercker/wercker/assignees{/user}","branches_url":"https://api.github.com/repos/wercker/wercker/branches{/branch}","tags_url":"https://api.github.com/repos/wercker/wercker/tags","blobs_url":"https://api.github.com/repos/wercker/wercker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wercker/wercker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wercker/wercker/git/refs{/sha}","trees_url":"https://api.github.com/repos/wercker/wercker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wercker/wercker/statuses/{sha}","languages_url":"https://api.github.com/repos/wercker/wercker/languages","stargazers_url":"https://api.github.com/repos/wercker/wercker/stargazers","contributors_url":"https://api.github.com/repos/wercker/wercker/contributors","subscribers_url":"https://api.github.com/repos/wercker/wercker/subscribers","subscription_url":"https://api.github.com/repos/wercker/wercker/subscription","commits_url":"https://api.github.com/repos/wercker/wercker/commits{/sha}","git_commits_url":"https://api.github.com/repos/wercker/wercker/git/commits{/sha}","comments_url":"https://api.github.com/repos/wercker/wercker/comments{/number}","issue_comment_url":"https://api.github.com/repos/wercker/wercker/issues/comments{/number}","contents_url":"https://api.github.com/repos/wercker/wercker/contents/{+path}","compare_url":"https://api.github.com/repos/wercker/wercker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wercker/wercker/merges","archive_url":"https://api.github.com/repos/wercker/wercker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wercker/wercker/downloads","issues_url":"https://api.github.com/repos/wercker/wercker/issues{/number}","pulls_url":"https://api.github.com/repos/wercker/wercker/pulls{/number}","milestones_url":"https://api.github.com/repos/wercker/wercker/milestones{/number}","notifications_url":"https://api.github.com/repos/wercker/wercker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wercker/wercker/labels{/name}","releases_url":"https://api.github.com/repos/wercker/wercker/releases{/id}","deployments_url":"https://api.github.com/repos/wercker/wercker/deployments","created_at":"2016-01-28T03:55:20Z","updated_at":"2018-04-01T06:32:25Z","pushed_at":"2018-04-02T14:41:21Z","git_url":"git://github.com/wercker/wercker.git","ssh_url":"git@github.com:wercker/wercker.git","clone_url":"https://github.com/wercker/wercker.git","svn_url":"https://github.com/wercker/wercker","homepage":"http://wercker.com","size":1423,"stargazers_count":531,"watchers_count":531,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"archived":false,"open_issues_count":94,"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":62,"open_issues":94,"watchers":531,"default_branch":"master"}},"base":{"label":"wercker:master","ref":"master","sha":"35ce08ac8260f9ea9494898333ad249fb02dd78b","user":{"login":"wercker","id":1695193,"avatar_url":"https://avatars3.githubusercontent.com/u/1695193?v=4","gravatar_id":"","url":"https://api.github.com/users/wercker","html_url":"https://github.com/wercker","followers_url":"https://api.github.com/users/wercker/followers","following_url":"https://api.github.com/users/wercker/following{/other_user}","gists_url":"https://api.github.com/users/wercker/gists{/gist_id}","starred_url":"https://api.github.com/users/wercker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wercker/subscriptions","organizations_url":"https://api.github.com/users/wercker/orgs","repos_url":"https://api.github.com/users/wercker/repos","events_url":"https://api.github.com/users/wercker/events{/privacy}","received_events_url":"https://api.github.com/users/wercker/received_events","type":"Organization","site_admin":false},"repo":{"id":50553550,"name":"wercker","full_name":"wercker/wercker","owner":{"login":"wercker","id":1695193,"avatar_url":"https://avatars3.githubusercontent.com/u/1695193?v=4","gravatar_id":"","url":"https://api.github.com/users/wercker","html_url":"https://github.com/wercker","followers_url":"https://api.github.com/users/wercker/followers","following_url":"https://api.github.com/users/wercker/following{/other_user}","gists_url":"https://api.github.com/users/wercker/gists{/gist_id}","starred_url":"https://api.github.com/users/wercker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wercker/subscriptions","organizations_url":"https://api.github.com/users/wercker/orgs","repos_url":"https://api.github.com/users/wercker/repos","events_url":"https://api.github.com/users/wercker/events{/privacy}","received_events_url":"https://api.github.com/users/wercker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wercker/wercker","description":"The Wercker CLI can be used to execute pipelines locally for both local development and easy introspection.","fork":false,"url":"https://api.github.com/repos/wercker/wercker","forks_url":"https://api.github.com/repos/wercker/wercker/forks","keys_url":"https://api.github.com/repos/wercker/wercker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wercker/wercker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wercker/wercker/teams","hooks_url":"https://api.github.com/repos/wercker/wercker/hooks","issue_events_url":"https://api.github.com/repos/wercker/wercker/issues/events{/number}","events_url":"https://api.github.com/repos/wercker/wercker/events","assignees_url":"https://api.github.com/repos/wercker/wercker/assignees{/user}","branches_url":"https://api.github.com/repos/wercker/wercker/branches{/branch}","tags_url":"https://api.github.com/repos/wercker/wercker/tags","blobs_url":"https://api.github.com/repos/wercker/wercker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wercker/wercker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wercker/wercker/git/refs{/sha}","trees_url":"https://api.github.com/repos/wercker/wercker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wercker/wercker/statuses/{sha}","languages_url":"https://api.github.com/repos/wercker/wercker/languages","stargazers_url":"https://api.github.com/repos/wercker/wercker/stargazers","contributors_url":"https://api.github.com/repos/wercker/wercker/contributors","subscribers_url":"https://api.github.com/repos/wercker/wercker/subscribers","subscription_url":"https://api.github.com/repos/wercker/wercker/subscription","commits_url":"https://api.github.com/repos/wercker/wercker/commits{/sha}","git_commits_url":"https://api.github.com/repos/wercker/wercker/git/commits{/sha}","comments_url":"https://api.github.com/repos/wercker/wercker/comments{/number}","issue_comment_url":"https://api.github.com/repos/wercker/wercker/issues/comments{/number}","contents_url":"https://api.github.com/repos/wercker/wercker/contents/{+path}","compare_url":"https://api.github.com/repos/wercker/wercker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wercker/wercker/merges","archive_url":"https://api.github.com/repos/wercker/wercker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wercker/wercker/downloads","issues_url":"https://api.github.com/repos/wercker/wercker/issues{/number}","pulls_url":"https://api.github.com/repos/wercker/wercker/pulls{/number}","milestones_url":"https://api.github.com/repos/wercker/wercker/milestones{/number}","notifications_url":"https://api.github.com/repos/wercker/wercker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wercker/wercker/labels{/name}","releases_url":"https://api.github.com/repos/wercker/wercker/releases{/id}","deployments_url":"https://api.github.com/repos/wercker/wercker/deployments","created_at":"2016-01-28T03:55:20Z","updated_at":"2018-04-01T06:32:25Z","pushed_at":"2018-04-02T14:41:21Z","git_url":"git://github.com/wercker/wercker.git","ssh_url":"git@github.com:wercker/wercker.git","clone_url":"https://github.com/wercker/wercker.git","svn_url":"https://github.com/wercker/wercker","homepage":"http://wercker.com","size":1423,"stargazers_count":531,"watchers_count":531,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"archived":false,"open_issues_count":94,"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":62,"open_issues":94,"watchers":531,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wercker/wercker/pulls/371"},"html":{"href":"https://github.com/wercker/wercker/pull/371"},"issue":{"href":"https://api.github.com/repos/wercker/wercker/issues/371"},"comments":{"href":"https://api.github.com/repos/wercker/wercker/issues/371/comments"},"review_comments":{"href":"https://api.github.com/repos/wercker/wercker/pulls/371/comments"},"review_comment":{"href":"https://api.github.com/repos/wercker/wercker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wercker/wercker/pulls/371/commits"},"statuses":{"href":"https://api.github.com/repos/wercker/wercker/statuses/6f2564d0a3d6174d11d955e55e14d7e8ea1bc875"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"hatchan"}}