gitlab-projects-settings 3.0.0__tar.gz → 4.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 (52) hide show
  1. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/.gitlab-ci.yml +120 -14
  2. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/CHANGELOG.md +53 -0
  3. gitlab_projects_settings-4.1.0/PKG-INFO +168 -0
  4. gitlab_projects_settings-4.1.0/README.md +132 -0
  5. gitlab_projects_settings-4.1.0/gitlab_projects_settings.egg-info/PKG-INFO +168 -0
  6. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/gitlab_projects_settings.egg-info/SOURCES.txt +7 -1
  7. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/gitlab_projects_settings.egg-info/requires.txt +2 -0
  8. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/requirements/runtime.txt +2 -0
  9. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/src/cli/entrypoint.py +148 -44
  10. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/src/cli/main.py +89 -7
  11. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/src/features/gitlab.py +204 -168
  12. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/src/package/bundle.py +8 -0
  13. gitlab_projects_settings-4.1.0/src/package/settings.py +144 -0
  14. gitlab_projects_settings-4.1.0/src/package/updates.py +216 -0
  15. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/src/package/version.py +5 -0
  16. gitlab_projects_settings-4.1.0/src/prints/boxes.py +82 -0
  17. gitlab_projects_settings-4.1.0/src/prints/themes.py +60 -0
  18. gitlab_projects_settings-4.1.0/src/system/platform.py +67 -0
  19. gitlab_projects_settings-4.1.0/src/types/gitlab.py +457 -0
  20. gitlab_projects_settings-4.1.0/src/types/strings.py +152 -0
  21. gitlab_projects_settings-3.0.0/PKG-INFO +0 -130
  22. gitlab_projects_settings-3.0.0/README.md +0 -96
  23. gitlab_projects_settings-3.0.0/gitlab_projects_settings.egg-info/PKG-INFO +0 -130
  24. gitlab_projects_settings-3.0.0/src/system/platform.py +0 -27
  25. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/.chglog/CHANGELOG.tpl.md +0 -0
  26. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/.chglog/changelog.sh +0 -0
  27. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/.chglog/config.yml +0 -0
  28. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/.gitignore +0 -0
  29. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/.markdownlint.json +0 -0
  30. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/.style.yapf +0 -0
  31. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/.vscode/extensions.json +0 -0
  32. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/.vscode/settings.json +0 -0
  33. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/LICENSE +0 -0
  34. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/gitlab_projects_settings.egg-info/dependency_links.txt +0 -0
  35. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/gitlab_projects_settings.egg-info/entry_points.txt +0 -0
  36. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/gitlab_projects_settings.egg-info/top_level.txt +0 -0
  37. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/mypy.ini +0 -0
  38. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/requirements/build.txt +0 -0
  39. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/requirements/deploy.txt +0 -0
  40. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/requirements/quality.txt +0 -0
  41. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/setup.cfg +0 -0
  42. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/setup.py +0 -0
  43. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/src/__init__.py +0 -0
  44. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/src/__main__.py +0 -0
  45. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/src/cli/__init__.py +0 -0
  46. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/src/features/__init__.py +0 -0
  47. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/src/package/__init__.py +0 -0
  48. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/src/prints/__init__.py +0 -0
  49. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/src/prints/colors.py +0 -0
  50. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/src/system/__init__.py +0 -0
  51. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/src/types/__init__.py +0 -0
  52. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.1.0}/src/types/namespaces.py +0 -0
@@ -1,11 +1,14 @@
1
- image: registry.gitlab.com/adriandc/gitlabci-local/python:3.11-alpine
2
-
3
1
  stages:
4
2
  - development
5
3
  - prepare
6
4
  - build
7
5
  - deploy
8
6
 
7
+ variables:
8
+ REGISTRY_HOST: registry.gitlab.com
9
+ REGISTRY_OWNER: adriandc
10
+ REGISTRY_PROJECT: gitlab-projects-settings
11
+
9
12
  .local:
10
13
  engine: docker,auto
11
14
  real_paths: true
@@ -53,12 +56,113 @@ changelog:
53
56
  rules:
54
57
  - if: $CI_LOCAL
55
58
 
