gitlab-projects-settings 2.0.0__tar.gz → 2.0.1__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-2.0.0 → gitlab_projects_settings-2.0.1}/CHANGELOG.md +8 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/PKG-INFO +1 -1
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/gitlab_projects_settings.egg-info/PKG-INFO +1 -1
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/src/cli/entrypoint.py +30 -5
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/src/features/gitlab.py +18 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/.chglog/CHANGELOG.tpl.md +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/.chglog/changelog.sh +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/.chglog/config.yml +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/.gitignore +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/.gitlab-ci.yml +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/.markdownlint.json +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/.style.yapf +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/.vscode/extensions.json +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/.vscode/settings.json +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/LICENSE +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/README.md +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/gitlab_projects_settings.egg-info/SOURCES.txt +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/gitlab_projects_settings.egg-info/dependency_links.txt +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/gitlab_projects_settings.egg-info/entry_points.txt +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/gitlab_projects_settings.egg-info/requires.txt +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/gitlab_projects_settings.egg-info/top_level.txt +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/mypy.ini +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/requirements/build.txt +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/requirements/deploy.txt +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/requirements/quality.txt +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/requirements/runtime.txt +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/setup.cfg +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/setup.py +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/src/__init__.py +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/src/__main__.py +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/src/cli/__init__.py +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/src/cli/main.py +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/src/features/__init__.py +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/src/package/__init__.py +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/src/package/bundle.py +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/src/package/version.py +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/src/prints/__init__.py +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/src/prints/colors.py +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/src/system/__init__.py +0 -0
- {gitlab_projects_settings-2.0.0 → gitlab_projects_settings-2.0.1}/src/system/platform.py +0 -0
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
|
|
2
|
+
<a name="2.0.1"></a>
|
|
3
|
+
## [2.0.1](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/2.0.0...2.0.1) (2024-04-28)
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* **entrypoint:** fix description updates faulty descriptions
|
|
8
|
+
|
|
9
|
+
|
|
2
10
|
<a name="2.0.0"></a>
|
|
3
11
|
## [2.0.0](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/1.1.0...2.0.0) (2024-04-27)
|
|
4
12
|
|
|
@@ -118,6 +118,18 @@ class Entrypoint:
|
|
|
118
118
|
# Acquire group
|
|
119
119
|
group = gitlab.group(criteria)
|
|
120
120
|
|
|
121
|
+
# Acquire parent group
|
|
122
|
+
parent_group: Group = None
|
|
123
|
+
if group.parent_id:
|
|
124
|
+
parent_group = gitlab.group(group.parent_id)
|
|
125
|
+
|
|
126
|
+
# Get parent description
|
|
127
|
+
parent_description: str = ''
|
|
128
|
+
parent_name: str = ''
|
|
129
|
+
if parent_group:
|
|
130
|
+
parent_description = parent_group.description
|
|
131
|
+
parent_name = parent_group.name
|
|
132
|
+
|
|
121
133
|
# Show group details
|
|
122
134
|
group_type = 'subgroup' if subgroup else 'group'
|
|
123
135
|
print(f'{Colors.BOLD} - GitLab {group_type}: '
|
|
@@ -134,8 +146,14 @@ class Entrypoint:
|
|
|
134
146
|
|
|
135
147
|
# Update group description
|
|
136
148
|
elif options.update_description:
|
|
137
|
-
|
|
138
|
-
|
|
149
|
+
parent_description_text: str = ''
|
|
150
|
+
if parent_name:
|
|
151
|
+
parent_description_text = ' - ' + GitLabFeature.Helper.describe(
|
|
152
|
+
parent_description,
|
|
153
|
+
parent_name,
|
|
154
|
+
)
|
|
155
|
+
description = f'{GitLabFeature.Helper.capitalize(group.name)}' \
|
|
156
|
+
f'{parent_description_text}'
|
|
139
157
|
gitlab.group_set_description(criteria, description)
|
|
140
158
|
print(f'{Colors.BOLD} - Updated description: '
|
|
141
159
|
f'{Colors.CYAN}{description}'
|
|
@@ -170,6 +188,9 @@ class Entrypoint:
|
|
|
170
188
|
# Acquire project
|
|
171
189
|
project = gitlab.project(criteria)
|
|
172
190
|
|
|
191
|
+
# Acquire group
|
|
192
|
+
group = gitlab.group(project.namespace['id'])
|
|
193
|
+
|
|
173
194
|
# Show project details
|
|
174
195
|
print(f'{Colors.BOLD} - GitLab project: '
|
|
175
196
|
f'{Colors.YELLOW_LIGHT}{project.path_with_namespace} '
|
|
@@ -185,11 +206,15 @@ class Entrypoint:
|
|
|
185
206
|
|
|
186
207
|
# Update project description
|
|
187
208
|
elif options.update_description:
|
|
188
|
-
|
|
189
|
-
|
|
209
|
+
group_description = GitLabFeature.Helper.describe(
|
|
210
|
+
group.description,
|
|
211
|
+
group.name,
|
|
212
|
+
)
|
|
213
|
+
description = f'{GitLabFeature.Helper.capitalize(project.name)}' \
|
|
214
|
+
f' - {group_description}'
|
|
190
215
|
gitlab.project_set_description(criteria, description)
|
|
191
216
|
print(f'{Colors.BOLD} - Updated description: '
|
|
192
|
-
f'{Colors.CYAN}{
|
|
217
|
+
f'{Colors.CYAN}{group_description}'
|
|
193
218
|
f'{Colors.RESET}')
|
|
194
219
|
|
|
195
220
|
# Reset project features
|
|
@@ -317,3 +317,21 @@ class GitLabFeature:
|
|
|
317
317
|
@property
|
|
318
318
|
def url(self) -> str:
|
|
319
319
|
return str(self.__gitlab.api_url)
|
|
320
|
+
|
|
321
|
+
# Helper class
|
|
322
|
+
class Helper:
|
|
323
|
+
|
|
324
|
+
# Capitalize
|
|
325
|
+
@staticmethod
|
|
326
|
+
def capitalize(text: str) -> str:
|
|
327
|
+
return f'{text[:1].capitalize()}{text[1:]}'
|
|
328
|
+
|
|
329
|
+
# Describe
|
|
330
|
+
@staticmethod
|
|
331
|
+
def describe(
|
|
332
|
+
description: str,
|
|
333
|
+
name: str,
|
|
334
|
+
) -> str:
|
|
335
|
+
if description:
|
|
336
|
+
return description
|
|
337
|
+
return GitLabFeature.Helper.capitalize(name)
|
|
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
|
|
File without changes
|