gitlab-projects-settings 2.1.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 (54) hide show
  1. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/.gitlab-ci.yml +144 -38
  2. gitlab_projects_settings-4.0.0/CHANGELOG.md +173 -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-2.1.0 → gitlab_projects_settings-4.0.0}/gitlab_projects_settings.egg-info/SOURCES.txt +8 -1
  7. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/gitlab_projects_settings.egg-info/requires.txt +1 -0
  8. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/requirements/runtime.txt +1 -0
  9. gitlab_projects_settings-4.0.0/src/cli/entrypoint.py +465 -0
  10. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/src/cli/main.py +121 -7
  11. gitlab_projects_settings-4.0.0/src/features/gitlab.py +469 -0
  12. {gitlab_projects_settings-2.1.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-2.1.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/__init__.py +0 -0
  19. gitlab_projects_settings-4.0.0/src/types/gitlab.py +435 -0
  20. gitlab_projects_settings-4.0.0/src/types/namespaces.py +33 -0
  21. gitlab_projects_settings-4.0.0/src/types/strings.py +152 -0
  22. gitlab_projects_settings-2.1.0/CHANGELOG.md +0 -100
  23. gitlab_projects_settings-2.1.0/PKG-INFO +0 -122
  24. gitlab_projects_settings-2.1.0/README.md +0 -88
  25. gitlab_projects_settings-2.1.0/gitlab_projects_settings.egg-info/PKG-INFO +0 -122
  26. gitlab_projects_settings-2.1.0/src/cli/entrypoint.py +0 -290
  27. gitlab_projects_settings-2.1.0/src/features/gitlab.py +0 -337
  28. gitlab_projects_settings-2.1.0/src/system/platform.py +0 -27
  29. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/.chglog/CHANGELOG.tpl.md +0 -0
  30. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/.chglog/changelog.sh +0 -0
  31. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/.chglog/config.yml +0 -0
  32. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/.gitignore +0 -0
  33. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/.markdownlint.json +0 -0
  34. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/.style.yapf +0 -0
  35. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/.vscode/extensions.json +0 -0
  36. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/.vscode/settings.json +0 -0
  37. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/LICENSE +0 -0
  38. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/gitlab_projects_settings.egg-info/dependency_links.txt +0 -0
  39. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/gitlab_projects_settings.egg-info/entry_points.txt +0 -0
  40. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/gitlab_projects_settings.egg-info/top_level.txt +0 -0
  41. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/mypy.ini +0 -0
  42. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/requirements/build.txt +0 -0
  43. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/requirements/deploy.txt +0 -0
  44. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/requirements/quality.txt +0 -0
  45. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/setup.cfg +0 -0
  46. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/setup.py +0 -0
  47. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/src/__init__.py +0 -0
  48. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/src/__main__.py +0 -0
  49. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/src/cli/__init__.py +0 -0
  50. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/src/features/__init__.py +0 -0
  51. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/src/package/__init__.py +0 -0
  52. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/src/prints/__init__.py +0 -0
  53. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/src/prints/colors.py +0 -0
  54. {gitlab_projects_settings-2.1.0 → gitlab_projects_settings-4.0.0}/src/system/__init__.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,40 +56,104 @@ changelog:
53
56
  rules:
54
57
  - if: $CI_LOCAL
55
58
 
56
- readme:
59
+ images:
57
60
  stage: development
58
61
  image: local:silent
59
62
  script:
63
+ # Rehost standard images
60
64
  - |
61
- export COLUMNS=120
62
- mkdir -p ./.tmp/
63
- PACKAGE_NAME=$(grep '^PROJECT_NAME =' ./setup.py | cut -d"'" -f2)
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
65
86
  echo ''
66
- echo '```yaml'
67
- alignments='[ ]\{2,\}'
68
- argument='[[:alnum:]][[:alnum:]_-]\{0,\}'
69
- letter='[[:alnum:]_]\{1\}'
70
- parameter='[-]\{1,2\}[[:alnum:]][[:alnum:]_-]\{0,\}'
71
- word='[[:alnum:]_-]\{1,\}'
72
- "${PACKAGE_NAME}" --help \
73
- | sed '1d; $d' \
74
- | sed "s/^\( ${parameter} ${word}${alignments}\)/\1# /g" \
75
- | sed "s/^\( ${parameter}${alignments}\)/\1# /g" \
76
- | sed "s/^\( ${parameter}, ${parameter}${alignments}\)/\1# /g" \
77
- | sed "s/^\( ${argument}${alignments}\)/\1# /g"
78
- echo '```'
87
+ echo " [INFO] Pull: ${REGISTRY_HOST}/${REGISTRY_OWNER}/${REGISTRY_PROJECT}/${base}"
79
88
  echo ''
80
- } >./.tmp/README.help.tmp
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
81
108
  - |
