{"action":"created","comment":{"url":"https://api.github.com/repos/psu-stewardship/scholarsphere/pulls/comments/25125664","id":25125664,"diff_hunk":"@@ -0,0 +1,30 @@\n+class MigrateAudit < ActiveRecord::Base\n+\n+  # This method populates the migrate_audit table with data \n+  # from the Fedora 3 repo.\n+  def self.f3_audit!(fedora_url, fedora_user, fedora_password, namespace)\n+    # destroy all existing audit records first\n+    all.each { |obj| obj.destroy! }\n+\n+    audit = MigrateAuditFedora3.new(fedora_url, fedora_user, fedora_password, namespace)\n+    f3_pids = audit.get_pids()\n+    f3_pids.each do |pid|\n+      info = audit.get_info(pid)\n+      create(f3_pid: pid, f3_model: info[:has_model], f3_title: info[:title])\n+    end\n+  end\n+\n+  # This method makes sure each record in the migrate_audit table is\n+  # in the Fedora 4 repo and it has the same model as its Fedora 3\n+  # counterpart.\n+  def self.f4_audit(fedora_url, fedora_user, fedora_password)\n+    # Clear previous results\n+    MigrateAudit.update_all(f4_id: nil, status: nil)\n+    # Run the audit.\n+    f3_data = all\n+    audit = MigrateAuditFedora4.new(fedora_url, fedora_user, fedora_password)\n+    audit.audit(f3_data) do |result|","path":"app/models/migrate_audit.rb","position":26,"original_position":26,"commit_id":"2e5ebda0f8cd17b2029e289737d34503d8d9545a","original_commit_id":"2e5ebda0f8cd17b2029e289737d34503d8d9545a","user":{"login":"awead","id":312085,"avatar_url":"https://avatars.githubusercontent.com/u/312085?v=3","gravatar_id":"","url":"https://api.github.com/users/awead","html_url":"https://github.com/awead","followers_url":"https://api.github.com/users/awead/followers","following_url":"https://api.github.com/users/awead/following{/other_user}","gists_url":"https://api.github.com/users/awead/gists{/gist_id}","starred_url":"https://api.github.com/users/awead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awead/subscriptions","organizations_url":"https://api.github.com/users/awead/orgs","repos_url":"https://api.github.com/users/awead/repos","events_url":"https://api.github.com/users/awead/events{/privacy}","received_events_url":"https://api.github.com/users/awead/received_events","type":"User","site_admin":false},"body":"consider:\r\n`audit.audit(all) do |result|`\r\nand if you just passed a MigrateAuditFedora4 object, this line could read:\r\n`auditor.audit(all) do |result|`\r\nwhich reads a bit better.","created_at":"2015-02-21T20:49:23Z","updated_at":"2015-02-21T20:49:23Z","html_url":"https://github.com/psu-stewardship/scholarsphere/pull/78#discussion_r25125664","pull_request_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/pulls/78","_links":{"self":{"href":"https://api.github.com/repos/psu-stewardship/scholarsphere/pulls/comments/25125664"},"html":{"href":"https://github.com/psu-stewardship/scholarsphere/pull/78#discussion_r25125664"},"pull_request":{"href":"https://api.github.com/repos/psu-stewardship/scholarsphere/pulls/78"}}},"pull_request":{"url":"https://api.github.com/repos/psu-stewardship/scholarsphere/pulls/78","id":29735106,"html_url":"https://github.com/psu-stewardship/scholarsphere/pull/78","diff_url":"https://github.com/psu-stewardship/scholarsphere/pull/78.diff","patch_url":"https://github.com/psu-stewardship/scholarsphere/pull/78.patch","issue_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/issues/78","number":78,"state":"open","locked":false,"title":"Adds rake tasks to audit the Fedora 3 to Fedora 4 migration","user":{"login":"hectorcorrea","id":568286,"avatar_url":"https://avatars.githubusercontent.com/u/568286?v=3","gravatar_id":"","url":"https://api.github.com/users/hectorcorrea","html_url":"https://github.com/hectorcorrea","followers_url":"https://api.github.com/users/hectorcorrea/followers","following_url":"https://api.github.com/users/hectorcorrea/following{/other_user}","gists_url":"https://api.github.com/users/hectorcorrea/gists{/gist_id}","starred_url":"https://api.github.com/users/hectorcorrea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hectorcorrea/subscriptions","organizations_url":"https://api.github.com/users/hectorcorrea/orgs","repos_url":"https://api.github.com/users/hectorcorrea/repos","events_url":"https://api.github.com/users/hectorcorrea/events{/privacy}","received_events_url":"https://api.github.com/users/hectorcorrea/received_events","type":"User","site_admin":false},"body":"This pull request adds a few rake tasks to audit the migration of objects from Fedora 3 to Fedora 4. The idea is that these tasks will be run after deploying the Fedora 4 code base to production and immediately after the migration of data has been performed.\r\n\r\nThe code to perform the audit issues straight HTTP requests to Fedora 3 and Fedora 4 and bypasses Rubydora and ActiveFedora to make sure we query the Fedora repo as close to the metal as possible. \r\n\r\nThe following Wiki page provides some information on how these rake tasks will be run in production: https://github.com/psu-stewardship/scholarsphere/wiki/Fedora-3-to-Fedora-4-Migration ","created_at":"2015-02-20T22:01:57Z","updated_at":"2015-02-21T20:49:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e8f10555e45fe317a0d6264a1af3e4160e25969","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/pulls/78/commits","review_comments_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/pulls/78/comments","review_comment_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/pulls/comments/{number}","comments_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/issues/78/comments","statuses_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/statuses/2e5ebda0f8cd17b2029e289737d34503d8d9545a","head":{"label":"psu-stewardship:premigrate_audit","ref":"premigrate_audit","sha":"2e5ebda0f8cd17b2029e289737d34503d8d9545a","user":{"login":"psu-stewardship","id":653493,"avatar_url":"https://avatars.githubusercontent.com/u/653493?v=3","gravatar_id":"","url":"https://api.github.com/users/psu-stewardship","html_url":"https://github.com/psu-stewardship","followers_url":"https://api.github.com/users/psu-stewardship/followers","following_url":"https://api.github.com/users/psu-stewardship/following{/other_user}","gists_url":"https://api.github.com/users/psu-stewardship/gists{/gist_id}","starred_url":"https://api.github.com/users/psu-stewardship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psu-stewardship/subscriptions","organizations_url":"https://api.github.com/users/psu-stewardship/orgs","repos_url":"https://api.github.com/users/psu-stewardship/repos","events_url":"https://api.github.com/users/psu-stewardship/events{/privacy}","received_events_url":"https://api.github.com/users/psu-stewardship/received_events","type":"Organization","site_admin":false},"repo":{"id":2481963,"name":"scholarsphere","full_name":"psu-stewardship/scholarsphere","owner":{"login":"psu-stewardship","id":653493,"avatar_url":"https://avatars.githubusercontent.com/u/653493?v=3","gravatar_id":"","url":"https://api.github.com/users/psu-stewardship","html_url":"https://github.com/psu-stewardship","followers_url":"https://api.github.com/users/psu-stewardship/followers","following_url":"https://api.github.com/users/psu-stewardship/following{/other_user}","gists_url":"https://api.github.com/users/psu-stewardship/gists{/gist_id}","starred_url":"https://api.github.com/users/psu-stewardship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psu-stewardship/subscriptions","organizations_url":"https://api.github.com/users/psu-stewardship/orgs","repos_url":"https://api.github.com/users/psu-stewardship/repos","events_url":"https://api.github.com/users/psu-stewardship/events{/privacy}","received_events_url":"https://api.github.com/users/psu-stewardship/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/psu-stewardship/scholarsphere","description":"A web application for ingest, curation, search, and display of digital assets. Powered by Hydra technologies (Rails, Hydra-head, Blacklight, Solr, Fedora Commons, etc.)","fork":false,"url":"https://api.github.com/repos/psu-stewardship/scholarsphere","forks_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/forks","keys_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/keys{/key_id}","collaborators_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/teams","hooks_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/hooks","issue_events_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/issues/events{/number}","events_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/events","assignees_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/assignees{/user}","branches_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/branches{/branch}","tags_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/tags","blobs_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/git/refs{/sha}","trees_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/git/trees{/sha}","statuses_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/statuses/{sha}","languages_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/languages","stargazers_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/stargazers","contributors_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/contributors","subscribers_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/subscribers","subscription_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/subscription","commits_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/commits{/sha}","git_commits_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/git/commits{/sha}","comments_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/comments{/number}","issue_comment_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/issues/comments/{number}","contents_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/contents/{+path}","compare_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/compare/{base}...{head}","merges_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/merges","archive_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/downloads","issues_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/issues{/number}","pulls_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/pulls{/number}","milestones_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/milestones{/number}","notifications_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/labels{/name}","releases_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/releases{/id}","created_at":"2011-09-29T13:12:23Z","updated_at":"2015-02-18T21:15:11Z","pushed_at":"2015-02-20T21:57:06Z","git_url":"git://github.com/psu-stewardship/scholarsphere.git","ssh_url":"git@github.com:psu-stewardship/scholarsphere.git","clone_url":"https://github.com/psu-stewardship/scholarsphere.git","svn_url":"https://github.com/psu-stewardship/scholarsphere","homepage":"","size":102926,"stargazers_count":45,"watchers_count":45,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":14,"forks":11,"open_issues":14,"watchers":45,"default_branch":"develop"}},"base":{"label":"psu-stewardship:develop","ref":"develop","sha":"9e5cc5076afac4879a30ade38b73352144afa732","user":{"login":"psu-stewardship","id":653493,"avatar_url":"https://avatars.githubusercontent.com/u/653493?v=3","gravatar_id":"","url":"https://api.github.com/users/psu-stewardship","html_url":"https://github.com/psu-stewardship","followers_url":"https://api.github.com/users/psu-stewardship/followers","following_url":"https://api.github.com/users/psu-stewardship/following{/other_user}","gists_url":"https://api.github.com/users/psu-stewardship/gists{/gist_id}","starred_url":"https://api.github.com/users/psu-stewardship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psu-stewardship/subscriptions","organizations_url":"https://api.github.com/users/psu-stewardship/orgs","repos_url":"https://api.github.com/users/psu-stewardship/repos","events_url":"https://api.github.com/users/psu-stewardship/events{/privacy}","received_events_url":"https://api.github.com/users/psu-stewardship/received_events","type":"Organization","site_admin":false},"repo":{"id":2481963,"name":"scholarsphere","full_name":"psu-stewardship/scholarsphere","owner":{"login":"psu-stewardship","id":653493,"avatar_url":"https://avatars.githubusercontent.com/u/653493?v=3","gravatar_id":"","url":"https://api.github.com/users/psu-stewardship","html_url":"https://github.com/psu-stewardship","followers_url":"https://api.github.com/users/psu-stewardship/followers","following_url":"https://api.github.com/users/psu-stewardship/following{/other_user}","gists_url":"https://api.github.com/users/psu-stewardship/gists{/gist_id}","starred_url":"https://api.github.com/users/psu-stewardship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psu-stewardship/subscriptions","organizations_url":"https://api.github.com/users/psu-stewardship/orgs","repos_url":"https://api.github.com/users/psu-stewardship/repos","events_url":"https://api.github.com/users/psu-stewardship/events{/privacy}","received_events_url":"https://api.github.com/users/psu-stewardship/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/psu-stewardship/scholarsphere","description":"A web application for ingest, curation, search, and display of digital assets. Powered by Hydra technologies (Rails, Hydra-head, Blacklight, Solr, Fedora Commons, etc.)","fork":false,"url":"https://api.github.com/repos/psu-stewardship/scholarsphere","forks_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/forks","keys_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/keys{/key_id}","collaborators_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/teams","hooks_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/hooks","issue_events_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/issues/events{/number}","events_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/events","assignees_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/assignees{/user}","branches_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/branches{/branch}","tags_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/tags","blobs_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/git/refs{/sha}","trees_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/git/trees{/sha}","statuses_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/statuses/{sha}","languages_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/languages","stargazers_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/stargazers","contributors_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/contributors","subscribers_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/subscribers","subscription_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/subscription","commits_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/commits{/sha}","git_commits_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/git/commits{/sha}","comments_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/comments{/number}","issue_comment_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/issues/comments/{number}","contents_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/contents/{+path}","compare_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/compare/{base}...{head}","merges_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/merges","archive_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/downloads","issues_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/issues{/number}","pulls_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/pulls{/number}","milestones_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/milestones{/number}","notifications_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/labels{/name}","releases_url":"https://api.github.com/repos/psu-stewardship/scholarsphere/releases{/id}","created_at":"2011-09-29T13:12:23Z","updated_at":"2015-02-18T21:15:11Z","pushed_at":"2015-02-20T21:57:06Z","git_url":"git://github.com/psu-stewardship/scholarsphere.git","ssh_url":"git@github.com:psu-stewardship/scholarsphere.git","clone_url":"https://github.com/psu-stewardship/scholarsphere.git","svn_url":"https://github.com/psu-stewardship/scholarsphere","homepage":"","size":102926,"stargazers_count":45,"watchers_count":45,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":14,"forks":11,"open_issues":14,"watchers":45,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/psu-stewardship/scholarsphere/pulls/78"},"html":{"href":"https://github.com/psu-stewardship/scholarsphere/pull/78"},"issue":{"href":"https://api.github.com/repos/psu-stewardship/scholarsphere/issues/78"},"comments":{"href":"https://api.github.com/repos/psu-stewardship/scholarsphere/issues/78/comments"},"review_comments":{"href":"https://api.github.com/repos/psu-stewardship/scholarsphere/pulls/78/comments"},"review_comment":{"href":"https://api.github.com/repos/psu-stewardship/scholarsphere/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/psu-stewardship/scholarsphere/pulls/78/commits"},"statuses":{"href":"https://api.github.com/repos/psu-stewardship/scholarsphere/statuses/2e5ebda0f8cd17b2029e289737d34503d8d9545a"}}}}