{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/comments/102676677","pull_request_review_id":23436764,"id":102676677,"diff_hunk":"@@ -0,0 +1,71 @@\n+require 'fileutils'\n+\n+module Foreman\n+  class Dynflow::Daemon\n+    # load the Rails environment and initialize the executor\n+    # in this thread.\n+    def run(foreman_root = Dir.pwd)\n+      STDERR.puts('Starting Rails environment')","path":"lib/foreman/dynflow/daemon.rb","position":8,"original_position":8,"commit_id":"8a486d154dc4e825a80b91d1f437b234a193b3cb","original_commit_id":"8a486d154dc4e825a80b91d1f437b234a193b3cb","user":{"login":"dLobatog","id":598891,"avatar_url":"https://avatars.githubusercontent.com/u/598891?v=3","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":"Carelessness, no good reason. Will change.","created_at":"2017-02-23T09:56:24Z","updated_at":"2017-02-23T09:56:24Z","html_url":"https://github.com/theforeman/foreman/pull/4316#discussion_r102676677","pull_request_url":"https://api.github.com/repos/theforeman/foreman/pulls/4316","_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments/102676677"},"html":{"href":"https://github.com/theforeman/foreman/pull/4316#discussion_r102676677"},"pull_request":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/4316"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/4316","id":107353493,"html_url":"https://github.com/theforeman/foreman/pull/4316","diff_url":"https://github.com/theforeman/foreman/pull/4316.diff","patch_url":"https://github.com/theforeman/foreman/pull/4316.patch","issue_url":"https://api.github.com/repos/theforeman/foreman/issues/4316","number":4316,"state":"open","locked":false,"title":"Fixes #18618 - Use Dynflow as an ActiveJob backend","user":{"login":"dLobatog","id":598891,"avatar_url":"https://avatars.githubusercontent.com/u/598891?v=3","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":"This commit initializes the Dynflow world in a very similar manner to\r\nforeman-tasks (if a Dynflow world is available from foreman-tasks, we\r\nuse that one). \r\n\r\nThis requires https://github.com/Dynflow/dynflow/pull/216 to be merged and released first.\r\n\r\nTo test, create a job on `app/jobs/`, for example (app/jobs/sample_job.rb)\r\n\r\n```ruby\r\nclass SampleJob < ActiveJob::Base\r\n  def perform(msg)\r\n    5.times { logger.info(\"#{msg}\") }\r\n  end\r\nend\r\n```\r\n\r\nThen on the console run any of the methods from ActiveJob, such as `SampleJob.perform_now`, `SampleJob.perform_later`, `SampleJob.set(:wait => 10.seconds).perform_later`, etcetera. The output should be similar to https://gist.github.com/anonymous/429e7171e867c94182839a4b0d1ddddc \r\n\r\ncc @iNecas as you're familiar with this initialization (mostly drawn from foreman-tasks)\r\n\r\nIf you want to run it as in production, run `rake dynflow:executor` on a different terminal, and run the job I posted above.\r\n\r\n![screenshot from 2017-02-22 10-29-43](https://cloud.githubusercontent.com/assets/598891/23205368/e9c0ba02-f8e9-11e6-9662-14064a895148.png)\r\n","created_at":"2017-02-22T08:02:22Z","updated_at":"2017-02-23T09:56:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"955456641129acdab49baf8c0cabe781e6c41c8b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/foreman/pulls/4316/commits","review_comments_url":"https://api.github.com/repos/theforeman/foreman/pulls/4316/comments","review_comment_url":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theforeman/foreman/issues/4316/comments","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/8a486d154dc4e825a80b91d1f437b234a193b3cb","head":{"label":"dLobatog:18618","ref":"18618","sha":"8a486d154dc4e825a80b91d1f437b234a193b3cb","user":{"login":"dLobatog","id":598891,"avatar_url":"https://avatars.githubusercontent.com/u/598891?v=3","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":5842097,"name":"foreman","full_name":"dLobatog/foreman","owner":{"login":"dLobatog","id":598891,"avatar_url":"https://avatars.githubusercontent.com/u/598891?v=3","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","description":"an application that automates the lifecycle of servers ","fork":true,"url":"https://api.github.com/repos/dLobatog/foreman","forks_url":"https://api.github.com/repos/dLobatog/foreman/forks","keys_url":"https://api.github.com/repos/dLobatog/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dLobatog/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dLobatog/foreman/teams","hooks_url":"https://api.github.com/repos/dLobatog/foreman/hooks","issue_events_url":"https://api.github.com/repos/dLobatog/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/dLobatog/foreman/events","assignees_url":"https://api.github.com/repos/dLobatog/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/dLobatog/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/dLobatog/foreman/tags","blobs_url":"https://api.github.com/repos/dLobatog/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dLobatog/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dLobatog/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/dLobatog/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dLobatog/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/dLobatog/foreman/languages","stargazers_url":"https://api.github.com/repos/dLobatog/foreman/stargazers","contributors_url":"https://api.github.com/repos/dLobatog/foreman/contributors","subscribers_url":"https://api.github.com/repos/dLobatog/foreman/subscribers","subscription_url":"https://api.github.com/repos/dLobatog/foreman/subscription","commits_url":"https://api.github.com/repos/dLobatog/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/dLobatog/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/dLobatog/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/dLobatog/foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/dLobatog/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/dLobatog/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dLobatog/foreman/merges","archive_url":"https://api.github.com/repos/dLobatog/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dLobatog/foreman/downloads","issues_url":"https://api.github.com/repos/dLobatog/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/dLobatog/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/dLobatog/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/dLobatog/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dLobatog/foreman/labels{/name}","releases_url":"https://api.github.com/repos/dLobatog/foreman/releases{/id}","deployments_url":"https://api.github.com/repos/dLobatog/foreman/deployments","created_at":"2012-09-17T14:23:49Z","updated_at":"2015-05-06T16:17:15Z","pushed_at":"2017-02-23T09:18:12Z","git_url":"git://github.com/dLobatog/foreman.git","ssh_url":"git@github.com:dLobatog/foreman.git","clone_url":"https://github.com/dLobatog/foreman.git","svn_url":"https://github.com/dLobatog/foreman","homepage":"http://theforeman.org","size":48203,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"develop"}},"base":{"label":"theforeman:develop","ref":"develop","sha":"e47301212fbb24e2af869cab96e62b6e23c0bcde","user":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","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,"name":"foreman","full_name":"theforeman/foreman","owner":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","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","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":"2017-02-22T16:43:15Z","pushed_at":"2017-02-23T09:50:17Z","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":55459,"stargazers_count":1164,"watchers_count":1164,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":594,"mirror_url":null,"open_issues_count":92,"forks":594,"open_issues":92,"watchers":1164,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/4316"},"html":{"href":"https://github.com/theforeman/foreman/pull/4316"},"issue":{"href":"https://api.github.com/repos/theforeman/foreman/issues/4316"},"comments":{"href":"https://api.github.com/repos/theforeman/foreman/issues/4316/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/4316/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/4316/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/foreman/statuses/8a486d154dc4e825a80b91d1f437b234a193b3cb"}}}}
{"actor":{"display_login":"dLobatog"}}