Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
de1ece7
[ADD] two modules from 8.0 WIP branch
legalsylvain Jul 21, 2017
d0ada4e
[PORT] replace obsolete tag openerp-data by odoo
legalsylvain Jul 21, 2017
74980bc
[PORT] replace select=True by index=True
legalsylvain Jul 21, 2017
e2b8420
[PORT] adapt xml inheritance to v10.0 (menu, form, ...)
legalsylvain Jul 21, 2017
e5c83de
[REM] remove issue, comment, commit, author object
legalsylvain Jul 21, 2017
bfc551d
[IMP] various improvments
legalsylvain Jul 21, 2017
351b309
[IMP] readme, courtesy @elicoidal
legalsylvain Aug 3, 2017
4bef395
[FIX] don't fail on empty url patterns
hbrunn Aug 1, 2017
8e67078
[FIX] various improvments
legalsylvain Aug 21, 2017
ee4a095
[FIX] Fix syncing of members. The get_by_url method needs a fetch met…
Oct 2, 2017
aaaecfc
[FIX] remove obsolete markdown requirement
legalsylvain Oct 3, 2017
4e2834e
[IMP] log error in case of multiple partners with same github id
sbidoul Oct 29, 2017
3d2333e
[FIX] incorrect call to __super_
legalsylvain Oct 29, 2017
635239c
Typos (double "you" and comma)
zeroheure Jan 28, 2018
22b8c22
[MIG] github_connector: Migration to 11.0
cubells May 29, 2018
2de1550
Fixed issue while fetching organization, user and members in v11
st-aprajapati Jun 21, 2018
4f120be
[IMP] github_connector: Add brand new icon and menu icon
pedrobaeza Aug 18, 2018
0ffec53
Trivial python3 fix
sbidoul Sep 15, 2018
a828d8f
[IMP] Add try-except on branch analyze action (#26)
StephanRozendaal Oct 2, 2018
7e288ba
[FIX] logging interpolation
sbidoul Nov 17, 2018
967b3be
[11.0][FIX] github_connector keyerror 'blog' (#34)
enriquemartin Feb 2, 2019
159ec74
[12.0][MIG] github_connector: Migration to v12
cristinamartinrod Jan 11, 2019
636adf1
[IMP] github connector: All modules only can be access by github app …
hugho-ad Jul 31, 2019
1578484
[FIX] github_connector: Ensure source path exists always
hugho-ad Sep 20, 2019
73b9e9c
[FIX] github_connector: Good comparison
pedrobaeza Nov 9, 2019
905f850
[IMP] github_connector*: Homogeneize API
pedrobaeza Nov 10, 2019
e6122d1
[IMP] github_connector: Make module_paths on repository branch field …
pedrobaeza Nov 10, 2019
688bc6a
introduce usage of github_token
Oct 17, 2019
15c51c9
[FIX] github_connector: Reinforce deletion method
pedrobaeza Dec 30, 2019
acbc967
[IMP] github_connector: black, isort
Mar 16, 2020
f6b821a
[MIG] github_connector: Migration to 13.0
Mar 16, 2020
117be10
[IMP] github_connector: Adapt to new API
Tardo Apr 20, 2020
e896b9f
[FIX] github_connector: Proper GitHub URL for repository branches
pedrobaeza Jul 7, 2020
d12d5ef
[FIX] github_connector: Fix branch complete name
pedrobaeza Jul 8, 2020
d48ddc3
[FIX] black
pedrobaeza Jul 8, 2020
d193bf2
[IMP] github_connector: Added the option to authenticate with tokens
CarlosRoca13 Jul 28, 2020
24b8994
[FIX] github_connector: Don't fail on empty local path on tests
pedrobaeza Aug 5, 2020
1226c80
[FIX] github_connector: Can't join path with boolean
pedrobaeza Aug 5, 2020
5a98c53
[IMP] github_connector: Added the SOURCE_CODE_LOCAL_PATH environment …
CarlosRoca13 Aug 10, 2020
dc138e0
[FIX] github_connector: Prevent error when archive records and later …
victoralmau Feb 19, 2021
8ca7eef
[IMP] github_connector: Code analysis
victoralmau Sep 16, 2020
8b10836
[FIX] github_connector: Use correct error messages
joao-p-marques Jun 8, 2021
338cc5f
[IMP] github_connector: black, isort, prettier
joao-p-marques Jun 8, 2021
accfc75
[MIG] github_connector: Migration to 14.0
joao-p-marques Jun 8, 2021
4d99fae
[REF] github_connector: Several improvements and refactor to PyGithub
joao-p-marques Jul 13, 2021
a1abb34
[FIX] github_connector: migration scripts
MiquelRForgeFlow Oct 28, 2021
01e5599
[ADD] Add dependency on README
Shide Feb 18, 2022
3183de3
[FIX] github_connector_odoo: Expected singleton: github.repository
May 20, 2022
9e6a868
[14.0][FIX] github_connector_*, fix smart button open actions
GSLabIt Jun 28, 2022
a51de00
[IMP] github_connector_odoo: Code analysis
victoralmau Sep 17, 2020
e4be6fb
[FIX] github_connector + github_connector_odoo: Change action .read()…
victoralmau Nov 14, 2022
6738b7d
[MIG] github_connector: Migration to 15.0
OpenCode Jun 22, 2022
771a63d
[MIG] github_connector: Migration to 15.0
victoralmau Nov 15, 2022
a5e5a66
[IMP] github_connector: Improve paths to exclude /setup/ folder and .…
victoralmau Mar 8, 2023
e6a5c46
[IMP] github_connector: Code refactor
victoralmau Jul 12, 2023
5378ee3
[IMP] github_connector: Add Inhibit inherited rules option from repos…
victoralmau Aug 17, 2023
beff54b
[FIX] github_connector: Set the correct "up to date" response to the …
victoralmau Sep 19, 2023
84db33b
[FIX] github_connector: Remove DeprecationWarning log
victoralmau Oct 5, 2023
79b7697
[FIX] github_connector: Remove tzinfo from github response to prevent…
victoralmau Oct 5, 2023
938c4a7
[FIX] github_connector: Linter fixes
pedrobaeza Oct 28, 2023
f55f745
[FIX] github_connector: Linter fixes
pedrobaeza Oct 28, 2023
0350c8c
[IMP] github_connector: Change pygount to cloc
victoralmau Sep 14, 2023
0f5b691
[IMP] github_connector*: Skip analysis rule info lines without info
victoralmau Nov 17, 2023
c695681
[MIG] github_connector: Migration to 16.0
carolinafernandez-tecnativa Jan 8, 2024
b7d4d86
Added translation using Weblate (Italian)
mymage Mar 20, 2024
b39fce5
[IMP] github_connector: pre-commit auto fixes
victoralmau Nov 8, 2024
25e3a4c
[MIG] github_connector: Migration to 17.0
victoralmau Nov 8, 2024
4aa24f8
Update translation files
weblate Nov 8, 2024
240e514
[MIG] github_connector_odoo: Migration to 17.0
victoralmau Nov 8, 2024
e15b654
Translated using Weblate (Italian)
mymage Nov 13, 2024
f930959
[IMP] github_connector: pre-commit auto fixes
carlos-lopez-tecnativa May 20, 2025
261dd53
[MIG] github_connector: Migration to version 18.0
carlos-lopez-tecnativa May 20, 2025
5f5ae5b
[UPD] Update github_connector.pot
May 21, 2025
6c975c2
[BOT] post-merge updates
OCA-git-bot May 21, 2025
273e1b6
[IMP] github_connector: pre-commit auto fixes
juppe Dec 15, 2025
7e41204
[MIG] github_connector: Migration to 19.0
juppe Dec 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
395 changes: 395 additions & 0 deletions github_connector/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,395 @@
================
Github Connector
================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:e870532a984285d7ce12852e0dbb9a9f38f17fbb90a99892fec759c79676870f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Finterface--github-lightgray.png?logo=github
:target: https://github.com/OCA/interface-github/tree/18.0/github_connector
:alt: OCA/interface-github
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/interface-github-18-0/interface-github-18-0-github_connector
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/interface-github&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows you to:

- Fetch into Odoo social information from Github (Organizations, Teams,
Users)
- Fetch into Odoo Code structure information from Github (Repositories,
Branches)
- Download source code from Github
- Analyze repository code from rules previously created

**Table of contents**

.. contents::
:local:

Installation
============

To install this addon, you need to install some python dependencies

.. code:: bash

sudo pip install PyGitHub
sudo apt install cloc
sudo pip install pathspec
sudo pip install GitPython

Analysis source code is generated by
https://github.com/roskakori/pygount

Configuration
=============

Once installed, you have to:

1. Open your odoo.conf file and add extra settings to mention Github
credentials, and the local path where the source code will be
downloaded:

- ``source_code_local_path = /workspace/source_code/``

Note: you can define the route as environment variable using the key
SOURCE_CODE_LOCAL_PATH

Note: make sure that Odoo process has read / write access on that folder

- ``github_token = your_github_access_token``

Note: The login/password auth has been deprecated by GitHub.
https://docs.github.com/en/rest/overview/other-authentication-methods#via-username-and-password

1. Go to 'Settings' / 'Technical' / 'Parameters' / 'System Parameters'
and define the following values:

1. ``github.max_try``: number of call to the API before an error is
raised. The more unstable/slow your connection, the higher should
be this value
2. ``git.partial_commit_during_analysis``: Set to ``True`` if you
want to commit the result of the analysis in the database after
each repository analysis. We recommend to set to ``True`` when you
perform the initial download (potentially with a lot of
repositories) in order to reduce the size of the transaction

|image|

2. Go to your(s) user(s) form to add them in the new 'Connector Github
Manager' groups. The members of this group will have the possibility
to run Github synchronization.

Technical Information
---------------------

This module provides 4 crons that you can enable:

- Synchronize All Organizations and Teams (``cron_update_organization``)
- Synchronize Branches List for All repositories
(``cron_update_branch_list``)
- Download Source Code for All Github Branches (``cron_download_code``)
- Analyze Source Code for All Github Branches (``cron_analyze_code``)

.. |image| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/github_settings.png

Usage
=====

Initial upload from Github
--------------------------

To fetch information from Github, you have to:

1. go to 'Github' / 'Settings' / 'Sync Object'

2. Select the object type you want to synchronize and its Gthub name

|sync_organization|

3. Once done for your organization(s), go to 'Github' / 'Github
Commnunity' / 'Organizations'

|github_organization_kanban|

4. Optionally, once organization is created, you can create series for
your projects. Go to 'Github' / 'Organizations' / click on your
organization / 'Organization Series' Tabs

|github_organization_series|

Select branches to download
---------------------------

This setting will prevent to download undesired branches, downloading
only main branches (releases):

1. In the 'Settings' tab, set repositories you don't want to download
(or repositories you want to download). If 'Specific repositories' is
set, 'Ignored Repositories' value is ignored.

2. In the 'Settings' tab, set the URL of the 'External Services' you use
for Continuous Integration and Coverage.

|github_organization_external_services|

3. Once done, click on buttons 'Syncs', to synchronize repositories,
teams and members. (This process can take a while depending of your
size)

|github_organization_sync_buttons|

Team / members synchronization
------------------------------

You can synchronize members teams:

1. Go to 'Teams' / tree view / 'Actions' / 'Update from Github'.

|github_team_kanban|

2. In each team, you can see the members list and the role of the
members

|github_team_partner_kanban|

3. In each team, you can see the repositories list but not the
permissions of the team. (See 'Known Issues' Section)

|github_team_repository_kanban|

Repositories synchronization
----------------------------

You can synchronize the branches of your repositories:

1. Go to 'Repositories' / tree view / 'Actions' / 'Update from Github'

|github_repository_kanban|

2. In each repository, you can see the main branches list and the size
of code source.

|github_repository_branch_kanban|

Fetching the source code
------------------------

Finally, you can download locally the source code of all your branches:

1. Go to 'Repository Branches' / tree view / 'Actions' / 'Download and
Analyse Source Code'.

|wizard_download_analyze|

2. In the tree view you can update manually source code or refresh
analysis.

|github_repository_branch_list|

Analysis source code
--------------------

It's possible to create custom analysis rules that relate to a GitHub
organization, GitHub repository and/or GitHub repository branch to
analyze code.

1. Go to 'Settings' / 'Analysis rule groups' and create records that
allow to organize the rules
2. Go to 'Settings' / 'Analysis rules' and create rules, for example:

..

1. Name: All code, Group: General, Paths: ``*``
2. Name: Python code, Group: General, Paths: ``*.py``
3. Name: Xml code, Group: General, Paths: ``*.xml``
4. Name: Repository 1, Group: Custom, Paths: /path/

Note: Paths field in 'Analysis rule' allow to put multiple paths for
line, path format is according to
https://git-scm.com/docs/gitignore#_pattern_format

1. Go to *GitHub > GitHub Community > Organizations* and define Analysis
rules (optional)
2. Go to *GitHub > GitHub Repository > Repositories* and define Analysis
rules (optional)
3. Go to *GitHub > GitHub Repository > Repository Branches* and define
Analysis rules (optional)

Analysis source code is executed when 'Update Source Code Analysis'
button in some 'Repository Branch', get all the Analysis rules
(Repository + Organization) and analyze code and generate info about it
Other option to Analysis source code is in cron called 'Analyze Source
Code for All Github Branches'

You can see in 'Repository Branch' / 'Code Analysis' the info obtained
from analysis rules.

Data creation in Github
-----------------------

You have the possibility to creates two items in Github directly from
Odoo

1. Teams:

1. Go to 'Settings' / 'Create Team in Github'.
2. Set the information and click on Create in Github.
3. Odoo will try to create the team. If access right and datas are
correct, the creation will be done directly in Github
4. Later on, a synchronization will be performed, to create the
according team in the Odoo instance.

|wizard_create_team|

2. Repositories:

1. Go to 'Settings' / 'Create Team in Github'.
2. Set the information and click on Create in Github.

|wizard_create_repository|

Note
----

Analysis in this module is basic: for the time being, it just gives
branches size.

Nevertheless, you can develop an extra Odoo Custom module to extend
analysis function and get extra statistics, depending on your needs.

In that way, you can see the module github_connector_odoo, if your
repositories contain Odoo modules.

Reporting
---------

This module provides several reports

**Branches by Serie**

|reporting_branches_by_serie|

**Sizes by Serie**

|reporting_sizes_by_serie|

**Repository branch analysis rule**

|github_repository_branch_rule_info_report|

.. |sync_organization| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/sync_organization.png
.. |github_organization_kanban| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/github_organization_kanban.png
.. |github_organization_series| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/github_organization_series.png
.. |github_organization_external_services| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/github_organization_external_services.png
.. |github_organization_sync_buttons| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/github_organization_sync_buttons.png
.. |github_team_kanban| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/github_team_kanban.png
.. |github_team_partner_kanban| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/github_team_partner_kanban.png
.. |github_team_repository_kanban| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/github_team_repository_kanban.png
.. |github_repository_kanban| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/github_repository_kanban.png
.. |github_repository_branch_kanban| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/github_repository_branch_kanban.png
.. |wizard_download_analyze| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/wizard_download_analyze.png
.. |github_repository_branch_list| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/github_repository_branch_list.png
.. |wizard_create_team| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/wizard_create_team.png
.. |wizard_create_repository| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/wizard_create_repository.png
.. |reporting_branches_by_serie| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/reporting_branches_by_serie.png
.. |reporting_sizes_by_serie| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/reporting_sizes_by_serie.png
.. |github_repository_branch_rule_info_report| image:: https://raw.githubusercontent.com/OCA/interface-github/18.0/github_connector/static/description/github_repository_branch_rule_info_report.png

Known issues / Roadmap
======================

- For the time being, Github API doesn't provide some informations that
are available by the classic UI, that includes:

1. team hierarchy: the field is present in the model
github_team.parent_id, but unused.

- Possible improvements:

1. Create a new module github_connector_website, that could display
teams / repositories / branches informations for non logged users.
2. Analyze commits (author, quantity by series, etc...): this feature
has been partially implemented in a V8.0 PR.
3. Synchronize Pull Request, Issues, Comments: this feature has been
partially implemented in a V8.0 PR.

- Refactor the github connector:

A python library called PyGitHub is available. It could be interesting
to use it, instead of using custom code. However, this lib doesn't
provide good access to child object, generating for the time being,
unnecessary API calls. For example, updating a repository should call
before a call to the parent organization (The current module is so
faster).

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/interface-github/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/interface-github/issues/new?body=module:%20github_connector%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* GRAP
* Akretion
* Tecnativa

Contributors
------------

- Sylvain LE GAL (https://twitter.com/legalsylvain)
- Sébastien BEAU (sebastien.beau@akretion.com)
- Benoît GUILLOT (benoit.guillot@akretion.com)
- Enrique Martín (enriquemartin@digital5.es)
- `Tecnativa <https://www.tecnativa.com>`__:",

- Pedro M. Baeza
- Vicent Cubells
- Alexandre Díaz
- Ernesto Tejeda
- Carlos Roca
- Víctor Martínez
- João Marques
- Carolina Fernandez

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/interface-github <https://github.com/OCA/interface-github/tree/18.0/github_connector>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions github_connector/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import models
from . import report
from . import wizards
Loading
Loading