{"action":"created","issue":{"url":"https://api.github.com/repos/Pysellus/pysellus/issues/59","labels_url":"https://api.github.com/repos/Pysellus/pysellus/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/Pysellus/pysellus/issues/59/comments","events_url":"https://api.github.com/repos/Pysellus/pysellus/issues/59/events","html_url":"https://github.com/Pysellus/pysellus/pull/59","id":112342395,"number":59,"title":"Support for custom integrations","user":{"login":"ergl","id":3091816,"avatar_url":"https://avatars.githubusercontent.com/u/3091816?v=3","gravatar_id":"","url":"https://api.github.com/users/ergl","html_url":"https://github.com/ergl","followers_url":"https://api.github.com/users/ergl/followers","following_url":"https://api.github.com/users/ergl/following{/other_user}","gists_url":"https://api.github.com/users/ergl/gists{/gist_id}","starred_url":"https://api.github.com/users/ergl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ergl/subscriptions","organizations_url":"https://api.github.com/users/ergl/orgs","repos_url":"https://api.github.com/users/ergl/repos","events_url":"https://api.github.com/users/ergl/events{/privacy}","received_events_url":"https://api.github.com/users/ergl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-20T11:03:03Z","updated_at":"2015-10-20T13:02:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Pysellus/pysellus/pulls/59","html_url":"https://github.com/Pysellus/pysellus/pull/59","diff_url":"https://github.com/Pysellus/pysellus/pull/59.diff","patch_url":"https://github.com/Pysellus/pysellus/pull/59.patch"},"body":"The syntax to add a new custom integration is as follows:\r\n\r\n```yaml\r\ncustom_integrations:\r\n    your_integration_name:\r\n        path: \"/absolute/path/to/integration/file\"\r\n        name: \"NameOfIntegrationClass\"\r\n```\r\n\r\nFor each custom integration, the user should supply the path of the\r\nintegration file, and the name of the class containing the integration\r\ninside the file (that would be the class inheriting from\r\nAbstractIntegration).\r\n\r\nThe program will abort if no matching class is found inside the given\r\nfile.\r\n\r\nStill pending: add tests"},"comment":{"url":"https://api.github.com/repos/Pysellus/pysellus/issues/comments/149561353","html_url":"https://github.com/Pysellus/pysellus/pull/59#issuecomment-149561353","issue_url":"https://api.github.com/repos/Pysellus/pysellus/issues/59","id":149561353,"user":{"login":"ergl","id":3091816,"avatar_url":"https://avatars.githubusercontent.com/u/3091816?v=3","gravatar_id":"","url":"https://api.github.com/users/ergl","html_url":"https://github.com/ergl","followers_url":"https://api.github.com/users/ergl/followers","following_url":"https://api.github.com/users/ergl/following{/other_user}","gists_url":"https://api.github.com/users/ergl/gists{/gist_id}","starred_url":"https://api.github.com/users/ergl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ergl/subscriptions","organizations_url":"https://api.github.com/users/ergl/orgs","repos_url":"https://api.github.com/users/ergl/repos","events_url":"https://api.github.com/users/ergl/events{/privacy}","received_events_url":"https://api.github.com/users/ergl/received_events","type":"User","site_admin":false},"created_at":"2015-10-20T13:02:29Z","updated_at":"2015-10-20T13:02:29Z","body":"Tests aside, what do you think of this approach to defining custom integrations?\r\n\r\nI know it's a bit different from what we thought at first, but this is the\r\nsimplest way I could think of.\r\n\r\nThe `name` field is there so that we know what class to add to\r\n`stock_integrations.integration_classes`.\r\n\r\nA simple custom integration (same behaviour as terminal) would look like:\r\n\r\n```python\r\nfrom pysellus.interfaces import AbstractIntegration\r\n\r\nclass MyService(AbstractIntegration):\r\n    def on_next(self, message):\r\n        print('Assert error in {} -> {}'.format(\r\n            message['test_name'],\r\n            message['expect_function']\r\n        ))\r\n```\r\n\r\nAnd the appropiate custom declaration would be:\r\n\r\n```yaml\r\ncustom_integrations:\r\n    my_service:\r\n        path: \"/.../sample_integration.py\"\r\n        name: \"MyService\"\r\n```"}}