59
+ images:
60
+ stage: development
61
+ image: local:silent
62
+ script:
63
+ # Rehost standard images
64
+ - |
65
+ for image in \
66
+ python:3.11-alpine \
67
+ ; do
68
+ if [ -z "${IMAGE}" ] || echo "${image}" | grep -q "${IMAGE}"; then
69
+ echo ''
70
+ echo " [INFO] Pull: ${image}"
71
+ echo ''
72
+ docker pull "${image}"
73
+ docker tag "${image}" "${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${image}"
74
+ echo ''
75
+ echo " [INFO] Push: ${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${image}"
76
+ echo ''
77
+ docker push "${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${image}"
78
+ docker rmi "${image}" >/dev/null || true
79
+ fi
80
+ done
81
+ # Prepare build image
82
+ - |
83
+ base='python:3.11-alpine'
84
+ image='gitlab-projects-settings:build'
85
+ if [ -z "${IMAGE}" ] || echo "${image}" | grep -q "${IMAGE}"; then
86
+ echo ''
87
+ echo " [INFO] Pull: ${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${base}"
88
+ echo ''
89
+ docker pull "${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${base}"
90
+ docker pull "${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${image}" || true
91
+ docker build -t "${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${image}" -f - . <<-EOF
92
+ FROM ${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${base}
93
+ RUN apk add -q git
94
+ COPY ./requirements/runtime.txt /tmp/
95
+ COPY ./requirements/build.txt /tmp/
96
+ RUN export PIP_DISABLE_PIP_VERSION_CHECK=1 \
97
+ && pip3 install -q -r /tmp/runtime.txt --no-cache-dir --upgrade \
98
+ && pip3 install -q -r /tmp/build.txt --no-cache-dir --upgrade \
99
+ && rm -f /tmp/runtime.txt \
100
+ && rm -f /tmp/build.txt
101
+ EOF
102
+ echo ''
103
+ echo " [INFO] Push: ${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${image}"
104
+ echo ''
105
+ docker push "${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${image}"
106
+ fi
107
+ # Prepare codestyle image
108
+ - |
109
+ base='python:3.11-alpine'
110
+ image='gitlab-projects-settings:codestyle'
111
+ if [ -z "${IMAGE}" ] || echo "${image}" | grep -q "${IMAGE}"; then
112
+ echo ''
113
+ echo " [INFO] Pull: ${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${base}"
114
+ echo ''
115
+ docker pull "${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${base}"
116
+ docker pull "${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${image}" || true
117
+ docker build -t "${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${image}" -f- . <<-EOF
118
+ FROM ${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${base}
119
+ RUN apk add -q git
120
+ COPY ./requirements/runtime.txt /tmp/
121
+ COPY ./requirements/quality.txt /tmp/
122
+ RUN export PIP_DISABLE_PIP_VERSION_CHECK=1 \
123
+ && pip3 install -q -r /tmp/runtime.txt --no-cache-dir --upgrade \
124
+ && pip3 install -q -r /tmp/quality.txt --no-cache-dir --upgrade \
125
+ && rm -f /tmp/runtime.txt \
126
+ && rm -f /tmp/quality.txt \
127
+ && rm -f /tmp/tests.txt
128
+ EOF
129
+ echo ''
130
+ echo " [INFO] Push: ${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${image}"
131
+ echo ''
132
+ docker push "${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${image}"
133
+ fi
134
+ # Prepare deploy image
135
+ - |
136
+ base='python:3.11-alpine'
137
+ image='gitlab-projects-settings:deploy'
138
+ if [ -z "${IMAGE}" ] || echo "${image}" | grep -q "${IMAGE}"; then
139
+ echo ''
140
+ echo " [INFO] Pull: ${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${base}"
141
+ echo ''
142
+ docker pull "${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${base}"
143
+ docker pull "${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${image}" || true
144
+ docker build -t "${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${image}" -f - . <<-EOF
145
+ FROM ${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${base}
146
+ RUN apk add -q gcc git libc-dev libffi-dev sed
147
+ COPY ./requirements/deploy.txt /tmp/
148
+ RUN export PIP_DISABLE_PIP_VERSION_CHECK=1 \
149
+ && pip3 install -q -r /tmp/deploy.txt --no-cache-dir --upgrade \
150
+ && rm -f /tmp/deploy.txt
151
+ EOF
152
+ echo ''
153
+ echo " [INFO] Push: ${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${image}"
154
+ echo ''
155
+ docker push "${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${image}"
156
+ fi
157
+ rules:
158
+ - if: $CI_LOCAL
159
+
56
160
  # =============================================================================
57
161
  # Stage: prepare
58
162
 
59
163
  codestyle:
60
164
  stage: prepare
61
- image: registry.gitlab.com/adriandc/gitlabci-local/gitlabci-local:codestyle
165
+ image: registry.gitlab.com/adriandc/gitlab-projects-settings/gitlab-projects-settings:codestyle
62
166
  script:
63
167
  - yapf -i ./src/*.py ./src/*/*.py ./setup.py
64
168
  - unify -i --quote "'" ./src/*.py ./src/*/*.py ./setup.py
@@ -77,11 +181,7 @@ codestyle:
77
181
 
78
182
  lint:
79
183
  stage: prepare
80
- image: registry.gitlab.com/adriandc/gitlabci-local/gitlabci-local:codestyle
81
- variables:
82
- PIP_DISABLE_PIP_VERSION_CHECK: 1
83
- before_script:
84
- - pip3 install -q -r ./requirements/runtime.txt --upgrade
184
+ image: registry.gitlab.com/adriandc/gitlab-projects-settings/gitlab-projects-settings:codestyle
85
185
  script:
86
186
  - pylint --errors-only ./src/ ./setup.py
87
187
  - pylint --disable=missing-docstring --load-plugins=pylint.extensions.no_self_use ./src/ ./setup.py
@@ -98,7 +198,7 @@ lint:
98
198
 
99
199
  typings:
100
200
  stage: prepare
101
- image: registry.gitlab.com/adriandc/gitlabci-local/gitlabci-local:codestyle
201
+ image: registry.gitlab.com/adriandc/gitlab-projects-settings/gitlab-projects-settings:codestyle
102
202
  variables:
103
203
  MYPY_CACHE_DIR: /dev/null
104
204
  MYPY_FORCE_COLOR: 1
@@ -127,7 +227,7 @@ typings:
127
227
 
128
228
  build:
129
229
  stage: build
130
- image: registry.gitlab.com/adriandc/gitlabci-local/gitlabci-local:build
230
+ image: registry.gitlab.com/adriandc/gitlab-projects-settings/gitlab-projects-settings:build
131
231
  needs: []
132
232
  script:
133
233
  - rm -rf ./build ./dist ./*.egg-info ./.eggs
@@ -170,13 +270,18 @@ readme:
170
270
  argument='[[:alnum:]][[:alnum:]_-]\{0,\}'
171
271
  letter='[[:alnum:]_]\{1\}'
172
272
  parameter='[-]\{1,2\}[[:alnum:]][[:alnum:]_-]\{0,\}'
273
+ separator='--'
173
274
  word='[[:alnum:]_-]\{1,\}'
275
+ help="[(]\{0,1\}${word}"
174
276
  "${PACKAGE_NAME}" --help \
175
277
  | sed '1d; $d' \
176
- | sed "s/^\( ${parameter} ${word}${alignments}\)/\1# /g" \
278
+ | sed "s/^\( ${parameter} \[${word}\]${alignments}\)/\1# /g" \
279
+ | sed "s/^\( ${parameter}\( ${word}\)\{1,\}${alignments}\)/\1# /g" \
177
280
  | sed "s/^\( ${parameter}${alignments}\)/\1# /g" \
178
281
  | sed "s/^\( ${parameter}, ${parameter}${alignments}\)/\1# /g" \
179
- | sed "s/^\( ${argument}${alignments}\)/\1# /g"
282
+ | sed "s/^\( ${separator}${alignments}\)/\1# /g" \
283
+ | sed "s/^\( ${argument}${alignments}\)/\1# /g" \
284
+ | sed "s/^\( ${alignments}\)\(${help}\)/\1# \2/g"
180
285
  echo '```'
181
286
  echo ''
182
287
  } >./.tmp/README.help.tmp
@@ -189,6 +294,7 @@ readme:
189
294
  - |
190
295
  git -c color.diff=always --no-pager diff ./README.md | grep --color=never '.' && echo ''
191
296
  echo ' > README: Updated successfully'
297
+ git diff --quiet ./README.md
192
298
  rules:
193
299
  - if: $CI_LOCAL
194
300
 
@@ -197,7 +303,7 @@ readme:
197
303
 
198
304
  deploy:release:
199
305
  stage: deploy
200
- image: registry.gitlab.com/adriandc/gitlabci-local/gitlabci-local:deploy
306
+ image: registry.gitlab.com/adriandc/gitlab-projects-settings/gitlab-projects-settings:deploy
201
307
  needs:
202
308
  - job: build
203
309
  variables:
@@ -215,7 +321,7 @@ deploy:release:
215
321
 
216
322
  deploy:trial:
217
323
  stage: deploy
218
- image: registry.gitlab.com/adriandc/gitlabci-local/gitlabci-local:deploy
324
+ image: registry.gitlab.com/adriandc/gitlab-projects-settings/gitlab-projects-settings:deploy
219
325
  needs:
220
326
  - job: build
221
327
  variables:
@@ -1,4 +1,57 @@
1
1
 
2
+ <a name="4.1.0"></a>
3
+ ## [4.1.0](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/4.0.0...4.1.0) (2024-05-17)
4
+
5
+ ### Features
6
+
7
+ * **entrypoint:** implement prompt confirmation upon deletions
8
+ * **gitlab:** isolate 'ProtectionLevels' enumeration
9
+ * **requirements:** prepare 'questionary' library integration
10
+
11
+
12
+ <a name="4.0.0"></a>
13
+ ## [4.0.0](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/3.0.0...4.0.0) (2024-05-15)
14
+
15
+ ### Bug Fixes
16
+
17
+ * **entrypoint:** refactor to return no error upon final actions
18
+ * **entrypoint:** avoid missing 'namespace_id' in 'User' responses
19
+ * **entrypoint:** use full paths instead of 'id' integer fields
20
+ * **gitlab:** disable all 'Repository' member features too
21
+ * **gitlab:** disable 'Repository' group feature after its members
22
+ * **gitlab:** accept deletion denials in 'project_reset_members'
23
+
24
+ ### Ci
25
+
26
+ * **gitlab-ci:** support multiple 'METAVAR' words in 'readme' job
27
+ * **gitlab-ci:** deprecate requirements install in 'lint' job
28
+ * **gitlab-ci:** implement 'images' and use project specific images
29
+ * **gitlab-ci:** detect 'README.md' issues in 'readme' job
30
+ * **gitlab-ci:** handle optional parameters and multiline in 'readme'
31
+
32
+ ### Cleanups
33
+
34
+ * **entrypoint:** minor Python codestyle improvement
35
+
36
+ ### Code Refactoring
37
+
38
+ * **gitlab:** optimize and centralize GitLab features handlings
39
+ * **gitlab:** isolate GitLab types to 'types/gitlab.py'
40
+ * **gitlab:** isolate 'GitLabFeature.AccessLevels' constants
41
+
42
+ ### Features
43
+
44
+ * **gitlab:** parse input features list and accept similar texts
45
+ * **gitlab:** prepare future access levels in 'project_reset_features'
46
+ * **gitlab:** isolate GitLab project features enumeration
47
+ * **gitlab:** automatically wait for group and project deletions
48
+ * **main:** document optional '--' positional arguments separator
49
+
50
+ ### Test
51
+
52
+ * **version:** add 'DEBUG_VERSION_FAKE' for debugging purposes
53
+
54
+
2
55
  <a name="3.0.0"></a>
3
56
  ## [3.0.0](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/2.1.0...3.0.0) (2024-05-06)
4
57
 
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.1
2
+ Name: gitlab-projects-settings
3
+ Version: 4.1.0
4
+ Summary: Configure GitLab groups and projects settings automatically
5
+ Home-page: https://gitlab.com/AdrianDC/gitlab-projects-settings
6
+ Author: Adrian DC
7
+ Author-email: radian.dc@gmail.com
8
+ License: Apache License 2.0
9
+ Project-URL: Bug Reports, https://gitlab.com/AdrianDC/gitlab-projects-settings/-/issues
10
+ Project-URL: Changelog, https://gitlab.com/AdrianDC/gitlab-projects-settings/blob/main/CHANGELOG.md
11
+ Project-URL: Documentation, https://gitlab.com/AdrianDC/gitlab-projects-settings#gitlab-projects-settings
12
+ Project-URL: Source, https://gitlab.com/AdrianDC/gitlab-projects-settings
13
+ Project-URL: Statistics, https://pypistats.org/packages/gitlab-projects-settings
14
+ Keywords: gitlab issues sync
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: Apache Software License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.6
21
+ Classifier: Programming Language :: Python :: 3.7
22
+ Classifier: Programming Language :: Python :: 3.8
23
+ Classifier: Programming Language :: Python :: 3.9
24
+ Classifier: Programming Language :: Python :: 3.10
25
+ Classifier: Programming Language :: Python :: 3.11
26
+ Classifier: Topic :: Software Development
27
+ Classifier: Topic :: Utilities
28
+ Requires-Python: >=3, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*
29
+ Description-Content-Type: text/markdown
30
+ License-File: LICENSE
31
+ Requires-Dist: colored>=1.4.2
32
+ Requires-Dist: python-gitlab>=4.4.0
33
+ Requires-Dist: questionary>=2.0.1
34
+ Requires-Dist: setuptools>=45.1.0
35
+ Requires-Dist: update_checker>=0.18.0
36
+
37
+ # gitlab-projects-settings
38
+
39
+ <!-- markdownlint-disable no-inline-html -->
40
+
41
+ [![Build](https://gitlab.com/AdrianDC/gitlab-projects-settings/badges/main/pipeline.svg)](https://gitlab.com/AdrianDC/gitlab-projects-settings/-/commits/main/)
42
+
43
+ Configure GitLab groups and projects settings automatically
44
+
45
+ ---
46
+
47
+ ## Purpose
48
+
49
+ This tool can automatically configure and update the GitLab settings
50
+ of groups, subgroups and projects, using multiple available options.
51
+
52
+ Repetitive tasks can be performed accross multiple projects at once,
53
+ for example protecting tags and branches, or setting a new avatar recursively.
54
+
55
+ The following step is required before using the tool:
56
+
57
+ - The GitLab user tokens must be created with an `api` scope (a short expiration date is recommended)
58
+
59
+ ---
60
+
61
+ ## Usage
62
+
63
+ <!-- prettier-ignore-start -->
64
+ <!-- readme-help-start -->
65
+
66
+ ```yaml
67
+ usage: gitlab-projects-settings [-h] [--version] [--update-check] [--settings] [--set GROUP KEY VAL] [-t TOKEN]
68
+ [--dry-run] [--exclude-group] [--exclude-subgroups] [--exclude-projects]
69
+ [--available-features] [--reset-features [KEEP_FEATURES]]
70
+ [--disable-features FEATURES] [--enable-features FEATURES] [--reset-members]
71
+ [--set-avatar FILE] [--set-description TEXT] [--update-description]
72
+ [--run-housekeeping] [--archive-project | --unarchive-project] [--delete-group]
73
+ [--delete-project] [--protect-branches] [--protect-tags [LEVEL]] [--]
74
+ [gitlab] [path]
75
+
76
+ gitlab-projects-settings: Configure GitLab groups and projects settings automatically
77
+
78
+ internal arguments:
79
+ -h, --help # Show this help message
80
+ --version # Show the current version
81
+ --update-check # Check for newer package updates
82
+ --settings # Show the current settings path and contents
83
+ --set GROUP KEY VAL # Set settings specific 'VAL' value to [GROUP] > KEY
84
+ # or unset by using 'UNSET' as 'VAL'
85
+
86
+ credentials arguments:
87
+ -t TOKEN # GitLab API token (default: GITLAB_TOKEN environment)
88
+
89
+ common settings arguments:
90
+ --dry-run # Enable dry run mode to check without saving
91
+ --exclude-group # Exclude parent group settings
92
+ --exclude-subgroups # Exclude children subgroups settings
93
+ --exclude-projects # Exclude children projects settings
94
+
95
+ general settings arguments:
96
+ --available-features # List the available GitLab project features known by the tool
97
+ --reset-features [KEEP_FEATURES] # Reset features of GitLab projects based on usage
98
+ # (Optionally keep features separated by ",")
99
+ --disable-features FEATURES # List of features to disable separated by ","
100
+ --enable-features FEATURES # List of features to enable separated by ","
101
+ --reset-members # Reset members of GitLab projects and groups
102
+ --set-avatar FILE # Set avatar of GitLab projects and groups
103
+ --set-description TEXT # Set description of GitLab projects and groups
104
+ --update-description # Update description of GitLab projects and groups automatically
105
+
106
+ advanced settings arguments:
107
+ --run-housekeeping # Run housekeeping of project or projects GitLab in groups
108
+ --archive-project # Archive project or projects in GitLab groups
109
+ --unarchive-project # Unarchive project or projects in GitLab groups
110
+ --delete-group # Delete group or groups in GitLab groups
111
+ --delete-project # Delete project or projects in GitLab groups
112
+
113
+ repository settings arguments:
114
+ --protect-branches # Protect branches with default master/main, develop and staging
115
+ --protect-tags [LEVEL] # Protect tags at level [no-one,admins,maintainers,developers] (default: no-one)
116
+
117
+ positional arguments:
118
+ -- # Positional arguments separator (recommended)
119
+ gitlab # GitLab URL (default: https://gitlab.com)
120
+ path # GitLab group, user namespace or project path
121
+ ```
122
+
123
+ <!-- readme-help-stop -->
124
+ <!-- prettier-ignore-end -->
125
+
126
+ ---
127
+
128
+ ## Userspace available settings
129
+
130
+ `gitlab-projects-settings` creates a `settings.ini` configuration file in a userspace folder.
131
+
132
+ For example, it allows to disable the automated updates daily check (`[updates] > enabled`)
133
+
134
+ The `settings.ini` file location and contents can be shown with the following command:
135
+
136
+ ```bash
137
+ gitlab-projects-settings --settings
138
+ ```
139
+
140
+ ---
141
+
142
+ ## Environment available configurations
143
+
144
+ `gitlab-projects-settings` uses `colored` for colors outputs and `questionary` for interactive menus.
145
+
146
+ If colors of both outputs types do not match the terminal's theme,
147
+ an environment variable `NO_COLOR=1` can be defined to disable colors.
148
+
149
+ ---
150
+
151
+ ## Dependencies
152
+
153
+ - [colored](https://pypi.org/project/colored/): Terminal colors and styles
154
+ - [python-gitlab](https://pypi.org/project/python-gitlab/): A python wrapper for the GitLab API
155
+ - [questionary](https://pypi.org/project/questionary/): Interactive terminal user interfaces
156
+ - [setuptools](https://pypi.org/project/setuptools/): Build and manage Python packages
157
+ - [update-checker](https://pypi.org/project/update-checker/): Check for package updates on PyPI
158
+
159
+ ---
160
+
161
+ ## References
162
+
163
+ - [git-chglog](https://github.com/git-chglog/git-chglog): CHANGELOG generator
164
+ - [gitlab-release](https://pypi.org/project/gitlab-release/): Utility for publishing on GitLab
165
+ - [gitlabci-local](https://pypi.org/project/gitlabci-local/): Launch .gitlab-ci.yml jobs locally
166
+ - [mypy](https://pypi.org/project/mypy/): Optional static typing for Python
167
+ - [PyPI](https://pypi.org/): The Python Package Index
168
+ - [twine](https://pypi.org/project/twine/): Utility for publishing on PyPI
@@ -0,0 +1,132 @@
1
+ # gitlab-projects-settings
2
+
3
+ <!-- markdownlint-disable no-inline-html -->
4
+
5
+ [![Build](https://gitlab.com/AdrianDC/gitlab-projects-settings/badges/main/pipeline.svg)](https://gitlab.com/AdrianDC/gitlab-projects-settings/-/commits/main/)
6
+
7
+ Configure GitLab groups and projects settings automatically
8
+
9
+ ---
10
+
11
+ ## Purpose
12
+
13
+ This tool can automatically configure and update the GitLab settings
14
+ of groups, subgroups and projects, using multiple available options.
15
+
16
+ Repetitive tasks can be performed accross multiple projects at once,
17
+ for example protecting tags and branches, or setting a new avatar recursively.
18
+
19
+ The following step is required before using the tool:
20
+
21
+ - The GitLab user tokens must be created with an `api` scope (a short expiration date is recommended)
22
+
23
+ ---
24
+
25
+ ## Usage
26
+
27
+ <!-- prettier-ignore-start -->
28
+ <!-- readme-help-start -->
29
+
30
+ ```yaml
31
+ usage: gitlab-projects-settings [-h] [--version] [--update-check] [--settings] [--set GROUP KEY VAL] [-t TOKEN]
32
+ [--dry-run] [--exclude-group] [--exclude-subgroups] [--exclude-projects]
33
+ [--available-features] [--reset-features [KEEP_FEATURES]]
34
+ [--disable-features FEATURES] [--enable-features FEATURES] [--reset-members]
35
+ [--set-avatar FILE] [--set-description TEXT] [--update-description]
36
+ [--run-housekeeping] [--archive-project | --unarchive-project] [--delete-group]
37
+ [--delete-project] [--protect-branches] [--protect-tags [LEVEL]] [--]
38
+ [gitlab] [path]
39
+
40
+ gitlab-projects-settings: Configure GitLab groups and projects settings automatically
41
+
42
+ internal arguments:
43
+ -h, --help # Show this help message
44
+ --version # Show the current version
45
+ --update-check # Check for newer package updates
46
+ --settings # Show the current settings path and contents
47
+ --set GROUP KEY VAL # Set settings specific 'VAL' value to [GROUP] > KEY
48
+ # or unset by using 'UNSET' as 'VAL'
49
+
50
+ credentials arguments:
51
+ -t TOKEN # GitLab API token (default: GITLAB_TOKEN environment)
52
+
53
+ common settings arguments:
54
+ --dry-run # Enable dry run mode to check without saving
55
+ --exclude-group # Exclude parent group settings
56
+ --exclude-subgroups # Exclude children subgroups settings
57
+ --exclude-projects # Exclude children projects settings
58
+
59
+ general settings arguments:
60
+ --available-features # List the available GitLab project features known by the tool
61
+ --reset-features [KEEP_FEATURES] # Reset features of GitLab projects based on usage
62
+ # (Optionally keep features separated by ",")
63
+ --disable-features FEATURES # List of features to disable separated by ","
64
+ --enable-features FEATURES # List of features to enable separated by ","
65
+ --reset-members # Reset members of GitLab projects and groups
66
+ --set-avatar FILE # Set avatar of GitLab projects and groups
67
+ --set-description TEXT # Set description of GitLab projects and groups
68
+ --update-description # Update description of GitLab projects and groups automatically
69
+
70
+ advanced settings arguments:
71
+ --run-housekeeping # Run housekeeping of project or projects GitLab in groups
72
+ --archive-project # Archive project or projects in GitLab groups
73
+ --unarchive-project # Unarchive project or projects in GitLab groups
74
+ --delete-group # Delete group or groups in GitLab groups
75
+ --delete-project # Delete project or projects in GitLab groups
76
+
77
+ repository settings arguments:
78
+ --protect-branches # Protect branches with default master/main, develop and staging
79
+ --protect-tags [LEVEL] # Protect tags at level [no-one,admins,maintainers,developers] (default: no-one)
80
+
81
+ positional arguments:
82
+ -- # Positional arguments separator (recommended)
83
+ gitlab # GitLab URL (default: https://gitlab.com)
84
+ path # GitLab group, user namespace or project path
85
+ ```
86
+
87
+ <!-- readme-help-stop -->
88
+ <!-- prettier-ignore-end -->
89
+
90
+ ---
91
+
92
+ ## Userspace available settings
93
+
94
+ `gitlab-projects-settings` creates a `settings.ini` configuration file in a userspace folder.
95
+
96
+ For example, it allows to disable the automated updates daily check (`[updates] > enabled`)
97
+
98
+ The `settings.ini` file location and contents can be shown with the following command:
99
+
100
+ ```bash
101
+ gitlab-projects-settings --settings
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Environment available configurations
107
+
108
+ `gitlab-projects-settings` uses `colored` for colors outputs and `questionary` for interactive menus.
109
+
110
+ If colors of both outputs types do not match the terminal's theme,
111
+ an environment variable `NO_COLOR=1` can be defined to disable colors.
112
+
113
+ ---
114
+
115
+ ## Dependencies
116
+
117
+ - [colored](https://pypi.org/project/colored/): Terminal colors and styles
118
+ - [python-gitlab](https://pypi.org/project/python-gitlab/): A python wrapper for the GitLab API
119
+ - [questionary](https://pypi.org/project/questionary/): Interactive terminal user interfaces
120
+ - [setuptools](https://pypi.org/project/setuptools/): Build and manage Python packages
121
+ - [update-checker](https://pypi.org/project/update-checker/): Check for package updates on PyPI
122
+
123
+ ---
124
+
125
+ ## References
126
+
127
+ - [git-chglog](https://github.com/git-chglog/git-chglog): CHANGELOG generator
128
+ - [gitlab-release](https://pypi.org/project/gitlab-release/): Utility for publishing on GitLab
129
+ - [gitlabci-local](https://pypi.org/project/gitlabci-local/): Launch .gitlab-ci.yml jobs locally
130
+ - [mypy](https://pypi.org/project/mypy/): Optional static typing for Python
131
+ - [PyPI](https://pypi.org/): The Python Package Index
132
+ - [twine](https://pypi.org/project/twine/): Utility for publishing on PyPI