{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/comments/221900966","pull_request_review_id":160658364,"id":221900966,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTkwMDk2Ng==","diff_hunk":"@@ -103,12 +103,19 @@ def export\n         send_data @report_template.to_erb, :type => 'text/plain', :disposition => 'attachment', :filename => @report_template.filename\n       end\n \n-      api :GET, \"/report_templates/:id/generate/\", N_(\"Generate a report template\")\n+      api :POST, \"/report_templates/:id/generate/\", N_(\"Generate a report template\")\n       param :id, :identifier, :required => true\n+      param :input_values, Hash, :desc => N_('Hash of input values where key is the name of input, value is the value for this input')\n \n       def generate\n-        response = @report_template.render(params: params)\n-        send_data response, :filename => @report_template.suggested_report_name.to_s\n+        @composer = ReportComposer.from_api_params(params)\n+        if @composer.valid?\n+          response = @report_template.render(params: params, template_input_values: @composer.template_input_values)\n+          send_data response, :filename => @report_template.suggested_report_name.to_s\n+        else\n+          @report_template = @composer\n+          process_resource_error :resource => @composer","path":"app/controllers/api/v2/report_templates_controller.rb","position":18,"original_position":18,"commit_id":"3eb72d8b8e713bf6f6f91c3bfdbbeac8eb30de52","original_commit_id":"3eb72d8b8e713bf6f6f91c3bfdbbeac8eb30de52","user":{"login":"ares","id":109773,"node_id":"MDQ6VXNlcjEwOTc3Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/109773?v=4","gravatar_id":"","url":"https://api.github.com/users/ares","html_url":"https://github.com/ares","followers_url":"https://api.github.com/users/ares/followers","following_url":"https://api.github.com/users/ares/following{/other_user}","gists_url":"https://api.github.com/users/ares/gists{/gist_id}","starred_url":"https://api.github.com/users/ares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ares/subscriptions","organizations_url":"https://api.github.com/users/ares/orgs","repos_url":"https://api.github.com/users/ares/repos","events_url":"https://api.github.com/users/ares/events{/privacy}","received_events_url":"https://api.github.com/users/ares/received_events","type":"User","site_admin":false},"body":"no longer needed even this, thanks to `@report_template = @composer`","created_at":"2018-10-02T10:35:43Z","updated_at":"2018-10-02T10:35:43Z","html_url":"https://github.com/theforeman/foreman/pull/5961#discussion_r221900966","pull_request_url":"https://api.github.com/repos/theforeman/foreman/pulls/5961","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments/221900966"},"html":{"href":"https://github.com/theforeman/foreman/pull/5961#discussion_r221900966"},"pull_request":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/5961"}},"in_reply_to_id":221597174},"pull_request":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/5961","id":209290749,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5MjkwNzQ5","html_url":"https://github.com/theforeman/foreman/pull/5961","diff_url":"https://github.com/theforeman/foreman/pull/5961.diff","patch_url":"https://github.com/theforeman/foreman/pull/5961.patch","issue_url":"https://api.github.com/repos/theforeman/foreman/issues/5961","number":5961,"state":"open","locked":false,"title":"[WIP] Template inputs","user":{"login":"ares","id":109773,"node_id":"MDQ6VXNlcjEwOTc3Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/109773?v=4","gravatar_id":"","url":"https://api.github.com/users/ares","html_url":"https://github.com/ares","followers_url":"https://api.github.com/users/ares/followers","following_url":"https://api.github.com/users/ares/following{/other_user}","gists_url":"https://api.github.com/users/ares/gists{/gist_id}","starred_url":"https://api.github.com/users/ares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ares/subscriptions","organizations_url":"https://api.github.com/users/ares/orgs","repos_url":"https://api.github.com/users/ares/repos","events_url":"https://api.github.com/users/ares/events{/privacy}","received_events_url":"https://api.github.com/users/ares/received_events","type":"User","site_admin":false},"body":"\r\n<!---\r\n\r\nThank you for contributing to The Foreman, please read the\r\n[following guide](https://www.theforeman.org/contribute.html), in short:\r\n\r\n* [Create an issue](https://projects.theforeman.org/projects/foreman/issues)\r\n* Reference the issue via `Fixes #1234` in the commit message\r\n* Prefer present-tense, imperative-style commit messages\r\n* Mark all strings for translation, see [Translating section in the guide]\r\n(https://projects.theforeman.org/projects/foreman/wiki/Translating)\r\n* Prepend `[WIP]` for work in progress to prevent bots from triggering actions\r\n* Be patient, we will do our best to take a look as soon as we can\r\n* Explain the purpose of the PR, attach screenshots if applicable\r\n* Be nice and respectful\r\n\r\nWe are running bots that will poke you if you miss an item from the list :-)\r\n\r\n--->\r\n","created_at":"2018-08-18T02:48:44Z","updated_at":"2018-10-02T10:35:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fcec3200019170a81dd7f466e1c06afc55887018","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":79040689,"node_id":"MDU6TGFiZWw3OTA0MDY4OQ==","url":"https://api.github.com/repos/theforeman/foreman/labels/Needs%20testing","name":"Needs testing","color":"fbca04","default":false},{"id":79040111,"node_id":"MDU6TGFiZWw3OTA0MDExMQ==","url":"https://api.github.com/repos/theforeman/foreman/labels/Waiting%20on%20contributor","name":"Waiting on contributor","color":"f7c6c7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/foreman/pulls/5961/commits","review_comments_url":"https://api.github.com/repos/theforeman/foreman/pulls/5961/comments","review_comment_url":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theforeman/foreman/issues/5961/comments","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/3eb72d8b8e713bf6f6f91c3bfdbbeac8eb30de52","head":{"label":"ares:template_inputs_other_way","ref":"template_inputs_other_way","sha":"3eb72d8b8e713bf6f6f91c3bfdbbeac8eb30de52","user":{"login":"ares","id":109773,"node_id":"MDQ6VXNlcjEwOTc3Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/109773?v=4","gravatar_id":"","url":"https://api.github.com/users/ares","html_url":"https://github.com/ares","followers_url":"https://api.github.com/users/ares/followers","following_url":"https://api.github.com/users/ares/following{/other_user}","gists_url":"https://api.github.com/users/ares/gists{/gist_id}","starred_url":"https://api.github.com/users/ares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ares/subscriptions","organizations_url":"https://api.github.com/users/ares/orgs","repos_url":"https://api.github.com/users/ares/repos","events_url":"https://api.github.com/users/ares/events{/privacy}","received_events_url":"https://api.github.com/users/ares/received_events","type":"User","site_admin":false},"repo":{"id":8576886,"node_id":"MDEwOlJlcG9zaXRvcnk4NTc2ODg2","name":"foreman","full_name":"ares/foreman","private":false,"owner":{"login":"ares","id":109773,"node_id":"MDQ6VXNlcjEwOTc3Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/109773?v=4","gravatar_id":"","url":"https://api.github.com/users/ares","html_url":"https://github.com/ares","followers_url":"https://api.github.com/users/ares/followers","following_url":"https://api.github.com/users/ares/following{/other_user}","gists_url":"https://api.github.com/users/ares/gists{/gist_id}","starred_url":"https://api.github.com/users/ares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ares/subscriptions","organizations_url":"https://api.github.com/users/ares/orgs","repos_url":"https://api.github.com/users/ares/repos","events_url":"https://api.github.com/users/ares/events{/privacy}","received_events_url":"https://api.github.com/users/ares/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ares/foreman","description":"an application that automates the lifecycle of servers ","fork":true,"url":"https://api.github.com/repos/ares/foreman","forks_url":"https://api.github.com/repos/ares/foreman/forks","keys_url":"https://api.github.com/repos/ares/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ares/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ares/foreman/teams","hooks_url":"https://api.github.com/repos/ares/foreman/hooks","issue_events_url":"https://api.github.com/repos/ares/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/ares/foreman/events","assignees_url":"https://api.github.com/repos/ares/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/ares/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/ares/foreman/tags","blobs_url":"https://api.github.com/repos/ares/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ares/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ares/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/ares/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ares/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/ares/foreman/languages","stargazers_url":"https://api.github.com/repos/ares/foreman/stargazers","contributors_url":"https://api.github.com/repos/ares/foreman/contributors","subscribers_url":"https://api.github.com/repos/ares/foreman/subscribers","subscription_url":"https://api.github.com/repos/ares/foreman/subscription","commits_url":"https://api.github.com/repos/ares/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/ares/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/ares/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/ares/foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/ares/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/ares/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ares/foreman/merges","archive_url":"https://api.github.com/repos/ares/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ares/foreman/downloads","issues_url":"https://api.github.com/repos/ares/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/ares/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/ares/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/ares/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ares/foreman/labels{/name}","releases_url":"https://api.github.com/repos/ares/foreman/releases{/id}","deployments_url":"https://api.github.com/repos/ares/foreman/deployments","created_at":"2013-03-05T09:59:59Z","updated_at":"2018-08-06T11:27:48Z","pushed_at":"2018-10-01T08:45:04Z","git_url":"git://github.com/ares/foreman.git","ssh_url":"git@github.com:ares/foreman.git","clone_url":"https://github.com/ares/foreman.git","svn_url":"https://github.com/ares/foreman","homepage":"http://theforeman.org","size":65761,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"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","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"theforeman:develop","ref":"develop","sha":"42febfe84e896fbacdd84d72294430a1ee82ce69","user":{"login":"theforeman","id":1439844,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0Mzk4NDQ=","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":258750,"node_id":"MDEwOlJlcG9zaXRvcnkyNTg3NTA=","name":"foreman","full_name":"theforeman/foreman","private":false,"owner":{"login":"theforeman","id":1439844,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0Mzk4NDQ=","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},"html_url":"https://github.com/theforeman/foreman","description":"an application that automates the lifecycle of servers ","fork":false,"url":"https://api.github.com/repos/theforeman/foreman","forks_url":"https://api.github.com/repos/theforeman/foreman/forks","keys_url":"https://api.github.com/repos/theforeman/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theforeman/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theforeman/foreman/teams","hooks_url":"https://api.github.com/repos/theforeman/foreman/hooks","issue_events_url":"https://api.github.com/repos/theforeman/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/theforeman/foreman/events","assignees_url":"https://api.github.com/repos/theforeman/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/theforeman/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/theforeman/foreman/tags","blobs_url":"https://api.github.com/repos/theforeman/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theforeman/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theforeman/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/theforeman/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/theforeman/foreman/languages","stargazers_url":"https://api.github.com/repos/theforeman/foreman/stargazers","contributors_url":"https://api.github.com/repos/theforeman/foreman/contributors","subscribers_url":"https://api.github.com/repos/theforeman/foreman/subscribers","subscription_url":"https://api.github.com/repos/theforeman/foreman/subscription","commits_url":"https://api.github.com/repos/theforeman/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/theforeman/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/theforeman/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/theforeman/foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/theforeman/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/theforeman/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theforeman/foreman/merges","archive_url":"https://api.github.com/repos/theforeman/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theforeman/foreman/downloads","issues_url":"https://api.github.com/repos/theforeman/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/theforeman/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/theforeman/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/theforeman/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theforeman/foreman/labels{/name}","releases_url":"https://api.github.com/repos/theforeman/foreman/releases{/id}","deployments_url":"https://api.github.com/repos/theforeman/foreman/deployments","created_at":"2009-07-23T15:07:00Z","updated_at":"2018-10-02T10:17:54Z","pushed_at":"2018-10-02T10:17:32Z","git_url":"git://github.com/theforeman/foreman.git","ssh_url":"git@github.com:theforeman/foreman.git","clone_url":"https://github.com/theforeman/foreman.git","svn_url":"https://github.com/theforeman/foreman","homepage":"http://theforeman.org","size":81468,"stargazers_count":1510,"watchers_count":1510,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":755,"mirror_url":null,"archived":false,"open_issues_count":133,"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","node_id":"MDc6TGljZW5zZTk="},"forks":755,"open_issues":133,"watchers":1510,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/5961"},"html":{"href":"https://github.com/theforeman/foreman/pull/5961"},"issue":{"href":"https://api.github.com/repos/theforeman/foreman/issues/5961"},"comments":{"href":"https://api.github.com/repos/theforeman/foreman/issues/5961/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/5961/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/5961/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/foreman/statuses/3eb72d8b8e713bf6f6f91c3bfdbbeac8eb30de52"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ares"}}