gitlab-projects-settings 2.0.2__tar.gz → 2.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.
Files changed (40) hide show
  1. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/CHANGELOG.md +13 -0
  2. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/PKG-INFO +1 -1
  3. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/gitlab_projects_settings.egg-info/PKG-INFO +1 -1
  4. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/src/cli/entrypoint.py +39 -22
  5. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/.chglog/CHANGELOG.tpl.md +0 -0
  6. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/.chglog/changelog.sh +0 -0
  7. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/.chglog/config.yml +0 -0
  8. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/.gitignore +0 -0
  9. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/.gitlab-ci.yml +0 -0
  10. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/.markdownlint.json +0 -0
  11. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/.style.yapf +0 -0
  12. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/.vscode/extensions.json +0 -0
  13. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/.vscode/settings.json +0 -0
  14. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/LICENSE +0 -0
  15. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/README.md +0 -0
  16. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/gitlab_projects_settings.egg-info/SOURCES.txt +0 -0
  17. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/gitlab_projects_settings.egg-info/dependency_links.txt +0 -0
  18. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/gitlab_projects_settings.egg-info/entry_points.txt +0 -0
  19. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/gitlab_projects_settings.egg-info/requires.txt +0 -0
  20. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/gitlab_projects_settings.egg-info/top_level.txt +0 -0
  21. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/mypy.ini +0 -0
  22. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/requirements/build.txt +0 -0
  23. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/requirements/deploy.txt +0 -0
  24. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/requirements/quality.txt +0 -0
  25. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/requirements/runtime.txt +0 -0
  26. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/setup.cfg +0 -0
  27. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/setup.py +0 -0
  28. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/src/__init__.py +0 -0
  29. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/src/__main__.py +0 -0
  30. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/src/cli/__init__.py +0 -0
  31. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/src/cli/main.py +0 -0
  32. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/src/features/__init__.py +0 -0
  33. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/src/features/gitlab.py +0 -0
  34. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/src/package/__init__.py +0 -0
  35. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/src/package/bundle.py +0 -0
  36. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/src/package/version.py +0 -0
  37. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/src/prints/__init__.py +0 -0
  38. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/src/prints/colors.py +0 -0
  39. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/src/system/__init__.py +0 -0
  40. {gitlab_projects_settings-2.0.2 → gitlab_projects_settings-2.1.0}/src/system/platform.py +0 -0
@@ -1,4 +1,17 @@
1
1
 
2
+ <a name="2.1.0"></a>
3
+ ## [2.1.0](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/2.0.2...2.1.0) (2024-04-28)
4
+
5
+ ### Bug Fixes
6
+
7
+ * **entrypoint:** fix project '--update-description' logs output
8
+
9
+ ### Features
10
+
11
+ * **entrypoint:** sort groups and projects recursively
12
+ * **entrypoint:** keep description if already contains group
13
+
14
+
2
15
  <a name="2.0.2"></a>
3
16
  ## [2.0.2](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/2.0.1...2.0.2) (2024-04-28)
4
17
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gitlab-projects-settings
3
- Version: 2.0.2
3
+ Version: 2.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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gitlab-projects-settings
3
- Version: 2.0.2
3
+ Version: 2.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
@@ -76,11 +76,14 @@ class Entrypoint:
76
76
 
77
77
  # Iterate through subgroups
78
78
  if not options.exclude_subgroups:
79
- for group_subgroup in group.descendant_groups.list(
80
- get_all=True,
81
- include_subgroups=True,
82
- order_by='path',
83
- sort='asc',
79
+ for group_subgroup in sorted(
80
+ group.descendant_groups.list(
81
+ get_all=True,
82
+ include_subgroups=True,
83
+ order_by='path',
84
+ sort='asc',
85
+ ),
86
+ key=lambda item: item.full_path,
84
87
  ):
85
88
  Entrypoint.group(
86
89
  options,
@@ -91,11 +94,14 @@ class Entrypoint:
91
94
 
92
95
  # Iterate through projects
93
96
  if not options.exclude_projects:
94
- for group_project in group.projects.list(
95
- get_all=True,
96
- include_subgroups=not options.exclude_subgroups,
97
- order_by='path',
98
- sort='asc',
97
+ for group_project in sorted(
98
+ group.projects.list(
99
+ get_all=True,
100
+ include_subgroups=not options.exclude_subgroups,
101
+ order_by='path',
102
+ sort='asc',
103
+ ),
104
+ key=lambda item: item.path_with_namespace,
99
105
  ):
100
106
  Entrypoint.project(
101
107
  options,
@@ -152,12 +158,18 @@ class Entrypoint:
152
158
  parent_description,
153
159
  parent_name,
154
160
  )
155
- description = f'{GitLabFeature.Helper.capitalize(group.name)}' \
156
- f'{parent_description_text}'
157
- gitlab.group_set_description(criteria, description)
158
- print(f'{Colors.BOLD} - Updated description: '
159
- f'{Colors.CYAN}{description}'
160
- f'{Colors.RESET}')
161
+ if not parent_description_text or not group.description.endswith(
162
+ f'{parent_description_text}'):
163
+ description = f'{GitLabFeature.Helper.capitalize(group.name)}' \
164
+ f'{parent_description_text}'
165
+ gitlab.group_set_description(criteria, description)
166
+ print(f'{Colors.BOLD} - Updated description: '
167
+ f'{Colors.CYAN}{description}'
168
+ f'{Colors.RESET}')
169
+ else:
170
+ print(f'{Colors.BOLD} - Kept description: '
171
+ f'{Colors.GREEN}{group.description}'
172
+ f'{Colors.RESET}')
161
173
 
162
174
  # Reset group members
163
175
  if options.reset_members:
@@ -210,12 +222,17 @@ class Entrypoint:
210
222
  group.description,
211
223
  group.name,
212
224
  )
213
- description = f'{GitLabFeature.Helper.capitalize(project.name)}' \
214
- f' - {group_description}'
215
- gitlab.project_set_description(criteria, description)
216
- print(f'{Colors.BOLD} - Updated description: '
217
- f'{Colors.CYAN}{group_description}'
218
- f'{Colors.RESET}')
225
+ if not project.description.endswith(f' - {group_description}'):
226
+ description = f'{GitLabFeature.Helper.capitalize(project.name)}' \
227
+ f' - {group_description}'
228
+ gitlab.project_set_description(criteria, description)
229
+ print(f'{Colors.BOLD} - Updated description: '
230
+ f'{Colors.CYAN}{description}'
231
+ f'{Colors.RESET}')
232
+ else:
233
+ print(f'{Colors.BOLD} - Kept description: '
234
+ f'{Colors.GREEN}{project.description}'
235
+ f'{Colors.RESET}')
219
236
 
220
237
  # Reset project features
221
238
  if options.reset_features: