gitlab-projects-settings 1.0.1__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/CHANGELOG.md +12 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/PKG-INFO +6 -6
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/README.md +5 -5
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings/cli/main.py +9 -9
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings/features/settings.py +66 -54
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings.egg-info/PKG-INFO +6 -6
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/.chglog/CHANGELOG.tpl.md +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/.chglog/changelog.sh +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/.chglog/config.yml +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/.gitignore +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/.gitlab-ci.yml +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/.markdownlint.json +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/.style.yapf +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/.vscode/extensions.json +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/.vscode/settings.json +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/LICENSE +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings/__init__.py +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings/__main__.py +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings/cli/__init__.py +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings/features/__init__.py +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings/features/gitlab.py +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings/package/__init__.py +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings/package/bundle.py +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings/package/version.py +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings/prints/__init__.py +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings/prints/colors.py +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings/system/__init__.py +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings/system/platform.py +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings.egg-info/SOURCES.txt +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings.egg-info/dependency_links.txt +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings.egg-info/entry_points.txt +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings.egg-info/requires.txt +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/gitlab_projects_settings.egg-info/top_level.txt +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/mypy.ini +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/requirements/build.txt +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/requirements/deploy.txt +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/requirements/quality.txt +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/requirements/runtime.txt +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/setup.cfg +0 -0
- {gitlab_projects_settings-1.0.1 → gitlab_projects_settings-1.1.0}/setup.py +0 -0
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
|
|
2
|
+
<a name="1.1.0"></a>
|
|
3
|
+
## [1.1.0](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/1.0.1...1.1.0) (2024-04-25)
|
|
4
|
+
|
|
5
|
+
### Code Refactoring
|
|
6
|
+
|
|
7
|
+
* **settings:** minor functions codestyle improvement
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **main:** rename '--avoid-*' parameters to '--exclude-*'
|
|
12
|
+
|
|
13
|
+
|
|
2
14
|
<a name="1.0.1"></a>
|
|
3
15
|
## [1.0.1](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/1.0.0...1.0.1) (2024-04-24)
|
|
4
16
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: gitlab-projects-settings
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: Configure GitLab groups and projects settings automatically
|
|
5
5
|
Home-page: https://gitlab.com/AdrianDC/gitlab-projects-settings
|
|
6
6
|
Author: Adrian DC
|
|
@@ -57,8 +57,8 @@ for example protecting tags and branches, or setting a new avatar recursively.
|
|
|
57
57
|
<!-- prettier-ignore-start -->
|
|
58
58
|
|
|
59
59
|
```yaml
|
|
60
|
-
usage: gitlab-projects-settings [-h] [--version] [-t TOKEN] [--dry-run] [--
|
|
61
|
-
[--
|
|
60
|
+
usage: gitlab-projects-settings [-h] [--version] [-t TOKEN] [--dry-run] [--exclude-group]
|
|
61
|
+
[--exclude-subgroups] [--exclude-projects] [--reset-features]
|
|
62
62
|
[--reset-members] [--set-avatar FILE] [--set-description TEXT]
|
|
63
63
|
[--update-description] [--protect-branches]
|
|
64
64
|
[--protect-tags LEVEL]
|
|
@@ -75,9 +75,9 @@ credentials arguments:
|
|
|
75
75
|
|
|
76
76
|
common settings arguments:
|
|
77
77
|
--dry-run # Enable dry run mode to check without saving
|
|
78
|
-
--
|
|
79
|
-
--
|
|
80
|
-
--
|
|
78
|
+
--exclude-group # Exclude parent group settings
|
|
79
|
+
--exclude-subgroups # Exclude children subgroups settings
|
|
80
|
+
--exclude-projects # Exclude children projects settings
|
|
81
81
|
|
|
82
82
|
general settings arguments:
|
|
83
83
|
--reset-features # Reset features of GitLab projects based on usage
|
|
@@ -23,8 +23,8 @@ for example protecting tags and branches, or setting a new avatar recursively.
|
|
|
23
23
|
<!-- prettier-ignore-start -->
|
|
24
24
|
|
|
25
25
|
```yaml
|
|
26
|
-
usage: gitlab-projects-settings [-h] [--version] [-t TOKEN] [--dry-run] [--
|
|
27
|
-
[--
|
|
26
|
+
usage: gitlab-projects-settings [-h] [--version] [-t TOKEN] [--dry-run] [--exclude-group]
|
|
27
|
+
[--exclude-subgroups] [--exclude-projects] [--reset-features]
|
|
28
28
|
[--reset-members] [--set-avatar FILE] [--set-description TEXT]
|
|
29
29
|
[--update-description] [--protect-branches]
|
|
30
30
|
[--protect-tags LEVEL]
|
|
@@ -41,9 +41,9 @@ credentials arguments:
|
|
|
41
41
|
|
|
42
42
|
common settings arguments:
|
|
43
43
|
--dry-run # Enable dry run mode to check without saving
|
|
44
|
-
--
|
|
45
|
-
--
|
|
46
|
-
--
|
|
44
|
+
--exclude-group # Exclude parent group settings
|
|
45
|
+
--exclude-subgroups # Exclude children subgroups settings
|
|
46
|
+
--exclude-projects # Exclude children projects settings
|
|
47
47
|
|
|
48
48
|
general settings arguments:
|
|
49
49
|
--reset-features # Reset features of GitLab projects based on usage
|
|
@@ -61,22 +61,22 @@ def main() -> None:
|
|
|
61
61
|
help='Enable dry run mode to check without saving',
|
|
62
62
|
)
|
|
63
63
|
group.add_argument(
|
|
64
|
-
'--
|
|
65
|
-
dest='
|
|
64
|
+
'--exclude-group',
|
|
65
|
+
dest='exclude_group',
|
|
66
66
|
action='store_true',
|
|
67
|
-
help='
|
|
67
|
+
help='Exclude parent group settings',
|
|
68
68
|
)
|
|
69
69
|
group.add_argument(
|
|
70
|
-
'--
|
|
71
|
-
dest='
|
|
70
|
+
'--exclude-subgroups',
|
|
71
|
+
dest='exclude_subgroups',
|
|
72
72
|
action='store_true',
|
|
73
|
-
help='
|
|
73
|
+
help='Exclude children subgroups settings',
|
|
74
74
|
)
|
|
75
75
|
group.add_argument(
|
|
76
|
-
'--
|
|
77
|
-
dest='
|
|
76
|
+
'--exclude-projects',
|
|
77
|
+
dest='exclude_projects',
|
|
78
78
|
action='store_true',
|
|
79
|
-
help='
|
|
79
|
+
help='Exclude children projects settings',
|
|
80
80
|
)
|
|
81
81
|
|
|
82
82
|
# Arguments general settings definitions
|
|
@@ -57,11 +57,11 @@ class SettingsFeature:
|
|
|
57
57
|
elif group:
|
|
58
58
|
|
|
59
59
|
# Handle group
|
|
60
|
-
if not options.
|
|
60
|
+
if not options.exclude_group:
|
|
61
61
|
SettingsFeature.group(options, gitlab, group.id)
|
|
62
62
|
|
|
63
63
|
# Iterate through subgroups
|
|
64
|
-
if not options.
|
|
64
|
+
if not options.exclude_subgroups:
|
|
65
65
|
for group_subgroup in group.descendant_groups.list(
|
|
66
66
|
get_all=True,
|
|
67
67
|
include_subgroups=True,
|
|
@@ -71,10 +71,10 @@ class SettingsFeature:
|
|
|
71
71
|
SettingsFeature.group(options, gitlab, group_subgroup.id)
|
|
72
72
|
|
|
73
73
|
# Iterate through projects
|
|
74
|
-
if not options.
|
|
74
|
+
if not options.exclude_projects:
|
|
75
75
|
for group_project in group.projects.list(
|
|
76
76
|
get_all=True,
|
|
77
|
-
include_subgroups=not options.
|
|
77
|
+
include_subgroups=not options.exclude_subgroups,
|
|
78
78
|
order_by='path',
|
|
79
79
|
sort='asc',
|
|
80
80
|
):
|
|
@@ -83,12 +83,71 @@ class SettingsFeature:
|
|
|
83
83
|
# Result
|
|
84
84
|
return True
|
|
85
85
|
|
|
86
|
-
#
|
|
86
|
+
# Group
|
|
87
87
|
@staticmethod
|
|
88
|
-
def
|
|
88
|
+
def group(
|
|
89
|
+
options: Namespace,
|
|
90
|
+
gitlab: GitLabFeature,
|
|
91
|
+
criteria: str,
|
|
92
|
+
subgroup: bool = False,
|
|
93
|
+
) -> None:
|
|
94
|
+
|
|
95
|
+
# Acquire group
|
|
96
|
+
group = gitlab.group(criteria)
|
|
89
97
|
|
|
90
|
-
# Show
|
|
98
|
+
# Show group details
|
|
99
|
+
group_type = 'subgroup' if subgroup else 'group'
|
|
100
|
+
print(f'{Colors.BOLD} - GitLab {group_type}: '
|
|
101
|
+
f'{Colors.YELLOW_LIGHT}{group.full_path} '
|
|
102
|
+
f'{Colors.CYAN}({group.description})'
|
|
103
|
+
f'{Colors.RESET}')
|
|
104
|
+
|
|
105
|
+
# Set group description
|
|
106
|
+
if options.set_description:
|
|
107
|
+
gitlab.group_set_description(criteria, options.set_description)
|
|
108
|
+
print(f'{Colors.BOLD} - Set description: '
|
|
109
|
+
f'{Colors.CYAN}{options.set_description}'
|
|
110
|
+
f'{Colors.RESET}')
|
|
111
|
+
|
|
112
|
+
# Update group description
|
|
113
|
+
elif options.update_description:
|
|
114
|
+
description = f'{group.name[:1].capitalize()}{group.name[1:]}' \
|
|
115
|
+
f' - description'
|
|
116
|
+
gitlab.group_set_description(criteria, description)
|
|
117
|
+
print(f'{Colors.BOLD} - Updated description: '
|
|
118
|
+
f'{Colors.CYAN}{description}'
|
|
119
|
+
f'{Colors.RESET}')
|
|
120
|
+
|
|
121
|
+
# Reset group members
|
|
122
|
+
if options.reset_members:
|
|
123
|
+
gitlab.group_reset_members(criteria)
|
|
124
|
+
print(f'{Colors.BOLD} - Reset members: '
|
|
125
|
+
f'{Colors.GREEN}Success'
|
|
126
|
+
f'{Colors.RESET}')
|
|
127
|
+
|
|
128
|
+
# Set group avatar
|
|
129
|
+
if options.set_avatar:
|
|
130
|
+
gitlab.group_set_avatar(criteria, options.set_avatar)
|
|
131
|
+
print(f'{Colors.BOLD} - Set avatar: '
|
|
132
|
+
f'{Colors.CYAN}{options.set_avatar}'
|
|
133
|
+
f'{Colors.RESET}')
|
|
134
|
+
|
|
135
|
+
# Footer
|
|
136
|
+
print(' ')
|
|
137
|
+
Platform.flush()
|
|
138
|
+
|
|
139
|
+
# Project, pylint: disable=too-many-branches
|
|
140
|
+
@staticmethod
|
|
141
|
+
def project(
|
|
142
|
+
options: Namespace,
|
|
143
|
+
gitlab: GitLabFeature,
|
|
144
|
+
criteria: str,
|
|
145
|
+
) -> None:
|
|
146
|
+
|
|
147
|
+
# Acquire project
|
|
91
148
|
project = gitlab.project(criteria)
|
|
149
|
+
|
|
150
|
+
# Show project details
|
|
92
151
|
print(f'{Colors.BOLD} - GitLab project: '
|
|
93
152
|
f'{Colors.YELLOW_LIGHT}{project.path_with_namespace} '
|
|
94
153
|
f'{Colors.CYAN}({project.description})'
|
|
@@ -164,50 +223,3 @@ class SettingsFeature:
|
|
|
164
223
|
# Footer
|
|
165
224
|
print(' ')
|
|
166
225
|
Platform.flush()
|
|
167
|
-
|
|
168
|
-
# GitLab projects settings group
|
|
169
|
-
@staticmethod
|
|
170
|
-
def group(options: Namespace, gitlab: GitLabFeature, criteria: str,
|
|
171
|
-
subgroup: bool = False) -> None:
|
|
172
|
-
|
|
173
|
-
# Show group details
|
|
174
|
-
group = gitlab.group(criteria)
|
|
175
|
-
group_type = 'subgroup' if subgroup else 'group'
|
|
176
|
-
print(f'{Colors.BOLD} - GitLab {group_type}: '
|
|
177
|
-
f'{Colors.YELLOW_LIGHT}{group.full_path} '
|
|
178
|
-
f'{Colors.CYAN}({group.description})'
|
|
179
|
-
f'{Colors.RESET}')
|
|
180
|
-
|
|
181
|
-
# Set group description
|
|
182
|
-
if options.set_description:
|
|
183
|
-
gitlab.group_set_description(criteria, options.set_description)
|
|
184
|
-
print(f'{Colors.BOLD} - Set description: '
|
|
185
|
-
f'{Colors.CYAN}{options.set_description}'
|
|
186
|
-
f'{Colors.RESET}')
|
|
187
|
-
|
|
188
|
-
# Update group description
|
|
189
|
-
elif options.update_description:
|
|
190
|
-
description = f'{group.name[:1].capitalize()}{group.name[1:]}' \
|
|
191
|
-
f' - description'
|
|
192
|
-
gitlab.group_set_description(criteria, description)
|
|
193
|
-
print(f'{Colors.BOLD} - Updated description: '
|
|
194
|
-
f'{Colors.CYAN}{description}'
|
|
195
|
-
f'{Colors.RESET}')
|
|
196
|
-
|
|
197
|
-
# Reset group members
|
|
198
|
-
if options.reset_members:
|
|
199
|
-
gitlab.group_reset_members(criteria)
|
|
200
|
-
print(f'{Colors.BOLD} - Reset members: '
|
|
201
|
-
f'{Colors.GREEN}Success'
|
|
202
|
-
f'{Colors.RESET}')
|
|
203
|
-
|
|
204
|
-
# Set group avatar
|
|
205
|
-
if options.set_avatar:
|
|
206
|
-
gitlab.group_set_avatar(criteria, options.set_avatar)
|
|
207
|
-
print(f'{Colors.BOLD} - Set avatar: '
|
|
208
|
-
f'{Colors.CYAN}{options.set_avatar}'
|
|
209
|
-
f'{Colors.RESET}')
|
|
210
|
-
|
|
211
|
-
# Footer
|
|
212
|
-
print(' ')
|
|
213
|
-
Platform.flush()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: gitlab-projects-settings
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: Configure GitLab groups and projects settings automatically
|
|
5
5
|
Home-page: https://gitlab.com/AdrianDC/gitlab-projects-settings
|
|
6
6
|
Author: Adrian DC
|
|
@@ -57,8 +57,8 @@ for example protecting tags and branches, or setting a new avatar recursively.
|
|
|
57
57
|
<!-- prettier-ignore-start -->
|
|
58
58
|
|
|
59
59
|
```yaml
|
|
60
|
-
usage: gitlab-projects-settings [-h] [--version] [-t TOKEN] [--dry-run] [--
|
|
61
|
-
[--
|
|
60
|
+
usage: gitlab-projects-settings [-h] [--version] [-t TOKEN] [--dry-run] [--exclude-group]
|
|
61
|
+
[--exclude-subgroups] [--exclude-projects] [--reset-features]
|
|
62
62
|
[--reset-members] [--set-avatar FILE] [--set-description TEXT]
|
|
63
63
|
[--update-description] [--protect-branches]
|
|
64
64
|
[--protect-tags LEVEL]
|
|
@@ -75,9 +75,9 @@ credentials arguments:
|
|
|
75
75
|
|
|
76
76
|
common settings arguments:
|
|
77
77
|
--dry-run # Enable dry run mode to check without saving
|
|
78
|
-
--
|
|
79
|
-
--
|
|
80
|
-
--
|
|
78
|
+
--exclude-group # Exclude parent group settings
|
|
79
|
+
--exclude-subgroups # Exclude children subgroups settings
|
|
80
|
+
--exclude-projects # Exclude children projects settings
|
|
81
81
|
|
|
82
82
|
general settings arguments:
|
|
83
83
|
--reset-features # Reset features of GitLab projects based on usage
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|