{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/90719250","pull_request_review_id":11239914,"id":90719250,"diff_hunk":"@@ -0,0 +1,48 @@\n+/* global miqSparkleOn miqSparkleOff showErrorMessage clearMessages */\n+\n+var GitImport = {\n+  retrieveDatastoreClickHandler: function() {\n+    $('.git-retrieve-datastore').click(function(event) {\n+      event.preventDefault();\n+      miqSparkleOn();\n+      clearMessages();\n+\n+      $.post('retrieve_git_datastore', $('#retrieve-git-datastore-form').serialize(), function(data) {\n+        var parsedData = JSON.parse(data);\n+        var messages = parsedData.message;\n+        if (messages && messages.level === \"error\") {\n+          showErrorMessage(messages.message);\n+          miqSparkleOff();\n+        } else {\n+          GitImport.pollForGitTaskCompletion(parsedData);\n+        }\n+      });\n+    });\n+  },\n+\n+  pollForGitTaskCompletion: function(gitData) {\n+    $.get('check_git_task', gitData, function(data) {\n+      var parsedData = JSON.parse(data);\n+      if (parsedData.state) {\n+        setTimeout(GitImport.pollForGitTaskCompletion, 1500, gitData);","path":"app/assets/javascripts/git_import.js","position":27,"original_position":27,"commit_id":"d5ee1dd924c7360859b14bb4223b1eba1f8c701f","original_commit_id":"d5ee1dd924c7360859b14bb4223b1eba1f8c701f","user":{"login":"syncrou","id":697347,"avatar_url":"https://avatars.githubusercontent.com/u/697347?v=3","gravatar_id":"","url":"https://api.github.com/users/syncrou","html_url":"https://github.com/syncrou","followers_url":"https://api.github.com/users/syncrou/followers","following_url":"https://api.github.com/users/syncrou/following{/other_user}","gists_url":"https://api.github.com/users/syncrou/gists{/gist_id}","starred_url":"https://api.github.com/users/syncrou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syncrou/subscriptions","organizations_url":"https://api.github.com/users/syncrou/orgs","repos_url":"https://api.github.com/users/syncrou/repos","events_url":"https://api.github.com/users/syncrou/events{/privacy}","received_events_url":"https://api.github.com/users/syncrou/received_events","type":"User","site_admin":false},"body":"@eclarizio - It might be nice to set a constant for this time out value. With that value's importance to this fix - the `1500` is hard to find buried in this function.","created_at":"2016-12-02T21:04:13Z","updated_at":"2016-12-02T21:04:13Z","html_url":"https://github.com/ManageIQ/manageiq/pull/12964#discussion_r90719250","pull_request_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12964","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/90719250"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/12964#discussion_r90719250"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12964"}}},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12964","id":96305068,"html_url":"https://github.com/ManageIQ/manageiq/pull/12964","diff_url":"https://github.com/ManageIQ/manageiq/pull/12964.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/12964.patch","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/12964","number":12964,"state":"open","locked":false,"title":"Fix for UI hangs if errors are encountered during Git Import","user":{"login":"eclarizio","id":164557,"avatar_url":"https://avatars.githubusercontent.com/u/164557?v=3","gravatar_id":"","url":"https://api.github.com/users/eclarizio","html_url":"https://github.com/eclarizio","followers_url":"https://api.github.com/users/eclarizio/followers","following_url":"https://api.github.com/users/eclarizio/following{/other_user}","gists_url":"https://api.github.com/users/eclarizio/gists{/gist_id}","starred_url":"https://api.github.com/users/eclarizio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclarizio/subscriptions","organizations_url":"https://api.github.com/users/eclarizio/orgs","repos_url":"https://api.github.com/users/eclarizio/repos","events_url":"https://api.github.com/users/eclarizio/events{/privacy}","received_events_url":"https://api.github.com/users/eclarizio/received_events","type":"User","site_admin":false},"body":"The main issue is that if github (or whatever site they're trying to use for an import) is down, it takes a really long time to timeout. @mkanoor and I figured out that in production, the apache timeout is 2 minutes, as is the timeout for the backend to decide that it should give up on trying to refresh the repo. This, coupled with the queue latency causes a 302 redirect to come back from the rails server, but apache instead serves up a 502 proxy error.\r\n\r\nThis fix aims to address this issue by instead not waiting for the task to finish on the server side, but on the client side. When we queue the task, we immediately pass the task id back to the client, which uses that to poll the server for completeness. I've currently set the poll to 1.5 seconds, if you think it should be longer or shorter, please let me know.\r\n\r\nLinks\r\n----------------\r\nhttps://bugzilla.redhat.com/show_bug.cgi?id=1393982\r\n\r\nSteps for Testing/QA\r\n-------------------------------\r\nTo mimic this in development, you can either add something to /etc/hosts like `8.8.8.8 github.com` and continue using github.com. Or, when importing, just use a local IP that doesn't resolve to anything in the url field, e.g. `https://192.168.1.42/test_org/test_repo`.\r\n\r\n@miq-bot add_label blocker, bug\r\n\r\n@miq-bot assign @gmcculloug \r\n\r\n@mkanoor Can you test and make sure everything appears to be working the same as it was before? I ran through a bunch of scenarios and it seemed to be behaving nicely, but I'd like a sanity check.\r\n@syncrou Can you review as there's a lot of javascript changes I made here that I'd like your eye on.\r\n","created_at":"2016-12-02T16:01:05Z","updated_at":"2016-12-02T21:04:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d77129bd287c75b1caba9c1a00963fcd8eb75922","assignee":{"login":"mkanoor","id":6452699,"avatar_url":"https://avatars.githubusercontent.com/u/6452699?v=3","gravatar_id":"","url":"https://api.github.com/users/mkanoor","html_url":"https://github.com/mkanoor","followers_url":"https://api.github.com/users/mkanoor/followers","following_url":"https://api.github.com/users/mkanoor/following{/other_user}","gists_url":"https://api.github.com/users/mkanoor/gists{/gist_id}","starred_url":"https://api.github.com/users/mkanoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkanoor/subscriptions","organizations_url":"https://api.github.com/users/mkanoor/orgs","repos_url":"https://api.github.com/users/mkanoor/repos","events_url":"https://api.github.com/users/mkanoor/events{/privacy}","received_events_url":"https://api.github.com/users/mkanoor/received_events","type":"User","site_admin":false},"assignees":[{"login":"mkanoor","id":6452699,"avatar_url":"https://avatars.githubusercontent.com/u/6452699?v=3","gravatar_id":"","url":"https://api.github.com/users/mkanoor","html_url":"https://github.com/mkanoor","followers_url":"https://api.github.com/users/mkanoor/followers","following_url":"https://api.github.com/users/mkanoor/following{/other_user}","gists_url":"https://api.github.com/users/mkanoor/gists{/gist_id}","starred_url":"https://api.github.com/users/mkanoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkanoor/subscriptions","organizations_url":"https://api.github.com/users/mkanoor/orgs","repos_url":"https://api.github.com/users/mkanoor/repos","events_url":"https://api.github.com/users/mkanoor/events{/privacy}","received_events_url":"https://api.github.com/users/mkanoor/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12964/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12964/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/12964/comments","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/d5ee1dd924c7360859b14bb4223b1eba1f8c701f","head":{"label":"eclarizio:BZ1393982_async","ref":"BZ1393982_async","sha":"d5ee1dd924c7360859b14bb4223b1eba1f8c701f","user":{"login":"eclarizio","id":164557,"avatar_url":"https://avatars.githubusercontent.com/u/164557?v=3","gravatar_id":"","url":"https://api.github.com/users/eclarizio","html_url":"https://github.com/eclarizio","followers_url":"https://api.github.com/users/eclarizio/followers","following_url":"https://api.github.com/users/eclarizio/following{/other_user}","gists_url":"https://api.github.com/users/eclarizio/gists{/gist_id}","starred_url":"https://api.github.com/users/eclarizio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclarizio/subscriptions","organizations_url":"https://api.github.com/users/eclarizio/orgs","repos_url":"https://api.github.com/users/eclarizio/repos","events_url":"https://api.github.com/users/eclarizio/events{/privacy}","received_events_url":"https://api.github.com/users/eclarizio/received_events","type":"User","site_admin":false},"repo":{"id":20897772,"name":"manageiq","full_name":"eclarizio/manageiq","owner":{"login":"eclarizio","id":164557,"avatar_url":"https://avatars.githubusercontent.com/u/164557?v=3","gravatar_id":"","url":"https://api.github.com/users/eclarizio","html_url":"https://github.com/eclarizio","followers_url":"https://api.github.com/users/eclarizio/followers","following_url":"https://api.github.com/users/eclarizio/following{/other_user}","gists_url":"https://api.github.com/users/eclarizio/gists{/gist_id}","starred_url":"https://api.github.com/users/eclarizio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclarizio/subscriptions","organizations_url":"https://api.github.com/users/eclarizio/orgs","repos_url":"https://api.github.com/users/eclarizio/repos","events_url":"https://api.github.com/users/eclarizio/events{/privacy}","received_events_url":"https://api.github.com/users/eclarizio/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eclarizio/manageiq","description":"ManageIQ Cloud Management Platform","fork":true,"url":"https://api.github.com/repos/eclarizio/manageiq","forks_url":"https://api.github.com/repos/eclarizio/manageiq/forks","keys_url":"https://api.github.com/repos/eclarizio/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eclarizio/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eclarizio/manageiq/teams","hooks_url":"https://api.github.com/repos/eclarizio/manageiq/hooks","issue_events_url":"https://api.github.com/repos/eclarizio/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/eclarizio/manageiq/events","assignees_url":"https://api.github.com/repos/eclarizio/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/eclarizio/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/eclarizio/manageiq/tags","blobs_url":"https://api.github.com/repos/eclarizio/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eclarizio/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eclarizio/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/eclarizio/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eclarizio/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/eclarizio/manageiq/languages","stargazers_url":"https://api.github.com/repos/eclarizio/manageiq/stargazers","contributors_url":"https://api.github.com/repos/eclarizio/manageiq/contributors","subscribers_url":"https://api.github.com/repos/eclarizio/manageiq/subscribers","subscription_url":"https://api.github.com/repos/eclarizio/manageiq/subscription","commits_url":"https://api.github.com/repos/eclarizio/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/eclarizio/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/eclarizio/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/eclarizio/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/eclarizio/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/eclarizio/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eclarizio/manageiq/merges","archive_url":"https://api.github.com/repos/eclarizio/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eclarizio/manageiq/downloads","issues_url":"https://api.github.com/repos/eclarizio/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/eclarizio/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/eclarizio/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/eclarizio/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eclarizio/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/eclarizio/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/eclarizio/manageiq/deployments","created_at":"2014-06-16T19:30:10Z","updated_at":"2014-06-23T20:42:21Z","pushed_at":"2016-12-02T19:14:45Z","git_url":"git://github.com/eclarizio/manageiq.git","ssh_url":"git@github.com:eclarizio/manageiq.git","clone_url":"https://github.com/eclarizio/manageiq.git","svn_url":"https://github.com/eclarizio/manageiq","homepage":null,"size":179730,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ManageIQ:master","ref":"master","sha":"6c1b6df95aeb9f0724ae7ff9711e74d704691910","user":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"repo":{"id":20789757,"name":"manageiq","full_name":"ManageIQ/manageiq","owner":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ManageIQ/manageiq","description":"ManageIQ Open-Source Management Platform","fork":false,"url":"https://api.github.com/repos/ManageIQ/manageiq","forks_url":"https://api.github.com/repos/ManageIQ/manageiq/forks","keys_url":"https://api.github.com/repos/ManageIQ/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ManageIQ/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ManageIQ/manageiq/teams","hooks_url":"https://api.github.com/repos/ManageIQ/manageiq/hooks","issue_events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/ManageIQ/manageiq/events","assignees_url":"https://api.github.com/repos/ManageIQ/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/ManageIQ/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/ManageIQ/manageiq/tags","blobs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ManageIQ/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/ManageIQ/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/ManageIQ/manageiq/languages","stargazers_url":"https://api.github.com/repos/ManageIQ/manageiq/stargazers","contributors_url":"https://api.github.com/repos/ManageIQ/manageiq/contributors","subscribers_url":"https://api.github.com/repos/ManageIQ/manageiq/subscribers","subscription_url":"https://api.github.com/repos/ManageIQ/manageiq/subscription","commits_url":"https://api.github.com/repos/ManageIQ/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/ManageIQ/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/ManageIQ/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/ManageIQ/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ManageIQ/manageiq/merges","archive_url":"https://api.github.com/repos/ManageIQ/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ManageIQ/manageiq/downloads","issues_url":"https://api.github.com/repos/ManageIQ/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/ManageIQ/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/ManageIQ/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/ManageIQ/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/ManageIQ/manageiq/deployments","created_at":"2014-06-13T02:31:26Z","updated_at":"2016-12-01T12:17:23Z","pushed_at":"2016-12-02T20:53:20Z","git_url":"git://github.com/ManageIQ/manageiq.git","ssh_url":"git@github.com:ManageIQ/manageiq.git","clone_url":"https://github.com/ManageIQ/manageiq.git","svn_url":"https://github.com/ManageIQ/manageiq","homepage":"manageiq.org","size":229363,"stargazers_count":358,"watchers_count":358,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":388,"mirror_url":null,"open_issues_count":905,"forks":388,"open_issues":905,"watchers":358,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12964"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/12964"},"issue":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/12964"},"comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/12964/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12964/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12964/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/manageiq/statuses/d5ee1dd924c7360859b14bb4223b1eba1f8c701f"}}}}
{"actor":{"display_login":"syncrou"}}