{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/comments/92361300","pull_request_review_id":12873871,"id":92361300,"diff_hunk":"@@ -5,6 +5,9 @@ import utils from './utils';\n import config from './config';\n import dedupe from './utils/dedupe-calls';\n import urlconfig from './urlconfig';\n+import { prefetchdata } from './scopes';\n+\n+const Promise = es6Promise.Promise;","path":"blueocean-core-js/src/js/fetch.js","position":6,"original_position":6,"commit_id":"46785d43b98c8cbc701ec1115196a0feb396fc5b","original_commit_id":"46785d43b98c8cbc701ec1115196a0feb396fc5b","user":{"login":"imeredith","id":140492,"avatar_url":"https://avatars.githubusercontent.com/u/140492?v=3","gravatar_id":"","url":"https://api.github.com/users/imeredith","html_url":"https://github.com/imeredith","followers_url":"https://api.github.com/users/imeredith/followers","following_url":"https://api.github.com/users/imeredith/following{/other_user}","gists_url":"https://api.github.com/users/imeredith/gists{/gist_id}","starred_url":"https://api.github.com/users/imeredith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imeredith/subscriptions","organizations_url":"https://api.github.com/users/imeredith/orgs","repos_url":"https://api.github.com/users/imeredith/repos","events_url":"https://api.github.com/users/imeredith/events{/privacy}","received_events_url":"https://api.github.com/users/imeredith/received_events","type":"User","site_admin":false},"body":"ah right. I don't think you need to do that? At the very least i have used the contructor in other places without it. But I don't thing it hurts also so meh.","created_at":"2016-12-14T10:12:04Z","updated_at":"2016-12-14T10:12:04Z","html_url":"https://github.com/jenkinsci/blueocean-plugin/pull/613#discussion_r92361300","pull_request_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/613","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/comments/92361300"},"html":{"href":"https://github.com/jenkinsci/blueocean-plugin/pull/613#discussion_r92361300"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/613"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/613","id":94636156,"html_url":"https://github.com/jenkinsci/blueocean-plugin/pull/613","diff_url":"https://github.com/jenkinsci/blueocean-plugin/pull/613.diff","patch_url":"https://github.com/jenkinsci/blueocean-plugin/pull/613.patch","issue_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/613","number":613,"state":"open","locked":false,"title":"[FIX JENKINS-39625] Part 2: Page preloading with pipeline state - Runs","user":{"login":"tfennelly","id":429311,"avatar_url":"https://avatars.githubusercontent.com/u/429311?v=3","gravatar_id":"","url":"https://api.github.com/users/tfennelly","html_url":"https://github.com/tfennelly","followers_url":"https://api.github.com/users/tfennelly/followers","following_url":"https://api.github.com/users/tfennelly/following{/other_user}","gists_url":"https://api.github.com/users/tfennelly/gists{/gist_id}","starred_url":"https://api.github.com/users/tfennelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfennelly/subscriptions","organizations_url":"https://api.github.com/users/tfennelly/orgs","repos_url":"https://api.github.com/users/tfennelly/repos","events_url":"https://api.github.com/users/tfennelly/events{/privacy}","received_events_url":"https://api.github.com/users/tfennelly/received_events","type":"User","site_admin":false},"body":"# Description\r\n\r\nSee [JENKINS-39625](https://issues.jenkins-ci.org/browse/JENKINS-39625).\r\n\r\nThis is following on from #612, adding `PipelineStatePreloader` extension point impl for preloading pipeline pages with state that can be used to short-circuit the fetch layer.\r\n\r\nWhat `PipelineStatePreloader` does is adds an entry in the `$blueocean.prefetchdata.PipelineStatePreloader` page object on page creation, with that object containing the `restUrl` for the first page of activity data i.e. records `0` to `26`. The client-side `Fetch` code (`blueocen-core-js`) checks the `restUrl` values in the objects in `$blueocean.prefetchdata` before issuing the REST API call. If the URL matches the fetch url then the fetch call bypasses the fetch and uses the `data` value inside the `$blueocean.prefetchdata.PipelineStatePreloader` object.\r\n\r\n<img width=\"1257\" alt=\"screenshot 2016-12-13 16 15 26\" src=\"https://cloud.githubusercontent.com/assets/429311/21148590/a4f24b1e-c150-11e6-9b9f-6ea0ad185167.png\">\r\n\r\nWe should be able to do this for other page data too e.g. favorites.\r\n\r\n# Coding Todos:\r\n- [x] Generic commons code for parsing a Blue Ocean UI URL. See \tee8773d and 1712012.\r\n- [x] Implement `PipelineStatePreloader` for setting pipeline runs state on the page. See 5bd676b.\r\n- [x] Modify client-side fetch code to check the \"prefetch\" data on the loaded page. We can attach prefetch data and associate it with REST API calls, allowing the fetch code to bypass the actual fetch call and use the prefetched data.\r\n\r\n# Submitter checklist\r\n- [x] Link to JIRA ticket in description, if appropriate.\r\n- [x] Change is code complete and matches issue description\r\n- [x] Appropriate unit or acceptance tests or explanation to why this change has no tests\r\n- [x] Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.\r\n- [x] Ran Acceptance Test Harness against PR changes. https://ci.blueocean.io/job/ATH-Jenkinsfile/job/master/616/\r\n\r\n# Reviewer checklist\r\n- [ ] Run the changes and verified the change matches the issue description\r\n- [ ] Reviewed the code\r\n- [ ] Verified that the appropriate tests have been written or valid explanation given\r\n\r\n@jenkinsci/code-reviewers @reviewbybees \r\n","created_at":"2016-11-21T15:27:39Z","updated_at":"2016-12-14T10:12:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c0a1e84d25dd983bf6820a9aac7b86930748ab6b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/613/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/613/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/613/comments","statuses_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/statuses/46785d43b98c8cbc701ec1115196a0feb396fc5b","head":{"label":"jenkinsci:JENKINS-39625-part2","ref":"JENKINS-39625-part2","sha":"46785d43b98c8cbc701ec1115196a0feb396fc5b","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":50250915,"name":"blueocean-plugin","full_name":"jenkinsci/blueocean-plugin","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/blueocean-plugin","description":"Blue Ocean is a reboot of the Jenkins CI/CD User Experience","fork":false,"url":"https://api.github.com/repos/jenkinsci/blueocean-plugin","forks_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/deployments","created_at":"2016-01-23T18:02:45Z","updated_at":"2016-12-14T06:10:05Z","pushed_at":"2016-12-14T08:34:49Z","git_url":"git://github.com/jenkinsci/blueocean-plugin.git","ssh_url":"git@github.com:jenkinsci/blueocean-plugin.git","clone_url":"https://github.com/jenkinsci/blueocean-plugin.git","svn_url":"https://github.com/jenkinsci/blueocean-plugin","homepage":"https://jenkins.io/projects/blueocean/","size":9947,"stargazers_count":1416,"watchers_count":1416,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":128,"mirror_url":null,"open_issues_count":14,"forks":128,"open_issues":14,"watchers":1416,"default_branch":"master"}},"base":{"label":"jenkinsci:JENKINS-39625-part1","ref":"JENKINS-39625-part1","sha":"067cf4fa1708145d7cc1ba9050854ef47b33bb0d","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":50250915,"name":"blueocean-plugin","full_name":"jenkinsci/blueocean-plugin","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/blueocean-plugin","description":"Blue Ocean is a reboot of the Jenkins CI/CD User Experience","fork":false,"url":"https://api.github.com/repos/jenkinsci/blueocean-plugin","forks_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/deployments","created_at":"2016-01-23T18:02:45Z","updated_at":"2016-12-14T06:10:05Z","pushed_at":"2016-12-14T08:34:49Z","git_url":"git://github.com/jenkinsci/blueocean-plugin.git","ssh_url":"git@github.com:jenkinsci/blueocean-plugin.git","clone_url":"https://github.com/jenkinsci/blueocean-plugin.git","svn_url":"https://github.com/jenkinsci/blueocean-plugin","homepage":"https://jenkins.io/projects/blueocean/","size":9947,"stargazers_count":1416,"watchers_count":1416,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":128,"mirror_url":null,"open_issues_count":14,"forks":128,"open_issues":14,"watchers":1416,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/613"},"html":{"href":"https://github.com/jenkinsci/blueocean-plugin/pull/613"},"issue":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/613"},"comments":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/613/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/613/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/613/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/statuses/46785d43b98c8cbc701ec1115196a0feb396fc5b"}}}}
{"actor":{"display_login":"imeredith"}}