{"action":"created","comment":{"url":"https://api.github.com/repos/genome/genome/pulls/comments/22732703","id":22732703,"diff_hunk":"@@ -630,5 +633,95 @@ sub result_is_on_cle_disk_group {\n     return Genome::Disk::Group::Validate::GenomeDiskGroups::is_cle_disk_group_name($disk_group_name);\n }\n \n+sub compare_output {\n+    my ($self, $other_process_id) = @_;\n+    my $process_id = $self->id;\n+\n+    unless (defined ($other_process_id)) {\n+        die $self->error_message('Require process ID argument!');\n+    }\n+    my $other_process = Genome::Process->get($other_process_id);\n+    unless ($other_process) {\n+        die $self->error_message('Could not get process for ID (%s)', $other_process_id);\n+    }\n+\n+    unless ($self->class eq $other_process->class) {\n+        die $self->error_message('Processes (%s) and (%s) are not of the same type', $process_id, $other_process_id);\n+    }\n+\n+    my %diffs = $self->_compare_output_files($other_process);\n+\n+    return %diffs;\n+}\n+\n+sub _compare_output_files {\n+    my ($self, $other_process) = @_;\n+\n+    my $output_dir = Genome::Sys->create_temp_file_path();\n+    my $other_output_dir = Genome::Sys->create_temp_file_path();\n+\n+    $self->symlink_results($output_dir);\n+    $other_process->symlink_results($other_output_dir);\n+\n+    return $self->_compare_output_directories($output_dir, $other_output_dir, $other_process);\n+}\n+\n+sub _compare_output_directories {\n+    my ($self, $output_dir, $other_output_dir, $other_process) = @_;\n+\n+    my %diffs;\n+    File::DirCompare->compare(\n+        $other_output_dir,\n+        $output_dir,\n+        sub {\n+            my ($other_file, $file) = @_;\n+            my $template = 'no %s %s found for process %s';\n+            my $other_target = defined($other_file)? abs_path($other_file) : undef;\n+            my $target = defined($file) ? abs_path($file) : undef;\n+            if (! $target) {","path":"lib/perl/Genome/Process.pm","position":68,"original_position":68,"commit_id":"0b0043ace7112aadd56d8b01dc5827fafe5cc102","original_commit_id":"0b0043ace7112aadd56d8b01dc5827fafe5cc102","user":{"login":"nnutter","id":207011,"avatar_url":"https://avatars.githubusercontent.com/u/207011?v=3","gravatar_id":"","url":"https://api.github.com/users/nnutter","html_url":"https://github.com/nnutter","followers_url":"https://api.github.com/users/nnutter/followers","following_url":"https://api.github.com/users/nnutter/following{/other_user}","gists_url":"https://api.github.com/users/nnutter/gists{/gist_id}","starred_url":"https://api.github.com/users/nnutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nnutter/subscriptions","organizations_url":"https://api.github.com/users/nnutter/orgs","repos_url":"https://api.github.com/users/nnutter/repos","events_url":"https://api.github.com/users/nnutter/events{/privacy}","received_events_url":"https://api.github.com/users/nnutter/received_events","type":"User","site_admin":false},"body":"If I can assume that...\r\n\r\n1. the mixing of relative and absolute paths in the keys of `%diffs` was unintentional.\r\n1. the use of `$self->id` in the `!$other_target` was unintentional.\r\n\r\nThen the following ~25 lines can be simplified to,\r\n\r\n```\r\nif (! $target) {\r\n    my $type = ( -f $other_target ? 'file' : 'directory' );\r\n    my $rel_path = File::Spec->abs2rel($other_file, $other_output_dir);\r\n    $diffs{$rel_path} = sprintf($template, $type, $rel_path, $self->id);\r\n} elsif (! $other_target) {\r\n    my $type = ( -f $target ? 'file' : 'directory' );\r\n    my $rel_path = File::Spec->abs2rel($file, $output_dir);\r\n    $diffs{$rel_path} = sprintf($template, $type, $rel_path, $other_process->id);\r\n}\r\n```","created_at":"2015-01-09T18:22:18Z","updated_at":"2015-01-09T18:22:18Z","html_url":"https://github.com/genome/genome/pull/391#discussion_r22732703","pull_request_url":"https://api.github.com/repos/genome/genome/pulls/391","_links":{"self":{"href":"https://api.github.com/repos/genome/genome/pulls/comments/22732703"},"html":{"href":"https://github.com/genome/genome/pull/391#discussion_r22732703"},"pull_request":{"href":"https://api.github.com/repos/genome/genome/pulls/391"}}},"pull_request":{"url":"https://api.github.com/repos/genome/genome/pulls/391","id":26968354,"html_url":"https://github.com/genome/genome/pull/391","diff_url":"https://github.com/genome/genome/pull/391.diff","patch_url":"https://github.com/genome/genome/pull/391.patch","issue_url":"https://api.github.com/repos/genome/genome/issues/391","number":391,"state":"open","locked":false,"title":"Add functionality to compare Genome::Process output files","user":{"login":"susannasiebert","id":6617192,"avatar_url":"https://avatars.githubusercontent.com/u/6617192?v=3","gravatar_id":"","url":"https://api.github.com/users/susannasiebert","html_url":"https://github.com/susannasiebert","followers_url":"https://api.github.com/users/susannasiebert/followers","following_url":"https://api.github.com/users/susannasiebert/following{/other_user}","gists_url":"https://api.github.com/users/susannasiebert/gists{/gist_id}","starred_url":"https://api.github.com/users/susannasiebert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/susannasiebert/subscriptions","organizations_url":"https://api.github.com/users/susannasiebert/orgs","repos_url":"https://api.github.com/users/susannasiebert/repos","events_url":"https://api.github.com/users/susannasiebert/events{/privacy}","received_events_url":"https://api.github.com/users/susannasiebert/received_events","type":"User","site_admin":false},"body":"This PR supersedes https://github.com/genome/genome/pull/374.\r\n\r\nThis is a first step towards tackling https://jira.gsc.wustl.edu/browse/AT-680. This PR implements a compare_output subroutine for Genome::Process that would give a similar output to G::M::B::compare_output.\r\n\r\nIn this PR Genome::Process::_compare_output_files handles the comparison instead of being abstract and deferring the implementation to the child classes. It utilizes Genome::Process::symlink_results to symlink all the results of a process into one directory. Genome::Process::_compare_output_directories handles the actual comparison of those directories.","created_at":"2015-01-07T16:27:04Z","updated_at":"2015-01-09T18:22:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b6d658c81568b3c54595ca38fe98ea6c16028a50","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/genome/genome/pulls/391/commits","review_comments_url":"https://api.github.com/repos/genome/genome/pulls/391/comments","review_comment_url":"https://api.github.com/repos/genome/genome/pulls/comments/{number}","comments_url":"https://api.github.com/repos/genome/genome/issues/391/comments","statuses_url":"https://api.github.com/repos/genome/genome/statuses/0b0043ace7112aadd56d8b01dc5827fafe5cc102","head":{"label":"susannasiebert:process","ref":"process","sha":"0b0043ace7112aadd56d8b01dc5827fafe5cc102","user":{"login":"susannasiebert","id":6617192,"avatar_url":"https://avatars.githubusercontent.com/u/6617192?v=3","gravatar_id":"","url":"https://api.github.com/users/susannasiebert","html_url":"https://github.com/susannasiebert","followers_url":"https://api.github.com/users/susannasiebert/followers","following_url":"https://api.github.com/users/susannasiebert/following{/other_user}","gists_url":"https://api.github.com/users/susannasiebert/gists{/gist_id}","starred_url":"https://api.github.com/users/susannasiebert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/susannasiebert/subscriptions","organizations_url":"https://api.github.com/users/susannasiebert/orgs","repos_url":"https://api.github.com/users/susannasiebert/repos","events_url":"https://api.github.com/users/susannasiebert/events{/privacy}","received_events_url":"https://api.github.com/users/susannasiebert/received_events","type":"User","site_admin":false},"repo":{"id":23836901,"name":"genome","full_name":"susannasiebert/genome","owner":{"login":"susannasiebert","id":6617192,"avatar_url":"https://avatars.githubusercontent.com/u/6617192?v=3","gravatar_id":"","url":"https://api.github.com/users/susannasiebert","html_url":"https://github.com/susannasiebert","followers_url":"https://api.github.com/users/susannasiebert/followers","following_url":"https://api.github.com/users/susannasiebert/following{/other_user}","gists_url":"https://api.github.com/users/susannasiebert/gists{/gist_id}","starred_url":"https://api.github.com/users/susannasiebert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/susannasiebert/subscriptions","organizations_url":"https://api.github.com/users/susannasiebert/orgs","repos_url":"https://api.github.com/users/susannasiebert/repos","events_url":"https://api.github.com/users/susannasiebert/events{/privacy}","received_events_url":"https://api.github.com/users/susannasiebert/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/susannasiebert/genome","description":"","fork":true,"url":"https://api.github.com/repos/susannasiebert/genome","forks_url":"https://api.github.com/repos/susannasiebert/genome/forks","keys_url":"https://api.github.com/repos/susannasiebert/genome/keys{/key_id}","collaborators_url":"https://api.github.com/repos/susannasiebert/genome/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/susannasiebert/genome/teams","hooks_url":"https://api.github.com/repos/susannasiebert/genome/hooks","issue_events_url":"https://api.github.com/repos/susannasiebert/genome/issues/events{/number}","events_url":"https://api.github.com/repos/susannasiebert/genome/events","assignees_url":"https://api.github.com/repos/susannasiebert/genome/assignees{/user}","branches_url":"https://api.github.com/repos/susannasiebert/genome/branches{/branch}","tags_url":"https://api.github.com/repos/susannasiebert/genome/tags","blobs_url":"https://api.github.com/repos/susannasiebert/genome/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/susannasiebert/genome/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/susannasiebert/genome/git/refs{/sha}","trees_url":"https://api.github.com/repos/susannasiebert/genome/git/trees{/sha}","statuses_url":"https://api.github.com/repos/susannasiebert/genome/statuses/{sha}","languages_url":"https://api.github.com/repos/susannasiebert/genome/languages","stargazers_url":"https://api.github.com/repos/susannasiebert/genome/stargazers","contributors_url":"https://api.github.com/repos/susannasiebert/genome/contributors","subscribers_url":"https://api.github.com/repos/susannasiebert/genome/subscribers","subscription_url":"https://api.github.com/repos/susannasiebert/genome/subscription","commits_url":"https://api.github.com/repos/susannasiebert/genome/commits{/sha}","git_commits_url":"https://api.github.com/repos/susannasiebert/genome/git/commits{/sha}","comments_url":"https://api.github.com/repos/susannasiebert/genome/comments{/number}","issue_comment_url":"https://api.github.com/repos/susannasiebert/genome/issues/comments/{number}","contents_url":"https://api.github.com/repos/susannasiebert/genome/contents/{+path}","compare_url":"https://api.github.com/repos/susannasiebert/genome/compare/{base}...{head}","merges_url":"https://api.github.com/repos/susannasiebert/genome/merges","archive_url":"https://api.github.com/repos/susannasiebert/genome/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/susannasiebert/genome/downloads","issues_url":"https://api.github.com/repos/susannasiebert/genome/issues{/number}","pulls_url":"https://api.github.com/repos/susannasiebert/genome/pulls{/number}","milestones_url":"https://api.github.com/repos/susannasiebert/genome/milestones{/number}","notifications_url":"https://api.github.com/repos/susannasiebert/genome/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/susannasiebert/genome/labels{/name}","releases_url":"https://api.github.com/repos/susannasiebert/genome/releases{/id}","created_at":"2014-09-09T14:30:47Z","updated_at":"2014-09-10T06:51:41Z","pushed_at":"2015-01-09T17:37:18Z","git_url":"git://github.com/susannasiebert/genome.git","ssh_url":"git@github.com:susannasiebert/genome.git","clone_url":"https://github.com/susannasiebert/genome.git","svn_url":"https://github.com/susannasiebert/genome","homepage":"","size":109231,"stargazers_count":0,"watchers_count":0,"language":"Perl","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":"genome:master","ref":"master","sha":"105151eab532ea717ea86ef7a4f9c4da98ed1adc","user":{"login":"genome","id":318108,"avatar_url":"https://avatars.githubusercontent.com/u/318108?v=3","gravatar_id":"","url":"https://api.github.com/users/genome","html_url":"https://github.com/genome","followers_url":"https://api.github.com/users/genome/followers","following_url":"https://api.github.com/users/genome/following{/other_user}","gists_url":"https://api.github.com/users/genome/gists{/gist_id}","starred_url":"https://api.github.com/users/genome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/genome/subscriptions","organizations_url":"https://api.github.com/users/genome/orgs","repos_url":"https://api.github.com/users/genome/repos","events_url":"https://api.github.com/users/genome/events{/privacy}","received_events_url":"https://api.github.com/users/genome/received_events","type":"Organization","site_admin":false},"repo":{"id":23442737,"name":"genome","full_name":"genome/genome","owner":{"login":"genome","id":318108,"avatar_url":"https://avatars.githubusercontent.com/u/318108?v=3","gravatar_id":"","url":"https://api.github.com/users/genome","html_url":"https://github.com/genome","followers_url":"https://api.github.com/users/genome/followers","following_url":"https://api.github.com/users/genome/following{/other_user}","gists_url":"https://api.github.com/users/genome/gists{/gist_id}","starred_url":"https://api.github.com/users/genome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/genome/subscriptions","organizations_url":"https://api.github.com/users/genome/orgs","repos_url":"https://api.github.com/users/genome/repos","events_url":"https://api.github.com/users/genome/events{/privacy}","received_events_url":"https://api.github.com/users/genome/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/genome/genome","description":"Core modules used by the GMS","fork":false,"url":"https://api.github.com/repos/genome/genome","forks_url":"https://api.github.com/repos/genome/genome/forks","keys_url":"https://api.github.com/repos/genome/genome/keys{/key_id}","collaborators_url":"https://api.github.com/repos/genome/genome/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/genome/genome/teams","hooks_url":"https://api.github.com/repos/genome/genome/hooks","issue_events_url":"https://api.github.com/repos/genome/genome/issues/events{/number}","events_url":"https://api.github.com/repos/genome/genome/events","assignees_url":"https://api.github.com/repos/genome/genome/assignees{/user}","branches_url":"https://api.github.com/repos/genome/genome/branches{/branch}","tags_url":"https://api.github.com/repos/genome/genome/tags","blobs_url":"https://api.github.com/repos/genome/genome/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/genome/genome/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/genome/genome/git/refs{/sha}","trees_url":"https://api.github.com/repos/genome/genome/git/trees{/sha}","statuses_url":"https://api.github.com/repos/genome/genome/statuses/{sha}","languages_url":"https://api.github.com/repos/genome/genome/languages","stargazers_url":"https://api.github.com/repos/genome/genome/stargazers","contributors_url":"https://api.github.com/repos/genome/genome/contributors","subscribers_url":"https://api.github.com/repos/genome/genome/subscribers","subscription_url":"https://api.github.com/repos/genome/genome/subscription","commits_url":"https://api.github.com/repos/genome/genome/commits{/sha}","git_commits_url":"https://api.github.com/repos/genome/genome/git/commits{/sha}","comments_url":"https://api.github.com/repos/genome/genome/comments{/number}","issue_comment_url":"https://api.github.com/repos/genome/genome/issues/comments/{number}","contents_url":"https://api.github.com/repos/genome/genome/contents/{+path}","compare_url":"https://api.github.com/repos/genome/genome/compare/{base}...{head}","merges_url":"https://api.github.com/repos/genome/genome/merges","archive_url":"https://api.github.com/repos/genome/genome/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/genome/genome/downloads","issues_url":"https://api.github.com/repos/genome/genome/issues{/number}","pulls_url":"https://api.github.com/repos/genome/genome/pulls{/number}","milestones_url":"https://api.github.com/repos/genome/genome/milestones{/number}","notifications_url":"https://api.github.com/repos/genome/genome/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/genome/genome/labels{/name}","releases_url":"https://api.github.com/repos/genome/genome/releases{/id}","created_at":"2014-08-28T20:59:19Z","updated_at":"2015-01-09T15:37:16Z","pushed_at":"2015-01-09T16:28:54Z","git_url":"git://github.com/genome/genome.git","ssh_url":"git@github.com:genome/genome.git","clone_url":"https://github.com/genome/genome.git","svn_url":"https://github.com/genome/genome","homepage":"","size":117601,"stargazers_count":3,"watchers_count":3,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":7,"forks":32,"open_issues":7,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/genome/genome/pulls/391"},"html":{"href":"https://github.com/genome/genome/pull/391"},"issue":{"href":"https://api.github.com/repos/genome/genome/issues/391"},"comments":{"href":"https://api.github.com/repos/genome/genome/issues/391/comments"},"review_comments":{"href":"https://api.github.com/repos/genome/genome/pulls/391/comments"},"review_comment":{"href":"https://api.github.com/repos/genome/genome/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/genome/genome/pulls/391/commits"},"statuses":{"href":"https://api.github.com/repos/genome/genome/statuses/0b0043ace7112aadd56d8b01dc5827fafe5cc102"}}}}