Skip to content

Commit 57d5b5f

Browse files
authored
Merge branch 'main' into feat/extend_service_accounts
2 parents 358da71 + abdaa68 commit 57d5b5f

28 files changed

+1024
-28
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
TOXENV: ${{ matrix.toxenv }}
7878
run: tox -- --override-ini='log_cli=True'
7979
- name: Upload codecov coverage
80-
uses: codecov/codecov-action@v5.5.2
80+
uses: codecov/codecov-action@v5.5.4
8181
with:
8282
files: ./coverage.xml
8383
flags: ${{ matrix.toxenv }}
@@ -100,7 +100,7 @@ jobs:
100100
TOXENV: cover
101101
run: tox
102102
- name: Upload codecov coverage
103-
uses: codecov/codecov-action@v5.5.2
103+
uses: codecov/codecov-action@v5.5.4
104104
with:
105105
files: ./coverage.xml
106106
flags: unit
@@ -120,7 +120,7 @@ jobs:
120120
pip install -r requirements-test.txt
121121
- name: Build package
122122
run: python -m build -o dist/
123-
- uses: actions/upload-artifact@v6.0.0
123+
- uses: actions/upload-artifact@v7.0.0
124124
with:
125125
name: dist
126126
path: dist
@@ -134,7 +134,7 @@ jobs:
134134
uses: actions/setup-python@v6.2.0
135135
with:
136136
python-version: '3.14'
137-
- uses: actions/download-artifact@v7.0.0
137+
- uses: actions/download-artifact@v8.0.1
138138
with:
139139
name: dist
140140
path: dist

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ default_language_version:
33

44
repos:
55
- repo: https://github.com/psf/black
6-
rev: 26.1.0
6+
rev: 26.3.1
77
hooks:
88
- id: black
99
- repo: https://github.com/commitizen-tools/commitizen
@@ -16,7 +16,7 @@ repos:
1616
hooks:
1717
- id: flake8
1818
- repo: https://github.com/pycqa/isort
19-
rev: 7.0.0
19+
rev: 8.0.1
2020
hooks:
2121
- id: isort
2222
- repo: https://github.com/pycqa/pylint
@@ -51,6 +51,6 @@ repos:
5151
- id: rst-directive-colons
5252
- id: rst-inline-touching-normal
5353
- repo: https://github.com/maxbrunet/pre-commit-renovate
54-
rev: 43.46.6
54+
rev: 43.100.0
5555
hooks:
5656
- id: renovate-config-validator

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
All versions below are listed in reverse chronological order.
44

