{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/interface-github/pulls/comments/86769140","pull_request_review_id":7408383,"id":86769140,"diff_hunk":"@@ -0,0 +1,112 @@\n+# -*- coding: utf-8 -*-\n+# Copyright (C) 2016-Today: Odoo Community Association (OCA)\n+# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)\n+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\n+\n+import logging\n+\n+from openerp import models, fields, api\n+\n+_logger = logging.getLogger(__name__)\n+\n+try:\n+    import markdown\n+except ImportError:\n+    _logger.debug(\"Cannot import 'markdown' python librairy.\")\n+\n+\n+class GithubIssue(models.Model):\n+    _name = 'github.issue'\n+    _inherit = ['abstract.github.model.author']\n+\n+    _github_type = 'issue'\n+    _github_login_field = 'number'\n+\n+    # Column Section\n+    repository_id = fields.Many2one(\n+        comodel_name='github.repository', string='Repository', readonly=True,\n+        required=True, ondelete='cascade')\n+\n+    issue_type = fields.Selection(\n+        selection=[('issue', 'Issue'), ('pull_request', 'Pull Request')],\n+        string='Type')\n+\n+    title = fields.Char(string='Title', readonly=True, required=True)\n+\n+    body = fields.Char(string='Body', readonly=True)\n+\n+    html_body = fields.Html(\n+        string='HTML Body', readonly=True, compute='_compute_html_body',\n+        store=True)\n+\n+    state = fields.Selection(selection=[\n+        ('open', 'Open'), ('closed', 'Closed')],\n+        string='State', readonly=True, required=True)\n+\n+    comment_ids = fields.One2many(\n+        string='Comments', comodel_name='github.comment',\n+        inverse_name='issue_id', readonly=True)\n+\n+    comment_qty = fields.Integer(\n+        string='Comments Quantity', compute='_compute_comment_qty',\n+        store=True)\n+\n+    approved_comment_qty = fields.Integer(\n+        string='Approved Comments Quantity', compute='_compute_opinion',\n+        multi='opinion', store=True)\n+\n+    disapproved_comment_qty = fields.Integer(\n+        string='Disapproved Comments Quantity', compute='_compute_opinion',\n+        multi='opinion', store=True)\n+\n+    # Compute section\n+    @api.multi\n+    @api.depends('body')\n+    def _compute_html_body(self):\n+        for issue in self:\n+            if issue.body:\n+                issue.html_body = markdown.markdown(issue.body)","path":"github_connector/models/github_issue.py","position":68,"original_position":68,"commit_id":"7dc24f73ee44fabfca5b9d4cc45d80ae741341a7","original_commit_id":"7dc24f73ee44fabfca5b9d4cc45d80ae741341a7","user":{"login":"gurneyalex","id":2032807,"avatar_url":"https://avatars.githubusercontent.com/u/2032807?v=3","gravatar_id":"","url":"https://api.github.com/users/gurneyalex","html_url":"https://github.com/gurneyalex","followers_url":"https://api.github.com/users/gurneyalex/followers","following_url":"https://api.github.com/users/gurneyalex/following{/other_user}","gists_url":"https://api.github.com/users/gurneyalex/gists{/gist_id}","starred_url":"https://api.github.com/users/gurneyalex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gurneyalex/subscriptions","organizations_url":"https://api.github.com/users/gurneyalex/orgs","repos_url":"https://api.github.com/users/gurneyalex/repos","events_url":"https://api.github.com/users/gurneyalex/events{/privacy}","received_events_url":"https://api.github.com/users/gurneyalex/received_events","type":"User","site_admin":false},"body":"don't we need some exception handling here in case the markdown parsing fails?\r\n\r\n(real question, I don't know that python module at all)","created_at":"2016-11-07T12:53:12Z","updated_at":"2016-11-07T12:53:12Z","html_url":"https://github.com/OCA/interface-github/pull/1#discussion_r86769140","pull_request_url":"https://api.github.com/repos/OCA/interface-github/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/OCA/interface-github/pulls/comments/86769140"},"html":{"href":"https://github.com/OCA/interface-github/pull/1#discussion_r86769140"},"pull_request":{"href":"https://api.github.com/repos/OCA/interface-github/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/interface-github/pulls/1","id":91598161,"html_url":"https://github.com/OCA/interface-github/pull/1","diff_url":"https://github.com/OCA/interface-github/pull/1.diff","patch_url":"https://github.com/OCA/interface-github/pull/1.patch","issue_url":"https://api.github.com/repos/OCA/interface-github/issues/1","number":1,"state":"open","locked":false,"title":"[ADD] two github modules","user":{"login":"legalsylvain","id":3407482,"avatar_url":"https://avatars.githubusercontent.com/u/3407482?v=3","gravatar_id":"","url":"https://api.github.com/users/legalsylvain","html_url":"https://github.com/legalsylvain","followers_url":"https://api.github.com/users/legalsylvain/followers","following_url":"https://api.github.com/users/legalsylvain/following{/other_user}","gists_url":"https://api.github.com/users/legalsylvain/gists{/gist_id}","starred_url":"https://api.github.com/users/legalsylvain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legalsylvain/subscriptions","organizations_url":"https://api.github.com/users/legalsylvain/orgs","repos_url":"https://api.github.com/users/legalsylvain/repos","events_url":"https://api.github.com/users/legalsylvain/events{/privacy}","received_events_url":"https://api.github.com/users/legalsylvain/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-31T12:06:08Z","updated_at":"2016-11-07T12:55:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"52c3f2730d60cf78772eab723d7c950c026e256b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OCA/interface-github/pulls/1/commits","review_comments_url":"https://api.github.com/repos/OCA/interface-github/pulls/1/comments","review_comment_url":"https://api.github.com/repos/OCA/interface-github/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/interface-github/issues/1/comments","statuses_url":"https://api.github.com/repos/OCA/interface-github/statuses/7dc24f73ee44fabfca5b9d4cc45d80ae741341a7","head":{"label":"legalsylvain:8.0_ADD_github_connector_modules","ref":"8.0_ADD_github_connector_modules","sha":"7dc24f73ee44fabfca5b9d4cc45d80ae741341a7","user":{"login":"legalsylvain","id":3407482,"avatar_url":"https://avatars.githubusercontent.com/u/3407482?v=3","gravatar_id":"","url":"https://api.github.com/users/legalsylvain","html_url":"https://github.com/legalsylvain","followers_url":"https://api.github.com/users/legalsylvain/followers","following_url":"https://api.github.com/users/legalsylvain/following{/other_user}","gists_url":"https://api.github.com/users/legalsylvain/gists{/gist_id}","starred_url":"https://api.github.com/users/legalsylvain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legalsylvain/subscriptions","organizations_url":"https://api.github.com/users/legalsylvain/orgs","repos_url":"https://api.github.com/users/legalsylvain/repos","events_url":"https://api.github.com/users/legalsylvain/events{/privacy}","received_events_url":"https://api.github.com/users/legalsylvain/received_events","type":"User","site_admin":false},"repo":{"id":72432125,"name":"interface-github","full_name":"legalsylvain/interface-github","owner":{"login":"legalsylvain","id":3407482,"avatar_url":"https://avatars.githubusercontent.com/u/3407482?v=3","gravatar_id":"","url":"https://api.github.com/users/legalsylvain","html_url":"https://github.com/legalsylvain","followers_url":"https://api.github.com/users/legalsylvain/followers","following_url":"https://api.github.com/users/legalsylvain/following{/other_user}","gists_url":"https://api.github.com/users/legalsylvain/gists{/gist_id}","starred_url":"https://api.github.com/users/legalsylvain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legalsylvain/subscriptions","organizations_url":"https://api.github.com/users/legalsylvain/orgs","repos_url":"https://api.github.com/users/legalsylvain/repos","events_url":"https://api.github.com/users/legalsylvain/events{/privacy}","received_events_url":"https://api.github.com/users/legalsylvain/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/legalsylvain/interface-github","description":"Tools to interact with github from Odoo","fork":true,"url":"https://api.github.com/repos/legalsylvain/interface-github","forks_url":"https://api.github.com/repos/legalsylvain/interface-github/forks","keys_url":"https://api.github.com/repos/legalsylvain/interface-github/keys{/key_id}","collaborators_url":"https://api.github.com/repos/legalsylvain/interface-github/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/legalsylvain/interface-github/teams","hooks_url":"https://api.github.com/repos/legalsylvain/interface-github/hooks","issue_events_url":"https://api.github.com/repos/legalsylvain/interface-github/issues/events{/number}","events_url":"https://api.github.com/repos/legalsylvain/interface-github/events","assignees_url":"https://api.github.com/repos/legalsylvain/interface-github/assignees{/user}","branches_url":"https://api.github.com/repos/legalsylvain/interface-github/branches{/branch}","tags_url":"https://api.github.com/repos/legalsylvain/interface-github/tags","blobs_url":"https://api.github.com/repos/legalsylvain/interface-github/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/legalsylvain/interface-github/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/legalsylvain/interface-github/git/refs{/sha}","trees_url":"https://api.github.com/repos/legalsylvain/interface-github/git/trees{/sha}","statuses_url":"https://api.github.com/repos/legalsylvain/interface-github/statuses/{sha}","languages_url":"https://api.github.com/repos/legalsylvain/interface-github/languages","stargazers_url":"https://api.github.com/repos/legalsylvain/interface-github/stargazers","contributors_url":"https://api.github.com/repos/legalsylvain/interface-github/contributors","subscribers_url":"https://api.github.com/repos/legalsylvain/interface-github/subscribers","subscription_url":"https://api.github.com/repos/legalsylvain/interface-github/subscription","commits_url":"https://api.github.com/repos/legalsylvain/interface-github/commits{/sha}","git_commits_url":"https://api.github.com/repos/legalsylvain/interface-github/git/commits{/sha}","comments_url":"https://api.github.com/repos/legalsylvain/interface-github/comments{/number}","issue_comment_url":"https://api.github.com/repos/legalsylvain/interface-github/issues/comments{/number}","contents_url":"https://api.github.com/repos/legalsylvain/interface-github/contents/{+path}","compare_url":"https://api.github.com/repos/legalsylvain/interface-github/compare/{base}...{head}","merges_url":"https://api.github.com/repos/legalsylvain/interface-github/merges","archive_url":"https://api.github.com/repos/legalsylvain/interface-github/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/legalsylvain/interface-github/downloads","issues_url":"https://api.github.com/repos/legalsylvain/interface-github/issues{/number}","pulls_url":"https://api.github.com/repos/legalsylvain/interface-github/pulls{/number}","milestones_url":"https://api.github.com/repos/legalsylvain/interface-github/milestones{/number}","notifications_url":"https://api.github.com/repos/legalsylvain/interface-github/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/legalsylvain/interface-github/labels{/name}","releases_url":"https://api.github.com/repos/legalsylvain/interface-github/releases{/id}","deployments_url":"https://api.github.com/repos/legalsylvain/interface-github/deployments","created_at":"2016-10-31T11:57:26Z","updated_at":"2016-10-06T16:42:24Z","pushed_at":"2016-11-04T00:33:29Z","git_url":"git://github.com/legalsylvain/interface-github.git","ssh_url":"git@github.com:legalsylvain/interface-github.git","clone_url":"https://github.com/legalsylvain/interface-github.git","svn_url":"https://github.com/legalsylvain/interface-github","homepage":null,"size":305,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"8.0"}},"base":{"label":"OCA:8.0","ref":"8.0","sha":"5fab30009b9f41e535d89ed0699a23b26a8053ba","user":{"login":"OCA","id":7600578,"avatar_url":"https://avatars.githubusercontent.com/u/7600578?v=3","gravatar_id":"","url":"https://api.github.com/users/OCA","html_url":"https://github.com/OCA","followers_url":"https://api.github.com/users/OCA/followers","following_url":"https://api.github.com/users/OCA/following{/other_user}","gists_url":"https://api.github.com/users/OCA/gists{/gist_id}","starred_url":"https://api.github.com/users/OCA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OCA/subscriptions","organizations_url":"https://api.github.com/users/OCA/orgs","repos_url":"https://api.github.com/users/OCA/repos","events_url":"https://api.github.com/users/OCA/events{/privacy}","received_events_url":"https://api.github.com/users/OCA/received_events","type":"Organization","site_admin":false},"repo":{"id":70173147,"name":"interface-github","full_name":"OCA/interface-github","owner":{"login":"OCA","id":7600578,"avatar_url":"https://avatars.githubusercontent.com/u/7600578?v=3","gravatar_id":"","url":"https://api.github.com/users/OCA","html_url":"https://github.com/OCA","followers_url":"https://api.github.com/users/OCA/followers","following_url":"https://api.github.com/users/OCA/following{/other_user}","gists_url":"https://api.github.com/users/OCA/gists{/gist_id}","starred_url":"https://api.github.com/users/OCA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OCA/subscriptions","organizations_url":"https://api.github.com/users/OCA/orgs","repos_url":"https://api.github.com/users/OCA/repos","events_url":"https://api.github.com/users/OCA/events{/privacy}","received_events_url":"https://api.github.com/users/OCA/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OCA/interface-github","description":"Tools to interact with github from Odoo","fork":false,"url":"https://api.github.com/repos/OCA/interface-github","forks_url":"https://api.github.com/repos/OCA/interface-github/forks","keys_url":"https://api.github.com/repos/OCA/interface-github/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/interface-github/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/interface-github/teams","hooks_url":"https://api.github.com/repos/OCA/interface-github/hooks","issue_events_url":"https://api.github.com/repos/OCA/interface-github/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/interface-github/events","assignees_url":"https://api.github.com/repos/OCA/interface-github/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/interface-github/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/interface-github/tags","blobs_url":"https://api.github.com/repos/OCA/interface-github/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/interface-github/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/interface-github/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/interface-github/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/interface-github/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/interface-github/languages","stargazers_url":"https://api.github.com/repos/OCA/interface-github/stargazers","contributors_url":"https://api.github.com/repos/OCA/interface-github/contributors","subscribers_url":"https://api.github.com/repos/OCA/interface-github/subscribers","subscription_url":"https://api.github.com/repos/OCA/interface-github/subscription","commits_url":"https://api.github.com/repos/OCA/interface-github/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/interface-github/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/interface-github/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/interface-github/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/interface-github/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/interface-github/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/interface-github/merges","archive_url":"https://api.github.com/repos/OCA/interface-github/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/interface-github/downloads","issues_url":"https://api.github.com/repos/OCA/interface-github/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/interface-github/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/interface-github/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/interface-github/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/interface-github/labels{/name}","releases_url":"https://api.github.com/repos/OCA/interface-github/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/interface-github/deployments","created_at":"2016-10-06T16:42:24Z","updated_at":"2016-10-31T13:10:22Z","pushed_at":"2016-11-04T00:33:29Z","git_url":"git://github.com/OCA/interface-github.git","ssh_url":"git@github.com:OCA/interface-github.git","clone_url":"https://github.com/OCA/interface-github.git","svn_url":"https://github.com/OCA/interface-github","homepage":null,"size":297,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"8.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/interface-github/pulls/1"},"html":{"href":"https://github.com/OCA/interface-github/pull/1"},"issue":{"href":"https://api.github.com/repos/OCA/interface-github/issues/1"},"comments":{"href":"https://api.github.com/repos/OCA/interface-github/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/interface-github/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/interface-github/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/interface-github/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/interface-github/statuses/7dc24f73ee44fabfca5b9d4cc45d80ae741341a7"}}}}
{"actor":{"display_login":"gurneyalex"}}