{"action":"created","comment":{"url":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/comments/182347629","pull_request_review_id":113121386,"id":182347629,"diff_hunk":"@@ -109,47 +153,32 @@ def push_tar(self, filename, image_names=None, repo_prefix=\"redhat-\"):\n \n         pulp_repos = self.pulp_handler.create_dockpulp_and_repos(image_names, repo_prefix)\n         _, file_extension = os.path.splitext(filename)\n+        upload_filename = None\n \n         try:\n             top_layer, layers = self.pulp_handler.get_tar_metadata(filename)\n-            # getImageIdsExist was introduced in rh-dockpulp 0.6+\n-            existing_imageids = self.pulp_handler.get_image_ids_existing(layers)\n-            self.log.debug(\"existing layers: %s\", existing_imageids)\n-\n-            # Strip existing layers from the tar and repack it\n-            remove_layers = [str(os.path.join(x, 'layer.tar')) for x in existing_imageids]\n-\n-            commands = {'.xz': 'xzcat', '.gz': 'zcat', '.bz2': 'bzcat', '.tar': 'cat'}\n-            unpacker = commands.get(file_extension, None)\n-            self.log.debug(\"using unpacker %s for extension %s\", unpacker, file_extension)\n-            if unpacker is None:\n-                raise Exception(\"Unknown tarball format: %s\" % filename)\n-\n-            with NamedTemporaryFile(prefix='strip_tar_', suffix='.gz') as outfile:\n-                cmd = \"set -o pipefail; {0} {1} | tar --delete {2} | gzip - > {3}\".format(\n-                    unpacker, filename, ' '.join(remove_layers), outfile.name)\n-                self.log.debug(\"running %s\", cmd)\n-                subprocess.check_call(cmd, shell=True)\n-                self.log.debug(\"uploading %s\", outfile.name)\n-                self.pulp_handler.upload(outfile.name)\n+            upload_filename = self._deduplicate_layers(layers, filename, file_extension)\n         except:\n             self.log.debug(\"Error on creating deduplicated layers tar\", exc_info=True)\n             try:\n-                if file_extension != '.tar':\n-                    raise RuntimeError(\"tar is already compressed\")\n-                with NamedTemporaryFile(prefix='full_tar_', suffix='.gz') as outfile:\n-                    cmd = \"set -o pipefail; cat {0} | gzip - > {1}\".format(\n-                        filename, outfile.name)\n-                    self.log.debug(\"Compressing tar using '%s' command\", cmd)\n-                    subprocess.check_call(cmd, shell=True)\n-                    self.log.debug(\"uploading %s\", outfile.name)\n-                    self.pulp_handler.upload(outfile.name)\n+                upload_filename = self._gzip_file(filename, file_extension)\n             except:\n                 self.log.info(\"Falling back to full tar upload\")\n-                self.pulp_handler.upload(filename)\n+\n+        in_rh_everithing = False","path":"atomic_reactor/plugins/post_push_to_pulp.py","position":97,"original_position":97,"commit_id":"8800eb091fe099bd9ca83cb8481b02319d6b8828","original_commit_id":"8800eb091fe099bd9ca83cb8481b02319d6b8828","user":{"login":"twaugh","id":6985468,"avatar_url":"https://avatars1.githubusercontent.com/u/6985468?v=4","gravatar_id":"","url":"https://api.github.com/users/twaugh","html_url":"https://github.com/twaugh","followers_url":"https://api.github.com/users/twaugh/followers","following_url":"https://api.github.com/users/twaugh/following{/other_user}","gists_url":"https://api.github.com/users/twaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/twaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twaugh/subscriptions","organizations_url":"https://api.github.com/users/twaugh/orgs","repos_url":"https://api.github.com/users/twaugh/repos","events_url":"https://api.github.com/users/twaugh/events{/privacy}","received_events_url":"https://api.github.com/users/twaugh/received_events","type":"User","site_admin":false},"body":"Typo, should be \"everything\"","created_at":"2018-04-18T08:31:56Z","updated_at":"2018-04-18T08:41:38Z","html_url":"https://github.com/projectatomic/atomic-reactor/pull/979#discussion_r182347629","pull_request_url":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/979","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/comments/182347629"},"html":{"href":"https://github.com/projectatomic/atomic-reactor/pull/979#discussion_r182347629"},"pull_request":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/979"}}},"pull_request":{"url":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/979","id":182244564,"html_url":"https://github.com/projectatomic/atomic-reactor/pull/979","diff_url":"https://github.com/projectatomic/atomic-reactor/pull/979.diff","patch_url":"https://github.com/projectatomic/atomic-reactor/pull/979.patch","issue_url":"https://api.github.com/repos/projectatomic/atomic-reactor/issues/979","number":979,"state":"open","locked":false,"title":"pulp push should pass pulp repo to upload call","user":{"login":"rcerven","id":23337371,"avatar_url":"https://avatars0.githubusercontent.com/u/23337371?v=4","gravatar_id":"","url":"https://api.github.com/users/rcerven","html_url":"https://github.com/rcerven","followers_url":"https://api.github.com/users/rcerven/followers","following_url":"https://api.github.com/users/rcerven/following{/other_user}","gists_url":"https://api.github.com/users/rcerven/gists{/gist_id}","starred_url":"https://api.github.com/users/rcerven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcerven/subscriptions","organizations_url":"https://api.github.com/users/rcerven/orgs","repos_url":"https://api.github.com/users/rcerven/repos","events_url":"https://api.github.com/users/rcerven/events{/privacy}","received_events_url":"https://api.github.com/users/rcerven/received_events","type":"User","site_admin":false},"body":"Signed-off-by: Robert Cerven <rcerven@redhat.com>","created_at":"2018-04-17T17:47:27Z","updated_at":"2018-04-18T08:41:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38c488194a10a1ed10514c4d3479982136d78725","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/979/commits","review_comments_url":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/979/comments","review_comment_url":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projectatomic/atomic-reactor/issues/979/comments","statuses_url":"https://api.github.com/repos/projectatomic/atomic-reactor/statuses/8800eb091fe099bd9ca83cb8481b02319d6b8828","head":{"label":"rcerven:pulp_push_upload","ref":"pulp_push_upload","sha":"8800eb091fe099bd9ca83cb8481b02319d6b8828","user":{"login":"rcerven","id":23337371,"avatar_url":"https://avatars0.githubusercontent.com/u/23337371?v=4","gravatar_id":"","url":"https://api.github.com/users/rcerven","html_url":"https://github.com/rcerven","followers_url":"https://api.github.com/users/rcerven/followers","following_url":"https://api.github.com/users/rcerven/following{/other_user}","gists_url":"https://api.github.com/users/rcerven/gists{/gist_id}","starred_url":"https://api.github.com/users/rcerven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcerven/subscriptions","organizations_url":"https://api.github.com/users/rcerven/orgs","repos_url":"https://api.github.com/users/rcerven/repos","events_url":"https://api.github.com/users/rcerven/events{/privacy}","received_events_url":"https://api.github.com/users/rcerven/received_events","type":"User","site_admin":false},"repo":{"id":74351578,"name":"atomic-reactor","full_name":"rcerven/atomic-reactor","owner":{"login":"rcerven","id":23337371,"avatar_url":"https://avatars0.githubusercontent.com/u/23337371?v=4","gravatar_id":"","url":"https://api.github.com/users/rcerven","html_url":"https://github.com/rcerven","followers_url":"https://api.github.com/users/rcerven/followers","following_url":"https://api.github.com/users/rcerven/following{/other_user}","gists_url":"https://api.github.com/users/rcerven/gists{/gist_id}","starred_url":"https://api.github.com/users/rcerven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcerven/subscriptions","organizations_url":"https://api.github.com/users/rcerven/orgs","repos_url":"https://api.github.com/users/rcerven/repos","events_url":"https://api.github.com/users/rcerven/events{/privacy}","received_events_url":"https://api.github.com/users/rcerven/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rcerven/atomic-reactor","description":"Simple python library for building docker images.","fork":true,"url":"https://api.github.com/repos/rcerven/atomic-reactor","forks_url":"https://api.github.com/repos/rcerven/atomic-reactor/forks","keys_url":"https://api.github.com/repos/rcerven/atomic-reactor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rcerven/atomic-reactor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rcerven/atomic-reactor/teams","hooks_url":"https://api.github.com/repos/rcerven/atomic-reactor/hooks","issue_events_url":"https://api.github.com/repos/rcerven/atomic-reactor/issues/events{/number}","events_url":"https://api.github.com/repos/rcerven/atomic-reactor/events","assignees_url":"https://api.github.com/repos/rcerven/atomic-reactor/assignees{/user}","branches_url":"https://api.github.com/repos/rcerven/atomic-reactor/branches{/branch}","tags_url":"https://api.github.com/repos/rcerven/atomic-reactor/tags","blobs_url":"https://api.github.com/repos/rcerven/atomic-reactor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rcerven/atomic-reactor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rcerven/atomic-reactor/git/refs{/sha}","trees_url":"https://api.github.com/repos/rcerven/atomic-reactor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rcerven/atomic-reactor/statuses/{sha}","languages_url":"https://api.github.com/repos/rcerven/atomic-reactor/languages","stargazers_url":"https://api.github.com/repos/rcerven/atomic-reactor/stargazers","contributors_url":"https://api.github.com/repos/rcerven/atomic-reactor/contributors","subscribers_url":"https://api.github.com/repos/rcerven/atomic-reactor/subscribers","subscription_url":"https://api.github.com/repos/rcerven/atomic-reactor/subscription","commits_url":"https://api.github.com/repos/rcerven/atomic-reactor/commits{/sha}","git_commits_url":"https://api.github.com/repos/rcerven/atomic-reactor/git/commits{/sha}","comments_url":"https://api.github.com/repos/rcerven/atomic-reactor/comments{/number}","issue_comment_url":"https://api.github.com/repos/rcerven/atomic-reactor/issues/comments{/number}","contents_url":"https://api.github.com/repos/rcerven/atomic-reactor/contents/{+path}","compare_url":"https://api.github.com/repos/rcerven/atomic-reactor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rcerven/atomic-reactor/merges","archive_url":"https://api.github.com/repos/rcerven/atomic-reactor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rcerven/atomic-reactor/downloads","issues_url":"https://api.github.com/repos/rcerven/atomic-reactor/issues{/number}","pulls_url":"https://api.github.com/repos/rcerven/atomic-reactor/pulls{/number}","milestones_url":"https://api.github.com/repos/rcerven/atomic-reactor/milestones{/number}","notifications_url":"https://api.github.com/repos/rcerven/atomic-reactor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rcerven/atomic-reactor/labels{/name}","releases_url":"https://api.github.com/repos/rcerven/atomic-reactor/releases{/id}","deployments_url":"https://api.github.com/repos/rcerven/atomic-reactor/deployments","created_at":"2016-11-21T10:15:27Z","updated_at":"2016-11-21T10:15:28Z","pushed_at":"2018-04-17T20:38:52Z","git_url":"git://github.com/rcerven/atomic-reactor.git","ssh_url":"git@github.com:rcerven/atomic-reactor.git","clone_url":"https://github.com/rcerven/atomic-reactor.git","svn_url":"https://github.com/rcerven/atomic-reactor","homepage":"","size":3247,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"projectatomic:master","ref":"master","sha":"d0d8f3312e0309750bd611257c50f37003b0200c","user":{"login":"projectatomic","id":6852258,"avatar_url":"https://avatars1.githubusercontent.com/u/6852258?v=4","gravatar_id":"","url":"https://api.github.com/users/projectatomic","html_url":"https://github.com/projectatomic","followers_url":"https://api.github.com/users/projectatomic/followers","following_url":"https://api.github.com/users/projectatomic/following{/other_user}","gists_url":"https://api.github.com/users/projectatomic/gists{/gist_id}","starred_url":"https://api.github.com/users/projectatomic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectatomic/subscriptions","organizations_url":"https://api.github.com/users/projectatomic/orgs","repos_url":"https://api.github.com/users/projectatomic/repos","events_url":"https://api.github.com/users/projectatomic/events{/privacy}","received_events_url":"https://api.github.com/users/projectatomic/received_events","type":"Organization","site_admin":false},"repo":{"id":25527782,"name":"atomic-reactor","full_name":"projectatomic/atomic-reactor","owner":{"login":"projectatomic","id":6852258,"avatar_url":"https://avatars1.githubusercontent.com/u/6852258?v=4","gravatar_id":"","url":"https://api.github.com/users/projectatomic","html_url":"https://github.com/projectatomic","followers_url":"https://api.github.com/users/projectatomic/followers","following_url":"https://api.github.com/users/projectatomic/following{/other_user}","gists_url":"https://api.github.com/users/projectatomic/gists{/gist_id}","starred_url":"https://api.github.com/users/projectatomic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectatomic/subscriptions","organizations_url":"https://api.github.com/users/projectatomic/orgs","repos_url":"https://api.github.com/users/projectatomic/repos","events_url":"https://api.github.com/users/projectatomic/events{/privacy}","received_events_url":"https://api.github.com/users/projectatomic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectatomic/atomic-reactor","description":"Simple python library for building docker images.","fork":false,"url":"https://api.github.com/repos/projectatomic/atomic-reactor","forks_url":"https://api.github.com/repos/projectatomic/atomic-reactor/forks","keys_url":"https://api.github.com/repos/projectatomic/atomic-reactor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectatomic/atomic-reactor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectatomic/atomic-reactor/teams","hooks_url":"https://api.github.com/repos/projectatomic/atomic-reactor/hooks","issue_events_url":"https://api.github.com/repos/projectatomic/atomic-reactor/issues/events{/number}","events_url":"https://api.github.com/repos/projectatomic/atomic-reactor/events","assignees_url":"https://api.github.com/repos/projectatomic/atomic-reactor/assignees{/user}","branches_url":"https://api.github.com/repos/projectatomic/atomic-reactor/branches{/branch}","tags_url":"https://api.github.com/repos/projectatomic/atomic-reactor/tags","blobs_url":"https://api.github.com/repos/projectatomic/atomic-reactor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectatomic/atomic-reactor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectatomic/atomic-reactor/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectatomic/atomic-reactor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectatomic/atomic-reactor/statuses/{sha}","languages_url":"https://api.github.com/repos/projectatomic/atomic-reactor/languages","stargazers_url":"https://api.github.com/repos/projectatomic/atomic-reactor/stargazers","contributors_url":"https://api.github.com/repos/projectatomic/atomic-reactor/contributors","subscribers_url":"https://api.github.com/repos/projectatomic/atomic-reactor/subscribers","subscription_url":"https://api.github.com/repos/projectatomic/atomic-reactor/subscription","commits_url":"https://api.github.com/repos/projectatomic/atomic-reactor/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectatomic/atomic-reactor/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectatomic/atomic-reactor/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectatomic/atomic-reactor/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectatomic/atomic-reactor/contents/{+path}","compare_url":"https://api.github.com/repos/projectatomic/atomic-reactor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectatomic/atomic-reactor/merges","archive_url":"https://api.github.com/repos/projectatomic/atomic-reactor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectatomic/atomic-reactor/downloads","issues_url":"https://api.github.com/repos/projectatomic/atomic-reactor/issues{/number}","pulls_url":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls{/number}","milestones_url":"https://api.github.com/repos/projectatomic/atomic-reactor/milestones{/number}","notifications_url":"https://api.github.com/repos/projectatomic/atomic-reactor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectatomic/atomic-reactor/labels{/name}","releases_url":"https://api.github.com/repos/projectatomic/atomic-reactor/releases{/id}","deployments_url":"https://api.github.com/repos/projectatomic/atomic-reactor/deployments","created_at":"2014-10-21T14:45:11Z","updated_at":"2018-04-17T16:49:59Z","pushed_at":"2018-04-17T20:38:54Z","git_url":"git://github.com/projectatomic/atomic-reactor.git","ssh_url":"git@github.com:projectatomic/atomic-reactor.git","clone_url":"https://github.com/projectatomic/atomic-reactor.git","svn_url":"https://github.com/projectatomic/atomic-reactor","homepage":"","size":3359,"stargazers_count":102,"watchers_count":102,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":42,"mirror_url":null,"archived":false,"open_issues_count":59,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":42,"open_issues":59,"watchers":102,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/979"},"html":{"href":"https://github.com/projectatomic/atomic-reactor/pull/979"},"issue":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/issues/979"},"comments":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/issues/979/comments"},"review_comments":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/979/comments"},"review_comment":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/pulls/979/commits"},"statuses":{"href":"https://api.github.com/repos/projectatomic/atomic-reactor/statuses/8800eb091fe099bd9ca83cb8481b02319d6b8828"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"twaugh"}}