{"action":"created","comment":{"url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/pulls/comments/142985953","pull_request_review_id":67431417,"id":142985953,"diff_hunk":"@@ -120,8 +120,15 @@ exports.getImageWritableStream = (deviceType, version) ->\n \t\t\t# Ensure the cache directory exists, to prevent\n \t\t\t# ENOENT errors when trying to write to it.\n \t\t\tmkdirp(path.dirname(imagePath)).then ->\n-\t\t\t\treturn fs.createWriteStream(imagePath)\n+\t\t\t\t# Append .inprogress to streams, move them to the right location only on success\n+\t\t\t\tinProgressPath = imagePath + '.inprogress'","path":"lib/cache.coffee","position":6,"original_position":6,"commit_id":"63600fbf1a60121a49cb023767d00bfb71c21c37","original_commit_id":"09c5f79088706e6c3c686007243b7a29eab83682","user":{"login":"pimterry","id":1526883,"avatar_url":"https://avatars0.githubusercontent.com/u/1526883?v=4","gravatar_id":"","url":"https://api.github.com/users/pimterry","html_url":"https://github.com/pimterry","followers_url":"https://api.github.com/users/pimterry/followers","following_url":"https://api.github.com/users/pimterry/following{/other_user}","gists_url":"https://api.github.com/users/pimterry/gists{/gist_id}","starred_url":"https://api.github.com/users/pimterry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pimterry/subscriptions","organizations_url":"https://api.github.com/users/pimterry/orgs","repos_url":"https://api.github.com/users/pimterry/repos","events_url":"https://api.github.com/users/pimterry/events{/privacy}","received_events_url":"https://api.github.com/users/pimterry/received_events","type":"User","site_admin":false},"body":"Great idea! Done, let me know what you think","created_at":"2017-10-05T16:15:11Z","updated_at":"2017-10-05T16:15:11Z","html_url":"https://github.com/resin-io-modules/resin-image-manager/pull/40#discussion_r142985953","pull_request_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/pulls/40","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/resin-io-modules/resin-image-manager/pulls/comments/142985953"},"html":{"href":"https://github.com/resin-io-modules/resin-image-manager/pull/40#discussion_r142985953"},"pull_request":{"href":"https://api.github.com/repos/resin-io-modules/resin-image-manager/pulls/40"}},"in_reply_to_id":142971719},"pull_request":{"url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/pulls/40","id":144695147,"html_url":"https://github.com/resin-io-modules/resin-image-manager/pull/40","diff_url":"https://github.com/resin-io-modules/resin-image-manager/pull/40.diff","patch_url":"https://github.com/resin-io-modules/resin-image-manager/pull/40.patch","issue_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/issues/40","number":40,"state":"open","locked":false,"title":"Don't persist downloads to the cache until they complete","user":{"login":"pimterry","id":1526883,"avatar_url":"https://avatars0.githubusercontent.com/u/1526883?v=4","gravatar_id":"","url":"https://api.github.com/users/pimterry","html_url":"https://github.com/pimterry","followers_url":"https://api.github.com/users/pimterry/followers","following_url":"https://api.github.com/users/pimterry/following{/other_user}","gists_url":"https://api.github.com/users/pimterry/gists{/gist_id}","starred_url":"https://api.github.com/users/pimterry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pimterry/subscriptions","organizations_url":"https://api.github.com/users/pimterry/orgs","repos_url":"https://api.github.com/users/pimterry/repos","events_url":"https://api.github.com/users/pimterry/events{/privacy}","received_events_url":"https://api.github.com/users/pimterry/received_events","type":"User","site_admin":false},"body":"This is aiming to solve https://github.com/resin-io/resin-cli/issues/541.\r\n\r\nIt doesn't completely solve #38, since we still can't easily check the integrity of our downloads, but it does stop us permanently caching downloads that don't really complete at all.","created_at":"2017-10-04T15:03:47Z","updated_at":"2017-10-05T16:15:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bed1a8f97be9c46231060e887f1400d275929d50","assignee":null,"assignees":[],"requested_reviewers":[{"login":"MoranF","id":5029459,"avatar_url":"https://avatars1.githubusercontent.com/u/5029459?v=4","gravatar_id":"","url":"https://api.github.com/users/MoranF","html_url":"https://github.com/MoranF","followers_url":"https://api.github.com/users/MoranF/followers","following_url":"https://api.github.com/users/MoranF/following{/other_user}","gists_url":"https://api.github.com/users/MoranF/gists{/gist_id}","starred_url":"https://api.github.com/users/MoranF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MoranF/subscriptions","organizations_url":"https://api.github.com/users/MoranF/orgs","repos_url":"https://api.github.com/users/MoranF/repos","events_url":"https://api.github.com/users/MoranF/events{/privacy}","received_events_url":"https://api.github.com/users/MoranF/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/pulls/40/commits","review_comments_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/pulls/40/comments","review_comment_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/issues/40/comments","statuses_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/statuses/63600fbf1a60121a49cb023767d00bfb71c21c37","head":{"label":"resin-io-modules:dont-cache-failed","ref":"dont-cache-failed","sha":"63600fbf1a60121a49cb023767d00bfb71c21c37","user":{"login":"resin-io-modules","id":17724750,"avatar_url":"https://avatars0.githubusercontent.com/u/17724750?v=4","gravatar_id":"","url":"https://api.github.com/users/resin-io-modules","html_url":"https://github.com/resin-io-modules","followers_url":"https://api.github.com/users/resin-io-modules/followers","following_url":"https://api.github.com/users/resin-io-modules/following{/other_user}","gists_url":"https://api.github.com/users/resin-io-modules/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io-modules/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io-modules/subscriptions","organizations_url":"https://api.github.com/users/resin-io-modules/orgs","repos_url":"https://api.github.com/users/resin-io-modules/repos","events_url":"https://api.github.com/users/resin-io-modules/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io-modules/received_events","type":"Organization","site_admin":false},"repo":{"id":35631384,"name":"resin-image-manager","full_name":"resin-io-modules/resin-image-manager","owner":{"login":"resin-io-modules","id":17724750,"avatar_url":"https://avatars0.githubusercontent.com/u/17724750?v=4","gravatar_id":"","url":"https://api.github.com/users/resin-io-modules","html_url":"https://github.com/resin-io-modules","followers_url":"https://api.github.com/users/resin-io-modules/followers","following_url":"https://api.github.com/users/resin-io-modules/following{/other_user}","gists_url":"https://api.github.com/users/resin-io-modules/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io-modules/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io-modules/subscriptions","organizations_url":"https://api.github.com/users/resin-io-modules/orgs","repos_url":"https://api.github.com/users/resin-io-modules/repos","events_url":"https://api.github.com/users/resin-io-modules/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io-modules/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resin-io-modules/resin-image-manager","description":"Manage device base operating systems resources with caching support.","fork":false,"url":"https://api.github.com/repos/resin-io-modules/resin-image-manager","forks_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/forks","keys_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/teams","hooks_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/hooks","issue_events_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/issues/events{/number}","events_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/events","assignees_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/assignees{/user}","branches_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/branches{/branch}","tags_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/tags","blobs_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/languages","stargazers_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/stargazers","contributors_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/contributors","subscribers_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/subscribers","subscription_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/subscription","commits_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/contents/{+path}","compare_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/merges","archive_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/downloads","issues_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/issues{/number}","pulls_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/labels{/name}","releases_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/releases{/id}","deployments_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/deployments","created_at":"2015-05-14T19:13:05Z","updated_at":"2017-03-24T08:55:32Z","pushed_at":"2017-10-05T16:13:28Z","git_url":"git://github.com/resin-io-modules/resin-image-manager.git","ssh_url":"git@github.com:resin-io-modules/resin-image-manager.git","clone_url":"https://github.com/resin-io-modules/resin-image-manager.git","svn_url":"https://github.com/resin-io-modules/resin-image-manager","homepage":"","size":109,"stargazers_count":2,"watchers_count":2,"language":"CoffeeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":2,"default_branch":"master"}},"base":{"label":"resin-io-modules:master","ref":"master","sha":"250801be3a8cfea69c53de7ab1de366b513c3dfe","user":{"login":"resin-io-modules","id":17724750,"avatar_url":"https://avatars0.githubusercontent.com/u/17724750?v=4","gravatar_id":"","url":"https://api.github.com/users/resin-io-modules","html_url":"https://github.com/resin-io-modules","followers_url":"https://api.github.com/users/resin-io-modules/followers","following_url":"https://api.github.com/users/resin-io-modules/following{/other_user}","gists_url":"https://api.github.com/users/resin-io-modules/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io-modules/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io-modules/subscriptions","organizations_url":"https://api.github.com/users/resin-io-modules/orgs","repos_url":"https://api.github.com/users/resin-io-modules/repos","events_url":"https://api.github.com/users/resin-io-modules/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io-modules/received_events","type":"Organization","site_admin":false},"repo":{"id":35631384,"name":"resin-image-manager","full_name":"resin-io-modules/resin-image-manager","owner":{"login":"resin-io-modules","id":17724750,"avatar_url":"https://avatars0.githubusercontent.com/u/17724750?v=4","gravatar_id":"","url":"https://api.github.com/users/resin-io-modules","html_url":"https://github.com/resin-io-modules","followers_url":"https://api.github.com/users/resin-io-modules/followers","following_url":"https://api.github.com/users/resin-io-modules/following{/other_user}","gists_url":"https://api.github.com/users/resin-io-modules/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io-modules/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io-modules/subscriptions","organizations_url":"https://api.github.com/users/resin-io-modules/orgs","repos_url":"https://api.github.com/users/resin-io-modules/repos","events_url":"https://api.github.com/users/resin-io-modules/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io-modules/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resin-io-modules/resin-image-manager","description":"Manage device base operating systems resources with caching support.","fork":false,"url":"https://api.github.com/repos/resin-io-modules/resin-image-manager","forks_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/forks","keys_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/teams","hooks_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/hooks","issue_events_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/issues/events{/number}","events_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/events","assignees_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/assignees{/user}","branches_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/branches{/branch}","tags_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/tags","blobs_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/languages","stargazers_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/stargazers","contributors_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/contributors","subscribers_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/subscribers","subscription_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/subscription","commits_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/contents/{+path}","compare_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/merges","archive_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/downloads","issues_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/issues{/number}","pulls_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/labels{/name}","releases_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/releases{/id}","deployments_url":"https://api.github.com/repos/resin-io-modules/resin-image-manager/deployments","created_at":"2015-05-14T19:13:05Z","updated_at":"2017-03-24T08:55:32Z","pushed_at":"2017-10-05T16:13:28Z","git_url":"git://github.com/resin-io-modules/resin-image-manager.git","ssh_url":"git@github.com:resin-io-modules/resin-image-manager.git","clone_url":"https://github.com/resin-io-modules/resin-image-manager.git","svn_url":"https://github.com/resin-io-modules/resin-image-manager","homepage":"","size":109,"stargazers_count":2,"watchers_count":2,"language":"CoffeeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/resin-io-modules/resin-image-manager/pulls/40"},"html":{"href":"https://github.com/resin-io-modules/resin-image-manager/pull/40"},"issue":{"href":"https://api.github.com/repos/resin-io-modules/resin-image-manager/issues/40"},"comments":{"href":"https://api.github.com/repos/resin-io-modules/resin-image-manager/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/resin-io-modules/resin-image-manager/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/resin-io-modules/resin-image-manager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/resin-io-modules/resin-image-manager/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/resin-io-modules/resin-image-manager/statuses/63600fbf1a60121a49cb023767d00bfb71c21c37"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pimterry"}}