Skip to content

Commit 67fda30

Browse files
committed
[MIG] github_connector: Migration to 17.0
TT51638
1 parent bb5dbe1 commit 67fda30

25 files changed

+266
-275
lines changed

github_connector/README.rst

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,18 @@ To fetch information from Github, you have to:
122122

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

125-
|image|
125+
|sync_organization|
126126

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

130-
|image1|
130+
|github_organization_kanban|
131131

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

136-
|image2|
136+
|github_organization_series|
137137

138138
Select branches to download
139139
---------------------------
@@ -148,13 +148,13 @@ only main branches (releases):
148148
2. In the 'Settings' tab, set the URL of the 'External Services' you use
149149
for Continuous Integration and Coverage.
150150

151-
|image3|
151+
|github_organization_external_services|
152152

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

157-
|image4|
157+
|github_organization_sync_buttons|
158158

159159
Team / members synchronization
160160
------------------------------
@@ -163,17 +163,17 @@ You can synchronize members teams:
163163

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

166-
|image5|
166+
|github_team_kanban|
167167

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

171-
|image6|
171+
|github_team_partner_kanban|
172172

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

176-
|image7|
176+
|github_team_repository_kanban|
177177

178178
Repositories synchronization
179179
----------------------------
@@ -182,12 +182,12 @@ You can synchronize the branches of your repositories:
182182

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

185-
|image8|
185+
|github_repository_kanban|
186186

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

190-
|image9|
190+
|github_repository_branch_kanban|
191191

192192
Fetching the source code
193193
------------------------
@@ -197,12 +197,12 @@ Finally, you can download locally the source code of all your branches:
197197
1. Go to 'Repository Branches' / tree view / 'Actions' / 'Download and
198198
Analyse Source Code'.
199199

200-
|image10|
200+
|wizard_download_analyze|
201201

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

205-
|image11|
205+
|github_repository_branch_list|
206206

207207
Analysis source code
208208
--------------------
@@ -257,14 +257,14 @@ Odoo
257257
4. Later on, a synchronization will be performed, to create the
258258
according team in the Odoo instance.
259259

260-
|image12|
260+
|wizard_create_team|
261261

262262
2. Repositories:
263263

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

267-
|image13|
267+
|wizard_create_repository|
268268

269269
Note
270270
----
@@ -285,33 +285,33 @@ This module provides several reports
285285

286286
**Branches by Serie**
287287

288-
|image14|
288+
|reporting_branches_by_serie|
289289

290290
**Sizes by Serie**
291291

292-
|image15|
292+
|reporting_sizes_by_serie|
293293

294294
**Repository branch analysis rule**
295295

296-
|image16|
297-
298-
.. |image| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/sync_organization.png
299-
.. |image1| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_organization_kanban.png
300-
.. |image2| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_organization_series.png
301-
.. |image3| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_organization_external_services.png
302-
.. |image4| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_organization_sync_buttons.png
303-
.. |image5| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_team_kanban.png
304-
.. |image6| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_team_partner_kanban.png
305-
.. |image7| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_team_repository_kanban.png
306-
.. |image8| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_repository_kanban.png
307-
.. |image9| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_repository_branch_kanban.png
308-
.. |image10| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/wizard_download_analyze.png
309-
.. |image11| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_repository_branch_list.png
310-
.. |image12| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/wizard_create_team.png
311-
.. |image13| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/wizard_create_repository.png
312-
.. |image14| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/reporting_branches_by_serie.png
313-
.. |image15| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/reporting_sizes_by_serie.png
314-
.. |image16| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_repository_branch_rule_info_report.png
296+
|github_repository_branch_rule_info_report|
297+
298+
.. |sync_organization| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/sync_organization.png
299+
.. |github_organization_kanban| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_organization_kanban.png
300+
.. |github_organization_series| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_organization_series.png
301+
.. |github_organization_external_services| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_organization_external_services.png
302+
.. |github_organization_sync_buttons| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_organization_sync_buttons.png
303+
.. |github_team_kanban| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_team_kanban.png
304+
.. |github_team_partner_kanban| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_team_partner_kanban.png
305+
.. |github_team_repository_kanban| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_team_repository_kanban.png
306+
.. |github_repository_kanban| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_repository_kanban.png
307+
.. |github_repository_branch_kanban| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_repository_branch_kanban.png
308+
.. |wizard_download_analyze| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/wizard_download_analyze.png
309+
.. |github_repository_branch_list| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_repository_branch_list.png
310+
.. |wizard_create_team| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/wizard_create_team.png
311+
.. |wizard_create_repository| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/wizard_create_repository.png
312+
.. |reporting_branches_by_serie| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/reporting_branches_by_serie.png
313+
.. |reporting_sizes_by_serie| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/reporting_sizes_by_serie.png
314+
.. |github_repository_branch_rule_info_report| image:: https://raw.githubusercontent.com/OCA/interface-github/17.0/github_connector/static/description/github_repository_branch_rule_info_report.png
315315

