-
Notifications
You must be signed in to change notification settings - Fork 7
/
gitlab_api_test.py
174 lines (168 loc) · 6.67 KB
/
gitlab_api_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#!/usr/local/bin/python3
import gitlab_api
if __name__ == '__main__':
obj = gitlab_api.GitlabAPI()
# print([(user['name'], user['email']) for user in obj.get_users('@odoo.com')])
# obj.project_mrs2csv(516) # MRS from ABSA
# members_attributes = obj.get_members_attributes('vauxoo')
# print(members_attributes)
# members obj.get_members_grouped_by_access_level('vauxoo')
# obj.delete_reporter_members('vauxoo')
# obj.get_project_depends()
# obj.get_project_variables()
# custom_projects_branches = ["vauxoo/[email protected]", "vauxoo/[email protected]", "vauxoo/[email protected]"]
# custom_projects_branches = [
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# ]
# # custom_projects_branches = [
# # "vauxoo/[email protected]"
# # ]
# created_mrs = obj.make_mr(
# custom_projects_branches,
# "[DUMMY] testing feature (autocreated) vauxoo/gitlab_tools#80",
# "Testing feature https://git.vauxoo.com/vauxoo/gitlab_tools/-/merge_requests/80",
# "gitlabtoolsmr80-moy",
# )
# print("MRs created: %s" % '\n'.join(created_mrs))
# obj.get_pipeline_artifacts("vauxoo", ["15.0", "14.0", "13.0", "12.0"], ["odoo", "odoo_test"])
# obj.get_project_files()
# custom_projects_branches = [
# "absa/[email protected]", "vauxoo/[email protected]", "vauxoo/[email protected]","vauxoo/[email protected]","vauxoo/[email protected]","vauxoo/[email protected]","vauxoo/[email protected]","vauxoo/[email protected]",
# ]
# created_mrs = obj.make_mr(
# custom_projects_branches,
# "[REF] CI: Using new vx-ci (autocreated)",
# "Migrating to new CI tool https://git.vauxoo.com/devops/vxci\n\nPart of https://git.vauxoo.com/devops/vxci/-/issues/7",
# "vxci-moy",
# )
# custom_projects_branches = [
# "absa/[email protected]",
# "qualifirst/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# ]
# created_mrs = obj.make_mr(
# custom_projects_branches,
# "[REF] CI: Update project-template (autocreated)",
# "Now it is compatible with multiple pipelines with coverage combine",
# "vxci-cvrg-combine-moy",
# )
# custom_projects_branches = [
# # "absa/[email protected]",
# # "qualifirst/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# ]
# # custom_projects_branches = [
# # "vauxoo/[email protected]",
# # "vauxoo/[email protected]",
# # "vauxoo/[email protected]",
# # "vauxoo/[email protected]",
# # "vauxoo/[email protected]",
# # "qualifirst/[email protected]",
# # ]
# # custom_projects_branches = [i for i in custom_projects_branches if i.endswith("@15.0")]
# # print('\n'.join(custom_projects_branches))
# # created_mrs = obj.make_mr(
# # custom_projects_branches,
# # "[REF] patches: Remove odoo/odoo#98232 patch (autocreated)",
# # "It was already fixed from https://github.com/odoo/odoo/pull/99829",
# # "patches-rm98232-moy",
# # )
# created_mrs = obj.make_mr(
# custom_projects_branches,
# "[REF] CI: Add missing check_keys to get docker image from quay.io (autocreated)",
# "Related to https://git.vauxoo.com/vauxoo/project-template/-/merge_requests/101",
# "mr101-moy",
# )
# print("Created MRs:\n%s" % '\n'.join(created_mrs))
# custom_projects_branches = [
# # "ircodoo/[email protected]",
# "mexico/[email protected]",
# "qualifirst/[email protected]",
# "qualifirst/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# "vauxoo/[email protected]",
# ]
# # obj.get_project_files()
# created_mrs = obj.make_mr(
# custom_projects_branches,
# "[REF] autofixes: Apply future autofixes\n"
# "Autofixes new version are creating changes",
# "autofixes-moy",
# run_pre_commit_vauxoo=True,
# task_id="1147", # Similar to LINT xD
# )
# print("MRs created: %s" % '\n'.join(created_mrs))
non_ascii = r"[^\x00-\x7F]"
print(obj.look_for_filename(fname_regex=non_ascii, only_default_branch=True))