5+
## v8.2.0 (2026-03-28)
6+
7+
### Documentation
8+
9+
- **testing**: Document passing pytest options during local development
10+
([`e6669f9`](https://github.com/python-gitlab/python-gitlab/commit/e6669f96d662d310109afa4a61fe8dabbd780a4e))
11+
12+
### Features
13+
14+
- **api**: Add support for project feature flags and feature flag user lists
15+
([`be68285`](https://github.com/python-gitlab/python-gitlab/commit/be68285793f35afc10a72b59da3fb24429631f54))
16+
17+
- **projects**: Add optional parameter to set approval rule on all protected branches.
18+
([`8d76028`](https://github.com/python-gitlab/python-gitlab/commit/8d76028a1ae3554527291dc98e6be041ff089ec5))
19+
20+
521
## v8.1.0 (2026-02-28)
622

723
### Bug Fixes

CONTRIBUTING.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,32 @@ To cleanup the environment delete the container:
194194
docker rm -f gitlab-test
195195
docker rm -f gitlab-runner-test
196196
197+
Pass options to ``pytest``
198+
--------------------------
199+
200+
Options to ``pytest`` can be passed by adding them after ``--`` when running ``tox``:
201+
202+
.. code-block:: bash
203+
204+
tox -e api_func_v4 -- <pytest options>.
205+
206+
For example, you can use this to run a specific test. Running all tests can be time-consuming,
207+
so this allows you to focus on just the tests relevant to your changes. You can do this by passing
208+
the ``-k`` flag to ``pytest`` and setting a relevant expression to select the tests to run. For example:
209+
210+
.. code-block:: bash
211+
212+
# Run all API functional tests from the ``test_projects.py`` file:
213+
tox -e api_func_v4 -- --keep-containers -k test_projects.py
214+
215+
# Run only the ``test_get_project`` test method from the ``test_projects.py`` file:
216+
tox -e api_func_v4 -- --keep-containers -k "test_projects.py and test_create_project"
217+
218+
# The above will select all test methods start with ``test_create_project`` from the ``test_projects.py`` file.
219+
# To select only the ``test_create_project`` method, you can exclude other methods by using the ``not`` operator:
220+
tox -e api_func_v4 -- --keep-containers -k "test_projects.py and test_create_project and not test_create_project_"
221+
222+
197223
Rerunning failed CI workflows
198224
-----------------------------
199225

docs/api-objects.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ API examples
2424
gl_objects/environments
2525
gl_objects/events
2626
gl_objects/epics
27-
gl_objects/features
27+
gl_objects/gitlab_features
2828
gl_objects/geo_nodes
2929
gl_objects/groups
3030
gl_objects/group_access_tokens
@@ -49,6 +49,8 @@ API examples
4949
gl_objects/pipelines_and_jobs
5050
gl_objects/projects
5151
gl_objects/project_access_tokens
52+
gl_objects/project_feature_flags
53+
gl_objects/project_feature_flag_user_lists
5254
gl_objects/protected_branches
5355
gl_objects/protected_container_repositories
5456
gl_objects/protected_environments
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
##############
2-
Features flags
3-
##############
1+
################################
2+
GitLab Development Feature Flags
3+
################################
4+
5+
.. note::
6+
7+
This API is for managing GitLab's internal development feature flags and requires administrator access.
8+
For project-level feature flags, see :doc:`project_feature_flags`.
49

510
Reference
611
---------
@@ -29,4 +34,4 @@ Create or set a feature::
2934

3035
Delete a feature::
3136

32-
feature.delete()
37+
feature.delete()
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
###############################
2+
Project Feature Flag User Lists
3+
###############################
4+
5+
Reference
6+
---------
7+
8+
* v4 API:
9+
10+
+ :class:`gitlab.v4.objects.ProjectFeatureFlagUserList`
11+
+ :class:`gitlab.v4.objects.ProjectFeatureFlagUserListManager`
12+
+ :attr:`gitlab.v4.objects.Project.feature_flags_user_lists`
13+
14+
* GitLab API: https://docs.gitlab.com/api/feature_flag_user_lists
15+
16+
Examples
17+
--------
18+
19+
List user lists::
20+
21+
user_lists = project.feature_flags_user_lists.list()
22+
23+
Get a user list::
24+
25+
user_list = project.feature_flags_user_lists.get(list_iid)
26+
27+
Create a user list::
28+
29+
user_list = project.feature_flags_user_lists.create({
30+
'name': 'my_user_list',
31+
'user_xids': 'user1,user2,user3'
32+
})
33+
34+
Update a user list::
35+
36+
user_list.name = 'updated_list_name'
37+
user_list.user_xids = 'user1,user2'
38+
user_list.save()
39+
40+
Delete a user list::
41+
42+
user_list.delete()
43+
44+
Search for a user list::
45+
46+
user_lists = project.feature_flags_user_lists.list(search='my_list')
47+
48+
See also
49+
--------
50+
51+
* :doc:`project_feature_flags`
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#####################
2+
Project Feature Flags
3+
#####################
4+
5+
Reference
6+
---------
7+
8+
* v4 API:
9+
10+
+ :class:`gitlab.v4.objects.ProjectFeatureFlag`
11+
+ :class:`gitlab.v4.objects.ProjectFeatureFlagManager`
12+
+ :attr:`gitlab.v4.objects.Project.feature_flags`
13+
14+
* GitLab API: https://docs.gitlab.com/api/feature_flags
15+
16+
Examples
17+
--------
18+
19+
List feature flags::
20+
21+
flags = project.feature_flags.list()
22+
23+
Get a feature flag::
24+
25+
flag = project.feature_flags.get('my_feature_flag')
26+
27+
Create a feature flag::
28+
29+
flag = project.feature_flags.create({'name': 'my_feature_flag', 'version': 'new_version_flag'})
30+
31+
Create a feature flag with strategies::
32+
33+
flag = project.feature_flags.create({
34+
'name': 'my_complex_flag',
35+
'version': 'new_version_flag',
36+
'strategies': [{
37+
'name': 'userWithId',
38+
'parameters': {'userIds': 'user1,user2'}
39+
}]
40+
})
41+
42+
Update a feature flag::
43+
44+
flag.description = 'Updated description'
45+
flag.save()
46+
47+
Rename a feature flag::
48+
49+
# You can rename a flag by changing its name attribute and calling save()
50+
flag.name = 'new_flag_name'
51+
flag.save()
52+
53+
# Alternatively, you can use the manager's update method
54+
project.feature_flags.update('old_flag_name', {'name': 'new_flag_name'})
55+
56+
Delete a feature flag::
57+
58+
flag.delete()
59+
60+
See also
61+
--------
62+
63+
* :doc:`project_feature_flag_user_lists`

docs/gl_objects/projects.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,44 @@ Search projects by custom attribute::
409409
project.customattributes.set('type', 'internal')
410410
gl.projects.list(custom_attributes={'type': 'internal'}, get_all=True)
411411

412+
Project feature flags
413+
=====================
414+
415+
Reference
416+
---------
417+
418+
* v4 API:
419+
420+
+ :class:`gitlab.v4.objects.ProjectFeatureFlag`
421+
+ :class:`gitlab.v4.objects.ProjectFeatureFlagManager`
422+
+ :attr:`gitlab.v4.objects.Project.feature_flags`
423+
424+
* GitLab API: https://docs.gitlab.com/api/feature_flags
425+
426+
Examples
427+
--------
428+
429+
See :doc:`project_feature_flags`.
430+
431+
Project feature flag user lists
432+
===============================
433+
434+
Reference
435+
---------
436+
437+
* v4 API:
438+
439+
+ :class:`gitlab.v4.objects.ProjectFeatureFlagUserList`
440+
+ :class:`gitlab.v4.objects.ProjectFeatureFlagUserListManager`
441+
+ :attr:`gitlab.v4.objects.Project.feature_flags_user_lists`
442+
443+
* GitLab API: https://docs.gitlab.com/api/feature_flag_user_lists
444+
445+
Examples
446+
--------
447+
448+
See :doc:`project_feature_flag_user_lists`.
449+
412450
Project files
413451
=============
414452

gitlab/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
__email__ = "gauvainpocentek@gmail.com"
44
__license__ = "LGPL3"
55
__title__ = "python-gitlab"
6-
__version__ = "8.1.0"
6+
__version__ = "8.2.0"

0 commit comments

Comments
 (0)