316316
Known issues / Roadmap
317317
======================

github_connector/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{
88
"name": "Github Connector",
99
"summary": "Synchronize information from Github repositories",
10-
"version": "16.0.1.0.0",
10+
"version": "17.0.1.0.0",
1111
"category": "Connector",
1212
"license": "AGPL-3",
1313
"author": "Odoo Community Association (OCA), GRAP, Akretion, Tecnativa",

github_connector/i18n/es.po

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,9 +1457,3 @@ msgstr "o"
14571457
#, python-format
14581458
msgid "source_code_local_path should be defined in your configuration file"
14591459
msgstr "source_code_local_path debe definirse en su archivo de configuración"
1460-
1461-
#~ msgid "# String"
1462-
#~ msgstr "# Cadena"
1463-
1464-
#~ msgid "Total string"
1465-
#~ msgstr "Total cadena"

github_connector/models/abstract_github_model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ def create_from_name(self, name):
200200
else:
201201
try:
202202
# Try to get an organization 1st.
203-
# An organization is always an user, but a user is not necessarily an org.
203+
# An organization is always an user, but a user is not necessarily
204+
# an org.
204205
gh_obj = gh_api.get_organization(p_name)
205206
except UnknownObjectException:
206207
# Try to get an user.

github_connector/models/github_repository.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,8 @@ def _compute_team_qty(self):
108108
@api.depends("name", "organization_id.github_name")
109109
def _compute_complete_name(self):
110110
for repository in self:
111-
repository.complete_name = "%(login)s/%(rep_name)s" % (
112-
{
113-
"login": repository.organization_id.github_name,
114-
"rep_name": repository.name or "",
115-
}
111+
repository.complete_name = (
112+
f"{repository.organization_id.github_name}/{repository.name or ''}"
116113
)
117114

118115
@api.depends("repository_branch_ids.repository_id")

github_connector/models/github_repository_branch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def _download_code(self):
179179
)
180180
% (branch.local_path)
181181
) from None
182-
command = ("git clone %s -b %s %s") % (
182+
command = ("git clone {} -b {} {}").format(
183183
gh_repo.clone_url,
184184
branch.name,
185185
branch.local_path,

github_connector/models/github_team.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ def _compute_github_url(self):
8888
@api.depends("name", "organization_id.github_name")
8989
def _compute_complete_name(self):
9090
for team in self:
91-
team.complete_name = "{}/{}".format(
92-
team.organization_id.github_name, team.github_name
91+
team.complete_name = (
92+
f"{team.organization_id.github_name}/{team.github_name}"
9393
)
9494

9595
@api.depends("partner_ids")

github_connector/readme/USAGE.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ To fetch information from Github, you have to:
66

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

9-
![image](../static/description/sync_organization.png)
9+
![sync_organization](static/description/sync_organization.png)
1010

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

14-
![image](../static/description/github_organization_kanban.png)
14+
![github_organization_kanban](static/description/github_organization_kanban.png)
1515

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

20-
![image](../static/description/github_organization_series.png)
20+
![github_organization_series](static/description/github_organization_series.png)
2121

2222
## Select branches to download
2323

@@ -31,44 +31,44 @@ only main branches (releases):
3131
2. In the 'Settings' tab, set the URL of the 'External Services' you
3232
use for Continuous Integration and Coverage.
3333

34-
![image](../static/description/github_organization_external_services.png)
34+
![github_organization_external_services](static/description/github_organization_external_services.png)
3535

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

40-
![image](../static/description/github_organization_sync_buttons.png)
40+
![github_organization_sync_buttons](static/description/github_organization_sync_buttons.png)
4141

4242
## Team / members synchronization
4343

4444
You can synchronize members teams:
4545

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

48-
![image](../static/description/github_team_kanban.png)
48+
![github_team_kanban](static/description/github_team_kanban.png)
4949

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

53-
![image](../static/description/github_team_partner_kanban.png)
53+
![github_team_partner_kanban](static/description/github_team_partner_kanban.png)
5454

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

58-
![image](../static/description/github_team_repository_kanban.png)
58+
![github_team_repository_kanban](static/description/github_team_repository_kanban.png)
5959

6060
## Repositories synchronization
6161

6262
You can synchronize the branches of your repositories:
6363

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

66-
![image](../static/description/github_repository_kanban.png)
66+
![github_repository_kanban](static/description/github_repository_kanban.png)
6767

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

71-
![image](../static/description/github_repository_branch_kanban.png)
71+
![github_repository_branch_kanban](static/description/github_repository_branch_kanban.png)
7272

7373
## Fetching the source code
7474

@@ -77,12 +77,12 @@ Finally, you can download locally the source code of all your branches:
7777
1. Go to 'Repository Branches' / tree view / 'Actions' / 'Download and
7878
Analyse Source Code'.
7979

80-
![image](../static/description/wizard_download_analyze.png)
80+
![wizard_download_analyze](static/description/wizard_download_analyze.png)
8181

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

85-
![image](../static/description/github_repository_branch_list.png)
85+
![github_repository_branch_list](static/description/github_repository_branch_list.png)
8686

8787
## Analysis source code
8888

@@ -133,14 +133,14 @@ Odoo
133133
4. Later on, a synchronization will be performed, to create the
134134
according team in the Odoo instance.
135135

136-
![image](../static/description/wizard_create_team.png)
136+
![wizard_create_team](static/description/wizard_create_team.png)
137137

138138
2. Repositories:
139139

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

143-
![image](../static/description/wizard_create_repository.png)
143+
![wizard_create_repository](static/description/wizard_create_repository.png)
144144

145145
## Note
146146

@@ -159,12 +159,12 @@ This module provides several reports
159159

160160
**Branches by Serie**
161161

162-
![image](../static/description/reporting_branches_by_serie.png)
162+
![reporting_branches_by_serie](static/description/reporting_branches_by_serie.png)
163163

164164
**Sizes by Serie**
165165

166-
![image](../static/description/reporting_sizes_by_serie.png)
166+
![reporting_sizes_by_serie](static/description/reporting_sizes_by_serie.png)
167167

168168
**Repository branch analysis rule**
169169

170-
![image](../static/description/github_repository_branch_rule_info_report.png)
170+
![github_repository_branch_rule_info_report](static/description/github_repository_branch_rule_info_report.png)

github_connector/report/github_repository_branch_rule_info_report.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class GithubRepositoryBranchRuleInfoReport(models.Model):
3838

3939
@property
4040
def _table_query(self):
41-
return "%s %s %s" % (self._select(), self._from(), self._group_by())
41+
return f"{self._select()} {self._from()} {self._group_by()}"
4242

4343
@api.model
4444
def _select(self):
@@ -63,8 +63,10 @@ def _from(self):
6363
FROM github_repository_branch_rule_info as grbri
6464
LEFT JOIN github_analysis_rule as gar ON grbri.analysis_rule_id = gar.id
6565
LEFT JOIN github_analysis_rule_group as garg ON gar.group_id = garg.id
66-
LEFT JOIN github_repository_branch as grb ON grbri.repository_branch_id = grb.id
67-
LEFT JOIN github_organization_serie as gos ON grb.organization_serie_id = gos.id
66+
LEFT JOIN github_repository_branch as grb
67+
ON grbri.repository_branch_id = grb.id
68+
LEFT JOIN github_organization_serie as gos
69+
ON grb.organization_serie_id = gos.id
6870
LEFT JOIN github_repository as gr ON grb.repository_id = gr.id
6971
"""
7072

0 commit comments

Comments
 (0)