{"action":"created","comment":{"url":"https://api.github.com/repos/openSUSE/open-build-service/pulls/comments/239392093","pull_request_review_id":182161251,"id":239392093,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTM5MjA5Mw==","diff_hunk":"@@ -93,9 +93,31 @@ def subprojects\n   end\n \n   def pulse\n+    switch_to_webui2\n     @pulse = @project.project_log_entries.page(params[:page])\n   end\n \n+  def update_pulse\n+    sleep(2)\n+    @range = 'month' if params[:range] == 'month'\n+    @range ||= 'week'\n+    case @range\n+    when 'month'\n+      range = 1.month.ago..Date.tomorrow\n+    else\n+      range = 1.week.ago..Date.tomorrow\n+    end\n+\n+    @pulse = @project.project_log_entries.where(datetime: range).group(:event_type).count\n+\n+    @requests = @project.target_of_bs_requests.where(updated_at: range).group(:state).count\n+    # sort by value...\n+    @requests = @requests.sort_by(&:last).reverse.to_h\n+    # transpose to percentages\n+    @requests_by_percentage = @requests.each_with_object({}) { |(k, v), hash| hash[k] = \"#{(v * 100.0 / @requests.values.sum).round}\" } if @requests.any?\n+    switch_to_webui2\n+  end","path":"src/api/app/controllers/webui/project_controller.rb","position":42,"original_position":36,"commit_id":"1c5de76b21ddab8b8f02528870466f5283b82e9b","original_commit_id":"5dc0c0f101de1743727d35b971b4574794fa5264","user":{"login":"bgeuken","id":968949,"node_id":"MDQ6VXNlcjk2ODk0OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/968949?v=4","gravatar_id":"","url":"https://api.github.com/users/bgeuken","html_url":"https://github.com/bgeuken","followers_url":"https://api.github.com/users/bgeuken/followers","following_url":"https://api.github.com/users/bgeuken/following{/other_user}","gists_url":"https://api.github.com/users/bgeuken/gists{/gist_id}","starred_url":"https://api.github.com/users/bgeuken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgeuken/subscriptions","organizations_url":"https://api.github.com/users/bgeuken/orgs","repos_url":"https://api.github.com/users/bgeuken/repos","events_url":"https://api.github.com/users/bgeuken/events{/privacy}","received_events_url":"https://api.github.com/users/bgeuken/received_events","type":"User","site_admin":false},"body":"Took about 30 minutes:wink:\r\nhttps://github.com/hennevogel/open-build-service/pull/8/commits/a8b6a400049b5c43f026f00086b004cd155a16c3","created_at":"2018-12-06T10:03:27Z","updated_at":"2018-12-06T10:03:27Z","html_url":"https://github.com/openSUSE/open-build-service/pull/6446#discussion_r239392093","pull_request_url":"https://api.github.com/repos/openSUSE/open-build-service/pulls/6446","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/openSUSE/open-build-service/pulls/comments/239392093"},"html":{"href":"https://github.com/openSUSE/open-build-service/pull/6446#discussion_r239392093"},"pull_request":{"href":"https://api.github.com/repos/openSUSE/open-build-service/pulls/6446"}},"in_reply_to_id":238558496},"pull_request":{"url":"https://api.github.com/repos/openSUSE/open-build-service/pulls/6446","id":235520146,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1NTIwMTQ2","html_url":"https://github.com/openSUSE/open-build-service/pull/6446","diff_url":"https://github.com/openSUSE/open-build-service/pull/6446.diff","patch_url":"https://github.com/openSUSE/open-build-service/pull/6446.patch","issue_url":"https://api.github.com/repos/openSUSE/open-build-service/issues/6446","number":6446,"state":"open","locked":false,"title":"Refactor and adopt pulse to bootstrap","user":{"login":"hennevogel","id":514785,"node_id":"MDQ6VXNlcjUxNDc4NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/514785?v=4","gravatar_id":"","url":"https://api.github.com/users/hennevogel","html_url":"https://github.com/hennevogel","followers_url":"https://api.github.com/users/hennevogel/followers","following_url":"https://api.github.com/users/hennevogel/following{/other_user}","gists_url":"https://api.github.com/users/hennevogel/gists{/gist_id}","starred_url":"https://api.github.com/users/hennevogel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hennevogel/subscriptions","organizations_url":"https://api.github.com/users/hennevogel/orgs","repos_url":"https://api.github.com/users/hennevogel/repos","events_url":"https://api.github.com/users/hennevogel/events{/privacy}","received_events_url":"https://api.github.com/users/hennevogel/received_events","type":"User","site_admin":false},"body":"This was some basic functionality. A bit extended now to give some more information about what is happening in a Project.\r\n\r\n![peek 2018-12-05 11-07](https://user-images.githubusercontent.com/514785/49506311-11066680-f87e-11e8-8c19-5cdc23563001.gif)\r\n\r\n","created_at":"2018-12-03T16:57:55Z","updated_at":"2018-12-06T10:03:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2e13bd00c6d4c411682dd49c244b94cb1371dcf5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1075150661,"node_id":"MDU6TGFiZWwxMDc1MTUwNjYx","url":"https://api.github.com/repos/openSUSE/open-build-service/labels/Bootstrap%20:rocket:","name":"Bootstrap :rocket:","color":"048743","default":false},{"id":21922370,"node_id":"MDU6TGFiZWwyMTkyMjM3MA==","url":"https://api.github.com/repos/openSUSE/open-build-service/labels/Frontend%20%F0%9F%91%BB","name":"Frontend 👻","color":"c7def8","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/openSUSE/open-build-service/pulls/6446/commits","review_comments_url":"https://api.github.com/repos/openSUSE/open-build-service/pulls/6446/comments","review_comment_url":"https://api.github.com/repos/openSUSE/open-build-service/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openSUSE/open-build-service/issues/6446/comments","statuses_url":"https://api.github.com/repos/openSUSE/open-build-service/statuses/1c5de76b21ddab8b8f02528870466f5283b82e9b","head":{"label":"hennevogel:feature/bootstrap-pulse","ref":"feature/bootstrap-pulse","sha":"1c5de76b21ddab8b8f02528870466f5283b82e9b","user":{"login":"hennevogel","id":514785,"node_id":"MDQ6VXNlcjUxNDc4NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/514785?v=4","gravatar_id":"","url":"https://api.github.com/users/hennevogel","html_url":"https://github.com/hennevogel","followers_url":"https://api.github.com/users/hennevogel/followers","following_url":"https://api.github.com/users/hennevogel/following{/other_user}","gists_url":"https://api.github.com/users/hennevogel/gists{/gist_id}","starred_url":"https://api.github.com/users/hennevogel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hennevogel/subscriptions","organizations_url":"https://api.github.com/users/hennevogel/orgs","repos_url":"https://api.github.com/users/hennevogel/repos","events_url":"https://api.github.com/users/hennevogel/events{/privacy}","received_events_url":"https://api.github.com/users/hennevogel/received_events","type":"User","site_admin":false},"repo":{"id":6598365,"node_id":"MDEwOlJlcG9zaXRvcnk2NTk4MzY1","name":"open-build-service","full_name":"hennevogel/open-build-service","private":false,"owner":{"login":"hennevogel","id":514785,"node_id":"MDQ6VXNlcjUxNDc4NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/514785?v=4","gravatar_id":"","url":"https://api.github.com/users/hennevogel","html_url":"https://github.com/hennevogel","followers_url":"https://api.github.com/users/hennevogel/followers","following_url":"https://api.github.com/users/hennevogel/following{/other_user}","gists_url":"https://api.github.com/users/hennevogel/gists{/gist_id}","starred_url":"https://api.github.com/users/hennevogel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hennevogel/subscriptions","organizations_url":"https://api.github.com/users/hennevogel/orgs","repos_url":"https://api.github.com/users/hennevogel/repos","events_url":"https://api.github.com/users/hennevogel/events{/privacy}","received_events_url":"https://api.github.com/users/hennevogel/received_events","type":"User","site_admin":false},"html_url":"https://github.com/hennevogel/open-build-service","description":"A generic system to build and distribute packages from sources in an automatic, consistent and reproducible way. Release your software for a wide range of operating systems and hardware architectures.","fork":true,"url":"https://api.github.com/repos/hennevogel/open-build-service","forks_url":"https://api.github.com/repos/hennevogel/open-build-service/forks","keys_url":"https://api.github.com/repos/hennevogel/open-build-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hennevogel/open-build-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hennevogel/open-build-service/teams","hooks_url":"https://api.github.com/repos/hennevogel/open-build-service/hooks","issue_events_url":"https://api.github.com/repos/hennevogel/open-build-service/issues/events{/number}","events_url":"https://api.github.com/repos/hennevogel/open-build-service/events","assignees_url":"https://api.github.com/repos/hennevogel/open-build-service/assignees{/user}","branches_url":"https://api.github.com/repos/hennevogel/open-build-service/branches{/branch}","tags_url":"https://api.github.com/repos/hennevogel/open-build-service/tags","blobs_url":"https://api.github.com/repos/hennevogel/open-build-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hennevogel/open-build-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hennevogel/open-build-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/hennevogel/open-build-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hennevogel/open-build-service/statuses/{sha}","languages_url":"https://api.github.com/repos/hennevogel/open-build-service/languages","stargazers_url":"https://api.github.com/repos/hennevogel/open-build-service/stargazers","contributors_url":"https://api.github.com/repos/hennevogel/open-build-service/contributors","subscribers_url":"https://api.github.com/repos/hennevogel/open-build-service/subscribers","subscription_url":"https://api.github.com/repos/hennevogel/open-build-service/subscription","commits_url":"https://api.github.com/repos/hennevogel/open-build-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/hennevogel/open-build-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/hennevogel/open-build-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/hennevogel/open-build-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/hennevogel/open-build-service/contents/{+path}","compare_url":"https://api.github.com/repos/hennevogel/open-build-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hennevogel/open-build-service/merges","archive_url":"https://api.github.com/repos/hennevogel/open-build-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hennevogel/open-build-service/downloads","issues_url":"https://api.github.com/repos/hennevogel/open-build-service/issues{/number}","pulls_url":"https://api.github.com/repos/hennevogel/open-build-service/pulls{/number}","milestones_url":"https://api.github.com/repos/hennevogel/open-build-service/milestones{/number}","notifications_url":"https://api.github.com/repos/hennevogel/open-build-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hennevogel/open-build-service/labels{/name}","releases_url":"https://api.github.com/repos/hennevogel/open-build-service/releases{/id}","deployments_url":"https://api.github.com/repos/hennevogel/open-build-service/deployments","created_at":"2012-11-08T15:30:07Z","updated_at":"2018-03-19T14:42:18Z","pushed_at":"2018-12-06T10:00:11Z","git_url":"git://github.com/hennevogel/open-build-service.git","ssh_url":"git@github.com:hennevogel/open-build-service.git","clone_url":"https://github.com/hennevogel/open-build-service.git","svn_url":"https://github.com/hennevogel/open-build-service","homepage":"http://openbuildservice.org/","size":63889,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":1,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"openSUSE:master","ref":"master","sha":"8d097f5bbad8dbbd7950cff66a43fa43ea8ccb1b","user":{"login":"openSUSE","id":623819,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMzgxOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/623819?v=4","gravatar_id":"","url":"https://api.github.com/users/openSUSE","html_url":"https://github.com/openSUSE","followers_url":"https://api.github.com/users/openSUSE/followers","following_url":"https://api.github.com/users/openSUSE/following{/other_user}","gists_url":"https://api.github.com/users/openSUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/openSUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openSUSE/subscriptions","organizations_url":"https://api.github.com/users/openSUSE/orgs","repos_url":"https://api.github.com/users/openSUSE/repos","events_url":"https://api.github.com/users/openSUSE/events{/privacy}","received_events_url":"https://api.github.com/users/openSUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":2046192,"node_id":"MDEwOlJlcG9zaXRvcnkyMDQ2MTky","name":"open-build-service","full_name":"openSUSE/open-build-service","private":false,"owner":{"login":"openSUSE","id":623819,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMzgxOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/623819?v=4","gravatar_id":"","url":"https://api.github.com/users/openSUSE","html_url":"https://github.com/openSUSE","followers_url":"https://api.github.com/users/openSUSE/followers","following_url":"https://api.github.com/users/openSUSE/following{/other_user}","gists_url":"https://api.github.com/users/openSUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/openSUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openSUSE/subscriptions","organizations_url":"https://api.github.com/users/openSUSE/orgs","repos_url":"https://api.github.com/users/openSUSE/repos","events_url":"https://api.github.com/users/openSUSE/events{/privacy}","received_events_url":"https://api.github.com/users/openSUSE/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/openSUSE/open-build-service","description":"A generic system to build and distribute packages from sources in an automatic, consistent and reproducible way. Release your software for a wide range of operating systems and hardware architectures.","fork":false,"url":"https://api.github.com/repos/openSUSE/open-build-service","forks_url":"https://api.github.com/repos/openSUSE/open-build-service/forks","keys_url":"https://api.github.com/repos/openSUSE/open-build-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openSUSE/open-build-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openSUSE/open-build-service/teams","hooks_url":"https://api.github.com/repos/openSUSE/open-build-service/hooks","issue_events_url":"https://api.github.com/repos/openSUSE/open-build-service/issues/events{/number}","events_url":"https://api.github.com/repos/openSUSE/open-build-service/events","assignees_url":"https://api.github.com/repos/openSUSE/open-build-service/assignees{/user}","branches_url":"https://api.github.com/repos/openSUSE/open-build-service/branches{/branch}","tags_url":"https://api.github.com/repos/openSUSE/open-build-service/tags","blobs_url":"https://api.github.com/repos/openSUSE/open-build-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openSUSE/open-build-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openSUSE/open-build-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/openSUSE/open-build-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openSUSE/open-build-service/statuses/{sha}","languages_url":"https://api.github.com/repos/openSUSE/open-build-service/languages","stargazers_url":"https://api.github.com/repos/openSUSE/open-build-service/stargazers","contributors_url":"https://api.github.com/repos/openSUSE/open-build-service/contributors","subscribers_url":"https://api.github.com/repos/openSUSE/open-build-service/subscribers","subscription_url":"https://api.github.com/repos/openSUSE/open-build-service/subscription","commits_url":"https://api.github.com/repos/openSUSE/open-build-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/openSUSE/open-build-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/openSUSE/open-build-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/openSUSE/open-build-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/openSUSE/open-build-service/contents/{+path}","compare_url":"https://api.github.com/repos/openSUSE/open-build-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openSUSE/open-build-service/merges","archive_url":"https://api.github.com/repos/openSUSE/open-build-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openSUSE/open-build-service/downloads","issues_url":"https://api.github.com/repos/openSUSE/open-build-service/issues{/number}","pulls_url":"https://api.github.com/repos/openSUSE/open-build-service/pulls{/number}","milestones_url":"https://api.github.com/repos/openSUSE/open-build-service/milestones{/number}","notifications_url":"https://api.github.com/repos/openSUSE/open-build-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openSUSE/open-build-service/labels{/name}","releases_url":"https://api.github.com/repos/openSUSE/open-build-service/releases{/id}","deployments_url":"https://api.github.com/repos/openSUSE/open-build-service/deployments","created_at":"2011-07-14T06:52:57Z","updated_at":"2018-12-06T08:56:15Z","pushed_at":"2018-12-06T09:38:00Z","git_url":"git://github.com/openSUSE/open-build-service.git","ssh_url":"git@github.com:openSUSE/open-build-service.git","clone_url":"https://github.com/openSUSE/open-build-service.git","svn_url":"https://github.com/openSUSE/open-build-service","homepage":"http://openbuildservice.org/","size":64881,"stargazers_count":402,"watchers_count":402,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":255,"mirror_url":null,"archived":false,"open_issues_count":557,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":255,"open_issues":557,"watchers":402,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openSUSE/open-build-service/pulls/6446"},"html":{"href":"https://github.com/openSUSE/open-build-service/pull/6446"},"issue":{"href":"https://api.github.com/repos/openSUSE/open-build-service/issues/6446"},"comments":{"href":"https://api.github.com/repos/openSUSE/open-build-service/issues/6446/comments"},"review_comments":{"href":"https://api.github.com/repos/openSUSE/open-build-service/pulls/6446/comments"},"review_comment":{"href":"https://api.github.com/repos/openSUSE/open-build-service/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openSUSE/open-build-service/pulls/6446/commits"},"statuses":{"href":"https://api.github.com/repos/openSUSE/open-build-service/statuses/1c5de76b21ddab8b8f02528870466f5283b82e9b"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"bgeuken"}}