{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/foreman_remote_execution/pulls/comments/168872354","pull_request_review_id":97319096,"id":168872354,"diff_hunk":"@@ -10,14 +10,34 @@ def new\n         :bookmark_id => params[:bookmark_id]\n       }\n     }\n-\n-    if (template = JobTemplate.find_by(id: params[:template_id]))\n+    template = (\n+      JobTemplate.find_by(id: params[:template_id]) ||\n+      RemoteExecutionFeature.find_by_label(params[:feature]).job_template\n+    )\n+    if template.present?\n       ui_params[:job_invocation] = {\n         :job_category => template.job_category,\n         :providers => {\n-          template.provider_type => {:job_template_id => template.id}\n+          template.provider_type => {\n+            :job_template_id => template.id\n+          }\n         }\n       }\n+      if params[:inputs].present?\n+        input_values = params[:inputs].permit!.to_hash.\n+          reduce({}) do |acc, input|","path":"app/controllers/job_invocations_controller.rb","position":22,"original_position":22,"commit_id":"3ac340c57a3771e304d03f20b0100cf612d46884","original_commit_id":"3ac340c57a3771e304d03f20b0100cf612d46884","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Align reduce with params[:inputs].permit!.to_hash. on line 27.","created_at":"2018-02-16T21:17:35Z","updated_at":"2018-02-16T21:17:35Z","html_url":"https://github.com/theforeman/foreman_remote_execution/pull/317#discussion_r168872354","pull_request_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/pulls/317","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman_remote_execution/pulls/comments/168872354"},"html":{"href":"https://github.com/theforeman/foreman_remote_execution/pull/317#discussion_r168872354"},"pull_request":{"href":"https://api.github.com/repos/theforeman/foreman_remote_execution/pulls/317"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/foreman_remote_execution/pulls/317","id":169656668,"html_url":"https://github.com/theforeman/foreman_remote_execution/pull/317","diff_url":"https://github.com/theforeman/foreman_remote_execution/pull/317.diff","patch_url":"https://github.com/theforeman/foreman_remote_execution/pull/317.patch","issue_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/issues/317","number":317,"state":"open","locked":false,"title":"Fixes #22604 - Accept input values as GET params in UI","user":{"login":"dLobatog","id":598891,"avatar_url":"https://avatars2.githubusercontent.com/u/598891?v=4","gravatar_id":"","url":"https://api.github.com/users/dLobatog","html_url":"https://github.com/dLobatog","followers_url":"https://api.github.com/users/dLobatog/followers","following_url":"https://api.github.com/users/dLobatog/following{/other_user}","gists_url":"https://api.github.com/users/dLobatog/gists{/gist_id}","starred_url":"https://api.github.com/users/dLobatog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dLobatog/subscriptions","organizations_url":"https://api.github.com/users/dLobatog/orgs","repos_url":"https://api.github.com/users/dLobatog/repos","events_url":"https://api.github.com/users/dLobatog/events{/privacy}","received_events_url":"https://api.github.com/users/dLobatog/received_events","type":"User","site_admin":false},"body":"The UI should accept template inputs through the URL to display\r\nthe JobInvocation new form with pre-filled fields.\r\n\r\nFor example,\r\nhttps://centos7-devel.lobatolan.home/job_invocations/new?feature=\r\nansible_run_insights_plan&inputs[plan_id]=3&inputs[organization_id]=20\r\nwould find the 'ansible_run_insights_plan' feature and 'plan_id' /\r\n'organization_id' as pre-filled fields.\r\n\r\n*WIP* - I need to add tests & a screencast to show how this works. It's pretty useful for https://github.com/redhataccess/foreman-plugin/","created_at":"2018-02-16T15:45:52Z","updated_at":"2018-02-16T21:17:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1edd9589ae95d070244705baf71210021741400","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":230713075,"url":"https://api.github.com/repos/theforeman/foreman_remote_execution/labels/Needs%20testing","name":"Needs testing","color":"fbca04","default":false},{"id":230713076,"url":"https://api.github.com/repos/theforeman/foreman_remote_execution/labels/Not%20yet%20reviewed","name":"Not yet reviewed","color":"009800","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/pulls/317/commits","review_comments_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/pulls/317/comments","review_comment_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/issues/317/comments","statuses_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/statuses/3ac340c57a3771e304d03f20b0100cf612d46884","head":{"label":"dLobatog:22604","ref":"22604","sha":"3ac340c57a3771e304d03f20b0100cf612d46884","user":{"login":"dLobatog","id":598891,"avatar_url":"https://avatars2.githubusercontent.com/u/598891?v=4","gravatar_id":"","url":"https://api.github.com/users/dLobatog","html_url":"https://github.com/dLobatog","followers_url":"https://api.github.com/users/dLobatog/followers","following_url":"https://api.github.com/users/dLobatog/following{/other_user}","gists_url":"https://api.github.com/users/dLobatog/gists{/gist_id}","starred_url":"https://api.github.com/users/dLobatog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dLobatog/subscriptions","organizations_url":"https://api.github.com/users/dLobatog/orgs","repos_url":"https://api.github.com/users/dLobatog/repos","events_url":"https://api.github.com/users/dLobatog/events{/privacy}","received_events_url":"https://api.github.com/users/dLobatog/received_events","type":"User","site_admin":false},"repo":{"id":44591925,"name":"foreman_remote_execution","full_name":"dLobatog/foreman_remote_execution","owner":{"login":"dLobatog","id":598891,"avatar_url":"https://avatars2.githubusercontent.com/u/598891?v=4","gravatar_id":"","url":"https://api.github.com/users/dLobatog","html_url":"https://github.com/dLobatog","followers_url":"https://api.github.com/users/dLobatog/followers","following_url":"https://api.github.com/users/dLobatog/following{/other_user}","gists_url":"https://api.github.com/users/dLobatog/gists{/gist_id}","starred_url":"https://api.github.com/users/dLobatog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dLobatog/subscriptions","organizations_url":"https://api.github.com/users/dLobatog/orgs","repos_url":"https://api.github.com/users/dLobatog/repos","events_url":"https://api.github.com/users/dLobatog/events{/privacy}","received_events_url":"https://api.github.com/users/dLobatog/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dLobatog/foreman_remote_execution","description":"A plugin bringing remote execution to the Foreman, completing the config management functionality with remote management functionality","fork":true,"url":"https://api.github.com/repos/dLobatog/foreman_remote_execution","forks_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/forks","keys_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/teams","hooks_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/hooks","issue_events_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/issues/events{/number}","events_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/events","assignees_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/assignees{/user}","branches_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/branches{/branch}","tags_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/tags","blobs_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/git/refs{/sha}","trees_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/statuses/{sha}","languages_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/languages","stargazers_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/stargazers","contributors_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/contributors","subscribers_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/subscribers","subscription_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/subscription","commits_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/commits{/sha}","git_commits_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/git/commits{/sha}","comments_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/comments{/number}","issue_comment_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/issues/comments{/number}","contents_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/contents/{+path}","compare_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/merges","archive_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/downloads","issues_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/issues{/number}","pulls_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/pulls{/number}","milestones_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/milestones{/number}","notifications_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/labels{/name}","releases_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/releases{/id}","deployments_url":"https://api.github.com/repos/dLobatog/foreman_remote_execution/deployments","created_at":"2015-10-20T08:17:17Z","updated_at":"2016-01-13T00:22:22Z","pushed_at":"2018-02-16T21:16:49Z","git_url":"git://github.com/dLobatog/foreman_remote_execution.git","ssh_url":"git@github.com:dLobatog/foreman_remote_execution.git","clone_url":"https://github.com/dLobatog/foreman_remote_execution.git","svn_url":"https://github.com/dLobatog/foreman_remote_execution","homepage":"","size":2682,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"theforeman:master","ref":"master","sha":"40931e5d34bf885f8014f4ef5e50ab21639730f2","user":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars2.githubusercontent.com/u/1439844?v=4","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"repo":{"id":34800230,"name":"foreman_remote_execution","full_name":"theforeman/foreman_remote_execution","owner":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars2.githubusercontent.com/u/1439844?v=4","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/theforeman/foreman_remote_execution","description":"A plugin bringing remote execution to the Foreman, completing the config management functionality with remote management functionality","fork":false,"url":"https://api.github.com/repos/theforeman/foreman_remote_execution","forks_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/forks","keys_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/teams","hooks_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/hooks","issue_events_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/issues/events{/number}","events_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/events","assignees_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/assignees{/user}","branches_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/branches{/branch}","tags_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/tags","blobs_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/git/refs{/sha}","trees_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/statuses/{sha}","languages_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/languages","stargazers_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/stargazers","contributors_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/contributors","subscribers_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/subscribers","subscription_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/subscription","commits_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/commits{/sha}","git_commits_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/git/commits{/sha}","comments_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/comments{/number}","issue_comment_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/issues/comments{/number}","contents_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/contents/{+path}","compare_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/merges","archive_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/downloads","issues_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/issues{/number}","pulls_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/pulls{/number}","milestones_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/milestones{/number}","notifications_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/labels{/name}","releases_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/releases{/id}","deployments_url":"https://api.github.com/repos/theforeman/foreman_remote_execution/deployments","created_at":"2015-04-29T14:57:15Z","updated_at":"2017-10-26T14:09:23Z","pushed_at":"2018-02-16T21:16:50Z","git_url":"git://github.com/theforeman/foreman_remote_execution.git","ssh_url":"git@github.com:theforeman/foreman_remote_execution.git","clone_url":"https://github.com/theforeman/foreman_remote_execution.git","svn_url":"https://github.com/theforeman/foreman_remote_execution","homepage":"","size":2713,"stargazers_count":15,"watchers_count":15,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":40,"mirror_url":null,"archived":false,"open_issues_count":16,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":40,"open_issues":16,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman_remote_execution/pulls/317"},"html":{"href":"https://github.com/theforeman/foreman_remote_execution/pull/317"},"issue":{"href":"https://api.github.com/repos/theforeman/foreman_remote_execution/issues/317"},"comments":{"href":"https://api.github.com/repos/theforeman/foreman_remote_execution/issues/317/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/foreman_remote_execution/pulls/317/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/foreman_remote_execution/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theforeman/foreman_remote_execution/pulls/317/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/foreman_remote_execution/statuses/3ac340c57a3771e304d03f20b0100cf612d46884"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"houndci-bot"}}