{"action":"created","comment":{"url":"https://api.github.com/repos/os-autoinst/openQA/pulls/comments/25565845","id":25565845,"diff_hunk":"@@ -0,0 +1,47 @@\n+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.\n+#\n+# This program is free software; you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation; either version 2 of the License, or\n+# (at your option) any later version.\n+#\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License along\n+# with this program; if not, see <http://www.gnu.org/licenses/>.\n+\n+package OpenQA::Controller::API::V1::Mm;\n+use Mojo::Base 'Mojolicious::Controller';\n+\n+use strict;\n+use warnings;\n+\n+use OpenQA::Schema::Result::Jobs;\n+\n+sub get_children_status {\n+    my ($self) = @_;\n+    my $status = $self->stash('status');\n+    if ($status eq 'running') {\n+        $status = OpenQA::Schema::Result::Jobs::RUNNING;\n+    }\n+    elsif ($status eq 'scheduled') {\n+        $status = OpenQA::Schema::Result::Jobs::SCHEDULED;\n+    }\n+    else {\n+        $status = OpenQA::Schema::Result::Jobs::DONE;\n+    }\n+    my $jobid = $self->stash('job_id');\n+\n+    my $res = $self->app->db->resultset('Jobs')->single({'id' => $jobid});\n+    if ($res) {","path":"lib/OpenQA/Controller/API/V1/Mm.pm","position":39,"original_position":39,"commit_id":"468341a11ed6e819aa34525a2039dc4858da68fa","original_commit_id":"468341a11ed6e819aa34525a2039dc4858da68fa","user":{"login":"aaannz","id":1260795,"avatar_url":"https://avatars.githubusercontent.com/u/1260795?v=3","gravatar_id":"","url":"https://api.github.com/users/aaannz","html_url":"https://github.com/aaannz","followers_url":"https://api.github.com/users/aaannz/followers","following_url":"https://api.github.com/users/aaannz/following{/other_user}","gists_url":"https://api.github.com/users/aaannz/gists{/gist_id}","starred_url":"https://api.github.com/users/aaannz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaannz/subscriptions","organizations_url":"https://api.github.com/users/aaannz/orgs","repos_url":"https://api.github.com/users/aaannz/repos","events_url":"https://api.github.com/users/aaannz/events{/privacy}","received_events_url":"https://api.github.com/users/aaannz/received_events","type":"User","site_admin":false},"body":"In this case I guess so. If I understand doc correctly, 'find' uses 'single' instead of 'search', but 'find' also iterates through all unique columns if column name is not supplied.","created_at":"2015-03-01T09:55:15Z","updated_at":"2015-03-01T09:55:15Z","html_url":"https://github.com/os-autoinst/openQA/pull/206#discussion_r25565845","pull_request_url":"https://api.github.com/repos/os-autoinst/openQA/pulls/206","_links":{"self":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/comments/25565845"},"html":{"href":"https://github.com/os-autoinst/openQA/pull/206#discussion_r25565845"},"pull_request":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/206"}}},"pull_request":{"url":"https://api.github.com/repos/os-autoinst/openQA/pulls/206","id":30168423,"html_url":"https://github.com/os-autoinst/openQA/pull/206","diff_url":"https://github.com/os-autoinst/openQA/pull/206.diff","patch_url":"https://github.com/os-autoinst/openQA/pull/206.patch","issue_url":"https://api.github.com/repos/os-autoinst/openQA/issues/206","number":206,"state":"open","locked":false,"title":"add checking for children status","user":{"login":"aaannz","id":1260795,"avatar_url":"https://avatars.githubusercontent.com/u/1260795?v=3","gravatar_id":"","url":"https://api.github.com/users/aaannz","html_url":"https://github.com/aaannz","followers_url":"https://api.github.com/users/aaannz/followers","following_url":"https://api.github.com/users/aaannz/following{/other_user}","gists_url":"https://api.github.com/users/aaannz/gists{/gist_id}","starred_url":"https://api.github.com/users/aaannz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaannz/subscriptions","organizations_url":"https://api.github.com/users/aaannz/orgs","repos_url":"https://api.github.com/users/aaannz/repos","events_url":"https://api.github.com/users/aaannz/events{/privacy}","received_events_url":"https://api.github.com/users/aaannz/received_events","type":"User","site_admin":false},"body":"- /api/v1/mm/children/[running|scheduled|done]\r\n  + uses jobtoken auth\r\n  + returns JSON {jobs => [jobids]} or 404 when job not found (can't\r\n  happen currently, but after preforking everything is possible)\r\n- test included\r\n- added as first snippet of potential MultiMachine API","created_at":"2015-02-27T14:10:34Z","updated_at":"2015-03-01T09:55:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"408040cc612194ae3b7bd80c383152339e31c72a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/os-autoinst/openQA/pulls/206/commits","review_comments_url":"https://api.github.com/repos/os-autoinst/openQA/pulls/206/comments","review_comment_url":"https://api.github.com/repos/os-autoinst/openQA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/os-autoinst/openQA/issues/206/comments","statuses_url":"https://api.github.com/repos/os-autoinst/openQA/statuses/468341a11ed6e819aa34525a2039dc4858da68fa","head":{"label":"aaannz:mm_api","ref":"mm_api","sha":"468341a11ed6e819aa34525a2039dc4858da68fa","user":{"login":"aaannz","id":1260795,"avatar_url":"https://avatars.githubusercontent.com/u/1260795?v=3","gravatar_id":"","url":"https://api.github.com/users/aaannz","html_url":"https://github.com/aaannz","followers_url":"https://api.github.com/users/aaannz/followers","following_url":"https://api.github.com/users/aaannz/following{/other_user}","gists_url":"https://api.github.com/users/aaannz/gists{/gist_id}","starred_url":"https://api.github.com/users/aaannz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaannz/subscriptions","organizations_url":"https://api.github.com/users/aaannz/orgs","repos_url":"https://api.github.com/users/aaannz/repos","events_url":"https://api.github.com/users/aaannz/events{/privacy}","received_events_url":"https://api.github.com/users/aaannz/received_events","type":"User","site_admin":false},"repo":{"id":20956890,"name":"openQA","full_name":"aaannz/openQA","owner":{"login":"aaannz","id":1260795,"avatar_url":"https://avatars.githubusercontent.com/u/1260795?v=3","gravatar_id":"","url":"https://api.github.com/users/aaannz","html_url":"https://github.com/aaannz","followers_url":"https://api.github.com/users/aaannz/followers","following_url":"https://api.github.com/users/aaannz/following{/other_user}","gists_url":"https://api.github.com/users/aaannz/gists{/gist_id}","starred_url":"https://api.github.com/users/aaannz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaannz/subscriptions","organizations_url":"https://api.github.com/users/aaannz/orgs","repos_url":"https://api.github.com/users/aaannz/repos","events_url":"https://api.github.com/users/aaannz/events{/privacy}","received_events_url":"https://api.github.com/users/aaannz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aaannz/openQA","description":"openQA web-frontend, scheduler and tools","fork":true,"url":"https://api.github.com/repos/aaannz/openQA","forks_url":"https://api.github.com/repos/aaannz/openQA/forks","keys_url":"https://api.github.com/repos/aaannz/openQA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aaannz/openQA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aaannz/openQA/teams","hooks_url":"https://api.github.com/repos/aaannz/openQA/hooks","issue_events_url":"https://api.github.com/repos/aaannz/openQA/issues/events{/number}","events_url":"https://api.github.com/repos/aaannz/openQA/events","assignees_url":"https://api.github.com/repos/aaannz/openQA/assignees{/user}","branches_url":"https://api.github.com/repos/aaannz/openQA/branches{/branch}","tags_url":"https://api.github.com/repos/aaannz/openQA/tags","blobs_url":"https://api.github.com/repos/aaannz/openQA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aaannz/openQA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aaannz/openQA/git/refs{/sha}","trees_url":"https://api.github.com/repos/aaannz/openQA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aaannz/openQA/statuses/{sha}","languages_url":"https://api.github.com/repos/aaannz/openQA/languages","stargazers_url":"https://api.github.com/repos/aaannz/openQA/stargazers","contributors_url":"https://api.github.com/repos/aaannz/openQA/contributors","subscribers_url":"https://api.github.com/repos/aaannz/openQA/subscribers","subscription_url":"https://api.github.com/repos/aaannz/openQA/subscription","commits_url":"https://api.github.com/repos/aaannz/openQA/commits{/sha}","git_commits_url":"https://api.github.com/repos/aaannz/openQA/git/commits{/sha}","comments_url":"https://api.github.com/repos/aaannz/openQA/comments{/number}","issue_comment_url":"https://api.github.com/repos/aaannz/openQA/issues/comments{/number}","contents_url":"https://api.github.com/repos/aaannz/openQA/contents/{+path}","compare_url":"https://api.github.com/repos/aaannz/openQA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aaannz/openQA/merges","archive_url":"https://api.github.com/repos/aaannz/openQA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aaannz/openQA/downloads","issues_url":"https://api.github.com/repos/aaannz/openQA/issues{/number}","pulls_url":"https://api.github.com/repos/aaannz/openQA/pulls{/number}","milestones_url":"https://api.github.com/repos/aaannz/openQA/milestones{/number}","notifications_url":"https://api.github.com/repos/aaannz/openQA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aaannz/openQA/labels{/name}","releases_url":"https://api.github.com/repos/aaannz/openQA/releases{/id}","created_at":"2014-06-18T09:33:35Z","updated_at":"2015-01-28T14:57:48Z","pushed_at":"2015-02-27T16:07:52Z","git_url":"git://github.com/aaannz/openQA.git","ssh_url":"git@github.com:aaannz/openQA.git","clone_url":"https://github.com/aaannz/openQA.git","svn_url":"https://github.com/aaannz/openQA","homepage":"http://openqa.opensuse.org/","size":13007,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"os-autoinst:master","ref":"master","sha":"4c50f8ac72acc15a2af1c69d73fb2ed1dbff7ec3","user":{"login":"os-autoinst","id":6918706,"avatar_url":"https://avatars.githubusercontent.com/u/6918706?v=3","gravatar_id":"","url":"https://api.github.com/users/os-autoinst","html_url":"https://github.com/os-autoinst","followers_url":"https://api.github.com/users/os-autoinst/followers","following_url":"https://api.github.com/users/os-autoinst/following{/other_user}","gists_url":"https://api.github.com/users/os-autoinst/gists{/gist_id}","starred_url":"https://api.github.com/users/os-autoinst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/os-autoinst/subscriptions","organizations_url":"https://api.github.com/users/os-autoinst/orgs","repos_url":"https://api.github.com/users/os-autoinst/repos","events_url":"https://api.github.com/users/os-autoinst/events{/privacy}","received_events_url":"https://api.github.com/users/os-autoinst/received_events","type":"Organization","site_admin":false},"repo":{"id":20883829,"name":"openQA","full_name":"os-autoinst/openQA","owner":{"login":"os-autoinst","id":6918706,"avatar_url":"https://avatars.githubusercontent.com/u/6918706?v=3","gravatar_id":"","url":"https://api.github.com/users/os-autoinst","html_url":"https://github.com/os-autoinst","followers_url":"https://api.github.com/users/os-autoinst/followers","following_url":"https://api.github.com/users/os-autoinst/following{/other_user}","gists_url":"https://api.github.com/users/os-autoinst/gists{/gist_id}","starred_url":"https://api.github.com/users/os-autoinst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/os-autoinst/subscriptions","organizations_url":"https://api.github.com/users/os-autoinst/orgs","repos_url":"https://api.github.com/users/os-autoinst/repos","events_url":"https://api.github.com/users/os-autoinst/events{/privacy}","received_events_url":"https://api.github.com/users/os-autoinst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/os-autoinst/openQA","description":"openQA web-frontend, scheduler and tools","fork":false,"url":"https://api.github.com/repos/os-autoinst/openQA","forks_url":"https://api.github.com/repos/os-autoinst/openQA/forks","keys_url":"https://api.github.com/repos/os-autoinst/openQA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/os-autoinst/openQA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/os-autoinst/openQA/teams","hooks_url":"https://api.github.com/repos/os-autoinst/openQA/hooks","issue_events_url":"https://api.github.com/repos/os-autoinst/openQA/issues/events{/number}","events_url":"https://api.github.com/repos/os-autoinst/openQA/events","assignees_url":"https://api.github.com/repos/os-autoinst/openQA/assignees{/user}","branches_url":"https://api.github.com/repos/os-autoinst/openQA/branches{/branch}","tags_url":"https://api.github.com/repos/os-autoinst/openQA/tags","blobs_url":"https://api.github.com/repos/os-autoinst/openQA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/os-autoinst/openQA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/os-autoinst/openQA/git/refs{/sha}","trees_url":"https://api.github.com/repos/os-autoinst/openQA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/os-autoinst/openQA/statuses/{sha}","languages_url":"https://api.github.com/repos/os-autoinst/openQA/languages","stargazers_url":"https://api.github.com/repos/os-autoinst/openQA/stargazers","contributors_url":"https://api.github.com/repos/os-autoinst/openQA/contributors","subscribers_url":"https://api.github.com/repos/os-autoinst/openQA/subscribers","subscription_url":"https://api.github.com/repos/os-autoinst/openQA/subscription","commits_url":"https://api.github.com/repos/os-autoinst/openQA/commits{/sha}","git_commits_url":"https://api.github.com/repos/os-autoinst/openQA/git/commits{/sha}","comments_url":"https://api.github.com/repos/os-autoinst/openQA/comments{/number}","issue_comment_url":"https://api.github.com/repos/os-autoinst/openQA/issues/comments{/number}","contents_url":"https://api.github.com/repos/os-autoinst/openQA/contents/{+path}","compare_url":"https://api.github.com/repos/os-autoinst/openQA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/os-autoinst/openQA/merges","archive_url":"https://api.github.com/repos/os-autoinst/openQA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/os-autoinst/openQA/downloads","issues_url":"https://api.github.com/repos/os-autoinst/openQA/issues{/number}","pulls_url":"https://api.github.com/repos/os-autoinst/openQA/pulls{/number}","milestones_url":"https://api.github.com/repos/os-autoinst/openQA/milestones{/number}","notifications_url":"https://api.github.com/repos/os-autoinst/openQA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/os-autoinst/openQA/labels{/name}","releases_url":"https://api.github.com/repos/os-autoinst/openQA/releases{/id}","created_at":"2014-06-16T12:23:22Z","updated_at":"2015-02-28T06:00:33Z","pushed_at":"2015-02-28T21:12:26Z","git_url":"git://github.com/os-autoinst/openQA.git","ssh_url":"git@github.com:os-autoinst/openQA.git","clone_url":"https://github.com/os-autoinst/openQA.git","svn_url":"https://github.com/os-autoinst/openQA","homepage":"http://openqa.opensuse.org/","size":15198,"stargazers_count":12,"watchers_count":12,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":18,"mirror_url":null,"open_issues_count":6,"forks":18,"open_issues":6,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/206"},"html":{"href":"https://github.com/os-autoinst/openQA/pull/206"},"issue":{"href":"https://api.github.com/repos/os-autoinst/openQA/issues/206"},"comments":{"href":"https://api.github.com/repos/os-autoinst/openQA/issues/206/comments"},"review_comments":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/206/comments"},"review_comment":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/206/commits"},"statuses":{"href":"https://api.github.com/repos/os-autoinst/openQA/statuses/468341a11ed6e819aa34525a2039dc4858da68fa"}}}}