diff --git a/.circleci/config.yml b/.circleci/config.yml index 09af132..5952797 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,34 +21,30 @@ jobs: name: Setup Log Folder For Reports command: sudo mkdir -p .log && sudo chmod 777 .log - - run: - name: Run Test - command: docker-compose run --rm odoo run_pytest.sh - - - run: - name: Codacy Coverage - command: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -l python -r .log/coverage.xml + # - run: + # name: Run Test + # command: docker-compose run --rm odoo run_pytest.sh - - store_test_results: - path: .log + # - store_test_results: + # path: .log # job that find the next tag for the current branch/repo and push the tag to github. # it will trigger the publish of a new docker image. - auto-tag: - machine: true - steps: - - checkout - - run: - <<: *quay_io_login - - run: - name: Get nws - command: | - curl -L $NWS_BIN_LOCATION > ./nws - chmod +x ./nws - - run: - name: Set tag - command: | - ./nws circleci create-tag -t odoo-base + # auto-tag: + # machine: true + # steps: + # - checkout + # - run: + # <<: *quay_io_login + # - run: + # name: Get nws + # command: | + # curl -L $NWS_BIN_LOCATION > ./nws + # chmod +x ./nws + # - run: + # name: Set tag + # command: | + # ./nws circleci create-tag -t odoo-base workflows: version: 2 @@ -57,10 +53,10 @@ workflows: - tests: context: quay.io - - auto-tag: - context: nws - requires: - - tests - filters: - branches: - only: /^1\d\.0/ + # - auto-tag: + # context: nws + # requires: + # - tests + # filters: + # branches: + # only: /^1\d\.0/ diff --git a/.docker_files/main/__init__.py b/.docker_files/main/__init__.py index 76f103f..3942b41 100644 --- a/.docker_files/main/__init__.py +++ b/.docker_files/main/__init__.py @@ -1,2 +1,2 @@ -# © 2023 - today Numigi +# © 2024 - today Numigi # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). diff --git a/.docker_files/main/__manifest__.py b/.docker_files/main/__manifest__.py index 0736ecf..d42757e 100644 --- a/.docker_files/main/__manifest__.py +++ b/.docker_files/main/__manifest__.py @@ -1,4 +1,4 @@ -# © 2019 - today Numigi +# © 2024 - today Numigi # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). { @@ -11,10 +11,7 @@ 'category': 'Other', 'summary': 'Install all addons required for testing.', 'depends': [ - 'github_event', - 'github_event_webhook', - 'github_pull_request', - 'github_pull_request_project', + 'base', ], 'installable': True, } diff --git a/.docker_files/odoo.conf b/.docker_files/odoo.conf index 2a7cdc7..973acdb 100644 --- a/.docker_files/odoo.conf +++ b/.docker_files/odoo.conf @@ -49,7 +49,7 @@ test_report_directory = False translate_modules = ['all'] unaccent = False without_demo = False -workers = 2 +workers = 0 xmlrpc = True xmlrpc_interface = xmlrpc_port = 8069 diff --git a/.docker_files/requirements.txt b/.docker_files/test-requirements.txt similarity index 100% rename from .docker_files/requirements.txt rename to .docker_files/test-requirements.txt diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..b6a254e --- /dev/null +++ b/.flake8 @@ -0,0 +1,12 @@ +[flake8] +max-line-length = 88 +max-complexity = 16 +# B = bugbear +# B9 = bugbear opinionated (incl line length) +select = C,E,F,W,B,B9 +# E203: whitespace before ':' (black behaviour) +# E501: flake8 line length (covered by bugbear B950) +# W503: line break before binary operator (black behaviour) +ignore = E203,E501,W503,F821 +per-file-ignores= + __init__.py:F401 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..94dc196 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,36 @@ +name: pre-commit + +on: + pull_request: + branches: + - "16.0" + push: + branches: + - "16.0" + +jobs: + pre-commit: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v2 + with: + python-version: "3.11" + - name: Get python version + run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV + - uses: actions/cache@v1 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + - name: Install pre-commit + run: pip install pre-commit + - name: Run pre-commit + run: pre-commit run --all-files --show-diff-on-failure --color=always + - name: Check that all files generated by pre-commit are in git + run: | + newfiles="$(git ls-files --others --exclude-from=.gitignore)" + if [ "$newfiles" != "" ] ; then + echo "Please check-in the following files:" + echo "$newfiles" + exit 1 + fi diff --git a/.gitignore b/.gitignore index 693f7d9..58df918 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,12 @@ -.log +/.idea/ +venv +log /.idea -__pycache__ +__pycache__/ +*.pyc +.venv +Pipfile +docker-compose.override.yml +.DS_STORE +.pytest_cache +.vscode/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..28b1b49 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,30 @@ +exclude: | + (?x) + # NOT INSTALLABLE ADDONS + # END NOT INSTALLABLE ADDONS + # Files and folders generated by bots, to avoid loops + ^setup/|/static/description/index\.html$| + # We don't want to mess with tool-generated files + .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/| + # Maybe reactivate this when all README files include prettier ignore tags? + ^README\.md$| + # Library files can have extraneous formatting (even minimized) + /static/(src/)?lib/| + # Repos using Sphinx to generate docs don't need prettying + ^docs/_templates/.*\.html$| + # Don't bother non-technical authors with formatting issues in docs + readme/.*\.(rst|md)$| + # Ignore build and dist directories in addons + /build/|/dist/| + # You don't usually want a bot to modify your legal texts + (LICENSE.*|COPYING.*) +default_language_version: + python: python3 + node: "14.13.0" +repos: + - repo: https://github.com/PyCQA/flake8 + rev: 3.8.3 + hooks: + - id: flake8 + name: flake8 + additional_dependencies: ["flake8-bugbear==20.1.4"] diff --git a/Dockerfile b/Dockerfile index 940be5c..fdda630 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,10 @@ -FROM quay.io/numigi/odoo-public:14.latest -MAINTAINER numigi +FROM quay.io/numigi/odoo-public:16.latest +LABEL maintainer="contact@numigi.com" USER root -COPY .docker_files/requirements.txt . -RUN pip3 install -r requirements.txt - -# Variable used for fetching private git repositories. -ARG GIT_TOKEN +COPY .docker_files/test-requirements.txt . +RUN pip3 install -r test-requirements.txt ENV THIRD_PARTY_ADDONS /mnt/third-party-addons RUN mkdir -p "${THIRD_PARTY_ADDONS}" && chown -R odoo "${THIRD_PARTY_ADDONS}" @@ -16,10 +13,5 @@ RUN gitoo install-all --conf_file /gitoo.yml --destination "${THIRD_PARTY_ADDONS USER odoo -COPY ./github_event /mnt/extra-addons/github_event -COPY ./github_event_webhook /mnt/extra-addons/github_event_webhook -COPY ./github_pull_request /mnt/extra-addons/github_pull_request -COPY ./github_pull_request_project /mnt/extra-addons/github_pull_request_project - COPY .docker_files/main /mnt/extra-addons/main COPY .docker_files/odoo.conf /etc/odoo diff --git a/docker-compose.yml b/docker-compose.yml index 3870816..a61165e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,10 +4,8 @@ services: build: context: . dockerfile: Dockerfile - args: - - GIT_TOKEN=${GIT_TOKEN} volumes: - - odoo-web-data:/var/lib/odoo + - odoo16-web-data:/var/lib/odoo - ./.log:/var/log/odoo ports: - "8069:8069" @@ -18,16 +16,16 @@ services: environment: - LOG_ODOO=/var/log/odoo db: - image: quay.io/numigi/postgres-odoo:13.1.6 + image: postgres:16.0 environment: - POSTGRES_PASSWORD=odoo - POSTGRES_USER=odoo - PGDATA=/var/lib/postgresql/data/pgdata volumes: - - odoo-db-data:/var/lib/postgresql/data/pgdata + - odoo16-db-data:/var/lib/postgresql/data/pgdata expose: - 5432 volumes: - odoo-web-data: - odoo-db-data: + odoo16-web-data: + odoo16-db-data: diff --git a/github_event/README.rst b/github_event/README.rst deleted file mode 100644 index 5039bce..0000000 --- a/github_event/README.rst +++ /dev/null @@ -1,34 +0,0 @@ -Github Events -============= - -This modules defines what is a GitHub event (as an Odoo object). - -.. contents:: Table of Contents - -Events ------- -As system administrator, I go to ``Configuration > Technical > GitHub > Events``. - -.. image:: static/description/menu_technical_events.png - -I see the list of events: - -.. image:: static/description/event_tree.png - -I open the form view of an event. - -.. image:: static/description/event_form.png - -Process Button --------------- -The ``Process`` button in the form view of events triggers the parsing of the payload. - -.. image:: static/description/event_form_process_button.png - -When no extra module is installed, only the ``Action`` is filled. - -Clicking multiple times on the button is idempotent. - -Contributors ------------- -* Numigi (tm) and all its contributors (https://bit.ly/numigiens) diff --git a/github_event/__init__.py b/github_event/__init__.py deleted file mode 100644 index 22b7d41..0000000 --- a/github_event/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -from . import models diff --git a/github_event/__manifest__.py b/github_event/__manifest__.py deleted file mode 100644 index 881b210..0000000 --- a/github_event/__manifest__.py +++ /dev/null @@ -1,22 +0,0 @@ -# © 2023 - Today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -{ - 'name': 'Github Events', - 'version': "14.0.1.0.0", - 'author': 'Numigi', - 'maintainer': 'Numigi', - 'website': 'https://bit.ly/numigi-com', - 'license': 'LGPL-3', - 'category': 'Connector', - 'summary': 'Define what is a github event as an odoo object', - 'depends': [ - 'base_sparse_field', - ], - 'data': [ - 'security/ir.model.access.csv', - 'views/github_event.xml', - 'views/menu.xml', - ], - 'installable': True, -} diff --git a/github_event/i18n/fr.po b/github_event/i18n/fr.po deleted file mode 100644 index 18573e9..0000000 --- a/github_event/i18n/fr.po +++ /dev/null @@ -1,102 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * github_pull_request -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-04 19:28+0000\n" -"PO-Revision-Date: 2019-12-04 14:30-0500\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: \n" -"X-Generator: Poedit 2.0.6\n" - -#. module: github_event -#: model:ir.model.fields,field_description:github_event.field_github_event__action -msgid "Action" -msgstr "Action" - -#. module: github_event -#: model:ir.model.fields,field_description:github_event.field_github_event__create_uid -msgid "Created by" -msgstr "Créé par" - -#. module: github_event -#: model:ir.model.fields,field_description:github_event.field_github_event__create_date -msgid "Created on" -msgstr "Créé le" - -#. module: github_event -#: model:ir.model.fields,field_description:github_event.field_github_event__display_name -msgid "Display Name" -msgstr "Nom affiché" - -#. module: github_event -#: model:ir.actions.act_window,name:github_event.events_action_window -#: model:ir.ui.menu,name:github_event.menu_github_event -msgid "Events" -msgstr "Événements" - -#. module: github_event -#: model:ir.ui.menu,name:github_event.menu_github -msgid "Github" -msgstr "Github" - -#. module: github_event -#: model:ir.model,name:github_event.model_github_event -#: model_terms:ir.ui.view,arch_db:github_event.github_event_form -msgid "Github Event" -msgstr "Événement Github" - -#. module: github_event -#: model_terms:ir.ui.view,arch_db:github_event.github_event_list -msgid "Github Events" -msgstr "Événements Github" - -#. module: github_event -#: model:ir.model.fields,field_description:github_event.field_github_event__id -msgid "ID" -msgstr "" - -#. module: github_event -#: model:ir.model.fields,field_description:github_event.field_github_event____last_update -msgid "Last Modified on" -msgstr "" - -#. module: github_event -#: model:ir.model.fields,field_description:github_event.field_github_event__write_uid -msgid "Last Updated by" -msgstr "" - -#. module: github_event -#: model:ir.model.fields,field_description:github_event.field_github_event__write_date -msgid "Last Updated on" -msgstr "" - -#. module: github_event -#: model:ir.model.fields,field_description:github_event.field_github_event__payload -#: model_terms:ir.ui.view,arch_db:github_event.github_event_form -msgid "Payload" -msgstr "" - -#. module: github_event -#: model:ir.model.fields,field_description:github_event.field_github_event__payload_serialized -msgid "Payload Serialized" -msgstr "" - -#. module: github_event -#: model_terms:ir.ui.view,arch_db:github_event.github_event_form -msgid "Process" -msgstr "Traîter" - -#. module: github_event -#: code:addons/github_event/models/github_event.py:40 -#, python-format -msgid "The payload does not contain a value at the path {}." -msgstr "Le payload ne contient pas de valeur sous le chemin {}." diff --git a/github_event/models/__init__.py b/github_event/models/__init__.py deleted file mode 100644 index a4baa0a..0000000 --- a/github_event/models/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -from . import ( - github_event, -) diff --git a/github_event/models/github_event.py b/github_event/models/github_event.py deleted file mode 100644 index 8a7d179..0000000 --- a/github_event/models/github_event.py +++ /dev/null @@ -1,54 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -import json -from odoo import api, fields, models, _ -from odoo.addons.base_sparse_field.models.fields import Serialized -from odoo.exceptions import ValidationError - - -class GithubEvent(models.Model): - - _name = "github.event" - _description = "Github Event" - _order = 'id desc' - - payload = fields.Text() - payload_serialized = Serialized( - compute='_compute_payload_serialized' - ) - - @api.depends('payload') - def _compute_payload_serialized(self): - events_with_payloads = self.filtered(lambda e: e.payload) - for event in events_with_payloads: - event.payload_serialized = json.loads(event.payload) - - action = fields.Char() - - def _get_value_from_payload(self, path): - """Get a value from the payload. - - :param path: a doted notation of the path to access the value. - :return: the value contained at the given path. - """ - section = self.payload_serialized - keys = path.split('.') - - for key in keys[:-1]: - if not isinstance(section, dict) or key not in section: - raise ValidationError(_( - "The payload does not contain a value at the path {}." - ).format(path)) - - section = section[key] - - return section[keys[-1]] - - def process(self): - """Process a github event. - - This method is intended to be inherited by other modules - to add extra behavior when processing a github event. - """ - self.action = self._get_value_from_payload('action') diff --git a/github_event/security/ir.model.access.csv b/github_event/security/ir.model.access.csv deleted file mode 100644 index 854100b..0000000 --- a/github_event/security/ir.model.access.csv +++ /dev/null @@ -1,3 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_github_event,access_github_event,model_github_event,base.group_user,1,0,0,0 -access_github_event_admin,access_github_event_admin,model_github_event,base.group_system,1,1,1,0 diff --git a/github_event/static/description/event_form.png b/github_event/static/description/event_form.png deleted file mode 100644 index e4206e1..0000000 Binary files a/github_event/static/description/event_form.png and /dev/null differ diff --git a/github_event/static/description/event_form_process_button.png b/github_event/static/description/event_form_process_button.png deleted file mode 100644 index 1ab06c5..0000000 Binary files a/github_event/static/description/event_form_process_button.png and /dev/null differ diff --git a/github_event/static/description/event_tree.png b/github_event/static/description/event_tree.png deleted file mode 100644 index 35764c0..0000000 Binary files a/github_event/static/description/event_tree.png and /dev/null differ diff --git a/github_event/static/description/icon.png b/github_event/static/description/icon.png deleted file mode 100644 index 92a86b1..0000000 Binary files a/github_event/static/description/icon.png and /dev/null differ diff --git a/github_event/static/description/menu_technical_events.png b/github_event/static/description/menu_technical_events.png deleted file mode 100644 index 7b91042..0000000 Binary files a/github_event/static/description/menu_technical_events.png and /dev/null differ diff --git a/github_event/tests/__init__.py b/github_event/tests/__init__.py deleted file mode 100644 index 7fa1774..0000000 --- a/github_event/tests/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). diff --git a/github_event/tests/common.py b/github_event/tests/common.py deleted file mode 100644 index 0b41d11..0000000 --- a/github_event/tests/common.py +++ /dev/null @@ -1,20 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -import os -from odoo.tests import common - - -class GithubEventCase(common.SavepointCase): - - @classmethod - def setUpClass(cls): - super().setUpClass() - cls.event_1 = cls.env['github.event'].create({}) - cls.event_2 = cls.env['github.event'].create({}) - - def _read_payload(self, filename): - test_folder = os.path.dirname(os.path.realpath(__file__)) - payload_file_path = os.path.join(test_folder, 'data', filename) - with open(payload_file_path, 'r') as file: - return file.read() diff --git a/github_event/tests/data/check_run_completed.json b/github_event/tests/data/check_run_completed.json deleted file mode 100644 index c32ddce..0000000 --- a/github_event/tests/data/check_run_completed.json +++ /dev/null @@ -1,251 +0,0 @@ -{ - "action": "completed", - "check_run": { - "id": 333445224, - "node_id": "MDg6Q2hlY2tSdW4zMzM0NDUyMjQ=", - "head_sha": "d7f4b1f4758357fa71543f48839ee28a678123ed", - "external_id": "{\"workflow-id\":\"e9af768d-2959-4db4-81b2-8dac0b3d7192\",\"actor-id\":\"581748a6-41dd-4e90-8d1d-e4fbc735aa0b\"}", - "url": "https://api.github.com/repos/Numigi/isidor12-orchestra/check-runs/333445224", - "html_url": "https://github.com/Numigi/isidor12-orchestra/runs/333445224", - "details_url": "https://circleci.com/workflow-run/e9af768d-2959-4db4-81b2-8dac0b3d7192?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-checks-link", - "status": "completed", - "conclusion": "success", - "started_at": "2019-12-04T17:08:33Z", - "completed_at": "2019-12-04T17:11:32Z", - "output": { - "title": "Workflow: odoo-run", - "summary": "* [odoo](https://circleci.com/gh/Numigi/isidor12-orchestra/132?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-checks-link) - Success", - "text": null, - "annotations_count": 0, - "annotations_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/check-runs/333445224/annotations" - }, - "name": "odoo-run", - "check_suite": { - "id": 342157118, - "node_id": "MDEwOkNoZWNrU3VpdGUzNDIxNTcxMTg=", - "head_branch": "prod", - "head_sha": "d7f4b1f4758357fa71543f48839ee28a678123ed", - "status": "completed", - "conclusion": "success", - "url": "https://api.github.com/repos/Numigi/isidor12-orchestra/check-suites/342157118", - "before": "45a3aa42df767ddc4557f07923b3991892cdf7f9", - "after": "d7f4b1f4758357fa71543f48839ee28a678123ed", - "pull_requests": [ - - ], - "app": { - "id": 18001, - "slug": "circleci-checks", - "node_id": "MDM6QXBwMTgwMDE=", - "owner": { - "login": "circleci", - "id": 1231870, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjEyMzE4NzA=", - "avatar_url": "https://avatars2.githubusercontent.com/u/1231870?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/circleci", - "html_url": "https://github.com/circleci", - "followers_url": "https://api.github.com/users/circleci/followers", - "following_url": "https://api.github.com/users/circleci/following{/other_user}", - "gists_url": "https://api.github.com/users/circleci/gists{/gist_id}", - "starred_url": "https://api.github.com/users/circleci/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/circleci/subscriptions", - "organizations_url": "https://api.github.com/users/circleci/orgs", - "repos_url": "https://api.github.com/users/circleci/repos", - "events_url": "https://api.github.com/users/circleci/events{/privacy}", - "received_events_url": "https://api.github.com/users/circleci/received_events", - "type": "Organization", - "site_admin": false - }, - "name": "CircleCI Checks", - "description": "See the status of your CircleCI workflows under the Pull Request Checks tab in the GitHub UI. With checks enabled, users will now be able to go to the Checks tab in GitHub to view the full hierarchy and status of CircleCI builds.\r\n\r\n*Note* - You cannot enable GitHub Checks for CircleCI from the GitHub UI, you must log into CircleCI and enable checks for your organization. You must have admin privileges for your organization to enable checks.", - "external_url": "https://circleci.com", - "html_url": "https://github.com/apps/circleci-checks", - "created_at": "2018-09-24T21:20:05Z", - "updated_at": "2018-10-17T15:49:07Z", - "permissions": { - "checks": "write", - "metadata": "read", - "single_file": "read" - }, - "events": [ - "check_run", - "check_suite" - ] - }, - "created_at": "2019-12-04T17:08:31Z", - "updated_at": "2019-12-04T17:11:32Z" - }, - "app": { - "id": 18001, - "slug": "circleci-checks", - "node_id": "MDM6QXBwMTgwMDE=", - "owner": { - "login": "circleci", - "id": 1231870, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjEyMzE4NzA=", - "avatar_url": "https://avatars2.githubusercontent.com/u/1231870?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/circleci", - "html_url": "https://github.com/circleci", - "followers_url": "https://api.github.com/users/circleci/followers", - "following_url": "https://api.github.com/users/circleci/following{/other_user}", - "gists_url": "https://api.github.com/users/circleci/gists{/gist_id}", - "starred_url": "https://api.github.com/users/circleci/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/circleci/subscriptions", - "organizations_url": "https://api.github.com/users/circleci/orgs", - "repos_url": "https://api.github.com/users/circleci/repos", - "events_url": "https://api.github.com/users/circleci/events{/privacy}", - "received_events_url": "https://api.github.com/users/circleci/received_events", - "type": "Organization", - "site_admin": false - }, - "name": "CircleCI Checks", - "description": "See the status of your CircleCI workflows under the Pull Request Checks tab in the GitHub UI. With checks enabled, users will now be able to go to the Checks tab in GitHub to view the full hierarchy and status of CircleCI builds.\r\n\r\n*Note* - You cannot enable GitHub Checks for CircleCI from the GitHub UI, you must log into CircleCI and enable checks for your organization. You must have admin privileges for your organization to enable checks.", - "external_url": "https://circleci.com", - "html_url": "https://github.com/apps/circleci-checks", - "created_at": "2018-09-24T21:20:05Z", - "updated_at": "2018-10-17T15:49:07Z", - "permissions": { - "checks": "write", - "metadata": "read", - "single_file": "read" - }, - "events": [ - "check_run", - "check_suite" - ] - }, - "pull_requests": [ - - ] - }, - "repository": { - "id": 194160220, - "node_id": "MDEwOlJlcG9zaXRvcnkxOTQxNjAyMjA=", - "name": "isidor12-orchestra", - "full_name": "Numigi/isidor12-orchestra", - "private": true, - "owner": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Numigi", - "html_url": "https://github.com/Numigi", - "followers_url": "https://api.github.com/users/Numigi/followers", - "following_url": "https://api.github.com/users/Numigi/following{/other_user}", - "gists_url": "https://api.github.com/users/Numigi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Numigi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Numigi/subscriptions", - "organizations_url": "https://api.github.com/users/Numigi/orgs", - "repos_url": "https://api.github.com/users/Numigi/repos", - "events_url": "https://api.github.com/users/Numigi/events{/privacy}", - "received_events_url": "https://api.github.com/users/Numigi/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/Numigi/isidor12-orchestra", - "description": "v12 de notre erp", - "fork": false, - "url": "https://api.github.com/repos/Numigi/isidor12-orchestra", - "forks_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/forks", - "keys_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/teams", - "hooks_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/hooks", - "issue_events_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/issues/events{/number}", - "events_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/events", - "assignees_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/assignees{/user}", - "branches_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/branches{/branch}", - "tags_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/tags", - "blobs_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/statuses/{sha}", - "languages_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/languages", - "stargazers_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/stargazers", - "contributors_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/contributors", - "subscribers_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/subscribers", - "subscription_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/subscription", - "commits_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/contents/{+path}", - "compare_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/merges", - "archive_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/downloads", - "issues_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/issues{/number}", - "pulls_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/pulls{/number}", - "milestones_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/milestones{/number}", - "notifications_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/labels{/name}", - "releases_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/releases{/id}", - "deployments_url": "https://api.github.com/repos/Numigi/isidor12-orchestra/deployments", - "created_at": "2019-06-27T20:39:36Z", - "updated_at": "2019-12-04T16:16:41Z", - "pushed_at": "2019-12-04T17:08:31Z", - "git_url": "git://github.com/Numigi/isidor12-orchestra.git", - "ssh_url": "git@github.com:Numigi/isidor12-orchestra.git", - "clone_url": "https://github.com/Numigi/isidor12-orchestra.git", - "svn_url": "https://github.com/Numigi/isidor12-orchestra", - "homepage": "https://isidor.numigi.net", - "size": 142, - "stargazers_count": 0, - "watchers_count": 0, - "language": null, - "has_issues": false, - "has_projects": false, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 0, - "license": null, - "forks": 0, - "open_issues": 0, - "watchers": 0, - "default_branch": "test" - }, - "organization": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "url": "https://api.github.com/orgs/Numigi", - "repos_url": "https://api.github.com/orgs/Numigi/repos", - "events_url": "https://api.github.com/orgs/Numigi/events", - "hooks_url": "https://api.github.com/orgs/Numigi/hooks", - "issues_url": "https://api.github.com/orgs/Numigi/issues", - "members_url": "https://api.github.com/orgs/Numigi/members{/member}", - "public_members_url": "https://api.github.com/orgs/Numigi/public_members{/member}", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "description": "" - }, - "sender": { - "login": "foutoucour", - "id": 547282, - "node_id": "MDQ6VXNlcjU0NzI4Mg==", - "avatar_url": "https://avatars2.githubusercontent.com/u/547282?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/foutoucour", - "html_url": "https://github.com/foutoucour", - "followers_url": "https://api.github.com/users/foutoucour/followers", - "following_url": "https://api.github.com/users/foutoucour/following{/other_user}", - "gists_url": "https://api.github.com/users/foutoucour/gists{/gist_id}", - "starred_url": "https://api.github.com/users/foutoucour/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/foutoucour/subscriptions", - "organizations_url": "https://api.github.com/users/foutoucour/orgs", - "repos_url": "https://api.github.com/users/foutoucour/repos", - "events_url": "https://api.github.com/users/foutoucour/events{/privacy}", - "received_events_url": "https://api.github.com/users/foutoucour/received_events", - "type": "User", - "site_admin": false - } -} diff --git a/github_event/tests/data/pull_request_1_merged.json b/github_event/tests/data/pull_request_1_merged.json deleted file mode 100644 index b40997b..0000000 --- a/github_event/tests/data/pull_request_1_merged.json +++ /dev/null @@ -1,505 +0,0 @@ -{ - "action": "closed", - "number": 45, - "pull_request": { - "url": "https://api.github.com/repos/Numigi/odoo-account-addons/pulls/45", - "id": 347671287, - "node_id": "MDExOlB1bGxSZXF1ZXN0MzQ3NjcxMjg3", - "html_url": "https://github.com/Numigi/odoo-account-addons/pull/45", - "diff_url": "https://github.com/Numigi/odoo-account-addons/pull/45.diff", - "patch_url": "https://github.com/Numigi/odoo-account-addons/pull/45.patch", - "issue_url": "https://api.github.com/repos/Numigi/odoo-account-addons/issues/45", - "number": 45, - "state": "closed", - "locked": false, - "title": "Add module account_show_full_features", - "user": { - "login": "ddufresne", - "id": 27902736, - "node_id": "MDQ6VXNlcjI3OTAyNzM2", - "avatar_url": "https://avatars3.githubusercontent.com/u/27902736?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/ddufresne", - "html_url": "https://github.com/ddufresne", - "followers_url": "https://api.github.com/users/ddufresne/followers", - "following_url": "https://api.github.com/users/ddufresne/following{/other_user}", - "gists_url": "https://api.github.com/users/ddufresne/gists{/gist_id}", - "starred_url": "https://api.github.com/users/ddufresne/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/ddufresne/subscriptions", - "organizations_url": "https://api.github.com/users/ddufresne/orgs", - "repos_url": "https://api.github.com/users/ddufresne/repos", - "events_url": "https://api.github.com/users/ddufresne/events{/privacy}", - "received_events_url": "https://api.github.com/users/ddufresne/received_events", - "type": "User", - "site_admin": false - }, - "body": "https://isidor.numigi.net/web#id=16549&action=292&active_id=601&model=project.task&view_type=form&menu_id=200\r\n\r\ndepends on https://github.com/Numigi/odoo-base-addons/pull/46", - "created_at": "2019-12-02T15:05:30Z", - "updated_at": "2019-12-03T11:22:06Z", - "closed_at": "2019-12-03T11:22:06Z", - "merged_at": "2019-12-03T11:22:06Z", - "merge_commit_sha": "b3ff19efb02afcf5f4b9d427db16a55de6289bc4", - "assignee": null, - "assignees": [ - - ], - "requested_reviewers": [ - - ], - "requested_teams": [ - - ], - "labels": [ - - ], - "milestone": null, - "commits_url": "https://api.github.com/repos/Numigi/odoo-account-addons/pulls/45/commits", - "review_comments_url": "https://api.github.com/repos/Numigi/odoo-account-addons/pulls/45/comments", - "review_comment_url": "https://api.github.com/repos/Numigi/odoo-account-addons/pulls/comments{/number}", - "comments_url": "https://api.github.com/repos/Numigi/odoo-account-addons/issues/45/comments", - "statuses_url": "https://api.github.com/repos/Numigi/odoo-account-addons/statuses/2b0dea7e1935f11d5a4318d190859586b9200139", - "head": { - "label": "Numigi:account_show_full_features", - "ref": "account_show_full_features", - "sha": "2b0dea7e1935f11d5a4318d190859586b9200139", - "user": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Numigi", - "html_url": "https://github.com/Numigi", - "followers_url": "https://api.github.com/users/Numigi/followers", - "following_url": "https://api.github.com/users/Numigi/following{/other_user}", - "gists_url": "https://api.github.com/users/Numigi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Numigi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Numigi/subscriptions", - "organizations_url": "https://api.github.com/users/Numigi/orgs", - "repos_url": "https://api.github.com/users/Numigi/repos", - "events_url": "https://api.github.com/users/Numigi/events{/privacy}", - "received_events_url": "https://api.github.com/users/Numigi/received_events", - "type": "Organization", - "site_admin": false - }, - "repo": { - "id": 125138732, - "node_id": "MDEwOlJlcG9zaXRvcnkxMjUxMzg3MzI=", - "name": "odoo-account-addons", - "full_name": "Numigi/odoo-account-addons", - "private": true, - "owner": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Numigi", - "html_url": "https://github.com/Numigi", - "followers_url": "https://api.github.com/users/Numigi/followers", - "following_url": "https://api.github.com/users/Numigi/following{/other_user}", - "gists_url": "https://api.github.com/users/Numigi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Numigi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Numigi/subscriptions", - "organizations_url": "https://api.github.com/users/Numigi/orgs", - "repos_url": "https://api.github.com/users/Numigi/repos", - "events_url": "https://api.github.com/users/Numigi/events{/privacy}", - "received_events_url": "https://api.github.com/users/Numigi/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/Numigi/odoo-account-addons", - "description": "Accounting related addons for Odoo", - "fork": false, - "url": "https://api.github.com/repos/Numigi/odoo-account-addons", - "forks_url": "https://api.github.com/repos/Numigi/odoo-account-addons/forks", - "keys_url": "https://api.github.com/repos/Numigi/odoo-account-addons/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/Numigi/odoo-account-addons/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/Numigi/odoo-account-addons/teams", - "hooks_url": "https://api.github.com/repos/Numigi/odoo-account-addons/hooks", - "issue_events_url": "https://api.github.com/repos/Numigi/odoo-account-addons/issues/events{/number}", - "events_url": "https://api.github.com/repos/Numigi/odoo-account-addons/events", - "assignees_url": "https://api.github.com/repos/Numigi/odoo-account-addons/assignees{/user}", - "branches_url": "https://api.github.com/repos/Numigi/odoo-account-addons/branches{/branch}", - "tags_url": "https://api.github.com/repos/Numigi/odoo-account-addons/tags", - "blobs_url": "https://api.github.com/repos/Numigi/odoo-account-addons/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/Numigi/odoo-account-addons/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/Numigi/odoo-account-addons/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/Numigi/odoo-account-addons/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/Numigi/odoo-account-addons/statuses/{sha}", - "languages_url": "https://api.github.com/repos/Numigi/odoo-account-addons/languages", - "stargazers_url": "https://api.github.com/repos/Numigi/odoo-account-addons/stargazers", - "contributors_url": "https://api.github.com/repos/Numigi/odoo-account-addons/contributors", - "subscribers_url": "https://api.github.com/repos/Numigi/odoo-account-addons/subscribers", - "subscription_url": "https://api.github.com/repos/Numigi/odoo-account-addons/subscription", - "commits_url": "https://api.github.com/repos/Numigi/odoo-account-addons/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/Numigi/odoo-account-addons/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/Numigi/odoo-account-addons/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/Numigi/odoo-account-addons/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/Numigi/odoo-account-addons/contents/{+path}", - "compare_url": "https://api.github.com/repos/Numigi/odoo-account-addons/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/Numigi/odoo-account-addons/merges", - "archive_url": "https://api.github.com/repos/Numigi/odoo-account-addons/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/Numigi/odoo-account-addons/downloads", - "issues_url": "https://api.github.com/repos/Numigi/odoo-account-addons/issues{/number}", - "pulls_url": "https://api.github.com/repos/Numigi/odoo-account-addons/pulls{/number}", - "milestones_url": "https://api.github.com/repos/Numigi/odoo-account-addons/milestones{/number}", - "notifications_url": "https://api.github.com/repos/Numigi/odoo-account-addons/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/Numigi/odoo-account-addons/labels{/name}", - "releases_url": "https://api.github.com/repos/Numigi/odoo-account-addons/releases{/id}", - "deployments_url": "https://api.github.com/repos/Numigi/odoo-account-addons/deployments", - "created_at": "2018-03-14T01:44:11Z", - "updated_at": "2019-11-29T15:51:27Z", - "pushed_at": "2019-12-03T11:22:06Z", - "git_url": "git://github.com/Numigi/odoo-account-addons.git", - "ssh_url": "git@github.com:Numigi/odoo-account-addons.git", - "clone_url": "https://github.com/Numigi/odoo-account-addons.git", - "svn_url": "https://github.com/Numigi/odoo-account-addons", - "homepage": null, - "size": 6038, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Python", - "has_issues": true, - "has_projects": false, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 0, - "license": { - "key": "lgpl-3.0", - "name": "GNU Lesser General Public License v3.0", - "spdx_id": "LGPL-3.0", - "url": "https://api.github.com/licenses/lgpl-3.0", - "node_id": "MDc6TGljZW5zZTEy" - }, - "forks": 0, - "open_issues": 0, - "watchers": 0, - "default_branch": "12.0" - } - }, - "base": { - "label": "Numigi:12.0", - "ref": "12.0", - "sha": "995b15993009c5c8cd41b282f524745ec44a8c84", - "user": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Numigi", - "html_url": "https://github.com/Numigi", - "followers_url": "https://api.github.com/users/Numigi/followers", - "following_url": "https://api.github.com/users/Numigi/following{/other_user}", - "gists_url": "https://api.github.com/users/Numigi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Numigi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Numigi/subscriptions", - "organizations_url": "https://api.github.com/users/Numigi/orgs", - "repos_url": "https://api.github.com/users/Numigi/repos", - "events_url": "https://api.github.com/users/Numigi/events{/privacy}", - "received_events_url": "https://api.github.com/users/Numigi/received_events", - "type": "Organization", - "site_admin": false - }, - "repo": { - "id": 125138732, - "node_id": "MDEwOlJlcG9zaXRvcnkxMjUxMzg3MzI=", - "name": "odoo-account-addons", - "full_name": "Numigi/odoo-account-addons", - "private": true, - "owner": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Numigi", - "html_url": "https://github.com/Numigi", - "followers_url": "https://api.github.com/users/Numigi/followers", - "following_url": "https://api.github.com/users/Numigi/following{/other_user}", - "gists_url": "https://api.github.com/users/Numigi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Numigi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Numigi/subscriptions", - "organizations_url": "https://api.github.com/users/Numigi/orgs", - "repos_url": "https://api.github.com/users/Numigi/repos", - "events_url": "https://api.github.com/users/Numigi/events{/privacy}", - "received_events_url": "https://api.github.com/users/Numigi/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/Numigi/odoo-account-addons", - "description": "Accounting related addons for Odoo", - "fork": false, - "url": "https://api.github.com/repos/Numigi/odoo-account-addons", - "forks_url": "https://api.github.com/repos/Numigi/odoo-account-addons/forks", - "keys_url": "https://api.github.com/repos/Numigi/odoo-account-addons/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/Numigi/odoo-account-addons/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/Numigi/odoo-account-addons/teams", - "hooks_url": "https://api.github.com/repos/Numigi/odoo-account-addons/hooks", - "issue_events_url": "https://api.github.com/repos/Numigi/odoo-account-addons/issues/events{/number}", - "events_url": "https://api.github.com/repos/Numigi/odoo-account-addons/events", - "assignees_url": "https://api.github.com/repos/Numigi/odoo-account-addons/assignees{/user}", - "branches_url": "https://api.github.com/repos/Numigi/odoo-account-addons/branches{/branch}", - "tags_url": "https://api.github.com/repos/Numigi/odoo-account-addons/tags", - "blobs_url": "https://api.github.com/repos/Numigi/odoo-account-addons/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/Numigi/odoo-account-addons/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/Numigi/odoo-account-addons/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/Numigi/odoo-account-addons/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/Numigi/odoo-account-addons/statuses/{sha}", - "languages_url": "https://api.github.com/repos/Numigi/odoo-account-addons/languages", - "stargazers_url": "https://api.github.com/repos/Numigi/odoo-account-addons/stargazers", - "contributors_url": "https://api.github.com/repos/Numigi/odoo-account-addons/contributors", - "subscribers_url": "https://api.github.com/repos/Numigi/odoo-account-addons/subscribers", - "subscription_url": "https://api.github.com/repos/Numigi/odoo-account-addons/subscription", - "commits_url": "https://api.github.com/repos/Numigi/odoo-account-addons/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/Numigi/odoo-account-addons/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/Numigi/odoo-account-addons/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/Numigi/odoo-account-addons/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/Numigi/odoo-account-addons/contents/{+path}", - "compare_url": "https://api.github.com/repos/Numigi/odoo-account-addons/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/Numigi/odoo-account-addons/merges", - "archive_url": "https://api.github.com/repos/Numigi/odoo-account-addons/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/Numigi/odoo-account-addons/downloads", - "issues_url": "https://api.github.com/repos/Numigi/odoo-account-addons/issues{/number}", - "pulls_url": "https://api.github.com/repos/Numigi/odoo-account-addons/pulls{/number}", - "milestones_url": "https://api.github.com/repos/Numigi/odoo-account-addons/milestones{/number}", - "notifications_url": "https://api.github.com/repos/Numigi/odoo-account-addons/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/Numigi/odoo-account-addons/labels{/name}", - "releases_url": "https://api.github.com/repos/Numigi/odoo-account-addons/releases{/id}", - "deployments_url": "https://api.github.com/repos/Numigi/odoo-account-addons/deployments", - "created_at": "2018-03-14T01:44:11Z", - "updated_at": "2019-11-29T15:51:27Z", - "pushed_at": "2019-12-03T11:22:06Z", - "git_url": "git://github.com/Numigi/odoo-account-addons.git", - "ssh_url": "git@github.com:Numigi/odoo-account-addons.git", - "clone_url": "https://github.com/Numigi/odoo-account-addons.git", - "svn_url": "https://github.com/Numigi/odoo-account-addons", - "homepage": null, - "size": 6038, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Python", - "has_issues": true, - "has_projects": false, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 0, - "license": { - "key": "lgpl-3.0", - "name": "GNU Lesser General Public License v3.0", - "spdx_id": "LGPL-3.0", - "url": "https://api.github.com/licenses/lgpl-3.0", - "node_id": "MDc6TGljZW5zZTEy" - }, - "forks": 0, - "open_issues": 0, - "watchers": 0, - "default_branch": "12.0" - } - }, - "_links": { - "self": { - "href": "https://api.github.com/repos/Numigi/odoo-account-addons/pulls/45" - }, - "html": { - "href": "https://github.com/Numigi/odoo-account-addons/pull/45" - }, - "issue": { - "href": "https://api.github.com/repos/Numigi/odoo-account-addons/issues/45" - }, - "comments": { - "href": "https://api.github.com/repos/Numigi/odoo-account-addons/issues/45/comments" - }, - "review_comments": { - "href": "https://api.github.com/repos/Numigi/odoo-account-addons/pulls/45/comments" - }, - "review_comment": { - "href": "https://api.github.com/repos/Numigi/odoo-account-addons/pulls/comments{/number}" - }, - "commits": { - "href": "https://api.github.com/repos/Numigi/odoo-account-addons/pulls/45/commits" - }, - "statuses": { - "href": "https://api.github.com/repos/Numigi/odoo-account-addons/statuses/2b0dea7e1935f11d5a4318d190859586b9200139" - } - }, - "author_association": "CONTRIBUTOR", - "draft": false, - "merged": true, - "mergeable": null, - "rebaseable": null, - "mergeable_state": "unknown", - "merged_by": { - "login": "numigi-robot", - "id": 46463621, - "node_id": "MDQ6VXNlcjQ2NDYzNjIx", - "avatar_url": "https://avatars2.githubusercontent.com/u/46463621?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/numigi-robot", - "html_url": "https://github.com/numigi-robot", - "followers_url": "https://api.github.com/users/numigi-robot/followers", - "following_url": "https://api.github.com/users/numigi-robot/following{/other_user}", - "gists_url": "https://api.github.com/users/numigi-robot/gists{/gist_id}", - "starred_url": "https://api.github.com/users/numigi-robot/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/numigi-robot/subscriptions", - "organizations_url": "https://api.github.com/users/numigi-robot/orgs", - "repos_url": "https://api.github.com/users/numigi-robot/repos", - "events_url": "https://api.github.com/users/numigi-robot/events{/privacy}", - "received_events_url": "https://api.github.com/users/numigi-robot/received_events", - "type": "User", - "site_admin": false - }, - "comments": 0, - "review_comments": 0, - "maintainer_can_modify": false, - "commits": 1, - "additions": 109, - "deletions": 1, - "changed_files": 13 - }, - "repository": { - "id": 125138732, - "node_id": "MDEwOlJlcG9zaXRvcnkxMjUxMzg3MzI=", - "name": "odoo-account-addons", - "full_name": "Numigi/odoo-account-addons", - "private": true, - "owner": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Numigi", - "html_url": "https://github.com/Numigi", - "followers_url": "https://api.github.com/users/Numigi/followers", - "following_url": "https://api.github.com/users/Numigi/following{/other_user}", - "gists_url": "https://api.github.com/users/Numigi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Numigi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Numigi/subscriptions", - "organizations_url": "https://api.github.com/users/Numigi/orgs", - "repos_url": "https://api.github.com/users/Numigi/repos", - "events_url": "https://api.github.com/users/Numigi/events{/privacy}", - "received_events_url": "https://api.github.com/users/Numigi/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/Numigi/odoo-account-addons", - "description": "Accounting related addons for Odoo", - "fork": false, - "url": "https://api.github.com/repos/Numigi/odoo-account-addons", - "forks_url": "https://api.github.com/repos/Numigi/odoo-account-addons/forks", - "keys_url": "https://api.github.com/repos/Numigi/odoo-account-addons/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/Numigi/odoo-account-addons/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/Numigi/odoo-account-addons/teams", - "hooks_url": "https://api.github.com/repos/Numigi/odoo-account-addons/hooks", - "issue_events_url": "https://api.github.com/repos/Numigi/odoo-account-addons/issues/events{/number}", - "events_url": "https://api.github.com/repos/Numigi/odoo-account-addons/events", - "assignees_url": "https://api.github.com/repos/Numigi/odoo-account-addons/assignees{/user}", - "branches_url": "https://api.github.com/repos/Numigi/odoo-account-addons/branches{/branch}", - "tags_url": "https://api.github.com/repos/Numigi/odoo-account-addons/tags", - "blobs_url": "https://api.github.com/repos/Numigi/odoo-account-addons/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/Numigi/odoo-account-addons/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/Numigi/odoo-account-addons/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/Numigi/odoo-account-addons/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/Numigi/odoo-account-addons/statuses/{sha}", - "languages_url": "https://api.github.com/repos/Numigi/odoo-account-addons/languages", - "stargazers_url": "https://api.github.com/repos/Numigi/odoo-account-addons/stargazers", - "contributors_url": "https://api.github.com/repos/Numigi/odoo-account-addons/contributors", - "subscribers_url": "https://api.github.com/repos/Numigi/odoo-account-addons/subscribers", - "subscription_url": "https://api.github.com/repos/Numigi/odoo-account-addons/subscription", - "commits_url": "https://api.github.com/repos/Numigi/odoo-account-addons/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/Numigi/odoo-account-addons/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/Numigi/odoo-account-addons/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/Numigi/odoo-account-addons/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/Numigi/odoo-account-addons/contents/{+path}", - "compare_url": "https://api.github.com/repos/Numigi/odoo-account-addons/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/Numigi/odoo-account-addons/merges", - "archive_url": "https://api.github.com/repos/Numigi/odoo-account-addons/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/Numigi/odoo-account-addons/downloads", - "issues_url": "https://api.github.com/repos/Numigi/odoo-account-addons/issues{/number}", - "pulls_url": "https://api.github.com/repos/Numigi/odoo-account-addons/pulls{/number}", - "milestones_url": "https://api.github.com/repos/Numigi/odoo-account-addons/milestones{/number}", - "notifications_url": "https://api.github.com/repos/Numigi/odoo-account-addons/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/Numigi/odoo-account-addons/labels{/name}", - "releases_url": "https://api.github.com/repos/Numigi/odoo-account-addons/releases{/id}", - "deployments_url": "https://api.github.com/repos/Numigi/odoo-account-addons/deployments", - "created_at": "2018-03-14T01:44:11Z", - "updated_at": "2019-11-29T15:51:27Z", - "pushed_at": "2019-12-03T11:22:06Z", - "git_url": "git://github.com/Numigi/odoo-account-addons.git", - "ssh_url": "git@github.com:Numigi/odoo-account-addons.git", - "clone_url": "https://github.com/Numigi/odoo-account-addons.git", - "svn_url": "https://github.com/Numigi/odoo-account-addons", - "homepage": null, - "size": 6038, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Python", - "has_issues": true, - "has_projects": false, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 0, - "license": { - "key": "lgpl-3.0", - "name": "GNU Lesser General Public License v3.0", - "spdx_id": "LGPL-3.0", - "url": "https://api.github.com/licenses/lgpl-3.0", - "node_id": "MDc6TGljZW5zZTEy" - }, - "forks": 0, - "open_issues": 0, - "watchers": 0, - "default_branch": "12.0" - }, - "organization": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "url": "https://api.github.com/orgs/Numigi", - "repos_url": "https://api.github.com/orgs/Numigi/repos", - "events_url": "https://api.github.com/orgs/Numigi/events", - "hooks_url": "https://api.github.com/orgs/Numigi/hooks", - "issues_url": "https://api.github.com/orgs/Numigi/issues", - "members_url": "https://api.github.com/orgs/Numigi/members{/member}", - "public_members_url": "https://api.github.com/orgs/Numigi/public_members{/member}", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "description": "" - }, - "sender": { - "login": "numigi-robot", - "id": 46463621, - "node_id": "MDQ6VXNlcjQ2NDYzNjIx", - "avatar_url": "https://avatars2.githubusercontent.com/u/46463621?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/numigi-robot", - "html_url": "https://github.com/numigi-robot", - "followers_url": "https://api.github.com/users/numigi-robot/followers", - "following_url": "https://api.github.com/users/numigi-robot/following{/other_user}", - "gists_url": "https://api.github.com/users/numigi-robot/gists{/gist_id}", - "starred_url": "https://api.github.com/users/numigi-robot/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/numigi-robot/subscriptions", - "organizations_url": "https://api.github.com/users/numigi-robot/orgs", - "repos_url": "https://api.github.com/users/numigi-robot/repos", - "events_url": "https://api.github.com/users/numigi-robot/events{/privacy}", - "received_events_url": "https://api.github.com/users/numigi-robot/received_events", - "type": "User", - "site_admin": false - } -} diff --git a/github_event/tests/data/pull_request_2_closed.json b/github_event/tests/data/pull_request_2_closed.json deleted file mode 100644 index 6a1dba4..0000000 --- a/github_event/tests/data/pull_request_2_closed.json +++ /dev/null @@ -1,486 +0,0 @@ -{ - "action": "closed", - "number": 5, - "pull_request": { - "url": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls/5", - "id": 344597866, - "node_id": "MDExOlB1bGxSZXF1ZXN0MzQ0NTk3ODY2", - "html_url": "https://github.com/Numigi/odoo-git-addons/pull/5", - "diff_url": "https://github.com/Numigi/odoo-git-addons/pull/5.diff", - "patch_url": "https://github.com/Numigi/odoo-git-addons/pull/5.patch", - "issue_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/5", - "number": 5, - "state": "closed", - "locked": false, - "title": "Add better logging", - "user": { - "login": "ddufresne", - "id": 27902736, - "node_id": "MDQ6VXNlcjI3OTAyNzM2", - "avatar_url": "https://avatars3.githubusercontent.com/u/27902736?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/ddufresne", - "html_url": "https://github.com/ddufresne", - "followers_url": "https://api.github.com/users/ddufresne/followers", - "following_url": "https://api.github.com/users/ddufresne/following{/other_user}", - "gists_url": "https://api.github.com/users/ddufresne/gists{/gist_id}", - "starred_url": "https://api.github.com/users/ddufresne/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/ddufresne/subscriptions", - "organizations_url": "https://api.github.com/users/ddufresne/orgs", - "repos_url": "https://api.github.com/users/ddufresne/repos", - "events_url": "https://api.github.com/users/ddufresne/events{/privacy}", - "received_events_url": "https://api.github.com/users/ddufresne/received_events", - "type": "User", - "site_admin": false - }, - "body": "", - "created_at": "2019-11-22T16:26:14Z", - "updated_at": "2019-11-22T17:12:05Z", - "closed_at": "2019-11-22T17:12:04Z", - "merged_at": null, - "merge_commit_sha": "3dd95f6672e30bd9951c69bcbbc83e78733b6d7d", - "assignee": null, - "assignees": [ - - ], - "requested_reviewers": [ - - ], - "requested_teams": [ - - ], - "labels": [ - - ], - "milestone": null, - "commits_url": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls/5/commits", - "review_comments_url": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls/5/comments", - "review_comment_url": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls/comments{/number}", - "comments_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/5/comments", - "statuses_url": "https://api.github.com/repos/Numigi/odoo-git-addons/statuses/8390440505eca84d057a0a8ef5a2bcf60b3681ee", - "head": { - "label": "Numigi:12.0-test", - "ref": "12.0-test", - "sha": "8390440505eca84d057a0a8ef5a2bcf60b3681ee", - "user": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Numigi", - "html_url": "https://github.com/Numigi", - "followers_url": "https://api.github.com/users/Numigi/followers", - "following_url": "https://api.github.com/users/Numigi/following{/other_user}", - "gists_url": "https://api.github.com/users/Numigi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Numigi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Numigi/subscriptions", - "organizations_url": "https://api.github.com/users/Numigi/orgs", - "repos_url": "https://api.github.com/users/Numigi/repos", - "events_url": "https://api.github.com/users/Numigi/events{/privacy}", - "received_events_url": "https://api.github.com/users/Numigi/received_events", - "type": "Organization", - "site_admin": false - }, - "repo": { - "id": 221295296, - "node_id": "MDEwOlJlcG9zaXRvcnkyMjEyOTUyOTY=", - "name": "odoo-git-addons", - "full_name": "Numigi/odoo-git-addons", - "private": false, - "owner": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Numigi", - "html_url": "https://github.com/Numigi", - "followers_url": "https://api.github.com/users/Numigi/followers", - "following_url": "https://api.github.com/users/Numigi/following{/other_user}", - "gists_url": "https://api.github.com/users/Numigi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Numigi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Numigi/subscriptions", - "organizations_url": "https://api.github.com/users/Numigi/orgs", - "repos_url": "https://api.github.com/users/Numigi/repos", - "events_url": "https://api.github.com/users/Numigi/events{/privacy}", - "received_events_url": "https://api.github.com/users/Numigi/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/Numigi/odoo-git-addons", - "description": "git and github related odoo modules", - "fork": false, - "url": "https://api.github.com/repos/Numigi/odoo-git-addons", - "forks_url": "https://api.github.com/repos/Numigi/odoo-git-addons/forks", - "keys_url": "https://api.github.com/repos/Numigi/odoo-git-addons/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/Numigi/odoo-git-addons/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/Numigi/odoo-git-addons/teams", - "hooks_url": "https://api.github.com/repos/Numigi/odoo-git-addons/hooks", - "issue_events_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/events{/number}", - "events_url": "https://api.github.com/repos/Numigi/odoo-git-addons/events", - "assignees_url": "https://api.github.com/repos/Numigi/odoo-git-addons/assignees{/user}", - "branches_url": "https://api.github.com/repos/Numigi/odoo-git-addons/branches{/branch}", - "tags_url": "https://api.github.com/repos/Numigi/odoo-git-addons/tags", - "blobs_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/Numigi/odoo-git-addons/statuses/{sha}", - "languages_url": "https://api.github.com/repos/Numigi/odoo-git-addons/languages", - "stargazers_url": "https://api.github.com/repos/Numigi/odoo-git-addons/stargazers", - "contributors_url": "https://api.github.com/repos/Numigi/odoo-git-addons/contributors", - "subscribers_url": "https://api.github.com/repos/Numigi/odoo-git-addons/subscribers", - "subscription_url": "https://api.github.com/repos/Numigi/odoo-git-addons/subscription", - "commits_url": "https://api.github.com/repos/Numigi/odoo-git-addons/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/Numigi/odoo-git-addons/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/Numigi/odoo-git-addons/contents/{+path}", - "compare_url": "https://api.github.com/repos/Numigi/odoo-git-addons/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/Numigi/odoo-git-addons/merges", - "archive_url": "https://api.github.com/repos/Numigi/odoo-git-addons/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/Numigi/odoo-git-addons/downloads", - "issues_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues{/number}", - "pulls_url": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls{/number}", - "milestones_url": "https://api.github.com/repos/Numigi/odoo-git-addons/milestones{/number}", - "notifications_url": "https://api.github.com/repos/Numigi/odoo-git-addons/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/Numigi/odoo-git-addons/labels{/name}", - "releases_url": "https://api.github.com/repos/Numigi/odoo-git-addons/releases{/id}", - "deployments_url": "https://api.github.com/repos/Numigi/odoo-git-addons/deployments", - "created_at": "2019-11-12T19:27:26Z", - "updated_at": "2019-11-20T15:39:53Z", - "pushed_at": "2019-11-22T16:26:15Z", - "git_url": "git://github.com/Numigi/odoo-git-addons.git", - "ssh_url": "git@github.com:Numigi/odoo-git-addons.git", - "clone_url": "https://github.com/Numigi/odoo-git-addons.git", - "svn_url": "https://github.com/Numigi/odoo-git-addons", - "homepage": null, - "size": 1445, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Python", - "has_issues": true, - "has_projects": false, - "has_downloads": true, - "has_wiki": false, - "has_pages": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 0, - "license": { - "key": "agpl-3.0", - "name": "GNU Affero General Public License v3.0", - "spdx_id": "AGPL-3.0", - "url": "https://api.github.com/licenses/agpl-3.0", - "node_id": "MDc6TGljZW5zZTE=" - }, - "forks": 0, - "open_issues": 0, - "watchers": 0, - "default_branch": "12.0" - } - }, - "base": { - "label": "Numigi:12.0", - "ref": "12.0", - "sha": "d938c7456c526fd9a471cf4a8b11ae1710a16d02", - "user": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Numigi", - "html_url": "https://github.com/Numigi", - "followers_url": "https://api.github.com/users/Numigi/followers", - "following_url": "https://api.github.com/users/Numigi/following{/other_user}", - "gists_url": "https://api.github.com/users/Numigi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Numigi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Numigi/subscriptions", - "organizations_url": "https://api.github.com/users/Numigi/orgs", - "repos_url": "https://api.github.com/users/Numigi/repos", - "events_url": "https://api.github.com/users/Numigi/events{/privacy}", - "received_events_url": "https://api.github.com/users/Numigi/received_events", - "type": "Organization", - "site_admin": false - }, - "repo": { - "id": 221295296, - "node_id": "MDEwOlJlcG9zaXRvcnkyMjEyOTUyOTY=", - "name": "odoo-git-addons", - "full_name": "Numigi/odoo-git-addons", - "private": false, - "owner": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Numigi", - "html_url": "https://github.com/Numigi", - "followers_url": "https://api.github.com/users/Numigi/followers", - "following_url": "https://api.github.com/users/Numigi/following{/other_user}", - "gists_url": "https://api.github.com/users/Numigi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Numigi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Numigi/subscriptions", - "organizations_url": "https://api.github.com/users/Numigi/orgs", - "repos_url": "https://api.github.com/users/Numigi/repos", - "events_url": "https://api.github.com/users/Numigi/events{/privacy}", - "received_events_url": "https://api.github.com/users/Numigi/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/Numigi/odoo-git-addons", - "description": "git and github related odoo modules", - "fork": false, - "url": "https://api.github.com/repos/Numigi/odoo-git-addons", - "forks_url": "https://api.github.com/repos/Numigi/odoo-git-addons/forks", - "keys_url": "https://api.github.com/repos/Numigi/odoo-git-addons/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/Numigi/odoo-git-addons/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/Numigi/odoo-git-addons/teams", - "hooks_url": "https://api.github.com/repos/Numigi/odoo-git-addons/hooks", - "issue_events_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/events{/number}", - "events_url": "https://api.github.com/repos/Numigi/odoo-git-addons/events", - "assignees_url": "https://api.github.com/repos/Numigi/odoo-git-addons/assignees{/user}", - "branches_url": "https://api.github.com/repos/Numigi/odoo-git-addons/branches{/branch}", - "tags_url": "https://api.github.com/repos/Numigi/odoo-git-addons/tags", - "blobs_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/Numigi/odoo-git-addons/statuses/{sha}", - "languages_url": "https://api.github.com/repos/Numigi/odoo-git-addons/languages", - "stargazers_url": "https://api.github.com/repos/Numigi/odoo-git-addons/stargazers", - "contributors_url": "https://api.github.com/repos/Numigi/odoo-git-addons/contributors", - "subscribers_url": "https://api.github.com/repos/Numigi/odoo-git-addons/subscribers", - "subscription_url": "https://api.github.com/repos/Numigi/odoo-git-addons/subscription", - "commits_url": "https://api.github.com/repos/Numigi/odoo-git-addons/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/Numigi/odoo-git-addons/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/Numigi/odoo-git-addons/contents/{+path}", - "compare_url": "https://api.github.com/repos/Numigi/odoo-git-addons/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/Numigi/odoo-git-addons/merges", - "archive_url": "https://api.github.com/repos/Numigi/odoo-git-addons/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/Numigi/odoo-git-addons/downloads", - "issues_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues{/number}", - "pulls_url": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls{/number}", - "milestones_url": "https://api.github.com/repos/Numigi/odoo-git-addons/milestones{/number}", - "notifications_url": "https://api.github.com/repos/Numigi/odoo-git-addons/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/Numigi/odoo-git-addons/labels{/name}", - "releases_url": "https://api.github.com/repos/Numigi/odoo-git-addons/releases{/id}", - "deployments_url": "https://api.github.com/repos/Numigi/odoo-git-addons/deployments", - "created_at": "2019-11-12T19:27:26Z", - "updated_at": "2019-11-20T15:39:53Z", - "pushed_at": "2019-11-22T16:26:15Z", - "git_url": "git://github.com/Numigi/odoo-git-addons.git", - "ssh_url": "git@github.com:Numigi/odoo-git-addons.git", - "clone_url": "https://github.com/Numigi/odoo-git-addons.git", - "svn_url": "https://github.com/Numigi/odoo-git-addons", - "homepage": null, - "size": 1445, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Python", - "has_issues": true, - "has_projects": false, - "has_downloads": true, - "has_wiki": false, - "has_pages": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 0, - "license": { - "key": "agpl-3.0", - "name": "GNU Affero General Public License v3.0", - "spdx_id": "AGPL-3.0", - "url": "https://api.github.com/licenses/agpl-3.0", - "node_id": "MDc6TGljZW5zZTE=" - }, - "forks": 0, - "open_issues": 0, - "watchers": 0, - "default_branch": "12.0" - } - }, - "_links": { - "self": { - "href": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls/5" - }, - "html": { - "href": "https://github.com/Numigi/odoo-git-addons/pull/5" - }, - "issue": { - "href": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/5" - }, - "comments": { - "href": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/5/comments" - }, - "review_comments": { - "href": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls/5/comments" - }, - "review_comment": { - "href": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls/comments{/number}" - }, - "commits": { - "href": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls/5/commits" - }, - "statuses": { - "href": "https://api.github.com/repos/Numigi/odoo-git-addons/statuses/8390440505eca84d057a0a8ef5a2bcf60b3681ee" - } - }, - "author_association": "CONTRIBUTOR", - "draft": false, - "merged": false, - "mergeable": true, - "rebaseable": true, - "mergeable_state": "clean", - "merged_by": null, - "comments": 1, - "review_comments": 0, - "maintainer_can_modify": false, - "commits": 1, - "additions": 5, - "deletions": 0, - "changed_files": 1 - }, - "repository": { - "id": 221295296, - "node_id": "MDEwOlJlcG9zaXRvcnkyMjEyOTUyOTY=", - "name": "odoo-git-addons", - "full_name": "Numigi/odoo-git-addons", - "private": false, - "owner": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Numigi", - "html_url": "https://github.com/Numigi", - "followers_url": "https://api.github.com/users/Numigi/followers", - "following_url": "https://api.github.com/users/Numigi/following{/other_user}", - "gists_url": "https://api.github.com/users/Numigi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Numigi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Numigi/subscriptions", - "organizations_url": "https://api.github.com/users/Numigi/orgs", - "repos_url": "https://api.github.com/users/Numigi/repos", - "events_url": "https://api.github.com/users/Numigi/events{/privacy}", - "received_events_url": "https://api.github.com/users/Numigi/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/Numigi/odoo-git-addons", - "description": "git and github related odoo modules", - "fork": false, - "url": "https://api.github.com/repos/Numigi/odoo-git-addons", - "forks_url": "https://api.github.com/repos/Numigi/odoo-git-addons/forks", - "keys_url": "https://api.github.com/repos/Numigi/odoo-git-addons/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/Numigi/odoo-git-addons/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/Numigi/odoo-git-addons/teams", - "hooks_url": "https://api.github.com/repos/Numigi/odoo-git-addons/hooks", - "issue_events_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/events{/number}", - "events_url": "https://api.github.com/repos/Numigi/odoo-git-addons/events", - "assignees_url": "https://api.github.com/repos/Numigi/odoo-git-addons/assignees{/user}", - "branches_url": "https://api.github.com/repos/Numigi/odoo-git-addons/branches{/branch}", - "tags_url": "https://api.github.com/repos/Numigi/odoo-git-addons/tags", - "blobs_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/Numigi/odoo-git-addons/statuses/{sha}", - "languages_url": "https://api.github.com/repos/Numigi/odoo-git-addons/languages", - "stargazers_url": "https://api.github.com/repos/Numigi/odoo-git-addons/stargazers", - "contributors_url": "https://api.github.com/repos/Numigi/odoo-git-addons/contributors", - "subscribers_url": "https://api.github.com/repos/Numigi/odoo-git-addons/subscribers", - "subscription_url": "https://api.github.com/repos/Numigi/odoo-git-addons/subscription", - "commits_url": "https://api.github.com/repos/Numigi/odoo-git-addons/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/Numigi/odoo-git-addons/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/Numigi/odoo-git-addons/contents/{+path}", - "compare_url": "https://api.github.com/repos/Numigi/odoo-git-addons/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/Numigi/odoo-git-addons/merges", - "archive_url": "https://api.github.com/repos/Numigi/odoo-git-addons/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/Numigi/odoo-git-addons/downloads", - "issues_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues{/number}", - "pulls_url": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls{/number}", - "milestones_url": "https://api.github.com/repos/Numigi/odoo-git-addons/milestones{/number}", - "notifications_url": "https://api.github.com/repos/Numigi/odoo-git-addons/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/Numigi/odoo-git-addons/labels{/name}", - "releases_url": "https://api.github.com/repos/Numigi/odoo-git-addons/releases{/id}", - "deployments_url": "https://api.github.com/repos/Numigi/odoo-git-addons/deployments", - "created_at": "2019-11-12T19:27:26Z", - "updated_at": "2019-11-20T15:39:53Z", - "pushed_at": "2019-11-22T16:26:15Z", - "git_url": "git://github.com/Numigi/odoo-git-addons.git", - "ssh_url": "git@github.com:Numigi/odoo-git-addons.git", - "clone_url": "https://github.com/Numigi/odoo-git-addons.git", - "svn_url": "https://github.com/Numigi/odoo-git-addons", - "homepage": null, - "size": 1445, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Python", - "has_issues": true, - "has_projects": false, - "has_downloads": true, - "has_wiki": false, - "has_pages": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 0, - "license": { - "key": "agpl-3.0", - "name": "GNU Affero General Public License v3.0", - "spdx_id": "AGPL-3.0", - "url": "https://api.github.com/licenses/agpl-3.0", - "node_id": "MDc6TGljZW5zZTE=" - }, - "forks": 0, - "open_issues": 0, - "watchers": 0, - "default_branch": "12.0" - }, - "organization": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "url": "https://api.github.com/orgs/Numigi", - "repos_url": "https://api.github.com/orgs/Numigi/repos", - "events_url": "https://api.github.com/orgs/Numigi/events", - "hooks_url": "https://api.github.com/orgs/Numigi/hooks", - "issues_url": "https://api.github.com/orgs/Numigi/issues", - "members_url": "https://api.github.com/orgs/Numigi/members{/member}", - "public_members_url": "https://api.github.com/orgs/Numigi/public_members{/member}", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "description": "" - }, - "sender": { - "login": "ddufresne", - "id": 27902736, - "node_id": "MDQ6VXNlcjI3OTAyNzM2", - "avatar_url": "https://avatars3.githubusercontent.com/u/27902736?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/ddufresne", - "html_url": "https://github.com/ddufresne", - "followers_url": "https://api.github.com/users/ddufresne/followers", - "following_url": "https://api.github.com/users/ddufresne/following{/other_user}", - "gists_url": "https://api.github.com/users/ddufresne/gists{/gist_id}", - "starred_url": "https://api.github.com/users/ddufresne/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/ddufresne/subscriptions", - "organizations_url": "https://api.github.com/users/ddufresne/orgs", - "repos_url": "https://api.github.com/users/ddufresne/repos", - "events_url": "https://api.github.com/users/ddufresne/events{/privacy}", - "received_events_url": "https://api.github.com/users/ddufresne/received_events", - "type": "User", - "site_admin": false - } -} diff --git a/github_event/tests/data/pull_request_2_reopened.json b/github_event/tests/data/pull_request_2_reopened.json deleted file mode 100644 index 321d804..0000000 --- a/github_event/tests/data/pull_request_2_reopened.json +++ /dev/null @@ -1,486 +0,0 @@ -{ - "action": "reopened", - "number": 5, - "pull_request": { - "url": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls/5", - "id": 344597866, - "node_id": "MDExOlB1bGxSZXF1ZXN0MzQ0NTk3ODY2", - "html_url": "https://github.com/Numigi/odoo-git-addons/pull/5", - "diff_url": "https://github.com/Numigi/odoo-git-addons/pull/5.diff", - "patch_url": "https://github.com/Numigi/odoo-git-addons/pull/5.patch", - "issue_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/5", - "number": 5, - "state": "open", - "locked": false, - "title": "Add better logging", - "user": { - "login": "ddufresne", - "id": 27902736, - "node_id": "MDQ6VXNlcjI3OTAyNzM2", - "avatar_url": "https://avatars3.githubusercontent.com/u/27902736?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/ddufresne", - "html_url": "https://github.com/ddufresne", - "followers_url": "https://api.github.com/users/ddufresne/followers", - "following_url": "https://api.github.com/users/ddufresne/following{/other_user}", - "gists_url": "https://api.github.com/users/ddufresne/gists{/gist_id}", - "starred_url": "https://api.github.com/users/ddufresne/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/ddufresne/subscriptions", - "organizations_url": "https://api.github.com/users/ddufresne/orgs", - "repos_url": "https://api.github.com/users/ddufresne/repos", - "events_url": "https://api.github.com/users/ddufresne/events{/privacy}", - "received_events_url": "https://api.github.com/users/ddufresne/received_events", - "type": "User", - "site_admin": false - }, - "body": "", - "created_at": "2019-11-22T16:26:14Z", - "updated_at": "2019-11-22T17:50:29Z", - "closed_at": null, - "merged_at": null, - "merge_commit_sha": "91f9bdd40634745bb5825bcd122f34df6ab5c027", - "assignee": null, - "assignees": [ - - ], - "requested_reviewers": [ - - ], - "requested_teams": [ - - ], - "labels": [ - - ], - "milestone": null, - "commits_url": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls/5/commits", - "review_comments_url": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls/5/comments", - "review_comment_url": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls/comments{/number}", - "comments_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/5/comments", - "statuses_url": "https://api.github.com/repos/Numigi/odoo-git-addons/statuses/8390440505eca84d057a0a8ef5a2bcf60b3681ee", - "head": { - "label": "Numigi:12.0-test", - "ref": "12.0-test", - "sha": "8390440505eca84d057a0a8ef5a2bcf60b3681ee", - "user": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Numigi", - "html_url": "https://github.com/Numigi", - "followers_url": "https://api.github.com/users/Numigi/followers", - "following_url": "https://api.github.com/users/Numigi/following{/other_user}", - "gists_url": "https://api.github.com/users/Numigi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Numigi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Numigi/subscriptions", - "organizations_url": "https://api.github.com/users/Numigi/orgs", - "repos_url": "https://api.github.com/users/Numigi/repos", - "events_url": "https://api.github.com/users/Numigi/events{/privacy}", - "received_events_url": "https://api.github.com/users/Numigi/received_events", - "type": "Organization", - "site_admin": false - }, - "repo": { - "id": 221295296, - "node_id": "MDEwOlJlcG9zaXRvcnkyMjEyOTUyOTY=", - "name": "odoo-git-addons", - "full_name": "Numigi/odoo-git-addons", - "private": false, - "owner": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Numigi", - "html_url": "https://github.com/Numigi", - "followers_url": "https://api.github.com/users/Numigi/followers", - "following_url": "https://api.github.com/users/Numigi/following{/other_user}", - "gists_url": "https://api.github.com/users/Numigi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Numigi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Numigi/subscriptions", - "organizations_url": "https://api.github.com/users/Numigi/orgs", - "repos_url": "https://api.github.com/users/Numigi/repos", - "events_url": "https://api.github.com/users/Numigi/events{/privacy}", - "received_events_url": "https://api.github.com/users/Numigi/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/Numigi/odoo-git-addons", - "description": "git and github related odoo modules", - "fork": false, - "url": "https://api.github.com/repos/Numigi/odoo-git-addons", - "forks_url": "https://api.github.com/repos/Numigi/odoo-git-addons/forks", - "keys_url": "https://api.github.com/repos/Numigi/odoo-git-addons/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/Numigi/odoo-git-addons/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/Numigi/odoo-git-addons/teams", - "hooks_url": "https://api.github.com/repos/Numigi/odoo-git-addons/hooks", - "issue_events_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/events{/number}", - "events_url": "https://api.github.com/repos/Numigi/odoo-git-addons/events", - "assignees_url": "https://api.github.com/repos/Numigi/odoo-git-addons/assignees{/user}", - "branches_url": "https://api.github.com/repos/Numigi/odoo-git-addons/branches{/branch}", - "tags_url": "https://api.github.com/repos/Numigi/odoo-git-addons/tags", - "blobs_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/Numigi/odoo-git-addons/statuses/{sha}", - "languages_url": "https://api.github.com/repos/Numigi/odoo-git-addons/languages", - "stargazers_url": "https://api.github.com/repos/Numigi/odoo-git-addons/stargazers", - "contributors_url": "https://api.github.com/repos/Numigi/odoo-git-addons/contributors", - "subscribers_url": "https://api.github.com/repos/Numigi/odoo-git-addons/subscribers", - "subscription_url": "https://api.github.com/repos/Numigi/odoo-git-addons/subscription", - "commits_url": "https://api.github.com/repos/Numigi/odoo-git-addons/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/Numigi/odoo-git-addons/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/Numigi/odoo-git-addons/contents/{+path}", - "compare_url": "https://api.github.com/repos/Numigi/odoo-git-addons/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/Numigi/odoo-git-addons/merges", - "archive_url": "https://api.github.com/repos/Numigi/odoo-git-addons/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/Numigi/odoo-git-addons/downloads", - "issues_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues{/number}", - "pulls_url": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls{/number}", - "milestones_url": "https://api.github.com/repos/Numigi/odoo-git-addons/milestones{/number}", - "notifications_url": "https://api.github.com/repos/Numigi/odoo-git-addons/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/Numigi/odoo-git-addons/labels{/name}", - "releases_url": "https://api.github.com/repos/Numigi/odoo-git-addons/releases{/id}", - "deployments_url": "https://api.github.com/repos/Numigi/odoo-git-addons/deployments", - "created_at": "2019-11-12T19:27:26Z", - "updated_at": "2019-11-20T15:39:53Z", - "pushed_at": "2019-11-22T16:26:15Z", - "git_url": "git://github.com/Numigi/odoo-git-addons.git", - "ssh_url": "git@github.com:Numigi/odoo-git-addons.git", - "clone_url": "https://github.com/Numigi/odoo-git-addons.git", - "svn_url": "https://github.com/Numigi/odoo-git-addons", - "homepage": null, - "size": 1446, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Python", - "has_issues": true, - "has_projects": false, - "has_downloads": true, - "has_wiki": false, - "has_pages": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 1, - "license": { - "key": "agpl-3.0", - "name": "GNU Affero General Public License v3.0", - "spdx_id": "AGPL-3.0", - "url": "https://api.github.com/licenses/agpl-3.0", - "node_id": "MDc6TGljZW5zZTE=" - }, - "forks": 0, - "open_issues": 1, - "watchers": 0, - "default_branch": "12.0" - } - }, - "base": { - "label": "Numigi:12.0", - "ref": "12.0", - "sha": "d938c7456c526fd9a471cf4a8b11ae1710a16d02", - "user": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Numigi", - "html_url": "https://github.com/Numigi", - "followers_url": "https://api.github.com/users/Numigi/followers", - "following_url": "https://api.github.com/users/Numigi/following{/other_user}", - "gists_url": "https://api.github.com/users/Numigi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Numigi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Numigi/subscriptions", - "organizations_url": "https://api.github.com/users/Numigi/orgs", - "repos_url": "https://api.github.com/users/Numigi/repos", - "events_url": "https://api.github.com/users/Numigi/events{/privacy}", - "received_events_url": "https://api.github.com/users/Numigi/received_events", - "type": "Organization", - "site_admin": false - }, - "repo": { - "id": 221295296, - "node_id": "MDEwOlJlcG9zaXRvcnkyMjEyOTUyOTY=", - "name": "odoo-git-addons", - "full_name": "Numigi/odoo-git-addons", - "private": false, - "owner": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Numigi", - "html_url": "https://github.com/Numigi", - "followers_url": "https://api.github.com/users/Numigi/followers", - "following_url": "https://api.github.com/users/Numigi/following{/other_user}", - "gists_url": "https://api.github.com/users/Numigi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Numigi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Numigi/subscriptions", - "organizations_url": "https://api.github.com/users/Numigi/orgs", - "repos_url": "https://api.github.com/users/Numigi/repos", - "events_url": "https://api.github.com/users/Numigi/events{/privacy}", - "received_events_url": "https://api.github.com/users/Numigi/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/Numigi/odoo-git-addons", - "description": "git and github related odoo modules", - "fork": false, - "url": "https://api.github.com/repos/Numigi/odoo-git-addons", - "forks_url": "https://api.github.com/repos/Numigi/odoo-git-addons/forks", - "keys_url": "https://api.github.com/repos/Numigi/odoo-git-addons/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/Numigi/odoo-git-addons/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/Numigi/odoo-git-addons/teams", - "hooks_url": "https://api.github.com/repos/Numigi/odoo-git-addons/hooks", - "issue_events_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/events{/number}", - "events_url": "https://api.github.com/repos/Numigi/odoo-git-addons/events", - "assignees_url": "https://api.github.com/repos/Numigi/odoo-git-addons/assignees{/user}", - "branches_url": "https://api.github.com/repos/Numigi/odoo-git-addons/branches{/branch}", - "tags_url": "https://api.github.com/repos/Numigi/odoo-git-addons/tags", - "blobs_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/Numigi/odoo-git-addons/statuses/{sha}", - "languages_url": "https://api.github.com/repos/Numigi/odoo-git-addons/languages", - "stargazers_url": "https://api.github.com/repos/Numigi/odoo-git-addons/stargazers", - "contributors_url": "https://api.github.com/repos/Numigi/odoo-git-addons/contributors", - "subscribers_url": "https://api.github.com/repos/Numigi/odoo-git-addons/subscribers", - "subscription_url": "https://api.github.com/repos/Numigi/odoo-git-addons/subscription", - "commits_url": "https://api.github.com/repos/Numigi/odoo-git-addons/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/Numigi/odoo-git-addons/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/Numigi/odoo-git-addons/contents/{+path}", - "compare_url": "https://api.github.com/repos/Numigi/odoo-git-addons/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/Numigi/odoo-git-addons/merges", - "archive_url": "https://api.github.com/repos/Numigi/odoo-git-addons/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/Numigi/odoo-git-addons/downloads", - "issues_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues{/number}", - "pulls_url": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls{/number}", - "milestones_url": "https://api.github.com/repos/Numigi/odoo-git-addons/milestones{/number}", - "notifications_url": "https://api.github.com/repos/Numigi/odoo-git-addons/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/Numigi/odoo-git-addons/labels{/name}", - "releases_url": "https://api.github.com/repos/Numigi/odoo-git-addons/releases{/id}", - "deployments_url": "https://api.github.com/repos/Numigi/odoo-git-addons/deployments", - "created_at": "2019-11-12T19:27:26Z", - "updated_at": "2019-11-20T15:39:53Z", - "pushed_at": "2019-11-22T16:26:15Z", - "git_url": "git://github.com/Numigi/odoo-git-addons.git", - "ssh_url": "git@github.com:Numigi/odoo-git-addons.git", - "clone_url": "https://github.com/Numigi/odoo-git-addons.git", - "svn_url": "https://github.com/Numigi/odoo-git-addons", - "homepage": null, - "size": 1446, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Python", - "has_issues": true, - "has_projects": false, - "has_downloads": true, - "has_wiki": false, - "has_pages": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 1, - "license": { - "key": "agpl-3.0", - "name": "GNU Affero General Public License v3.0", - "spdx_id": "AGPL-3.0", - "url": "https://api.github.com/licenses/agpl-3.0", - "node_id": "MDc6TGljZW5zZTE=" - }, - "forks": 0, - "open_issues": 1, - "watchers": 0, - "default_branch": "12.0" - } - }, - "_links": { - "self": { - "href": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls/5" - }, - "html": { - "href": "https://github.com/Numigi/odoo-git-addons/pull/5" - }, - "issue": { - "href": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/5" - }, - "comments": { - "href": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/5/comments" - }, - "review_comments": { - "href": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls/5/comments" - }, - "review_comment": { - "href": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls/comments{/number}" - }, - "commits": { - "href": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls/5/commits" - }, - "statuses": { - "href": "https://api.github.com/repos/Numigi/odoo-git-addons/statuses/8390440505eca84d057a0a8ef5a2bcf60b3681ee" - } - }, - "author_association": "CONTRIBUTOR", - "draft": false, - "merged": false, - "mergeable": null, - "rebaseable": null, - "mergeable_state": "unknown", - "merged_by": null, - "comments": 1, - "review_comments": 0, - "maintainer_can_modify": false, - "commits": 1, - "additions": 5, - "deletions": 0, - "changed_files": 1 - }, - "repository": { - "id": 221295296, - "node_id": "MDEwOlJlcG9zaXRvcnkyMjEyOTUyOTY=", - "name": "odoo-git-addons", - "full_name": "Numigi/odoo-git-addons", - "private": false, - "owner": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/Numigi", - "html_url": "https://github.com/Numigi", - "followers_url": "https://api.github.com/users/Numigi/followers", - "following_url": "https://api.github.com/users/Numigi/following{/other_user}", - "gists_url": "https://api.github.com/users/Numigi/gists{/gist_id}", - "starred_url": "https://api.github.com/users/Numigi/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/Numigi/subscriptions", - "organizations_url": "https://api.github.com/users/Numigi/orgs", - "repos_url": "https://api.github.com/users/Numigi/repos", - "events_url": "https://api.github.com/users/Numigi/events{/privacy}", - "received_events_url": "https://api.github.com/users/Numigi/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/Numigi/odoo-git-addons", - "description": "git and github related odoo modules", - "fork": false, - "url": "https://api.github.com/repos/Numigi/odoo-git-addons", - "forks_url": "https://api.github.com/repos/Numigi/odoo-git-addons/forks", - "keys_url": "https://api.github.com/repos/Numigi/odoo-git-addons/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/Numigi/odoo-git-addons/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/Numigi/odoo-git-addons/teams", - "hooks_url": "https://api.github.com/repos/Numigi/odoo-git-addons/hooks", - "issue_events_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/events{/number}", - "events_url": "https://api.github.com/repos/Numigi/odoo-git-addons/events", - "assignees_url": "https://api.github.com/repos/Numigi/odoo-git-addons/assignees{/user}", - "branches_url": "https://api.github.com/repos/Numigi/odoo-git-addons/branches{/branch}", - "tags_url": "https://api.github.com/repos/Numigi/odoo-git-addons/tags", - "blobs_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/Numigi/odoo-git-addons/statuses/{sha}", - "languages_url": "https://api.github.com/repos/Numigi/odoo-git-addons/languages", - "stargazers_url": "https://api.github.com/repos/Numigi/odoo-git-addons/stargazers", - "contributors_url": "https://api.github.com/repos/Numigi/odoo-git-addons/contributors", - "subscribers_url": "https://api.github.com/repos/Numigi/odoo-git-addons/subscribers", - "subscription_url": "https://api.github.com/repos/Numigi/odoo-git-addons/subscription", - "commits_url": "https://api.github.com/repos/Numigi/odoo-git-addons/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/Numigi/odoo-git-addons/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/Numigi/odoo-git-addons/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/Numigi/odoo-git-addons/contents/{+path}", - "compare_url": "https://api.github.com/repos/Numigi/odoo-git-addons/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/Numigi/odoo-git-addons/merges", - "archive_url": "https://api.github.com/repos/Numigi/odoo-git-addons/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/Numigi/odoo-git-addons/downloads", - "issues_url": "https://api.github.com/repos/Numigi/odoo-git-addons/issues{/number}", - "pulls_url": "https://api.github.com/repos/Numigi/odoo-git-addons/pulls{/number}", - "milestones_url": "https://api.github.com/repos/Numigi/odoo-git-addons/milestones{/number}", - "notifications_url": "https://api.github.com/repos/Numigi/odoo-git-addons/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/Numigi/odoo-git-addons/labels{/name}", - "releases_url": "https://api.github.com/repos/Numigi/odoo-git-addons/releases{/id}", - "deployments_url": "https://api.github.com/repos/Numigi/odoo-git-addons/deployments", - "created_at": "2019-11-12T19:27:26Z", - "updated_at": "2019-11-20T15:39:53Z", - "pushed_at": "2019-11-22T16:26:15Z", - "git_url": "git://github.com/Numigi/odoo-git-addons.git", - "ssh_url": "git@github.com:Numigi/odoo-git-addons.git", - "clone_url": "https://github.com/Numigi/odoo-git-addons.git", - "svn_url": "https://github.com/Numigi/odoo-git-addons", - "homepage": null, - "size": 1446, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Python", - "has_issues": true, - "has_projects": false, - "has_downloads": true, - "has_wiki": false, - "has_pages": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 1, - "license": { - "key": "agpl-3.0", - "name": "GNU Affero General Public License v3.0", - "spdx_id": "AGPL-3.0", - "url": "https://api.github.com/licenses/agpl-3.0", - "node_id": "MDc6TGljZW5zZTE=" - }, - "forks": 0, - "open_issues": 1, - "watchers": 0, - "default_branch": "12.0" - }, - "organization": { - "login": "Numigi", - "id": 36130157, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjM2MTMwMTU3", - "url": "https://api.github.com/orgs/Numigi", - "repos_url": "https://api.github.com/orgs/Numigi/repos", - "events_url": "https://api.github.com/orgs/Numigi/events", - "hooks_url": "https://api.github.com/orgs/Numigi/hooks", - "issues_url": "https://api.github.com/orgs/Numigi/issues", - "members_url": "https://api.github.com/orgs/Numigi/members{/member}", - "public_members_url": "https://api.github.com/orgs/Numigi/public_members{/member}", - "avatar_url": "https://avatars3.githubusercontent.com/u/36130157?v=4", - "description": "" - }, - "sender": { - "login": "ddufresne", - "id": 27902736, - "node_id": "MDQ6VXNlcjI3OTAyNzM2", - "avatar_url": "https://avatars3.githubusercontent.com/u/27902736?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/ddufresne", - "html_url": "https://github.com/ddufresne", - "followers_url": "https://api.github.com/users/ddufresne/followers", - "following_url": "https://api.github.com/users/ddufresne/following{/other_user}", - "gists_url": "https://api.github.com/users/ddufresne/gists{/gist_id}", - "starred_url": "https://api.github.com/users/ddufresne/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/ddufresne/subscriptions", - "organizations_url": "https://api.github.com/users/ddufresne/orgs", - "repos_url": "https://api.github.com/users/ddufresne/repos", - "events_url": "https://api.github.com/users/ddufresne/events{/privacy}", - "received_events_url": "https://api.github.com/users/ddufresne/received_events", - "type": "User", - "site_admin": false - } -} diff --git a/github_event/tests/test_github_event.py b/github_event/tests/test_github_event.py deleted file mode 100644 index ff412bc..0000000 --- a/github_event/tests/test_github_event.py +++ /dev/null @@ -1,21 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -from ddt import ddt, data, unpack -from .common import GithubEventCase - - -@ddt -class TestGithubEvent(GithubEventCase): - - @data( - ('pull_request_1_merged.json', 'closed'), - ('pull_request_2_closed.json', 'closed'), - ('pull_request_2_reopened.json', 'reopened'), - ('check_run_completed.json', 'completed'), - ) - @unpack - def test_action(self, filename, expected_action): - self.event_1.payload = self._read_payload(filename) - self.event_1.process() - assert self.event_1.action == expected_action diff --git a/github_event/views/github_event.xml b/github_event/views/github_event.xml deleted file mode 100644 index 9fc2540..0000000 --- a/github_event/views/github_event.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Github Event Form - github.event - -
-
-
- - - - - - - - - - - -
-
-
- - - Github Event List - github.event - - - - - - - - - - Events - github.event - current - ir.actions.act_window - tree,form - - -
diff --git a/github_event/views/menu.xml b/github_event/views/menu.xml deleted file mode 100644 index 181c038..0000000 --- a/github_event/views/menu.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - diff --git a/github_event_webhook/README.rst b/github_event_webhook/README.rst deleted file mode 100644 index 03bad74..0000000 --- a/github_event_webhook/README.rst +++ /dev/null @@ -1,39 +0,0 @@ -Github Event Webhook -==================== -This module defines an HTTP controller to register events in Odoo using github webhook. - -Each event is processed asynchronously in a queue job. - -.. contents:: Table of Contents - -Configuration -------------- - -Define your Secret -~~~~~~~~~~~~~~~~~~ -First, generate a secret that will be used to authentify the webhook with your Odoo instance. -You may use the tool of your choice to create the secret. - -Then, create a system parameter: - -* Key: ``github_pull_request.github_secret`` -* Value: Your secret - -.. image:: static/description/webhook_secret_parameter.png - -Setup the Webhook -~~~~~~~~~~~~~~~~~ -Then, in Github, setup the webhook. - -.. image:: static/description/github_webhook_example.png - -* Payload URL: ``{base_url}/web/github/event`` -* Content Type: ``application/x-www-form-urlencoded`` -* Secret: Your secret - -In the section ``Which events would you like to trigger this webhook?``, -select ``Let me select individual events``, then check ``Pull requests``. - -Contributors ------------- -* Numigi (tm) and all its contributors (https://bit.ly/numigiens) diff --git a/github_event_webhook/__init__.py b/github_event_webhook/__init__.py deleted file mode 100644 index 7c3200f..0000000 --- a/github_event_webhook/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -from . import models, controllers diff --git a/github_event_webhook/__manifest__.py b/github_event_webhook/__manifest__.py deleted file mode 100644 index 1a9dee9..0000000 --- a/github_event_webhook/__manifest__.py +++ /dev/null @@ -1,21 +0,0 @@ -# © 2023 - Today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -{ - 'name': 'Github Event Webhook', - 'version': "14.0.1.0.0", - 'author': 'Numigi', - 'maintainer': 'Numigi', - 'website': 'https://bit.ly/numigi-com', - 'license': 'LGPL-3', - 'category': 'Connector', - 'summary': 'Add a controller for importing events from github', - 'depends': [ - 'github_event', - 'queue_job', - ], - 'data': [ - 'data/queue_job_function_data.xml', - ], - 'installable': True, -} diff --git a/github_event_webhook/controllers/__init__.py b/github_event_webhook/controllers/__init__.py deleted file mode 100644 index 24a35e2..0000000 --- a/github_event_webhook/controllers/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# © 2023 - Today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -from . import github diff --git a/github_event_webhook/controllers/github.py b/github_event_webhook/controllers/github.py deleted file mode 100644 index ade5630..0000000 --- a/github_event_webhook/controllers/github.py +++ /dev/null @@ -1,70 +0,0 @@ -# © 2023 - Today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -import json -import hmac -import hashlib -from odoo import http -from odoo.http import request, Response -from werkzeug.urls import url_encode - -import logging -_logger = logging.getLogger(__name__) - -GITHUB_EVENT_SECRET_PARAM = 'github_pull_request.github_secret' -GITHUB_SIGNATURE_HEADER = 'X-Hub-Signature' - - -def make_github_signature(request_body: str, secret: str) -> str: - """Make a Github signature from the given request body and secret. - - :param request_body: the request body - :param secret: the secret (token) - """ - digest = hmac.new(secret.encode(), request_body.encode(), - hashlib.sha1).hexdigest() - return 'sha1={}'.format(digest) - - -def _get_github_signature_from_headers() -> str: - return request.httprequest.headers.get(GITHUB_SIGNATURE_HEADER, "") - - -def _check_github_event_signature(signature: str) -> bool: - request_body = url_encode(request.httprequest.form) - secret = request.env['ir.config_parameter'].with_user( - request.uid).get_param(GITHUB_EVENT_SECRET_PARAM) - return make_github_signature(request_body, secret) == signature - - -class GithubEvent(http.Controller): - - @http.route('/web/github/event', type='http', auth='none', sitemap=False, csrf=False) - def new_github_event(self, **data): - signature = _get_github_signature_from_headers() - - if not signature: - message = "The github signature is required to submit a new event." - _logger.info(message) - return Response(message, status=401) - - if not _check_github_event_signature(signature): - message = "The given github signature is not valid." - _logger.info(message) - return Response(message, status=401) - - json_payload = self._get_json_payload(data) - event = self._create_event(json_payload) - event.with_delay().process_job() - - return Response(status=201) - - @staticmethod - def _get_json_payload(data): - return data['payload'] - - @staticmethod - def _create_event(json_payload): - return request.env['github.event'].sudo().create({ - 'payload': json_payload, - }) diff --git a/github_event_webhook/data/queue_job_function_data.xml b/github_event_webhook/data/queue_job_function_data.xml deleted file mode 100644 index ee92fa9..0000000 --- a/github_event_webhook/data/queue_job_function_data.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - github_event - - - - - - process_job - - - - - diff --git a/github_event_webhook/models/__init__.py b/github_event_webhook/models/__init__.py deleted file mode 100644 index a4baa0a..0000000 --- a/github_event_webhook/models/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -from . import ( - github_event, -) diff --git a/github_event_webhook/models/github_event.py b/github_event_webhook/models/github_event.py deleted file mode 100644 index 3c09846..0000000 --- a/github_event_webhook/models/github_event.py +++ /dev/null @@ -1,13 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -from odoo import models - - -class GithubEvent(models.Model): - - _inherit = "github.event" - - def process_job(self): - """Process a github event.""" - self.process() diff --git a/github_event_webhook/static/description/github_webhook_example.png b/github_event_webhook/static/description/github_webhook_example.png deleted file mode 100644 index bf7a51d..0000000 Binary files a/github_event_webhook/static/description/github_webhook_example.png and /dev/null differ diff --git a/github_event_webhook/static/description/icon.png b/github_event_webhook/static/description/icon.png deleted file mode 100644 index 92a86b1..0000000 Binary files a/github_event_webhook/static/description/icon.png and /dev/null differ diff --git a/github_event_webhook/static/description/webhook_secret_parameter.png b/github_event_webhook/static/description/webhook_secret_parameter.png deleted file mode 100644 index 57ae1bb..0000000 Binary files a/github_event_webhook/static/description/webhook_secret_parameter.png and /dev/null differ diff --git a/github_event_webhook/tests/__init__.py b/github_event_webhook/tests/__init__.py deleted file mode 100644 index 7fa1774..0000000 --- a/github_event_webhook/tests/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). diff --git a/github_event_webhook/tests/test_github_controller.py b/github_event_webhook/tests/test_github_controller.py deleted file mode 100644 index c5ea0c7..0000000 --- a/github_event_webhook/tests/test_github_controller.py +++ /dev/null @@ -1,85 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -from collections import OrderedDict -from odoo.addons.test_http_request.common import mock_odoo_request -from odoo.tests import common -from uuid import uuid4 -from werkzeug.urls import url_encode -import json -from ..controllers.github import ( - GithubEvent, - GITHUB_EVENT_SECRET_PARAM, - GITHUB_SIGNATURE_HEADER, - make_github_signature, -) - - -class TestPullRequest(common.SavepointCase): - - @classmethod - def setUpClass(cls): - super().setUpClass() - cls.env['github.event'].search([]).unlink() - cls.token = str(uuid4()) - cls.env['ir.config_parameter'].set_param( - GITHUB_EVENT_SECRET_PARAM, cls.token) - - def setUp(self): - super().setUp() - self.controller = GithubEvent() - self.payload = OrderedDict([ - ('number', 1), - ('action', 'created'), - ]) - self.data = {'payload': json.dumps(self.payload)} - encoded_data = url_encode(self.data) - signature = make_github_signature(encoded_data, self.token) - self.headers = {GITHUB_SIGNATURE_HEADER: signature} - - def _get_created_event(self): - return self.env['github.event'].search([]) - - def test_after_called__event_created(self): - with mock_odoo_request(self.env, headers=self.headers, data=self.data): - response = self.controller.new_github_event(**self.data) - - assert response.status_code == 201 - assert len(self._get_created_event()) == 1 - - def test_event_created_with_payload(self): - with mock_odoo_request(self.env, headers=self.headers, data=self.data): - self.controller.new_github_event(**self.data) - - event = self._get_created_event() - assert event.payload - assert json.loads(event.payload) == self.payload - - def test_if_token_not_passed__return_error_401(self): - del self.headers[GITHUB_SIGNATURE_HEADER] - - with mock_odoo_request(self.env, headers=self.headers, data=self.data): - response = self.controller.new_github_event(**self.data) - - assert response.status_code == 401 - assert not self._get_created_event() - - def test_if_wrong_token_passed__return_error_401(self): - self.headers[GITHUB_SIGNATURE_HEADER] = 'sha1={}'.format(str(uuid4())) - - with mock_odoo_request(self.env, headers=self.headers, data=self.data): - response = self.controller.new_github_event(**self.data) - - assert response.status_code == 401 - assert not self._get_created_event() - - def test_after_called__queue_job_created(self): - with mock_odoo_request(self.env, headers=self.headers, data=self.data): - self.controller.new_github_event(**self.data) - - event = self._get_created_event() - job = self.env['queue.job'].search([ - ('model_name', '=', 'github.event'), - ('method_name', '=', 'process_job'), - ]).filtered(lambda j: j.record_ids == [event.id]) - assert len(job) == 1 diff --git a/github_pull_request/README.rst b/github_pull_request/README.rst deleted file mode 100644 index f1e603b..0000000 --- a/github_pull_request/README.rst +++ /dev/null @@ -1,49 +0,0 @@ -Github Pull Request -=================== - -This modules defines what is a GitHub pull requests (as an Odoo object). - -.. contents:: Table of Contents - -Pull Requests -------------- -As system administrator, I go to ``Configuration > Technical > GitHub > Pull Requests``. - - .. image:: static/description/menu_technical_pull_requests.png - -I see the list of pull requests: - - .. image:: static/description/pull_request_tree.png - - .. image:: static/description/pull_request_form.png - -Events ------- -A pull request has a list of events. - -.. image:: static/description/pull_request_event_list.png - -In the form view of an event, a ``Pull Request`` section is added. - -.. image:: static/description/pull_request_event_form.png - -This section is filled using the payload when processing the event. - -Pull Request Creation / Update ------------------------------- -When an event is processed, a pull request is assigned to the event. -If no existing pull request matches the event, a new pull request is created. - -.. - - Of course, if the event is not related to a pull requests (i.e. if it was generated from a github issue), - no pull request will be assigned to it. - -If it is the latest event for the pull request, the pull request record -will be updated from the event data. - -Therefore, a pull request record in Odoo is updated as soon has new events are registered. - -Contributors ------------- -* Numigi (tm) and all its contributors (https://bit.ly/numigiens) diff --git a/github_pull_request/__init__.py b/github_pull_request/__init__.py deleted file mode 100644 index 22b7d41..0000000 --- a/github_pull_request/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -from . import models diff --git a/github_pull_request/__manifest__.py b/github_pull_request/__manifest__.py deleted file mode 100644 index f638c3a..0000000 --- a/github_pull_request/__manifest__.py +++ /dev/null @@ -1,23 +0,0 @@ -# © 2023 - Today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -{ - 'name': 'Github Pull Request', - 'version': "14.0.1.0.0", - 'author': 'Numigi', - 'maintainer': 'Numigi', - 'website': 'https://bit.ly/numigi-com', - 'license': 'LGPL-3', - 'category': 'Connector', - 'summary': 'Define what is a github Pull Request as an odoo object.', - 'depends': [ - 'github_event', - ], - 'data': [ - 'security/ir.model.access.csv', - 'views/github_event.xml', - 'views/github_pull_request.xml', - 'views/menu.xml', - ], - 'installable': True, -} diff --git a/github_pull_request/i18n/fr.po b/github_pull_request/i18n/fr.po deleted file mode 100644 index 3d5bae9..0000000 --- a/github_pull_request/i18n/fr.po +++ /dev/null @@ -1,185 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * github_pull_request -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-04 19:31+0000\n" -"PO-Revision-Date: 2019-12-04 14:33-0500\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: \n" -"X-Generator: Poedit 2.0.6\n" - -#. module: github_pull_request -#: sql_constraint:github.pull_request:0 -msgid "A Pull Request already exists for this source" -msgstr "Une pull request existe déjà pour cette source" - -#. module: github_pull_request -#: selection:github.event,pull_request_state:0 -#: selection:github.pull_request,state:0 -msgid "Closed" -msgstr "Fermé" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request__create_uid -msgid "Created by" -msgstr "" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request__create_date -msgid "Created on" -msgstr "" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request__developer_id -#: model_terms:ir.ui.view,arch_db:github_pull_request.github_pull_request_search -msgid "Developer" -msgstr "Développeur" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request__display_name -msgid "Display Name" -msgstr "" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request__event_ids -#: model_terms:ir.ui.view,arch_db:github_pull_request.github_pull_request_form -msgid "Events" -msgstr "Événements" - -#. module: github_pull_request -#: model_terms:ir.ui.view,arch_db:github_pull_request.github_pull_request_search -msgid "Finished" -msgstr "Fini" - -#. module: github_pull_request -#: model:ir.model,name:github_pull_request.model_github_event -msgid "Github Event" -msgstr "" - -#. module: github_pull_request -#: model:ir.model,name:github_pull_request.model_github_pull_request -#: model_terms:ir.ui.view,arch_db:github_pull_request.github_pull_request_form -#: model_terms:ir.ui.view,arch_db:github_pull_request.github_pull_request_search -#: model_terms:ir.ui.view,arch_db:github_pull_request.github_pull_request_tree -msgid "Github Pull Request" -msgstr "" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request__host -msgid "Host" -msgstr "Hôte" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request__id -msgid "ID" -msgstr "" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request____last_update -msgid "Last Modified on" -msgstr "" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request__write_uid -msgid "Last Updated by" -msgstr "" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request__write_date -msgid "Last Updated on" -msgstr "" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request__latest_update -msgid "Latest Update" -msgstr "" - -#. module: github_pull_request -#: selection:github.event,pull_request_state:0 -#: selection:github.pull_request,state:0 -msgid "Merged" -msgstr "Mergé" - -#. module: github_pull_request -#: selection:github.event,pull_request_state:0 -#: selection:github.pull_request,state:0 -#: model_terms:ir.ui.view,arch_db:github_pull_request.github_pull_request_search -msgid "Open" -msgstr "Ouvert" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request__organization -msgid "Organization" -msgstr "Organisation" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_event__pull_request_id -#: model_terms:ir.ui.view,arch_db:github_pull_request.github_event_form_with_pull_request_fields -msgid "Pull Request" -msgstr "Pull Request" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request__pull_request_number -msgid "Pull Request Number" -msgstr "Numéro de la pull request" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_event__pull_request_state -msgid "Pull Request State" -msgstr "État de la pull request" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_event__pull_request_title -msgid "Pull Request Title" -msgstr "Titre de la pull request" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_event__pull_request_updated_at -msgid "Pull Request Updated At" -msgstr "Date mise à jour de la pull request" - -#. module: github_pull_request -#: model:ir.actions.act_window,name:github_pull_request.pull_requests_action_window -#: model:ir.ui.menu,name:github_pull_request.menu_github_pull_requests -msgid "Pull Requests" -msgstr "" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request__repository -#: model_terms:ir.ui.view,arch_db:github_pull_request.github_pull_request_search -msgid "Repository" -msgstr "Dépôt" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request__source -msgid "Source" -msgstr "" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request__state -#: model_terms:ir.ui.view,arch_db:github_pull_request.github_event_form_with_pull_request_fields -#: model_terms:ir.ui.view,arch_db:github_pull_request.github_pull_request_form -#: model_terms:ir.ui.view,arch_db:github_pull_request.github_pull_request_search -msgid "State" -msgstr "État" - -#. module: github_pull_request -#: model:ir.model.fields,field_description:github_pull_request.field_github_pull_request__title -#: model_terms:ir.ui.view,arch_db:github_pull_request.github_event_form_with_pull_request_fields -msgid "Title" -msgstr "Titre" - -#. module: github_pull_request -#: model_terms:ir.ui.view,arch_db:github_pull_request.github_event_form_with_pull_request_fields -#: model_terms:ir.ui.view,arch_db:github_pull_request.github_pull_request_form -msgid "Updated At" -msgstr "Mise à jour" diff --git a/github_pull_request/models/__init__.py b/github_pull_request/models/__init__.py deleted file mode 100644 index 4983ac6..0000000 --- a/github_pull_request/models/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -from . import ( - github_event, - github_pull_request, -) diff --git a/github_pull_request/models/common.py b/github_pull_request/models/common.py deleted file mode 100644 index 4f8a656..0000000 --- a/github_pull_request/models/common.py +++ /dev/null @@ -1,13 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -OPEN = 'open' -MERGED = 'merged' -CLOSED = 'closed' - - -PULL_REQUEST_STATES = [ - (OPEN, 'Open'), - (MERGED, 'Merged'), - (CLOSED, 'Closed'), -] diff --git a/github_pull_request/models/github_event.py b/github_pull_request/models/github_event.py deleted file mode 100644 index 5176e36..0000000 --- a/github_pull_request/models/github_event.py +++ /dev/null @@ -1,72 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -import dateutil.parser -from odoo import fields, models -from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT -from .common import PULL_REQUEST_STATES, MERGED - - -class GithubEvent(models.Model): - - _inherit = 'github.event' - - pull_request_id = fields.Many2one( - 'github.pull_request', - 'Pull Request', - ondelete='restrict', - index=True, - copy=False, - ) - pull_request_updated_at = fields.Datetime() - pull_request_title = fields.Char() - pull_request_state = fields.Selection( - PULL_REQUEST_STATES, - ) - - def _find_existing_pull_request(self, url): - return self.env['github.pull_request'].search([ - ('source', '=', url), - ]) - - def _make_pull_request(self, url): - return self.env['github.pull_request'].create({'source': url}) - - def _get_pull_request(self): - url = self._get_value_from_payload('pull_request.html_url') - existing_pull_request = self._find_existing_pull_request(url) - return existing_pull_request or self._make_pull_request(url) - - def _get_pull_request_state(self): - is_merged = self._get_value_from_payload('pull_request.merged_at') - return MERGED if is_merged else self._get_value_from_payload('pull_request.state') - - def _get_pull_request_updated_at(self): - datetime_string = self._get_value_from_payload( - 'pull_request.updated_at') - datetime_obj = dateutil.parser.parse(datetime_string) - naive_datetime_string = datetime_obj.strftime( - DEFAULT_SERVER_DATETIME_FORMAT) - return naive_datetime_string - - def _get_pull_request_title(self): - return self._get_value_from_payload("pull_request.title") - - def _update_from_pull_request_fields(self): - """Update the event's data related to pull requests from its payload.""" - self.write({ - 'pull_request_id': self._get_pull_request().id, - 'pull_request_state': self._get_pull_request_state(), - 'pull_request_updated_at': self._get_pull_request_updated_at(), - 'pull_request_title': self._get_pull_request_title(), - }) - - def process(self): - super().process() - - is_pull_request_event = 'pull_request' in self.payload_serialized - if is_pull_request_event: - self._update_from_pull_request_fields() - - if self.pull_request_id.is_latest_event(self): - self.pull_request_id.update_from_event(self) diff --git a/github_pull_request/models/github_pull_request.py b/github_pull_request/models/github_pull_request.py deleted file mode 100644 index 3919fbb..0000000 --- a/github_pull_request/models/github_pull_request.py +++ /dev/null @@ -1,81 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -import re -from odoo import fields, models, api -from .common import PULL_REQUEST_STATES, OPEN - - -regex_github_source = re.compile( - r'https:\/\/(?P[\w\.]+)/' - r'(?P\w+)/' - r'(?P[\w\-_]+)/' - r'pull/' - r'(?P\d+)' -) - - -class GithubPullRequest(models.Model): - _name = "github.pull_request" - _description = "Github Pull Request" - _rec_name = 'title' - - title = fields.Char() - source = fields.Char(required=True) - state = fields.Selection( - PULL_REQUEST_STATES, - default=OPEN, - ) - developer_id = fields.Many2one( - 'res.partner', 'Developer', ondelete='restrict', index=True) - host = fields.Char(readonly=True) - organization = fields.Char(readonly=True) - repository = fields.Char(readonly=True) - pull_request_number = fields.Integer(readony=True) - - _sql_constraints = [ - ('source', 'UNIQUE (source)', 'A Pull Request already exists for this source'), - ] - - @api.model - def create(self, vals): - updated_vals = update_according_to_source(vals['source'], vals) - return super().create(updated_vals) - - def write(self, vals): - updated_vals = update_according_to_source(vals.get('source', ''), vals) - super().write(updated_vals) - - -def update_according_to_source(source: str, vals: dict) -> dict: - res = re.match(regex_github_source, source) - if res: - vals.update(res.groupdict()) - return vals - - -class GithubPullRequestWithEvents(models.Model): - - _inherit = 'github.pull_request' - - latest_update = fields.Datetime() - event_ids = fields.One2many( - 'github.event', 'pull_request_id', 'Events', - ) - - def is_latest_event(self, event): - """Verify whether an event is the latest event recorded for this pull request. - - :ptype event: github.event - :rtype: bool - """ - return not self.latest_update or event.pull_request_updated_at >= self.latest_update - - def update_from_event(self, event): - """Update the pull request from the given event. - - :ptype event: github.event - """ - self.state = event.pull_request_state - self.latest_update = event.pull_request_updated_at - self.title = event.pull_request_title diff --git a/github_pull_request/security/ir.model.access.csv b/github_pull_request/security/ir.model.access.csv deleted file mode 100644 index ae0358a..0000000 --- a/github_pull_request/security/ir.model.access.csv +++ /dev/null @@ -1,3 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_github_pull_request,access_github_pull_request,model_github_pull_request,base.group_user,1,0,0,0 -access_github_pull_request_admin,access_github_pull_request_admin,model_github_pull_request,base.group_system,1,1,1,0 diff --git a/github_pull_request/static/description/icon.png b/github_pull_request/static/description/icon.png deleted file mode 100644 index 92a86b1..0000000 Binary files a/github_pull_request/static/description/icon.png and /dev/null differ diff --git a/github_pull_request/static/description/menu_technical_pull_requests.png b/github_pull_request/static/description/menu_technical_pull_requests.png deleted file mode 100644 index 0d727d2..0000000 Binary files a/github_pull_request/static/description/menu_technical_pull_requests.png and /dev/null differ diff --git a/github_pull_request/static/description/pull_request_event_form.png b/github_pull_request/static/description/pull_request_event_form.png deleted file mode 100644 index 06700ec..0000000 Binary files a/github_pull_request/static/description/pull_request_event_form.png and /dev/null differ diff --git a/github_pull_request/static/description/pull_request_event_list.png b/github_pull_request/static/description/pull_request_event_list.png deleted file mode 100644 index 990346f..0000000 Binary files a/github_pull_request/static/description/pull_request_event_list.png and /dev/null differ diff --git a/github_pull_request/static/description/pull_request_form.png b/github_pull_request/static/description/pull_request_form.png deleted file mode 100644 index d2f8190..0000000 Binary files a/github_pull_request/static/description/pull_request_form.png and /dev/null differ diff --git a/github_pull_request/static/description/pull_request_tree.png b/github_pull_request/static/description/pull_request_tree.png deleted file mode 100644 index 54d2f3e..0000000 Binary files a/github_pull_request/static/description/pull_request_tree.png and /dev/null differ diff --git a/github_pull_request/tests/__init__.py b/github_pull_request/tests/__init__.py deleted file mode 100644 index 7fa1774..0000000 --- a/github_pull_request/tests/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). diff --git a/github_pull_request/tests/test_github_event.py b/github_pull_request/tests/test_github_event.py deleted file mode 100644 index 6c020df..0000000 --- a/github_pull_request/tests/test_github_event.py +++ /dev/null @@ -1,82 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -from odoo.addons.github_event.tests.common import GithubEventCase -from ddt import ddt, data, unpack - - -@ddt -class TestGithubEvent(GithubEventCase): - - def test_if_not_pull_request_event__no_pull_request_created(self): - self.event_1.payload = self._read_payload('check_run_completed.json') - self.event_1.process() - assert not self.event_1.pull_request_id - - def test_if_not_existing_pull_request__new_pull_request_created(self): - self.event_1.payload = self._read_payload( - 'pull_request_2_reopened.json') - self.event_1.process() - assert self.event_1.pull_request_id - - def test_if_existing_pull_request__event_attached_to_same_pull_request(self): - self.event_1.payload = self._read_payload('pull_request_2_closed.json') - self.event_2.payload = self._read_payload( - 'pull_request_2_reopened.json') - self.event_1.process() - self.event_2.process() - assert self.event_1.pull_request_id - assert self.event_1.pull_request_id == self.event_2.pull_request_id - - def test_event_can_be_processed_twice(self): - self.event_1.payload = self._read_payload('pull_request_2_closed.json') - self.event_1.process() - - initial_pull_request = self.event_1.pull_request_id - - self.event_1.process() - assert self.event_1.pull_request_id == initial_pull_request - - @data( - ('pull_request_1_merged.json', 'merged'), - ('pull_request_2_closed.json', 'closed'), - ('pull_request_2_reopened.json', 'open'), - ) - @unpack - def test_status(self, filename, expected_state): - self.event_1.payload = self._read_payload(filename) - self.event_1.process() - assert self.event_1.pull_request_id.state == expected_state - - @data( - ('pull_request_2_closed.json', 'pull_request_2_reopened.json'), - ('pull_request_2_reopened.json', 'pull_request_2_closed.json'), - ) - @unpack - def test_if_not_last_event__pull_request_not_updated(self, first_event, second_event): - """Test that the pull request is only updated by the latest event. - - The event pull_request_closed is updated at: 2023-11-22T17:12:05Z - The event pull_request_reopened is updated at: 2023-11-22T17:50:29Z - - The final result is that the pull request is open, because - the pull request is closed, then reopened. - - This result must not depend on whether one event is processed before the other. - """ - self.event_1.payload = self._read_payload(first_event) - self.event_2.payload = self._read_payload(second_event) - self.event_1.process() - self.event_2.process() - assert self.event_1.pull_request_id == self.event_2.pull_request_id - assert self.event_1.pull_request_id.state == 'open' - - @data( - ('pull_request_1_merged.json', 'Add module account_show_full_features'), - ('pull_request_2_closed.json', 'Add better logging'), - ) - @unpack - def test_title(self, filename, expected_title): - self.event_1.payload = self._read_payload(filename) - self.event_1.process() - assert self.event_1.pull_request_id.title == expected_title diff --git a/github_pull_request/tests/test_github_pull_request.py b/github_pull_request/tests/test_github_pull_request.py deleted file mode 100644 index 9a72531..0000000 --- a/github_pull_request/tests/test_github_pull_request.py +++ /dev/null @@ -1,47 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - - -from odoo.tests import common -from ddt import ddt, data, unpack - -test_data = ( - ("https://github.com/Numigi/odoo_git_addons/pull/108693", "organization", "Numigi",), - ("https://github.com/OCA/odoo_git_addons/pull/108693", "organization", "OCA",), - ("https://www.github.com/Numigi/odoo_git_addons/pull/108693", - "host", "www.github.com", ), - ("https://github.com/Numigi/odoo_git_addons/pull/108693", "host", "github.com",), - ("https://github.com/Numigi/odoo-git-addons/pull/108693", - "repository", "odoo-git-addons",), - ("https://github.com/Numigi/odoo_git_addons/pull/108693", - "repository", "odoo_git_addons",), - ("https://github.com/Numigi/odoo_git_addons/pull/1", "pull_request_number", 1,), - ("https://github.com/Numigi/odoo_git_addons/pull/108693", - "pull_request_number", 108693,), -) - - -@ddt -class TestPullRequest(common.SavepointCase): - - @classmethod - def setUpClass(cls): - super().setUpClass() - - cls.github_pull_request_pool = cls.env["github.pull_request"] - - @data(*test_data) - @unpack - def test_whenPrIsCreatedFromURL_thenFieldsAreFilled(self, url, field, expected): - pr = self.github_pull_request_pool.create({'source': url}) - assert pr[field] == expected - - @data(*test_data) - @unpack - def test_whenPrIsUpdatedFromURL_thenFieldsAreUpdated(self, url, field, expected): - pr = self.github_pull_request_pool.create( - {'source': "https://github.com/Numigi/odoo-public/pull/666"} - # fake url, does not matter - ) - pr.source = url - assert pr[field] == expected diff --git a/github_pull_request/views/github_event.xml b/github_pull_request/views/github_event.xml deleted file mode 100644 index 48ece7c..0000000 --- a/github_pull_request/views/github_event.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - Github Event Form: add fields related to pull requests - github.event - - - - - - - - - - - - - - - Github Event Form: add fields related to pull requests - github.event - - - - - - - - - diff --git a/github_pull_request/views/github_pull_request.xml b/github_pull_request/views/github_pull_request.xml deleted file mode 100644 index 3d7d994..0000000 --- a/github_pull_request/views/github_pull_request.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - github.pull_request - Default tree view for github.pull_request - - - - - - - - - - - github.pull_request - Default form view for github.pull_request - -
- -

- -

- - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- - - github.pull_request - Default search view for github.pull_request - - - - - - - - - - - - - - - - - - - Pull Requests - github.pull_request - current - ir.actions.act_window - tree,form - - -
diff --git a/github_pull_request/views/menu.xml b/github_pull_request/views/menu.xml deleted file mode 100644 index b683fd1..0000000 --- a/github_pull_request/views/menu.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/github_pull_request_project/README.rst b/github_pull_request_project/README.rst deleted file mode 100644 index d734a9a..0000000 --- a/github_pull_request_project/README.rst +++ /dev/null @@ -1,19 +0,0 @@ -Github Pull Request Project -=========================== - -This modules adds a relation between tasks and github pull request. - - -Tasks in Pull Request Form view -------------------------------- - - .. image:: static/description/pull_request_form_tasks.png - -Pull Requests in Tasks Form View --------------------------------- - - .. image:: static/description/.project_task_pull_request.png - -Contributors ------------- -* Numigi (tm) and all its contributors (https://bit.ly/numigiens) diff --git a/github_pull_request_project/__init__.py b/github_pull_request_project/__init__.py deleted file mode 100644 index 22b7d41..0000000 --- a/github_pull_request_project/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -from . import models diff --git a/github_pull_request_project/__manifest__.py b/github_pull_request_project/__manifest__.py deleted file mode 100644 index 1c37d8f..0000000 --- a/github_pull_request_project/__manifest__.py +++ /dev/null @@ -1,23 +0,0 @@ -# © 2023 - Today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -{ - 'name': 'Github Pull Request Project', - 'version': "14.0.1.0.0", - 'author': 'Numigi', - 'maintainer': 'Numigi', - 'website': 'https://bit.ly/numigi-com', - 'license': 'LGPL-3', - 'category': 'Project', - 'summary': 'Create a relation between tasks and github.pull_request models.', - 'depends': ['project', 'github_pull_request'], - 'data': [ - 'data/project_tags.xml', - 'views/ir_actions_act_window.xml', - 'views/ir_ui_menu.xml', - 'views/github_pull_request.xml', - 'views/project_task.xml', - ], - 'auto_install': True, - 'installable': True, -} diff --git a/github_pull_request_project/data/project_tags.xml b/github_pull_request_project/data/project_tags.xml deleted file mode 100644 index 4ef2c2c..0000000 --- a/github_pull_request_project/data/project_tags.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - PR: Open - - - - - PR: Merged - - - - - PR: Closed - - - - diff --git a/github_pull_request_project/i18n/fr.po b/github_pull_request_project/i18n/fr.po deleted file mode 100644 index a29dc80..0000000 --- a/github_pull_request_project/i18n/fr.po +++ /dev/null @@ -1,50 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * github_pull_request_project -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-14 19:48+0000\n" -"PO-Revision-Date: 2019-11-14 19:48+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: github_pull_request_project -#: model:ir.model,name:github_pull_request_project.model_github_pull_request -msgid "Github Pull Request" -msgstr "" - -#. module: github_pull_request_project -#: model:ir.model.fields,field_description:github_pull_request_project.field_project_task__no_pull_request_open -msgid "No Pull Request Open" -msgstr "Aucune pull request d'ouverte" - -#. module: github_pull_request_project -#: model:ir.model.fields,field_description:github_pull_request_project.field_project_task__pull_request_qty -msgid "Pull Request Qty" -msgstr "Quantité de pull request" - -#. module: github_pull_request_project -#: model:ir.actions.act_window,name:github_pull_request_project.pull_requests_action_window_context -#: model:ir.model.fields,field_description:github_pull_request_project.field_project_task__pull_request_ids -#: model:ir.ui.menu,name:github_pull_request_project.project_pull_request_menu -#: model_terms:ir.ui.view,arch_db:github_pull_request_project.project_task_form_pull_requests -msgid "Pull Requests" -msgstr "" - -#. module: github_pull_request_project -#: model:ir.model,name:github_pull_request_project.model_project_task -msgid "Task" -msgstr "Tâche" - -#. module: github_pull_request_project -#: model:ir.model.fields,field_description:github_pull_request_project.field_github_pull_request__task_ids -msgid "Tasks" -msgstr "Tâches" - diff --git a/github_pull_request_project/models/__init__.py b/github_pull_request_project/models/__init__.py deleted file mode 100644 index ed476b7..0000000 --- a/github_pull_request_project/models/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -from . import ( - github_pull_request -) diff --git a/github_pull_request_project/models/github_pull_request.py b/github_pull_request_project/models/github_pull_request.py deleted file mode 100644 index b177bb5..0000000 --- a/github_pull_request_project/models/github_pull_request.py +++ /dev/null @@ -1,112 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -from odoo import fields, models, api - - -class GithubPullRequestTask(models.Model): - - _inherit = "github.pull_request" - - task_ids = fields.Many2many( - 'project.task', - 'pull_request_task_ref', - 'pull_request_id', - 'task_id', - string='Tasks' - ) - - @api.model - def create(self, vals): - pr = super().create(vals) - pr.task_ids._update_pull_request_tags() - return pr - - def write(self, vals): - must_update_tags_on_tasks = 'task_ids' in vals or 'state' in vals - - if must_update_tags_on_tasks: - tasks_to_update = self.mapped('task_ids') - - super().write(vals) - - if must_update_tags_on_tasks: - tasks_to_update |= self.mapped('task_ids') - tasks_to_update._update_pull_request_tags() - - return True - - -def has_pull_request_at_state(task: 'project.task', state: str) -> bool: - """Return True if the task has at least one PR at the given state.""" - return task.pull_request_ids.filtered(lambda pr: pr.state == state) - - -class ProjectTaskPullRequest(models.Model): - - _inherit = "project.task" - - pull_request_ids = fields.Many2many( - 'github.pull_request', - 'pull_request_task_ref', - 'task_id', - 'pull_request_id', - string='Pull Requests', - copy=False, - ) - - def _compute_pull_request_qty(self): - for record in self: - record.pull_request_qty = len(record.pull_request_ids) - - pull_request_qty = fields.Integer(compute="_compute_pull_request_qty") - - def _check_all_pull_request_state(self): - for record in self: - record.no_pull_request_open = is_no_pull_request_open(record) - - @api.model - def create(self, vals): - task = super().create(vals) - task._update_pull_request_tags() - return task - - def write(self, vals): - super().write(vals) - - if 'pull_request_ids' in vals: - self._update_pull_request_tags() - - return True - - def _update_pull_request_tags(self): - tag_open = self.env.ref( - 'github_pull_request_project.tag_pull_request_open') - tag_merged = self.env.ref( - 'github_pull_request_project.tag_pull_request_merged') - tag_closed = self.env.ref( - 'github_pull_request_project.tag_pull_request_closed') - - for task in self: - show_open_tag = ( - has_pull_request_at_state(task, 'open') - ) - show_merged_tag = ( - has_pull_request_at_state(task, 'merged') and - not show_open_tag - ) - show_closed_tag = ( - has_pull_request_at_state(task, 'closed') and - not show_open_tag and - not show_merged_tag - ) - - task.update({'tag_ids': [ - (4 if show_open_tag else 3, tag_open.id), - (4 if show_merged_tag else 3, tag_merged.id), - (4 if show_closed_tag else 3, tag_closed.id), - ]}) - - @api.onchange('pull_request_ids') - def _onchange_pull_requests_update_tags(self): - self._update_pull_request_tags() diff --git a/github_pull_request_project/static/description/icon.png b/github_pull_request_project/static/description/icon.png deleted file mode 100644 index 92a86b1..0000000 Binary files a/github_pull_request_project/static/description/icon.png and /dev/null differ diff --git a/github_pull_request_project/static/description/project_task_pull_requests.png b/github_pull_request_project/static/description/project_task_pull_requests.png deleted file mode 100644 index 04b2b2a..0000000 Binary files a/github_pull_request_project/static/description/project_task_pull_requests.png and /dev/null differ diff --git a/github_pull_request_project/static/description/pull_request_form_tasks.png b/github_pull_request_project/static/description/pull_request_form_tasks.png deleted file mode 100644 index 19c1477..0000000 Binary files a/github_pull_request_project/static/description/pull_request_form_tasks.png and /dev/null differ diff --git a/github_pull_request_project/tests/__init__.py b/github_pull_request_project/tests/__init__.py deleted file mode 100644 index 2c7675f..0000000 --- a/github_pull_request_project/tests/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - -from . import test_project_task diff --git a/github_pull_request_project/tests/test_project_task.py b/github_pull_request_project/tests/test_project_task.py deleted file mode 100644 index 175eaf4..0000000 --- a/github_pull_request_project/tests/test_project_task.py +++ /dev/null @@ -1,135 +0,0 @@ -# © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - - -from odoo.tests import common - - -class TestProjectTask(common.SavepointCase): - - @classmethod - def setUpClass(cls): - super().setUpClass() - cls.pull_request_open = cls.env["github.pull_request"].create({ - "source": "https://github.com/Numigi/odoo-git-addons/pull/1", - "state": "open" - }) - cls.pull_request_closed = cls.env["github.pull_request"].create({ - "source": "https://github.com/Numigi/odoo-git-addons/pull/2", - "state": "closed" - }) - cls.pull_request_merged = cls.env["github.pull_request"].create({ - "source": "https://github.com/Numigi/odoo-git-addons/pull/3", - "state": "merged" - }) - - cls.tag_open = cls.env.ref( - 'github_pull_request_project.tag_pull_request_open') - cls.tag_merged = cls.env.ref( - 'github_pull_request_project.tag_pull_request_merged') - cls.tag_closed = cls.env.ref( - 'github_pull_request_project.tag_pull_request_closed') - - # Simple cases - def test_whenNoPR_thenNoTag(self): - task = self.env["project.task"].create({ - "name": "ttask", "pull_request_ids": [(5, False, False)] - }) - assert not task.tag_ids - - def test_whenPrAreMerged_thenTaskMerged(self): - task = self.env["project.task"].create({ - "name": "ttask", "pull_request_ids": [(6, False, (self.pull_request_merged.id,))] - }) - assert task.tag_ids == self.tag_merged - - def test_whenPrAreClosed_thenTaskClosed(self): - task = self.env["project.task"].create({ - "name": "ttask", "pull_request_ids": [(6, False, (self.pull_request_closed.id,))] - }) - assert task.tag_ids == self.tag_closed - - def test_whenPrAreOpen_thenTaskOpen(self): - task = self.env["project.task"].create({ - "name": "ttask", "pull_request_ids": [(6, False, (self.pull_request_open.id,))] - }) - assert task.tag_ids == self.tag_open - - # Mixing cases - def test_whenAllStates_thenTaskOpen(self): - task = self.env["project.task"].create({ - "name": "ttask", - "pull_request_ids": [( - 6, False, - ( - self.pull_request_open.id, - self.pull_request_closed.id, - self.pull_request_merged.id - ) - )] - }) - assert task.tag_ids == self.tag_open - - def test_whenClosedAndMerged_thenTaskMerged(self): - task = self.env["project.task"].create({ - "name": "ttask", - "pull_request_ids": [( - 6, False, (self.pull_request_closed.id, - self.pull_request_merged.id) - )] - }) - assert task.tag_ids == self.tag_merged - - def test_whenMergedAndOpen_thenTaskOpen(self): - task = self.env["project.task"].create({ - "name": "ttask", - "pull_request_ids": [( - 6, False, (self.pull_request_merged.id, - self.pull_request_open.id) - )] - }) - assert task.tag_ids == self.tag_open - - def test_whenClosedAndOpen_thenTaskOpen(self): - task = self.env["project.task"].create({ - "name": "ttask", - "pull_request_ids": [( - 6, False, (self.pull_request_closed.id, - self.pull_request_open.id) - )] - }) - assert task.tag_ids == self.tag_open - - def test_onTaskWrite_tagsUpdated(self): - task = self.env["project.task"].create({ - "name": "ttask", - }) - task.pull_request_ids = self.pull_request_open - assert task.tag_ids == self.tag_open - - def test_onPullRequestStateChange_tagsUpdated(self): - task = self.env["project.task"].create({ - "name": "ttask", - "pull_request_ids": [(4, self.pull_request_open.id)], - }) - assert task.tag_ids == self.tag_open - self.pull_request_open.state = 'merged' - assert task.tag_ids == self.tag_merged - - def test_onPullRequestTaskIdsChange_tagsUpdated(self): - task = self.env["project.task"].create({ - "name": "ttask", - }) - self.pull_request_open.task_ids = task - assert task.tag_ids == self.tag_open - - def test_onPullRequestCreate_tagsUpdated(self): - task = self.env["project.task"].create({ - "name": "ttask", - }) - self.env["github.pull_request"].create({ - "source": "https://github.com/Numigi/odoo-git-addons/pull/999", - "state": "open", - "task_ids": [(4, task.id)], - }) - assert task.tag_ids == self.tag_open diff --git a/github_pull_request_project/views/github_pull_request.xml b/github_pull_request_project/views/github_pull_request.xml deleted file mode 100644 index b492473..0000000 --- a/github_pull_request_project/views/github_pull_request.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - github.pull_request - Github Pull Request: task ids - form - - - - - - - - - - - github.pull_request - Github Pull Request: task ids - 16 - search - - diff --git a/github_pull_request_project/views/ir_actions_act_window.xml b/github_pull_request_project/views/ir_actions_act_window.xml deleted file mode 100644 index 00a7120..0000000 --- a/github_pull_request_project/views/ir_actions_act_window.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - Pull Requests - github.pull_request - current - ir.actions.act_window - tree,form - { - 'search_default_task_ids': [active_id], - } - - diff --git a/github_pull_request_project/views/ir_ui_menu.xml b/github_pull_request_project/views/ir_ui_menu.xml deleted file mode 100644 index 62ba878..0000000 --- a/github_pull_request_project/views/ir_ui_menu.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - Pull Requests - - 10 - - diff --git a/github_pull_request_project/views/project_task.xml b/github_pull_request_project/views/project_task.xml deleted file mode 100644 index c98cf65..0000000 --- a/github_pull_request_project/views/project_task.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - -
- -
- - - - - -
- - project.task - Project Task: pull request fields - 99 -
- -
diff --git a/gitoo.yml b/gitoo.yml index 53e7ad7..0d2df58 100644 --- a/gitoo.yml +++ b/gitoo.yml @@ -1,9 +1,4 @@ -- url: https://{{GIT_TOKEN}}@github.com/Numigi/odoo-base-addons - branch: "14.0" - includes: - - test_http_request - - url: https://github.com/OCA/queue - branch: "14.0" + branch: "16.0" includes: - queue_job