{"action":"closed","number":63,"pull_request":{"url":"https://api.github.com/repos/plone/plone.app.linkintegrity/pulls/63","id":158122913,"html_url":"https://github.com/plone/plone.app.linkintegrity/pull/63","diff_url":"https://github.com/plone/plone.app.linkintegrity/pull/63.diff","patch_url":"https://github.com/plone/plone.app.linkintegrity/pull/63.patch","issue_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/issues/63","number":63,"state":"closed","locked":false,"title":"Optimize migration of old Archetypes references","user":{"login":"davisagli","id":49014,"avatar_url":"https://avatars0.githubusercontent.com/u/49014?v=4","gravatar_id":"","url":"https://api.github.com/users/davisagli","html_url":"https://github.com/davisagli","followers_url":"https://api.github.com/users/davisagli/followers","following_url":"https://api.github.com/users/davisagli/following{/other_user}","gists_url":"https://api.github.com/users/davisagli/gists{/gist_id}","starred_url":"https://api.github.com/users/davisagli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davisagli/subscriptions","organizations_url":"https://api.github.com/users/davisagli/orgs","repos_url":"https://api.github.com/users/davisagli/repos","events_url":"https://api.github.com/users/davisagli/events{/privacy}","received_events_url":"https://api.github.com/users/davisagli/received_events","type":"User","site_admin":false},"body":"This changes the approach for migrating Archetypes references to the relation catalog, and makes it run faster. On one large site (~300k items) this makes the migration run for us in 20 minutes instead of multiple hours.\r\n\r\nThe old code looped over the references in the reference_catalog and triggered the modified event on the source and target objects to make the linkintegrity event handlers scan for links and add them to the relation catalog. This has multiple problems:\r\n- It triggers a portal_catalog reindex of the source and target objects which isn't necessary.\r\n- It updates the modified time of the source and target.\r\n- It spends time scanning for links even though we can already look up the existing links easily in the reference_catalog.\r\n- It scans the target object for no reason that I can see.\r\n- It does these things while looping over references. So if an object is the source or target of multiple references, it will be reindexed and its relations replaced multiple times, once for each reference!\r\n\r\nThe new approach is to directly add a relation to the zc.relation catalog for each one that exists in the reference_catalog without rescanning the links.","created_at":"2017-12-13T15:24:46Z","updated_at":"2017-12-13T18:21:46Z","closed_at":"2017-12-13T18:21:46Z","merged_at":"2017-12-13T18:21:46Z","merge_commit_sha":"a4f9a4588fb37615e41e52714f4c7e593502c888","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/pulls/63/commits","review_comments_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/pulls/63/comments","review_comment_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/pulls/comments{/number}","comments_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/issues/63/comments","statuses_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/statuses/4a535d506e78dcb105fb07dc800b04b43c2cd176","head":{"label":"plone:davisagli-migration","ref":"davisagli-migration","sha":"4a535d506e78dcb105fb07dc800b04b43c2cd176","user":{"login":"plone","id":72034,"avatar_url":"https://avatars0.githubusercontent.com/u/72034?v=4","gravatar_id":"","url":"https://api.github.com/users/plone","html_url":"https://github.com/plone","followers_url":"https://api.github.com/users/plone/followers","following_url":"https://api.github.com/users/plone/following{/other_user}","gists_url":"https://api.github.com/users/plone/gists{/gist_id}","starred_url":"https://api.github.com/users/plone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plone/subscriptions","organizations_url":"https://api.github.com/users/plone/orgs","repos_url":"https://api.github.com/users/plone/repos","events_url":"https://api.github.com/users/plone/events{/privacy}","received_events_url":"https://api.github.com/users/plone/received_events","type":"Organization","site_admin":false},"repo":{"id":2432511,"name":"plone.app.linkintegrity","full_name":"plone/plone.app.linkintegrity","owner":{"login":"plone","id":72034,"avatar_url":"https://avatars0.githubusercontent.com/u/72034?v=4","gravatar_id":"","url":"https://api.github.com/users/plone","html_url":"https://github.com/plone","followers_url":"https://api.github.com/users/plone/followers","following_url":"https://api.github.com/users/plone/following{/other_user}","gists_url":"https://api.github.com/users/plone/gists{/gist_id}","starred_url":"https://api.github.com/users/plone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plone/subscriptions","organizations_url":"https://api.github.com/users/plone/orgs","repos_url":"https://api.github.com/users/plone/repos","events_url":"https://api.github.com/users/plone/events{/privacy}","received_events_url":"https://api.github.com/users/plone/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/plone/plone.app.linkintegrity","description":"link integrity checking for Plone content","fork":false,"url":"https://api.github.com/repos/plone/plone.app.linkintegrity","forks_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/forks","keys_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/teams","hooks_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/hooks","issue_events_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/issues/events{/number}","events_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/events","assignees_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/assignees{/user}","branches_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/branches{/branch}","tags_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/tags","blobs_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/git/refs{/sha}","trees_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/statuses/{sha}","languages_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/languages","stargazers_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/stargazers","contributors_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/contributors","subscribers_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/subscribers","subscription_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/subscription","commits_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/commits{/sha}","git_commits_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/git/commits{/sha}","comments_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/comments{/number}","issue_comment_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/issues/comments{/number}","contents_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/contents/{+path}","compare_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/merges","archive_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/downloads","issues_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/issues{/number}","pulls_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/pulls{/number}","milestones_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/milestones{/number}","notifications_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/labels{/name}","releases_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/releases{/id}","deployments_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/deployments","created_at":"2011-09-21T20:14:55Z","updated_at":"2017-04-07T04:10:52Z","pushed_at":"2017-12-13T18:21:46Z","git_url":"git://github.com/plone/plone.app.linkintegrity.git","ssh_url":"git@github.com:plone/plone.app.linkintegrity.git","clone_url":"https://github.com/plone/plone.app.linkintegrity.git","svn_url":"https://github.com/plone/plone.app.linkintegrity","homepage":"https://pypi.python.org/pypi/plone.app.linkintegrity","size":711,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":13,"open_issues":5,"watchers":5,"default_branch":"master"}},"base":{"label":"plone:master","ref":"master","sha":"823a82686e90f8d3dcb596e77bac85573e13d641","user":{"login":"plone","id":72034,"avatar_url":"https://avatars0.githubusercontent.com/u/72034?v=4","gravatar_id":"","url":"https://api.github.com/users/plone","html_url":"https://github.com/plone","followers_url":"https://api.github.com/users/plone/followers","following_url":"https://api.github.com/users/plone/following{/other_user}","gists_url":"https://api.github.com/users/plone/gists{/gist_id}","starred_url":"https://api.github.com/users/plone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plone/subscriptions","organizations_url":"https://api.github.com/users/plone/orgs","repos_url":"https://api.github.com/users/plone/repos","events_url":"https://api.github.com/users/plone/events{/privacy}","received_events_url":"https://api.github.com/users/plone/received_events","type":"Organization","site_admin":false},"repo":{"id":2432511,"name":"plone.app.linkintegrity","full_name":"plone/plone.app.linkintegrity","owner":{"login":"plone","id":72034,"avatar_url":"https://avatars0.githubusercontent.com/u/72034?v=4","gravatar_id":"","url":"https://api.github.com/users/plone","html_url":"https://github.com/plone","followers_url":"https://api.github.com/users/plone/followers","following_url":"https://api.github.com/users/plone/following{/other_user}","gists_url":"https://api.github.com/users/plone/gists{/gist_id}","starred_url":"https://api.github.com/users/plone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plone/subscriptions","organizations_url":"https://api.github.com/users/plone/orgs","repos_url":"https://api.github.com/users/plone/repos","events_url":"https://api.github.com/users/plone/events{/privacy}","received_events_url":"https://api.github.com/users/plone/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/plone/plone.app.linkintegrity","description":"link integrity checking for Plone content","fork":false,"url":"https://api.github.com/repos/plone/plone.app.linkintegrity","forks_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/forks","keys_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/teams","hooks_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/hooks","issue_events_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/issues/events{/number}","events_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/events","assignees_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/assignees{/user}","branches_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/branches{/branch}","tags_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/tags","blobs_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/git/refs{/sha}","trees_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/statuses/{sha}","languages_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/languages","stargazers_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/stargazers","contributors_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/contributors","subscribers_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/subscribers","subscription_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/subscription","commits_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/commits{/sha}","git_commits_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/git/commits{/sha}","comments_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/comments{/number}","issue_comment_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/issues/comments{/number}","contents_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/contents/{+path}","compare_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/merges","archive_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/downloads","issues_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/issues{/number}","pulls_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/pulls{/number}","milestones_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/milestones{/number}","notifications_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/labels{/name}","releases_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/releases{/id}","deployments_url":"https://api.github.com/repos/plone/plone.app.linkintegrity/deployments","created_at":"2011-09-21T20:14:55Z","updated_at":"2017-04-07T04:10:52Z","pushed_at":"2017-12-13T18:21:46Z","git_url":"git://github.com/plone/plone.app.linkintegrity.git","ssh_url":"git@github.com:plone/plone.app.linkintegrity.git","clone_url":"https://github.com/plone/plone.app.linkintegrity.git","svn_url":"https://github.com/plone/plone.app.linkintegrity","homepage":"https://pypi.python.org/pypi/plone.app.linkintegrity","size":711,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":13,"open_issues":5,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/plone/plone.app.linkintegrity/pulls/63"},"html":{"href":"https://github.com/plone/plone.app.linkintegrity/pull/63"},"issue":{"href":"https://api.github.com/repos/plone/plone.app.linkintegrity/issues/63"},"comments":{"href":"https://api.github.com/repos/plone/plone.app.linkintegrity/issues/63/comments"},"review_comments":{"href":"https://api.github.com/repos/plone/plone.app.linkintegrity/pulls/63/comments"},"review_comment":{"href":"https://api.github.com/repos/plone/plone.app.linkintegrity/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/plone/plone.app.linkintegrity/pulls/63/commits"},"statuses":{"href":"https://api.github.com/repos/plone/plone.app.linkintegrity/statuses/4a535d506e78dcb105fb07dc800b04b43c2cd176"}},"author_association":"OWNER","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"davisagli","id":49014,"avatar_url":"https://avatars0.githubusercontent.com/u/49014?v=4","gravatar_id":"","url":"https://api.github.com/users/davisagli","html_url":"https://github.com/davisagli","followers_url":"https://api.github.com/users/davisagli/followers","following_url":"https://api.github.com/users/davisagli/following{/other_user}","gists_url":"https://api.github.com/users/davisagli/gists{/gist_id}","starred_url":"https://api.github.com/users/davisagli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davisagli/subscriptions","organizations_url":"https://api.github.com/users/davisagli/orgs","repos_url":"https://api.github.com/users/davisagli/repos","events_url":"https://api.github.com/users/davisagli/events{/privacy}","received_events_url":"https://api.github.com/users/davisagli/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":57,"deletions":51,"changed_files":6}}
{"actor":{"display_login":"davisagli"}}