{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq-gems-pending/issues/406","repository_url":"https://api.github.com/repos/ManageIQ/manageiq-gems-pending","labels_url":"https://api.github.com/repos/ManageIQ/manageiq-gems-pending/issues/406/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq-gems-pending/issues/406/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq-gems-pending/issues/406/events","html_url":"https://github.com/ManageIQ/manageiq-gems-pending/pull/406","id":378481838,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5MTc4MTY4","number":406,"title":"Use Gem::Package for tar pg restore unpacking via download streaming","user":{"login":"NickLaMuro","id":314014,"node_id":"MDQ6VXNlcjMxNDAxNA==","avatar_url":"https://avatars0.githubusercontent.com/u/314014?v=4","gravatar_id":"","url":"https://api.github.com/users/NickLaMuro","html_url":"https://github.com/NickLaMuro","followers_url":"https://api.github.com/users/NickLaMuro/followers","following_url":"https://api.github.com/users/NickLaMuro/following{/other_user}","gists_url":"https://api.github.com/users/NickLaMuro/gists{/gist_id}","starred_url":"https://api.github.com/users/NickLaMuro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickLaMuro/subscriptions","organizations_url":"https://api.github.com/users/NickLaMuro/orgs","repos_url":"https://api.github.com/users/NickLaMuro/repos","events_url":"https://api.github.com/users/NickLaMuro/events{/privacy}","received_events_url":"https://api.github.com/users/NickLaMuro/received_events","type":"User","site_admin":false},"labels":[{"id":474821132,"node_id":"MDU6TGFiZWw0NzQ4MjExMzI=","url":"https://api.github.com/repos/ManageIQ/manageiq-gems-pending/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":1069067283,"node_id":"MDU6TGFiZWwxMDY5MDY3Mjgz","url":"https://api.github.com/repos/ManageIQ/manageiq-gems-pending/labels/hammer/yes","name":"hammer/yes","color":"000000","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-07T21:43:55Z","updated_at":"2018-11-10T00:31:28Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq-gems-pending/pulls/406","html_url":"https://github.com/ManageIQ/manageiq-gems-pending/pull/406","diff_url":"https://github.com/ManageIQ/manageiq-gems-pending/pull/406.diff","patch_url":"https://github.com/ManageIQ/manageiq-gems-pending/pull/406.patch"},"body":"This requires https://github.com/ManageIQ/manageiq-gems-pending/pull/405 to be merged to function properly with files streams.\n\nThis change has a few benefits:\n\n- It removes the dependency for an external gem, `minitar` (minor, but nice)\n- It supports streaming files (important)\n\nThe first was simply a side affect, though one I admit I am happy with the result about, but unfortunately was a required change to allow me to do this without too much custom code.\n\n`Archive::Tar::Minitar.unpack` does not support IO objects that don't use `rewind`, since it uses `Archive::Tar::Minitar::Input` under the hood:\n\n- https://github.com/halostatue/minitar/blob/41c3ca65/lib/archive/tar/minitar.rb#L249\n- https://github.com/halostatue/minitar/blob/41c3ca65/lib/archive/tar/minitar/input.rb#L6-L7\n\nThe main code that we wanted from the codebase, however, was the `extract_entry` method from `Input`:\n\n- https://github.com/halostatue/minitar/blob/41c3ca65/lib/archive/tar/minitar/input.rb#L117\n\nWhich again, requires an `Input` model, and the check for if the `@io` is \"seekable\" is done on instantiation:\n\n- https://github.com/halostatue/minitar/blob/41c3ca65/lib/archive/tar/minitar/input.rb#L76-L78\n\n`Gem::Package.extract_tar_gz` method, however, only requires instantiating a instance with a \"gem name\", which doesn't even have to be a real gem, and then we have access to the method without worry, and can pass in our own `IO` object as we see fit.\n\nThat said, it isn't ideal, but the alternative would be re-writing one of these two methods:\n\n- https://github.com/halostatue/minitar/blob/41c3ca65/lib/archive/tar/minitar/input.rb#L117-L194\n- https://github.com/rubygems/rubygems/blob/master/lib/rubygems/package.rb#L381-L418\n\nIn which LJ probably wouldn't approve of all of the additions...\n\n* * *\n\nOf note, and a minor \"fun fact\":  The code for `minitar` is based on the same person's code, Mauricio Julio Fernández Pradier, as is found in `rubygems`:\n\n- https://github.com/halostatue/minitar/blob/41c3ca65/README.rdoc#L37\n- https://github.com/halostatue/minitar/blob/41c3ca65/Licence.md#L7\n- https://github.com/rubygems/rubygems/blob/d43e4d01/lib/rubygems/package/tar_reader.rb#L4"},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq-gems-pending/issues/comments/437537140","html_url":"https://github.com/ManageIQ/manageiq-gems-pending/pull/406#issuecomment-437537140","issue_url":"https://api.github.com/repos/ManageIQ/manageiq-gems-pending/issues/406","id":437537140,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzUzNzE0MA==","user":{"login":"miq-bot","id":7806257,"node_id":"MDQ6VXNlcjc4MDYyNTc=","avatar_url":"https://avatars1.githubusercontent.com/u/7806257?v=4","gravatar_id":"","url":"https://api.github.com/users/miq-bot","html_url":"https://github.com/miq-bot","followers_url":"https://api.github.com/users/miq-bot/followers","following_url":"https://api.github.com/users/miq-bot/following{/other_user}","gists_url":"https://api.github.com/users/miq-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/miq-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miq-bot/subscriptions","organizations_url":"https://api.github.com/users/miq-bot/orgs","repos_url":"https://api.github.com/users/miq-bot/repos","events_url":"https://api.github.com/users/miq-bot/events{/privacy}","received_events_url":"https://api.github.com/users/miq-bot/received_events","type":"User","site_admin":false},"created_at":"2018-11-10T00:31:28Z","updated_at":"2018-11-10T00:31:28Z","author_association":"MEMBER","body":"<rubocop />Checked commit https://github.com/NickLaMuro/manageiq-gems-pending/commit/3b153b6341ef227c3a99a9c9bd50da2506e65bd3 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0\n1 file checked, 0 offenses detected\nEverything looks fine. :trophy:\n"}}
{"actor":{"display_login":"miq-bot"}}