gitlab-projects-settings 3.0.0__tar.gz → 4.0.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 (51) hide show
  1. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/.gitlab-ci.yml +120 -14
  2. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/CHANGELOG.md +43 -0
  3. gitlab_projects_settings-4.0.0/PKG-INFO +157 -0
  4. gitlab_projects_settings-4.0.0/README.md +122 -0
  5. gitlab_projects_settings-4.0.0/gitlab_projects_settings.egg-info/PKG-INFO +157 -0
  6. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/gitlab_projects_settings.egg-info/SOURCES.txt +6 -1
  7. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/gitlab_projects_settings.egg-info/requires.txt +1 -0
  8. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/requirements/runtime.txt +1 -0
  9. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/src/cli/entrypoint.py +106 -42
  10. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/src/cli/main.py +83 -5
  11. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/src/features/gitlab.py +200 -164
  12. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/src/package/bundle.py +8 -0
  13. gitlab_projects_settings-4.0.0/src/package/settings.py +144 -0
  14. gitlab_projects_settings-4.0.0/src/package/updates.py +216 -0
  15. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/src/package/version.py +5 -0
  16. gitlab_projects_settings-4.0.0/src/prints/boxes.py +82 -0
  17. gitlab_projects_settings-4.0.0/src/system/platform.py +67 -0
  18. gitlab_projects_settings-4.0.0/src/types/gitlab.py +435 -0
  19. gitlab_projects_settings-4.0.0/src/types/strings.py +152 -0
  20. gitlab_projects_settings-3.0.0/PKG-INFO +0 -130
  21. gitlab_projects_settings-3.0.0/README.md +0 -96
  22. gitlab_projects_settings-3.0.0/gitlab_projects_settings.egg-info/PKG-INFO +0 -130
  23. gitlab_projects_settings-3.0.0/src/system/platform.py +0 -27
  24. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/.chglog/CHANGELOG.tpl.md +0 -0
  25. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/.chglog/changelog.sh +0 -0
  26. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/.chglog/config.yml +0 -0
  27. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/.gitignore +0 -0
  28. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/.markdownlint.json +0 -0
  29. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/.style.yapf +0 -0
  30. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/.vscode/extensions.json +0 -0
  31. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/.vscode/settings.json +0 -0
  32. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/LICENSE +0 -0
  33. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/gitlab_projects_settings.egg-info/dependency_links.txt +0 -0
  34. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/gitlab_projects_settings.egg-info/entry_points.txt +0 -0
  35. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/gitlab_projects_settings.egg-info/top_level.txt +0 -0
  36. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/mypy.ini +0 -0
  37. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/requirements/build.txt +0 -0
  38. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/requirements/deploy.txt +0 -0
  39. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/requirements/quality.txt +0 -0
  40. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/setup.cfg +0 -0
  41. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/setup.py +0 -0
  42. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/src/__init__.py +0 -0
  43. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/src/__main__.py +0 -0
  44. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/src/cli/__init__.py +0 -0
  45. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/src/features/__init__.py +0 -0
  46. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/src/package/__init__.py +0 -0
  47. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/src/prints/__init__.py +0 -0
  48. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/src/prints/colors.py +0 -0
  49. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/src/system/__init__.py +0 -0
  50. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.0}/src/types/__init__.py +0 -0
  51. {gitlab_projects_settings-3.0.0 → gitlab_projects_settings-4.0.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,47 @@
1
1
 
2
+ <a name="4.0.0"></a>
3
+ ## [4.0.0](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/3.0.0...4.0.0) (2024-05-15)
4
+
5
+ ### Bug Fixes
6
+
7
+ * **entrypoint:** refactor to return no error upon final actions
8
+ * **entrypoint:** avoid missing 'namespace_id' in 'User' responses
9
+ * **entrypoint:** use full paths instead of 'id' integer fields
10
+ * **gitlab:** disable all 'Repository' member features too
11
+ * **gitlab:** disable 'Repository' group feature after its members
12
+ * **gitlab:** accept deletion denials in 'project_reset_members'
13
+
14
+ ### Ci
15
+
16
+ * **gitlab-ci:** support multiple 'METAVAR' words in 'readme' job
17
+ * **gitlab-ci:** deprecate requirements install in 'lint' job
18
+ * **gitlab-ci:** implement 'images' and use project specific images
19
+ * **gitlab-ci:** detect 'README.md' issues in 'readme' job
20
+ * **gitlab-ci:** handle optional parameters and multiline in 'readme'
21
+
22
+ ### Cleanups
23
+
24
+ * **entrypoint:** minor Python codestyle improvement
25
+
26
+ ### Code Refactoring
27
+
28
+ * **gitlab:** optimize and centralize GitLab features handlings
29
+ * **gitlab:** isolate GitLab types to 'types/gitlab.py'
30
+ * **gitlab:** isolate 'GitLabFeature.AccessLevels' constants
31
+
32
+ ### Features
33
+
34
+ * **gitlab:** parse input features list and accept similar texts
35
+ * **gitlab:** prepare future access levels in 'project_reset_features'
36
+ * **gitlab:** isolate GitLab project features enumeration
37
+ * **gitlab:** automatically wait for group and project deletions
38
+ * **main:** document optional '--' positional arguments separator
39
+
40
+ ### Test
41
+
42
+ * **version:** add 'DEBUG_VERSION_FAKE' for debugging purposes
43
+
44
+
2
45
  <a name="3.0.0"></a>
3
46
  ## [3.0.0](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/2.1.0...3.0.0) (2024-05-06)
4
47
 
@@ -0,0 +1,157 @@
1
+ Metadata-Version: 2.1
2
+ Name: gitlab-projects-settings
3
+ Version: 4.0.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: setuptools>=45.1.0
34
+ Requires-Dist: update_checker>=0.18.0
35
+
36
+ # gitlab-projects-settings
37
+
38
+ <!-- markdownlint-disable no-inline-html -->
39
+
40
+ [![Build](https://gitlab.com/AdrianDC/gitlab-projects-settings/badges/main/pipeline.svg)](https://gitlab.com/AdrianDC/gitlab-projects-settings/-/commits/main/)
41
+
42
+ Configure GitLab groups and projects settings automatically
43
+
44
+ ---
45
+
46
+ ## Purpose
47
+
48
+ This tool can automatically configure and update the GitLab settings
49
+ of groups, subgroups and projects, using multiple available options.
50
+
51
+ Repetitive tasks can be performed accross multiple projects at once,
52
+ for example protecting tags and branches, or setting a new avatar recursively.
53
+
54
+ The following step is required before using the tool:
55
+
56
+ - The GitLab user tokens must be created with an `api` scope (a short expiration date is recommended)
57
+
58
+ ---
59
+
60
+ ## Usage
61
+
62
+ <!-- prettier-ignore-start -->
63
+ <!-- readme-help-start -->
64
+
65
+ ```yaml
66
+ usage: gitlab-projects-settings [-h] [--version] [--update-check] [--settings] [--set GROUP KEY VAL] [-t TOKEN]
67
+ [--dry-run] [--exclude-group] [--exclude-subgroups] [--exclude-projects]
68
+ [--available-features] [--reset-features [KEEP_FEATURES]]
69
+ [--disable-features FEATURES] [--enable-features FEATURES] [--reset-members]
70
+ [--set-avatar FILE] [--set-description TEXT] [--update-description]
71
+ [--run-housekeeping] [--archive-project | --unarchive-project] [--delete-group]
72
+ [--delete-project] [--protect-branches] [--protect-tags LEVEL] [--]
73
+ [gitlab] [path]
74
+
75
+ gitlab-projects-settings: Configure GitLab groups and projects settings automatically
76
+
77
+ internal arguments:
78
+ -h, --help # Show this help message
79
+ --version # Show the current version
80
+ --update-check # Check for newer package updates
81
+ --settings # Show the current settings path and contents
82
+ --set GROUP KEY VAL # Set settings specific 'VAL' value to [GROUP] > KEY
83
+ # or unset by using 'UNSET' as 'VAL'
84
+
85
+ credentials arguments:
86
+ -t TOKEN # GitLab API token (default: GITLAB_TOKEN environment)
87
+
88
+ common settings arguments:
89
+ --dry-run # Enable dry run mode to check without saving
90
+ --exclude-group # Exclude parent group settings
91
+ --exclude-subgroups # Exclude children subgroups settings
92
+ --exclude-projects # Exclude children projects settings
93
+
94
+ general settings arguments:
95
+ --available-features # List the available GitLab project features known by the tool
96
+ --reset-features [KEEP_FEATURES] # Reset features of GitLab projects based on usage
97
+ # (Optionally keep features separated by ",")
98
+ --disable-features FEATURES # List of features to disable separated by ","
99
+ --enable-features FEATURES # List of features to enable separated by ","
100
+ --reset-members # Reset members of GitLab projects and groups
101
+ --set-avatar FILE # Set avatar of GitLab projects and groups
102
+ --set-description TEXT # Set description of GitLab projects and groups
103
+ --update-description # Update description of GitLab projects and groups automatically
104
+
105
+ advanced settings arguments:
106
+ --run-housekeeping # Run housekeeping of project or projects GitLab in groups
107
+ --archive-project # Archive project or projects in GitLab groups
108
+ --unarchive-project # Unarchive project or projects in GitLab groups
109
+ --delete-group # Delete group or groups in GitLab groups
110
+ --delete-project # Delete project or projects in GitLab groups
111
+
112
+ repository settings arguments:
113
+ --protect-branches # Protect branches with default master/main, develop and staging
114
+ --protect-tags LEVEL # Protect tags at level [no-one,admins,maintainers,developers]
115
+
116
+ positional arguments:
117
+ -- # Positional arguments separator (recommended)
118
+ gitlab # GitLab URL (default: https://gitlab.com)
119
+ path # GitLab group, user namespace or project path
120
+ ```
121
+
122
+ <!-- readme-help-stop -->
123
+ <!-- prettier-ignore-end -->
124
+
125
+ ---
126
+
127
+ ## Userspace available settings
128
+
129
+ `gitlab-projects-settings` creates a `settings.ini` configuration file in a userspace folder.
130
+
131
+ For example, it allows to disable the automated updates daily check (`[updates] > enabled`)
132
+
133
+ The `settings.ini` file location and contents can be shown with the following command:
134
+
135
+ ```bash
136
+ gitlab-projects-settings --settings
137
+ ```
138
+
139
+ ---
140
+
141
+ ## Dependencies
142
+
143
+ - [colored](https://pypi.org/project/colored/): Terminal colors and styles
144
+ - [python-gitlab](https://pypi.org/project/python-gitlab/): A python wrapper for the GitLab API
145
+ - [setuptools](https://pypi.org/project/setuptools/): Build and manage Python packages
146
+ - [update-checker](https://pypi.org/project/update-checker/): Check for package updates on PyPI
147
+
148
+ ---
149
+
150
+ ## References
151
+
152
+ - [git-chglog](https://github.com/git-chglog/git-chglog): CHANGELOG generator
153
+ - [gitlab-release](https://pypi.org/project/gitlab-release/): Utility for publishing on GitLab
154
+ - [gitlabci-local](https://pypi.org/project/gitlabci-local/): Launch .gitlab-ci.yml jobs locally
155
+ - [mypy](https://pypi.org/project/mypy/): Optional static typing for Python
156
+ - [PyPI](https://pypi.org/): The Python Package Index
157
+ - [twine](https://pypi.org/project/twine/): Utility for publishing on PyPI
@@ -0,0 +1,122 @@
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]
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
+ ## Dependencies
107
+
108
+ - [colored](https://pypi.org/project/colored/): Terminal colors and styles
109
+ - [python-gitlab](https://pypi.org/project/python-gitlab/): A python wrapper for the GitLab API
110
+ - [setuptools](https://pypi.org/project/setuptools/): Build and manage Python packages
111
+ - [update-checker](https://pypi.org/project/update-checker/): Check for package updates on PyPI
112
+
113
+ ---
114
+
115
+ ## References
116
+
117
+ - [git-chglog](https://github.com/git-chglog/git-chglog): CHANGELOG generator
118
+ - [gitlab-release](https://pypi.org/project/gitlab-release/): Utility for publishing on GitLab
119
+ - [gitlabci-local](https://pypi.org/project/gitlabci-local/): Launch .gitlab-ci.yml jobs locally
120
+ - [mypy](https://pypi.org/project/mypy/): Optional static typing for Python
121
+ - [PyPI](https://pypi.org/): The Python Package Index
122
+ - [twine](https://pypi.org/project/twine/): Utility for publishing on PyPI