{"action":"created","comment":{"url":"https://api.github.com/repos/leapp-to/leapp/pulls/comments/180988754","pull_request_review_id":111505982,"id":180988754,"diff_hunk":"@@ -13,73 +13,130 @@\n \n \n class Actor(object):\n+    \"\"\"\n+    The Actor class represents the smallest step in the workflow. It defines what kind\n+    of data it expects, it consumes (process) a given data and produces data for other\n+    actors in the workflow.\n+    \"\"\"\n+\n     name = None\n+    \"\"\" Name of the actor that's used to identify data/messages created by the actor. \"\"\"\n+\n     description = None\n+    \"\"\" More verbose actor's description.\"\"\"\n+\n     consumes = ()\n+    \"\"\"\n+    Tuple of :py:class:`leapp.models.Model` derived classes defined in the :ref:`repositories <terminology:repository>` that\n+    define :ref:`messages <terminology:message>` the actor consumes.\n+    \"\"\"\n+\n     produces = ()\n+    \"\"\"\n+    Tuple of :py:class:`leapp.models.Model` derived classes defined in the :ref:`repositories <terminology:repository>` that define\n+    :ref:`messages <terminology:message>` the actor produces.\n+    \"\"\"\n+\n     tags = ()\n+    \"\"\"\n+    Tuple of :py:class:`leapp.tags.Tag` derived classes by which :ref:`workflow <terminology:workflow>` :ref:`phases <terminology:phase>` select\n+    actors for execution.\n+    \"\"\"\n \n     def __init__(self, messaging=None, logger=None):\n         self._messaging = messaging\n         self.log = (logger or logging.getLogger('leapp.actors')).getChild(self.name)\n-        \"\"\" Configured logger for the actor \"\"\"\n+        \"\"\" A configured logger instance for the current actor \"\"\"\n \n     @property\n     def actor_files_paths(self):\n+        \"\"\" Returns the file paths that are bundled with the actor. (Path to the content of the actor's file directory)\"\"\"\n         return os.getenv(\"LEAPP_FILES\", \"\").split(\":\")\n \n     @property\n     def files_paths(self):\n+        \"\"\" Returns all actor file paths (related ones to the actor and common actors files paths). \"\"\"\n         return self.actor_files_paths + self.common_files_paths\n \n     @property\n     def common_files_paths(self):\n+        \"\"\" Returns all common repository file paths. \"\"\"\n         return os.getenv(\"LEAPP_COMMON_FILES\", \"\").split(\":\")\n \n     def get_folder_path(self, name):\n+        \"\"\"\n+        Displays first folder path within actor.\n+\n+        :param name: Name of the folder\n+        :type name: str\n+        :return: Found folder path\n+        :rtype: str or None\n+        \"\"\"\n         for path in self.files_paths:\n             path = os.path.join(path, name)\n             if os.path.isdir(path):\n                 return path\n         return None\n \n     def get_file_path(self, name):\n+        \"\"\"\n+        Displays first file path within actor and common actors file paths.\n+\n+        :param name: Name of the file\n+        :type name: str\n+        :return: Found file path\n+        :rtype: str or None\n+        \"\"\"\n         for path in self.files_paths:\n             path = os.path.join(path, name)\n             if os.path.isfile(path):\n                 return path\n         return None\n \n     def run(self, *args):\n+        \"\"\" Runs actor calling method :py:func:`process`. \"\"\"\n         os.environ['LEAPP_CURRENT_ACTOR'] = self.name\n         try:\n             self.process(*args)\n         finally:\n             os.environ.pop('LEAPP_CURRENT_ACTOR', None)\n \n     def process(self, *args, **kwargs):\n+        \"\"\" Main processing method (in inherited actors, the function needs to be defined to be able process)\"\"\"\n         raise NotImplementedError()\n \n-    def produce(self, *args):\n+    def produce(self, *models):\n+        \"\"\"\n+        After running :py:func:`process`, it prepares processed data - results to next processing in workflow.\n+\n+        :param models: what data models is going to be produced\n+        :type models: tuple of derived classes from :py:class:`leapp.models.Model`\n+        \"\"\"\n         if self._messaging:\n-            for arg in args:\n-                if isinstance(arg, getattr(self.__class__, 'produces')):\n-                    message_data = json.dumps(arg.dump(), sort_keys=True)\n+            for model in models:\n+                if isinstance(model, getattr(self.__class__, 'produces')):\n+                    message_data = json.dumps(model.dump(), sort_keys=True)\n                     message_hash = hashlib.sha256(message_data).hexdigest()\n-                    self._messaging.produce(arg.topic.name, {\n-                        'type': arg.__class__.__name__,\n+                    self._messaging.produce(model.topic.name, {\n+                        'type': model.__class__.__name__,\n                         'actor': self.name,\n-                        'topic': arg.topic.name,\n+                        'topic': model.topic.name,\n                         'stamp': datetime.datetime.utcnow().isoformat() + 'Z',\n                         'message': {\n                             'data': message_data,\n                             'hash': message_hash\n                         }\n                     })\n \n-    def consume(self, *types):\n+    def consume(self, *models):\n+        \"\"\"\n+        Load any given model data types to be able to process them.\n+\n+        :param models: what data models is going to be processed","path":"leapp/actors/__init__.py","position":132,"original_position":132,"commit_id":"4cd1e0eb8fafde8150a3d6bcc6825532bc46666b","original_commit_id":"4cd1e0eb8fafde8150a3d6bcc6825532bc46666b","user":{"login":"vinzenz","id":36638,"avatar_url":"https://avatars1.githubusercontent.com/u/36638?v=4","gravatar_id":"","url":"https://api.github.com/users/vinzenz","html_url":"https://github.com/vinzenz","followers_url":"https://api.github.com/users/vinzenz/followers","following_url":"https://api.github.com/users/vinzenz/following{/other_user}","gists_url":"https://api.github.com/users/vinzenz/gists{/gist_id}","starred_url":"https://api.github.com/users/vinzenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinzenz/subscriptions","organizations_url":"https://api.github.com/users/vinzenz/orgs","repos_url":"https://api.github.com/users/vinzenz/repos","events_url":"https://api.github.com/users/vinzenz/events{/privacy}","received_events_url":"https://api.github.com/users/vinzenz/received_events","type":"User","site_admin":false},"body":"Models to use as filter for the messages to return","created_at":"2018-04-12T07:36:49Z","updated_at":"2018-04-12T07:36:55Z","html_url":"https://github.com/leapp-to/leapp/pull/299#discussion_r180988754","pull_request_url":"https://api.github.com/repos/leapp-to/leapp/pulls/299","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/leapp-to/leapp/pulls/comments/180988754"},"html":{"href":"https://github.com/leapp-to/leapp/pull/299#discussion_r180988754"},"pull_request":{"href":"https://api.github.com/repos/leapp-to/leapp/pulls/299"}}},"pull_request":{"url":"https://api.github.com/repos/leapp-to/leapp/pulls/299","id":180355924,"html_url":"https://github.com/leapp-to/leapp/pull/299","diff_url":"https://github.com/leapp-to/leapp/pull/299.diff","patch_url":"https://github.com/leapp-to/leapp/pull/299.patch","issue_url":"https://api.github.com/repos/leapp-to/leapp/issues/299","number":299,"state":"open","locked":false,"title":"Add docstring to leapp.actors","user":{"login":"jzigmund","id":2270962,"avatar_url":"https://avatars0.githubusercontent.com/u/2270962?v=4","gravatar_id":"","url":"https://api.github.com/users/jzigmund","html_url":"https://github.com/jzigmund","followers_url":"https://api.github.com/users/jzigmund/followers","following_url":"https://api.github.com/users/jzigmund/following{/other_user}","gists_url":"https://api.github.com/users/jzigmund/gists{/gist_id}","starred_url":"https://api.github.com/users/jzigmund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzigmund/subscriptions","organizations_url":"https://api.github.com/users/jzigmund/orgs","repos_url":"https://api.github.com/users/jzigmund/repos","events_url":"https://api.github.com/users/jzigmund/events{/privacy}","received_events_url":"https://api.github.com/users/jzigmund/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-09T16:05:49Z","updated_at":"2018-04-12T07:36:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e3f1e2b254b83cc231fddc54fbc82ede80357999","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":896681885,"url":"https://api.github.com/repos/leapp-to/leapp/labels/docs","name":"docs","color":"72c6d8","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/leapp-to/leapp/pulls/299/commits","review_comments_url":"https://api.github.com/repos/leapp-to/leapp/pulls/299/comments","review_comment_url":"https://api.github.com/repos/leapp-to/leapp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/leapp-to/leapp/issues/299/comments","statuses_url":"https://api.github.com/repos/leapp-to/leapp/statuses/4cd1e0eb8fafde8150a3d6bcc6825532bc46666b","head":{"label":"jzigmund:docs_actors","ref":"docs_actors","sha":"4cd1e0eb8fafde8150a3d6bcc6825532bc46666b","user":{"login":"jzigmund","id":2270962,"avatar_url":"https://avatars0.githubusercontent.com/u/2270962?v=4","gravatar_id":"","url":"https://api.github.com/users/jzigmund","html_url":"https://github.com/jzigmund","followers_url":"https://api.github.com/users/jzigmund/followers","following_url":"https://api.github.com/users/jzigmund/following{/other_user}","gists_url":"https://api.github.com/users/jzigmund/gists{/gist_id}","starred_url":"https://api.github.com/users/jzigmund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzigmund/subscriptions","organizations_url":"https://api.github.com/users/jzigmund/orgs","repos_url":"https://api.github.com/users/jzigmund/repos","events_url":"https://api.github.com/users/jzigmund/events{/privacy}","received_events_url":"https://api.github.com/users/jzigmund/received_events","type":"User","site_admin":false},"repo":{"id":101069236,"name":"leapp","full_name":"jzigmund/leapp","owner":{"login":"jzigmund","id":2270962,"avatar_url":"https://avatars0.githubusercontent.com/u/2270962?v=4","gravatar_id":"","url":"https://api.github.com/users/jzigmund","html_url":"https://github.com/jzigmund","followers_url":"https://api.github.com/users/jzigmund/followers","following_url":"https://api.github.com/users/jzigmund/following{/other_user}","gists_url":"https://api.github.com/users/jzigmund/gists{/gist_id}","starred_url":"https://api.github.com/users/jzigmund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzigmund/subscriptions","organizations_url":"https://api.github.com/users/jzigmund/orgs","repos_url":"https://api.github.com/users/jzigmund/repos","events_url":"https://api.github.com/users/jzigmund/events{/privacy}","received_events_url":"https://api.github.com/users/jzigmund/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jzigmund/leapp","description":"Prototype stuff","fork":true,"url":"https://api.github.com/repos/jzigmund/leapp","forks_url":"https://api.github.com/repos/jzigmund/leapp/forks","keys_url":"https://api.github.com/repos/jzigmund/leapp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jzigmund/leapp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jzigmund/leapp/teams","hooks_url":"https://api.github.com/repos/jzigmund/leapp/hooks","issue_events_url":"https://api.github.com/repos/jzigmund/leapp/issues/events{/number}","events_url":"https://api.github.com/repos/jzigmund/leapp/events","assignees_url":"https://api.github.com/repos/jzigmund/leapp/assignees{/user}","branches_url":"https://api.github.com/repos/jzigmund/leapp/branches{/branch}","tags_url":"https://api.github.com/repos/jzigmund/leapp/tags","blobs_url":"https://api.github.com/repos/jzigmund/leapp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jzigmund/leapp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jzigmund/leapp/git/refs{/sha}","trees_url":"https://api.github.com/repos/jzigmund/leapp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jzigmund/leapp/statuses/{sha}","languages_url":"https://api.github.com/repos/jzigmund/leapp/languages","stargazers_url":"https://api.github.com/repos/jzigmund/leapp/stargazers","contributors_url":"https://api.github.com/repos/jzigmund/leapp/contributors","subscribers_url":"https://api.github.com/repos/jzigmund/leapp/subscribers","subscription_url":"https://api.github.com/repos/jzigmund/leapp/subscription","commits_url":"https://api.github.com/repos/jzigmund/leapp/commits{/sha}","git_commits_url":"https://api.github.com/repos/jzigmund/leapp/git/commits{/sha}","comments_url":"https://api.github.com/repos/jzigmund/leapp/comments{/number}","issue_comment_url":"https://api.github.com/repos/jzigmund/leapp/issues/comments{/number}","contents_url":"https://api.github.com/repos/jzigmund/leapp/contents/{+path}","compare_url":"https://api.github.com/repos/jzigmund/leapp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jzigmund/leapp/merges","archive_url":"https://api.github.com/repos/jzigmund/leapp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jzigmund/leapp/downloads","issues_url":"https://api.github.com/repos/jzigmund/leapp/issues{/number}","pulls_url":"https://api.github.com/repos/jzigmund/leapp/pulls{/number}","milestones_url":"https://api.github.com/repos/jzigmund/leapp/milestones{/number}","notifications_url":"https://api.github.com/repos/jzigmund/leapp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jzigmund/leapp/labels{/name}","releases_url":"https://api.github.com/repos/jzigmund/leapp/releases{/id}","deployments_url":"https://api.github.com/repos/jzigmund/leapp/deployments","created_at":"2017-08-22T14:01:59Z","updated_at":"2017-08-22T14:02:00Z","pushed_at":"2018-04-11T15:56:01Z","git_url":"git://github.com/jzigmund/leapp.git","ssh_url":"git@github.com:jzigmund/leapp.git","clone_url":"https://github.com/jzigmund/leapp.git","svn_url":"https://github.com/jzigmund/leapp","homepage":"http://leapp.readthedocs.io/","size":5632,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"leapp-to:master","ref":"master","sha":"02cf4f2fab375e2d0151f6a449781d153bb2be5e","user":{"login":"leapp-to","id":25977968,"avatar_url":"https://avatars0.githubusercontent.com/u/25977968?v=4","gravatar_id":"","url":"https://api.github.com/users/leapp-to","html_url":"https://github.com/leapp-to","followers_url":"https://api.github.com/users/leapp-to/followers","following_url":"https://api.github.com/users/leapp-to/following{/other_user}","gists_url":"https://api.github.com/users/leapp-to/gists{/gist_id}","starred_url":"https://api.github.com/users/leapp-to/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leapp-to/subscriptions","organizations_url":"https://api.github.com/users/leapp-to/orgs","repos_url":"https://api.github.com/users/leapp-to/repos","events_url":"https://api.github.com/users/leapp-to/events{/privacy}","received_events_url":"https://api.github.com/users/leapp-to/received_events","type":"Organization","site_admin":false},"repo":{"id":84006362,"name":"leapp","full_name":"leapp-to/leapp","owner":{"login":"leapp-to","id":25977968,"avatar_url":"https://avatars0.githubusercontent.com/u/25977968?v=4","gravatar_id":"","url":"https://api.github.com/users/leapp-to","html_url":"https://github.com/leapp-to","followers_url":"https://api.github.com/users/leapp-to/followers","following_url":"https://api.github.com/users/leapp-to/following{/other_user}","gists_url":"https://api.github.com/users/leapp-to/gists{/gist_id}","starred_url":"https://api.github.com/users/leapp-to/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leapp-to/subscriptions","organizations_url":"https://api.github.com/users/leapp-to/orgs","repos_url":"https://api.github.com/users/leapp-to/repos","events_url":"https://api.github.com/users/leapp-to/events{/privacy}","received_events_url":"https://api.github.com/users/leapp-to/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/leapp-to/leapp","description":null,"fork":false,"url":"https://api.github.com/repos/leapp-to/leapp","forks_url":"https://api.github.com/repos/leapp-to/leapp/forks","keys_url":"https://api.github.com/repos/leapp-to/leapp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leapp-to/leapp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leapp-to/leapp/teams","hooks_url":"https://api.github.com/repos/leapp-to/leapp/hooks","issue_events_url":"https://api.github.com/repos/leapp-to/leapp/issues/events{/number}","events_url":"https://api.github.com/repos/leapp-to/leapp/events","assignees_url":"https://api.github.com/repos/leapp-to/leapp/assignees{/user}","branches_url":"https://api.github.com/repos/leapp-to/leapp/branches{/branch}","tags_url":"https://api.github.com/repos/leapp-to/leapp/tags","blobs_url":"https://api.github.com/repos/leapp-to/leapp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leapp-to/leapp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leapp-to/leapp/git/refs{/sha}","trees_url":"https://api.github.com/repos/leapp-to/leapp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leapp-to/leapp/statuses/{sha}","languages_url":"https://api.github.com/repos/leapp-to/leapp/languages","stargazers_url":"https://api.github.com/repos/leapp-to/leapp/stargazers","contributors_url":"https://api.github.com/repos/leapp-to/leapp/contributors","subscribers_url":"https://api.github.com/repos/leapp-to/leapp/subscribers","subscription_url":"https://api.github.com/repos/leapp-to/leapp/subscription","commits_url":"https://api.github.com/repos/leapp-to/leapp/commits{/sha}","git_commits_url":"https://api.github.com/repos/leapp-to/leapp/git/commits{/sha}","comments_url":"https://api.github.com/repos/leapp-to/leapp/comments{/number}","issue_comment_url":"https://api.github.com/repos/leapp-to/leapp/issues/comments{/number}","contents_url":"https://api.github.com/repos/leapp-to/leapp/contents/{+path}","compare_url":"https://api.github.com/repos/leapp-to/leapp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leapp-to/leapp/merges","archive_url":"https://api.github.com/repos/leapp-to/leapp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leapp-to/leapp/downloads","issues_url":"https://api.github.com/repos/leapp-to/leapp/issues{/number}","pulls_url":"https://api.github.com/repos/leapp-to/leapp/pulls{/number}","milestones_url":"https://api.github.com/repos/leapp-to/leapp/milestones{/number}","notifications_url":"https://api.github.com/repos/leapp-to/leapp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leapp-to/leapp/labels{/name}","releases_url":"https://api.github.com/repos/leapp-to/leapp/releases{/id}","deployments_url":"https://api.github.com/repos/leapp-to/leapp/deployments","created_at":"2017-03-05T22:17:25Z","updated_at":"2018-04-12T07:24:36Z","pushed_at":"2018-04-12T07:24:34Z","git_url":"git://github.com/leapp-to/leapp.git","ssh_url":"git@github.com:leapp-to/leapp.git","clone_url":"https://github.com/leapp-to/leapp.git","svn_url":"https://github.com/leapp-to/leapp","homepage":"https://leapp-to.github.io/","size":5629,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":20,"open_issues":2,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/leapp-to/leapp/pulls/299"},"html":{"href":"https://github.com/leapp-to/leapp/pull/299"},"issue":{"href":"https://api.github.com/repos/leapp-to/leapp/issues/299"},"comments":{"href":"https://api.github.com/repos/leapp-to/leapp/issues/299/comments"},"review_comments":{"href":"https://api.github.com/repos/leapp-to/leapp/pulls/299/comments"},"review_comment":{"href":"https://api.github.com/repos/leapp-to/leapp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/leapp-to/leapp/pulls/299/commits"},"statuses":{"href":"https://api.github.com/repos/leapp-to/leapp/statuses/4cd1e0eb8fafde8150a3d6bcc6825532bc46666b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"vinzenz"}}