82
- lead='^<!-- readme-help-start -->$'
83
- tail='^<!-- readme-help-stop -->$'
84
- sed -i "/${lead}/,/${tail}/{ /${lead}/{ p; r ./.tmp/README.help.tmp
85
- }; /${tail}/p; d }" ./README.md | head -n 100
86
- - rm -f ./.tmp/README.help.tmp
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
87
135
  - |
88
- git -c color.diff=always --no-pager diff ./README.md | grep --color=never '.' && echo ''
89
- echo ' > README: Updated successfully'
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
90
157
  rules:
91
158
  - if: $CI_LOCAL
92
159
 
@@ -95,7 +162,7 @@ readme:
95
162
 
96
163
  codestyle:
97
164
  stage: prepare
98
- image: registry.gitlab.com/adriandc/gitlabci-local/gitlabci-local:codestyle
165
+ image: registry.gitlab.com/adriandc/gitlab-projects-settings/gitlab-projects-settings:codestyle
99
166
  script:
100
167
  - yapf -i ./src/*.py ./src/*/*.py ./setup.py
101
168
  - unify -i --quote "'" ./src/*.py ./src/*/*.py ./setup.py
@@ -114,11 +181,7 @@ codestyle:
114
181
 
115
182
  lint:
116
183
  stage: prepare
117
- image: registry.gitlab.com/adriandc/gitlabci-local/gitlabci-local:codestyle
118
- variables:
119
- PIP_DISABLE_PIP_VERSION_CHECK: 1
120
- before_script:
121
- - pip3 install -q -r ./requirements/runtime.txt --upgrade
184
+ image: registry.gitlab.com/adriandc/gitlab-projects-settings/gitlab-projects-settings:codestyle
122
185
  script:
123
186
  - pylint --errors-only ./src/ ./setup.py
124
187
  - pylint --disable=missing-docstring --load-plugins=pylint.extensions.no_self_use ./src/ ./setup.py
@@ -135,7 +198,7 @@ lint:
135
198
 
136
199
  typings:
137
200
  stage: prepare
138
- image: registry.gitlab.com/adriandc/gitlabci-local/gitlabci-local:codestyle
201
+ image: registry.gitlab.com/adriandc/gitlab-projects-settings/gitlab-projects-settings:codestyle
139
202
  variables:
140
203
  MYPY_CACHE_DIR: /dev/null
141
204
  MYPY_FORCE_COLOR: 1
@@ -164,7 +227,7 @@ typings:
164
227
 
165
228
  build:
166
229
  stage: build
167
- image: registry.gitlab.com/adriandc/gitlabci-local/gitlabci-local:build
230
+ image: registry.gitlab.com/adriandc/gitlab-projects-settings/gitlab-projects-settings:build
168
231
  needs: []
169
232
  script:
170
233
  - rm -rf ./build ./dist ./*.egg-info ./.eggs
@@ -192,12 +255,55 @@ install:
192
255
  rules:
193
256
  - if: $CI_LOCAL
194
257
 
258
+ readme:
259
+ stage: build
260
+ image: local:silent
261
+ script:
262
+ - |
263
+ export COLUMNS=120
264
+ mkdir -p ./.tmp/
265
+ PACKAGE_NAME=$(grep '^PROJECT_NAME =' ./setup.py | cut -d"'" -f2)
266
+ {
267
+ echo ''
268
+ echo '```yaml'
269
+ alignments='[ ]\{2,\}'
270
+ argument='[[:alnum:]][[:alnum:]_-]\{0,\}'
271
+ letter='[[:alnum:]_]\{1\}'
272
+ parameter='[-]\{1,2\}[[:alnum:]][[:alnum:]_-]\{0,\}'
273
+ separator='--'
274
+ word='[[:alnum:]_-]\{1,\}'
275
+ help="[(]\{0,1\}${word}"
276
+ "${PACKAGE_NAME}" --help \
277
+ | sed '1d; $d' \
278
+ | sed "s/^\( ${parameter} \[${word}\]${alignments}\)/\1# /g" \
279
+ | sed "s/^\( ${parameter}\( ${word}\)\{1,\}${alignments}\)/\1# /g" \
280
+ | sed "s/^\( ${parameter}${alignments}\)/\1# /g" \
281
+ | sed "s/^\( ${parameter}, ${parameter}${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"
285
+ echo '```'
286
+ echo ''
287
+ } >./.tmp/README.help.tmp
288
+ - |
289
+ lead='^<!-- readme-help-start -->$'
290
+ tail='^<!-- readme-help-stop -->$'
291
+ sed -i "/${lead}/,/${tail}/{ /${lead}/{ p; r ./.tmp/README.help.tmp
292
+ }; /${tail}/p; d }" ./README.md | head -n 100
293
+ - rm -f ./.tmp/README.help.tmp
294
+ - |
295
+ git -c color.diff=always --no-pager diff ./README.md | grep --color=never '.' && echo ''
296
+ echo ' > README: Updated successfully'
297
+ git diff --quiet ./README.md
298
+ rules:
299
+ - if: $CI_LOCAL
300
+
195
301
  # =============================================================================
196
302
  # Stage: deploy
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:
@@ -0,0 +1,173 @@
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
+
45
+ <a name="3.0.0"></a>
46
+ ## [3.0.0](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/2.1.0...3.0.0) (2024-05-06)
47
+
48
+ ### Bug Fixes
49
+
50
+ * **entrypoint:** resolve support for private user namespaces
51
+ * **entrypoint:** detect if GitLab actions can continue
52
+ * **entrypoint:** enforce against missing '.description' values
53
+ * **gitlab:** enforce 'group_delete' usage in '--dry-run' mode
54
+ * **gitlab:** delay groups deletion by 10s and projects by 5s
55
+ * **gitlab:** get all branches and tags upon 'list()' calls
56
+ * **gitlab:** get all members in 'project_reset_members'
57
+
58
+ ### Ci
59
+
60
+ * **gitlab-ci:** move 'readme' job after 'build' and local 'install'
61
+
62
+ ### Cleanups
63
+
64
+ * **gitlab:** minor comments changes in 'project_reset_features'
65
+
66
+ ### Features
67
+
68
+ * **entrypoint:** preserve main group description if exists
69
+ * **entrypoint:** always flush progress output logs
70
+ * **gitlab:** detect multiple branches to keep 'Merge requests'
71
+ * **gitlab:** detect 'Token Access' usage for 'CI/CD' features
72
+ * **namespaces:** migrate 'Helper' class to 'Namespaces' class
73
+
74
+
75
+ <a name="2.1.0"></a>
76
+ ## [2.1.0](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/2.0.2...2.1.0) (2024-04-28)
77
+
78
+ ### Bug Fixes
79
+
80
+ * **entrypoint:** fix project '--update-description' logs output
81
+
82
+ ### Features
83
+
84
+ * **entrypoint:** sort groups and projects recursively
85
+ * **entrypoint:** keep description if already contains group
86
+
87
+
88
+ <a name="2.0.2"></a>
89
+ ## [2.0.2](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/2.0.1...2.0.2) (2024-04-28)
90
+
91
+ ### Ci
92
+
93
+ * **gitlab-ci:** disable 'typing' mypy caching with 'MYPY_CACHE_DIR'
94
+
95
+ ### Documentation
96
+
97
+ * **readme:** document GitLab tokens' creation instructions
98
+
99
+ ### Features
100
+
101
+ * **main:** limit '--help' width to terminal width or 120 chars
102
+
103
+
104
+ <a name="2.0.1"></a>
105
+ ## [2.0.1](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/2.0.0...2.0.1) (2024-04-28)
106
+
107
+ ### Bug Fixes
108
+
109
+ * **entrypoint:** fix description updates faulty descriptions
110
+
111
+
112
+ <a name="2.0.0"></a>
113
+ ## [2.0.0](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/1.1.0...2.0.0) (2024-04-27)
114
+
115
+ ### Bug Fixes
116
+
117
+ * **gitlab:** enforce '--dry-run' usage and improve Python codestyle
118
+ * **settings:** apply 'subgroup' feature to subgroup groups
119
+
120
+ ### Ci
121
+
122
+ * **gitlab-ci:** implement 'readme' local job to update README details
123
+
124
+ ### Cleanups
125
+
126
+ * **gitlab:** minor Python codestyle improvements
127
+ * **settings:** minor Python codestyle improvements
128
+ * **src:** ignore 'import-error' over '__init__' and '__main__'
129
+
130
+ ### Code Refactoring
131
+
132
+ * **entrypoint:** minor Python codestyle improvements
133
+ * **src:** isolate all sources under 'src/'
134
+
135
+ ### Documentation
136
+
137
+ * **readme:** regenerate '--help' details in 'README.md'
138
+
139
+ ### Features
140
+
141
+ * **cli:** isolate 'features/settings.py' to 'cli/entrypoint.py'
142
+ * **main:** align 'RawTextHelpFormatter' to 30 chars columns
143
+ * **main:** change '--set-description' metavar to 'TEXT'
144
+ * **settings:** change project/group descriptions color
145
+
146
+
147
+ <a name="1.1.0"></a>
148
+ ## [1.1.0](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/1.0.1...1.1.0) (2024-04-25)
149
+
150
+ ### Code Refactoring
151
+
152
+ * **settings:** minor functions codestyle improvement
153
+
154
+ ### Features
155
+
156
+ * **main:** rename '--avoid-*' parameters to '--exclude-*'
157
+
158
+
159
+ <a name="1.0.1"></a>
160
+ ## [1.0.1](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/1.0.0...1.0.1) (2024-04-24)
161
+
162
+ ### Documentation
163
+
164
+ * **setup:** fix PyPI 'gitlab-projects-settings' documentation
165
+
166
+
167
+ <a name="1.0.0"></a>
168
+ ## 1.0.0 (2024-04-24)
169
+
170
+ ### Features
171
+
172
+ * **gitlab-projects-settings:** initial sources implementation
173
+
@@ -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