You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

708 lines
30KB

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
  7. <title>Github Connector</title>
  8. <style type="text/css">
  9. /*
  10. :Author: David Goodger (goodger@python.org)
  11. :Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
  12. :Copyright: This stylesheet has been placed in the public domain.
  13. Default cascading style sheet for the HTML output of Docutils.
  14. See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
  15. customize this style sheet.
  16. */
  17. /* used to remove borders from tables and images */
  18. .borderless, table.borderless td, table.borderless th {
  19. border: 0 }
  20. table.borderless td, table.borderless th {
  21. /* Override padding for "table.docutils td" with "! important".
  22. The right padding separates the table cells. */
  23. padding: 0 0.5em 0 0 ! important }
  24. .first {
  25. /* Override more specific margin styles with "! important". */
  26. margin-top: 0 ! important }
  27. .last, .with-subtitle {
  28. margin-bottom: 0 ! important }
  29. .hidden {
  30. display: none }
  31. .subscript {
  32. vertical-align: sub;
  33. font-size: smaller }
  34. .superscript {
  35. vertical-align: super;
  36. font-size: smaller }
  37. a.toc-backref {
  38. text-decoration: none ;
  39. color: black }
  40. blockquote.epigraph {
  41. margin: 2em 5em ; }
  42. dl.docutils dd {
  43. margin-bottom: 0.5em }
  44. object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
  45. overflow: hidden;
  46. }
  47. /* Uncomment (and remove this text!) to get bold-faced definition list terms
  48. dl.docutils dt {
  49. font-weight: bold }
  50. */
  51. div.abstract {
  52. margin: 2em 5em }
  53. div.abstract p.topic-title {
  54. font-weight: bold ;
  55. text-align: center }
  56. div.admonition, div.attention, div.caution, div.danger, div.error,
  57. div.hint, div.important, div.note, div.tip, div.warning {
  58. margin: 2em ;
  59. border: medium outset ;
  60. padding: 1em }
  61. div.admonition p.admonition-title, div.hint p.admonition-title,
  62. div.important p.admonition-title, div.note p.admonition-title,
  63. div.tip p.admonition-title {
  64. font-weight: bold ;
  65. font-family: sans-serif }
  66. div.attention p.admonition-title, div.caution p.admonition-title,
  67. div.danger p.admonition-title, div.error p.admonition-title,
  68. div.warning p.admonition-title, .code .error {
  69. color: red ;
  70. font-weight: bold ;
  71. font-family: sans-serif }
  72. /* Uncomment (and remove this text!) to get reduced vertical space in
  73. compound paragraphs.
  74. div.compound .compound-first, div.compound .compound-middle {
  75. margin-bottom: 0.5em }
  76. div.compound .compound-last, div.compound .compound-middle {
  77. margin-top: 0.5em }
  78. */
  79. div.dedication {
  80. margin: 2em 5em ;
  81. text-align: center ;
  82. font-style: italic }
  83. div.dedication p.topic-title {
  84. font-weight: bold ;
  85. font-style: normal }
  86. div.figure {
  87. margin-left: 2em ;
  88. margin-right: 2em }
  89. div.footer, div.header {
  90. clear: both;
  91. font-size: smaller }
  92. div.line-block {
  93. display: block ;
  94. margin-top: 1em ;
  95. margin-bottom: 1em }
  96. div.line-block div.line-block {
  97. margin-top: 0 ;
  98. margin-bottom: 0 ;
  99. margin-left: 1.5em }
  100. div.sidebar {
  101. margin: 0 0 0.5em 1em ;
  102. border: medium outset ;
  103. padding: 1em ;
  104. background-color: #ffffee ;
  105. width: 40% ;
  106. float: right ;
  107. clear: right }
  108. div.sidebar p.rubric {
  109. font-family: sans-serif ;
  110. font-size: medium }
  111. div.system-messages {
  112. margin: 5em }
  113. div.system-messages h1 {
  114. color: red }
  115. div.system-message {
  116. border: medium outset ;
  117. padding: 1em }
  118. div.system-message p.system-message-title {
  119. color: red ;
  120. font-weight: bold }
  121. div.topic {
  122. margin: 2em }
  123. h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
  124. h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
  125. margin-top: 0.4em }
  126. h1.title {
  127. text-align: center }
  128. h2.subtitle {
  129. text-align: center }
  130. hr.docutils {
  131. width: 75% }
  132. img.align-left, .figure.align-left, object.align-left, table.align-left {
  133. clear: left ;
  134. float: left ;
  135. margin-right: 1em }
  136. img.align-right, .figure.align-right, object.align-right, table.align-right {
  137. clear: right ;
  138. float: right ;
  139. margin-left: 1em }
  140. img.align-center, .figure.align-center, object.align-center {
  141. display: block;
  142. margin-left: auto;
  143. margin-right: auto;
  144. }
  145. table.align-center {
  146. margin-left: auto;
  147. margin-right: auto;
  148. }
  149. .align-left {
  150. text-align: left }
  151. .align-center {
  152. clear: both ;
  153. text-align: center }
  154. .align-right {
  155. text-align: right }
  156. /* reset inner alignment in figures */
  157. div.align-right {
  158. text-align: inherit }
  159. /* div.align-center * { */
  160. /* text-align: left } */
  161. .align-top {
  162. vertical-align: top }
  163. .align-middle {
  164. vertical-align: middle }
  165. .align-bottom {
  166. vertical-align: bottom }
  167. ol.simple, ul.simple {
  168. margin-bottom: 1em }
  169. ol.arabic {
  170. list-style: decimal }
  171. ol.loweralpha {
  172. list-style: lower-alpha }
  173. ol.upperalpha {
  174. list-style: upper-alpha }
  175. ol.lowerroman {
  176. list-style: lower-roman }
  177. ol.upperroman {
  178. list-style: upper-roman }
  179. p.attribution {
  180. text-align: right ;
  181. margin-left: 50% }
  182. p.caption {
  183. font-style: italic }
  184. p.credits {
  185. font-style: italic ;
  186. font-size: smaller }
  187. p.label {
  188. white-space: nowrap }
  189. p.rubric {
  190. font-weight: bold ;
  191. font-size: larger ;
  192. color: maroon ;
  193. text-align: center }
  194. p.sidebar-title {
  195. font-family: sans-serif ;
  196. font-weight: bold ;
  197. font-size: larger }
  198. p.sidebar-subtitle {
  199. font-family: sans-serif ;
  200. font-weight: bold }
  201. p.topic-title {
  202. font-weight: bold }
  203. pre.address {
  204. margin-bottom: 0 ;
  205. margin-top: 0 ;
  206. font: inherit }
  207. pre.literal-block, pre.doctest-block, pre.math, pre.code {
  208. margin-left: 2em ;
  209. margin-right: 2em }
  210. pre.code .ln { color: grey; } /* line numbers */
  211. pre.code, code { background-color: #eeeeee }
  212. pre.code .comment, code .comment { color: #5C6576 }
  213. pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
  214. pre.code .literal.string, code .literal.string { color: #0C5404 }
  215. pre.code .name.builtin, code .name.builtin { color: #352B84 }
  216. pre.code .deleted, code .deleted { background-color: #DEB0A1}
  217. pre.code .inserted, code .inserted { background-color: #A3D289}
  218. span.classifier {
  219. font-family: sans-serif ;
  220. font-style: oblique }
  221. span.classifier-delimiter {
  222. font-family: sans-serif ;
  223. font-weight: bold }
  224. span.interpreted {
  225. font-family: sans-serif }
  226. span.option {
  227. white-space: nowrap }
  228. span.pre {
  229. white-space: pre }
  230. span.problematic {
  231. color: red }
  232. span.section-subtitle {
  233. /* font-size relative to parent (h1..h6 element) */
  234. font-size: 80% }
  235. table.citation {
  236. border-left: solid 1px gray;
  237. margin-left: 1px }
  238. table.docinfo {
  239. margin: 2em 4em }
  240. table.docutils {
  241. margin-top: 0.5em ;
  242. margin-bottom: 0.5em }
  243. table.footnote {
  244. border-left: solid 1px black;
  245. margin-left: 1px }
  246. table.docutils td, table.docutils th,
  247. table.docinfo td, table.docinfo th {
  248. padding-left: 0.5em ;
  249. padding-right: 0.5em ;
  250. vertical-align: top }
  251. table.docutils th.field-name, table.docinfo th.docinfo-name {
  252. font-weight: bold ;
  253. text-align: left ;
  254. white-space: nowrap ;
  255. padding-left: 0 }
  256. /* "booktabs" style (no vertical lines) */
  257. table.docutils.booktabs {
  258. border: 0px;
  259. border-top: 2px solid;
  260. border-bottom: 2px solid;
  261. border-collapse: collapse;
  262. }
  263. table.docutils.booktabs * {
  264. border: 0px;
  265. }
  266. table.docutils.booktabs th {
  267. border-bottom: thin solid;
  268. text-align: left;
  269. }
  270. h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
  271. h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
  272. font-size: 100% }
  273. ul.auto-toc {
  274. list-style-type: none }
  275. </style>
  276. </head>
  277. <body>
  278. <div class="document" id="github-connector">
  279. <h1 class="title">Github Connector</h1>
  280. <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  281. !! This file is generated by oca-gen-addon-readme !!
  282. !! changes will be overwritten. !!
  283. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
  284. <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/interface-github/tree/13.0/github_connector"><img alt="OCA/interface-github" src="https://img.shields.io/badge/github-OCA%2Finterface--github-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/interface-github-13-0/interface-github-13-0-github_connector"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/229/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
  285. <p>This module allows you to:</p>
  286. <ul class="simple">
  287. <li>Fetch into Odoo social information from Github (Organizations, Teams, Users)</li>
  288. <li>Fetch into Odoo Code structure information from Github (Repositories,
  289. Branches)</li>
  290. <li>Download source code from Github</li>
  291. <li>Analyze repository code from rules previously created</li>
  292. </ul>
  293. <p><strong>Table of contents</strong></p>
  294. <div class="contents local topic" id="contents">
  295. <ul class="simple">
  296. <li><a class="reference internal" href="#installation" id="id1">Installation</a></li>
  297. <li><a class="reference internal" href="#configuration" id="id2">Configuration</a><ul>
  298. <li><a class="reference internal" href="#technical-information" id="id3">Technical Information</a></li>
  299. </ul>
  300. </li>
  301. <li><a class="reference internal" href="#usage" id="id4">Usage</a><ul>
  302. <li><a class="reference internal" href="#initial-upload-from-github" id="id5">Initial upload from Github</a></li>
  303. <li><a class="reference internal" href="#select-branches-to-download" id="id6">Select branches to download</a></li>
  304. <li><a class="reference internal" href="#team-members-synchronization" id="id7">Team / members synchronization</a></li>
  305. <li><a class="reference internal" href="#repositories-synchronization" id="id8">Repositories synchronization</a></li>
  306. <li><a class="reference internal" href="#fetching-the-source-code" id="id9">Fetching the source code</a></li>
  307. <li><a class="reference internal" href="#analysis-source-code" id="id10">Analysis source code</a></li>
  308. <li><a class="reference internal" href="#data-creation-in-github" id="id11">Data creation in Github</a></li>
  309. <li><a class="reference internal" href="#note" id="id12">Note</a></li>
  310. <li><a class="reference internal" href="#reporting" id="id13">Reporting</a></li>
  311. </ul>
  312. </li>
  313. <li><a class="reference internal" href="#known-issues-roadmap" id="id14">Known issues / Roadmap</a></li>
  314. <li><a class="reference internal" href="#bug-tracker" id="id15">Bug Tracker</a></li>
  315. <li><a class="reference internal" href="#credits" id="id16">Credits</a><ul>
  316. <li><a class="reference internal" href="#authors" id="id17">Authors</a></li>
  317. <li><a class="reference internal" href="#contributors" id="id18">Contributors</a></li>
  318. <li><a class="reference internal" href="#maintainers" id="id19">Maintainers</a></li>
  319. </ul>
  320. </li>
  321. </ul>
  322. </div>
  323. <div class="section" id="installation">
  324. <h1><a class="toc-backref" href="#id1">Installation</a></h1>
  325. <p>To install this addon, you need to install some python dependencies</p>
  326. <pre class="code bash literal-block">
  327. <span class="sb">``</span>sudo pip install PyGitHub<span class="sb">``</span>
  328. <span class="sb">``</span>sudo pip install pygount<span class="sb">``</span>
  329. <span class="sb">``</span>sudo pip install pathspec<span class="sb">``</span>
  330. </pre>
  331. <p>Analysis source code is generated by <a class="reference external" href="https://github.com/roskakori/pygount">https://github.com/roskakori/pygount</a></p>
  332. </div>
  333. <div class="section" id="configuration">
  334. <h1><a class="toc-backref" href="#id2">Configuration</a></h1>
  335. <p>Once installed, you have to:</p>
  336. <ol class="arabic simple">
  337. <li>Open your odoo.conf file and add extra settings to mention Github
  338. credentials, and the local path where the source code will be downloaded:<ul>
  339. <li><tt class="docutils literal">source_code_local_path = /workspace/source_code/</tt></li>
  340. </ul>
  341. </li>
  342. </ol>
  343. <p>Note: you can define the route as environment variable using the key
  344. SOURCE_CODE_LOCAL_PATH</p>
  345. <p>Note: make sure that Odoo process has read / write access on that folder</p>
  346. <blockquote>
  347. <ul class="simple">
  348. <li><tt class="docutils literal">github_token = your_github_access_token</tt></li>
  349. </ul>
  350. </blockquote>
  351. <p>or</p>
  352. <blockquote>
  353. <ul class="simple">
  354. <li><tt class="docutils literal">github_login = your_github_login</tt></li>
  355. <li><tt class="docutils literal">github_password = your_github_password</tt></li>
  356. </ul>
  357. </blockquote>
  358. <p>Note: if token and login/password are provided, the token will be used.
  359. The login/password auth will be deprecated by GitHub in the future.</p>
  360. <ol class="arabic">
  361. <li><p class="first">Go to ‘Settings’ / ‘Technical’ / ‘Parameters’ / ‘System Parameters’
  362. and define the following values:</p>
  363. <ol class="arabic simple">
  364. <li><tt class="docutils literal">github.max_try</tt>: number of call to the API before an error
  365. is raised. The more unstable/slow your connection, the higher should be
  366. this value</li>
  367. <li><tt class="docutils literal">git.partial_commit_during_analysis</tt>: Set to <tt class="docutils literal">True</tt> if you want to
  368. commit the result of the analysis in the database after each repository
  369. analysis. We recommend to set to <tt class="docutils literal">True</tt> when you perform the initial
  370. download (potentially with a lot of repositories) in order to reduce the
  371. size of the transaction</li>
  372. </ol>
  373. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_settings.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_settings.png" />
  374. </li>
  375. <li><p class="first">Go to your(s) user(s) form to add them in the new ‘Connector Github Manager’
  376. groups. The members of this group will have the possibility to run Github
  377. synchronization.</p>
  378. </li>
  379. </ol>
  380. <div class="section" id="technical-information">
  381. <h2><a class="toc-backref" href="#id3">Technical Information</a></h2>
  382. <p>This module provides 4 crons that you can enable:</p>
  383. <ul class="simple">
  384. <li>Synchronize All Organizations and Teams (<tt class="docutils literal">cron_update_organization</tt>)</li>
  385. <li>Synchronize Branches List for All repositories (<tt class="docutils literal">cron_update_branch_list</tt>)</li>
  386. <li>Download Source Code for All Github Branches (<tt class="docutils literal">cron_download_code</tt>)</li>
  387. <li>Analyze Source Code for All Github Branches (<tt class="docutils literal">cron_analyze_code</tt>)</li>
  388. </ul>
  389. </div>
  390. </div>
  391. <div class="section" id="usage">
  392. <h1><a class="toc-backref" href="#id4">Usage</a></h1>
  393. <div class="section" id="initial-upload-from-github">
  394. <h2><a class="toc-backref" href="#id5">Initial upload from Github</a></h2>
  395. <p>To fetch information from Github, you have to:</p>
  396. <ol class="arabic">
  397. <li><p class="first">go to ‘Github’ / ‘Settings’ / ‘Sync Object’</p>
  398. </li>
  399. <li><p class="first">Select the object type you want to synchronize and its Gthub name</p>
  400. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/sync_organization.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/sync_organization.png" />
  401. </li>
  402. <li><p class="first">Once done for your organization(s), go to ‘Github’ / ‘Github Commnunity’ /
  403. ‘Organizations’</p>
  404. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_organization_kanban.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_organization_kanban.png" />
  405. </li>
  406. <li><p class="first">Optionally, once organization is created, you can create series for your
  407. projects. Go to ‘Github’ / ‘Organizations’ / click on your organization /
  408. ‘Organization Series’ Tabs</p>
  409. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_organization_series.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_organization_series.png" />
  410. </li>
  411. </ol>
  412. </div>
  413. <div class="section" id="select-branches-to-download">
  414. <h2><a class="toc-backref" href="#id6">Select branches to download</a></h2>
  415. <p>This setting will prevent to download undesired branches, downloading only
  416. main branches (releases):</p>
  417. <ol class="arabic">
  418. <li><p class="first">In the ‘Settings’ tab, set repositories you don’t want to download
  419. (or repositories you want to download). If ‘Specific repositories’ is set,
  420. ‘Ignored Repositories’ value is ignored.</p>
  421. </li>
  422. <li><p class="first">In the ‘Settings’ tab, set the URL of the ‘External Services’ you use
  423. for Continuous Integration and Coverage.</p>
  424. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_organization_external_services.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_organization_external_services.png" />
  425. </li>
  426. <li><p class="first">Once done, click on buttons ‘Syncs’, to synchronize repositories, teams and
  427. members. (This process can take a while depending of your size)</p>
  428. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_organization_sync_buttons.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_organization_sync_buttons.png" />
  429. </li>
  430. </ol>
  431. </div>
  432. <div class="section" id="team-members-synchronization">
  433. <h2><a class="toc-backref" href="#id7">Team / members synchronization</a></h2>
  434. <p>You can synchronize members teams:</p>
  435. <ol class="arabic">
  436. <li><p class="first">Go to ‘Teams’ / tree view / ‘Actions’ / ‘Update from Github’.</p>
  437. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_team_kanban.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_team_kanban.png" />
  438. </li>
  439. <li><p class="first">In each team, you can see the members list and the role of the members</p>
  440. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_team_partner_kanban.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_team_partner_kanban.png" />
  441. </li>
  442. <li><p class="first">In each team, you can see the repositories list but not the permissions of the
  443. team. (See ‘Known Issues’ Section)</p>
  444. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_team_repository_kanban.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_team_repository_kanban.png" />
  445. </li>
  446. </ol>
  447. </div>
  448. <div class="section" id="repositories-synchronization">
  449. <h2><a class="toc-backref" href="#id8">Repositories synchronization</a></h2>
  450. <p>You can synchronize the branches of your repositories:</p>
  451. <ol class="arabic">
  452. <li><p class="first">Go to ‘Repositories’ /
  453. tree view / ‘Actions’ / ‘Update from Github’</p>
  454. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_repository_kanban.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_repository_kanban.png" />
  455. </li>
  456. <li><p class="first">In each repository, you can see the main branches list and the size of code
  457. source.</p>
  458. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_repository_branch_kanban.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_repository_branch_kanban.png" />
  459. </li>
  460. </ol>
  461. </div>
  462. <div class="section" id="fetching-the-source-code">
  463. <h2><a class="toc-backref" href="#id9">Fetching the source code</a></h2>
  464. <p>Finally, you can download locally the source code of all your branches:</p>
  465. <ol class="arabic">
  466. <li><p class="first">Go to ‘Repository Branches’ / tree view / ‘Actions’ / ‘Download and Analyse Source Code’.</p>
  467. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/wizard_download_analyze.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/wizard_download_analyze.png" />
  468. </li>
  469. <li><p class="first">In the tree view you can update manually source code or refresh analysis.</p>
  470. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_repository_branch_list.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_repository_branch_list.png" />
  471. </li>
  472. </ol>
  473. </div>
  474. <div class="section" id="analysis-source-code">
  475. <h2><a class="toc-backref" href="#id10">Analysis source code</a></h2>
  476. <p>It’s possible to create custom analysis rules that relate to a GitHub organization, GitHub repository and/or GitHub repository branch to analyze code.</p>
  477. <ol class="arabic simple">
  478. <li>Go to ‘Settings’ / ‘Analysis rule groups’ and create records that allow to organize the rules</li>
  479. <li>Go to ‘Settings’ / ‘Analysis rules’ and create rules, for example:</li>
  480. </ol>
  481. <blockquote>
  482. <ol class="arabic simple">
  483. <li>Name: All code, Group: General, Paths: <tt class="docutils literal">*</tt></li>
  484. <li>Name: Python code, Group: General, Paths: <tt class="docutils literal">*.py</tt></li>
  485. <li>Name: Xml code, Group: General, Paths: <tt class="docutils literal">*.xml</tt></li>
  486. <li>Name: Repository 1, Group: Custom, Paths: /path/</li>
  487. </ol>
  488. </blockquote>
  489. <p>Note: Paths field in ‘Analysis rule’ allow to put multiple paths for line, path format is according to <a class="reference external" href="https://git-scm.com/docs/gitignore#_pattern_format">https://git-scm.com/docs/gitignore#_pattern_format</a></p>
  490. <ol class="arabic simple">
  491. <li>Go to <em>GitHub &gt; GitHub Community &gt; Organizations</em> and define Analysis rules (optional)</li>
  492. <li>Go to <em>GitHub &gt; GitHub Repository &gt; Repositories</em> and define Analysis rules (optional)</li>
  493. <li>Go to <em>GitHub &gt; GitHub Repository &gt; Repository Branches</em> and define Analysis rules (optional)</li>
  494. </ol>
  495. <p>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
  496. Other option to Analysis source code is in cron called ‘Analyze Source Code for All Github Branches’</p>
  497. <p>You can see in ‘Repository Branch’ / ‘Code Analysis’ the info obtained from analysis rules.</p>
  498. </div>
  499. <div class="section" id="data-creation-in-github">
  500. <h2><a class="toc-backref" href="#id11">Data creation in Github</a></h2>
  501. <p>You have the possibility to creates two items in Github directly from Odoo</p>
  502. <ol class="arabic">
  503. <li><p class="first">Teams:</p>
  504. <ol class="arabic simple">
  505. <li>Go to ‘Settings’ / ‘Create Team in Github’.</li>
  506. <li>Set the information and click on Create in Github.</li>
  507. <li>Odoo will try to create the team. If access right and datas are correct,
  508. the creation will be done directly in Github</li>
  509. <li>Later on, a synchronization will be performed, to create the according
  510. team in the Odoo instance.</li>
  511. </ol>
  512. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/wizard_create_team.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/wizard_create_team.png" />
  513. </li>
  514. <li><p class="first">Repositories:</p>
  515. <ol class="arabic simple">
  516. <li>Go to ‘Settings’ / ‘Create Team in Github’.</li>
  517. <li>Set the information and click on Create in Github.</li>
  518. </ol>
  519. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/wizard_create_repository.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/wizard_create_repository.png" />
  520. </li>
  521. </ol>
  522. </div>
  523. <div class="section" id="note">
  524. <h2><a class="toc-backref" href="#id12">Note</a></h2>
  525. <p>Analysis in this module is basic: for the time being, it just gives branches
  526. size.</p>
  527. <p>Nevertheless, you can develop an extra Odoo Custom module to extend analysis
  528. function and get extra statistics, depending on your needs.</p>
  529. <p>In that way, you can see the module github_connector_odoo, if your repositories
  530. contain Odoo modules.</p>
  531. </div>
  532. <div class="section" id="reporting">
  533. <h2><a class="toc-backref" href="#id13">Reporting</a></h2>
  534. <p>This module provides several reports</p>
  535. <p><strong>Branches by Serie</strong></p>
  536. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/reporting_branches_by_serie.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/reporting_branches_by_serie.png" />
  537. <p><strong>Sizes by Serie</strong></p>
  538. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/reporting_sizes_by_serie.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/reporting_sizes_by_serie.png" />
  539. <p><strong>Repository branch analysis rule</strong></p>
  540. <img alt="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_repository_branch_rule_info_report.png" src="https://raw.githubusercontent.com/OCA/interface-github/13.0/github_connector/static/description/github_repository_branch_rule_info_report.png" />
  541. </div>
  542. </div>
  543. <div class="section" id="known-issues-roadmap">
  544. <h1><a class="toc-backref" href="#id14">Known issues / Roadmap</a></h1>
  545. <ul>
  546. <li><p class="first">For the time being, Github API doesn’t provide some informations that are
  547. available by the classic UI, that includes:</p>
  548. <ol class="arabic simple">
  549. <li>team hierarchy: the field is present in the model github_team.parent_id,
  550. but unused.</li>
  551. </ol>
  552. </li>
  553. <li><p class="first">Possible improvements:</p>
  554. <ol class="arabic simple">
  555. <li>Create a new module github_connector_website, that could display
  556. teams / repositories / branches informations for non logged users.</li>
  557. <li>Analyze commits (author, quantity by series, etc…):
  558. this feature has been partially implemented in a V8.0 PR.</li>
  559. <li>Synchronize Pull Request, Issues, Comments:
  560. this feature has been partially implemented in a V8.0 PR.</li>
  561. </ol>
  562. </li>
  563. <li><p class="first">Refactor the github connector:</p>
  564. <p>A python library called PyGitHub is available. It could be interesting
  565. to use it, instead of using custom code. However, this lib doesn’t provide
  566. good access to child object, generating for the time being, unnecessary
  567. API calls. For example, updating a repository should call before a call to
  568. the parent organization (The current module is so faster).</p>
  569. </li>
  570. </ul>
  571. </div>
  572. <div class="section" id="bug-tracker">
  573. <h1><a class="toc-backref" href="#id15">Bug Tracker</a></h1>
  574. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/interface-github/issues">GitHub Issues</a>.
  575. In case of trouble, please check there if your issue has already been reported.
  576. If you spotted it first, help us smashing it by providing a detailed and welcomed
  577. <a class="reference external" href="https://github.com/OCA/interface-github/issues/new?body=module:%20github_connector%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
  578. <p>Do not contact contributors directly about support or help with technical issues.</p>
  579. </div>
  580. <div class="section" id="credits">
  581. <h1><a class="toc-backref" href="#id16">Credits</a></h1>
  582. <div class="section" id="authors">
  583. <h2><a class="toc-backref" href="#id17">Authors</a></h2>
  584. <ul class="simple">
  585. <li>GRAP</li>
  586. <li>Akretion</li>
  587. <li>Tecnativa</li>
  588. </ul>
  589. </div>
  590. <div class="section" id="contributors">
  591. <h2><a class="toc-backref" href="#id18">Contributors</a></h2>
  592. <ul class="simple">
  593. <li>Sylvain LE GAL (<a class="reference external" href="https://twitter.com/legalsylvain">https://twitter.com/legalsylvain</a>)</li>
  594. <li>Sébastien BEAU (<a class="reference external" href="mailto:sebastien.beau&#64;akretion.com">sebastien.beau&#64;akretion.com</a>)</li>
  595. <li>Benoît GUILLOT (<a class="reference external" href="mailto:benoit.guillot&#64;akretion.com">benoit.guillot&#64;akretion.com</a>)</li>
  596. <li>Enrique Martín (<a class="reference external" href="mailto:enriquemartin&#64;digital5.es">enriquemartin&#64;digital5.es</a>)</li>
  597. <li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:”,<ul>
  598. <li>Pedro M. Baeza</li>
  599. <li>Vicent Cubells</li>
  600. <li>Alexandre Díaz</li>
  601. <li>Ernesto Tejeda</li>
  602. <li>Carlos Roca</li>
  603. <li>Víctor Martínez</li>
  604. </ul>
  605. </li>
  606. </ul>
  607. </div>
  608. <div class="section" id="maintainers">
  609. <h2><a class="toc-backref" href="#id19">Maintainers</a></h2>
  610. <p>This module is maintained by the OCA.</p>
  611. <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
  612. <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
  613. mission is to support the collaborative development of Odoo features and
  614. promote its widespread use.</p>
  615. <p>This module is part of the <a class="reference external" href="https://github.com/OCA/interface-github/tree/13.0/github_connector">OCA/interface-github</a> project on GitHub.</p>
  616. <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
  617. </div>
  618. </div>
  619. </div>
  620. </body>
  621. </html>
上海开阖软件有限公司 沪ICP备12045867号-1