Skip to content

Commit 3cfd390

Browse files
Merge branch 'main' into typos
2 parents ee5f444 + a208276 commit 3cfd390

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1082
-160
lines changed

.github/workflows/docs.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
sphinx:
2323
runs-on: ubuntu-20.04
2424
steps:
25-
- uses: actions/checkout@v3.1.0
25+
- uses: actions/checkout@v3.3.0
2626
- name: Set up Python
27-
uses: actions/setup-python@v4.3.0
27+
uses: actions/setup-python@v4.5.0
2828
with:
2929
python-version: "3.11"
3030
- name: Install dependencies
@@ -34,17 +34,17 @@ jobs:
3434
TOXENV: docs
3535
run: tox
3636
- name: Archive generated docs
37-
uses: actions/upload-artifact@v3.1.1
37+
uses: actions/upload-artifact@v3.1.2
3838
with:
3939
name: html-docs
4040
path: build/sphinx/html/
4141

4242
twine-check:
4343
runs-on: ubuntu-20.04
4444
steps:
45-
- uses: actions/checkout@v3.1.0
45+
- uses: actions/checkout@v3.3.0
4646
- name: Set up Python
47-
uses: actions/setup-python@v4.3.0
47+
uses: actions/setup-python@v4.5.0
4848
with:
4949
python-version: "3.11"
5050
- name: Install dependencies

.github/workflows/lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
lint:
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v3.1.0
25+
- uses: actions/checkout@v3.3.0
2626
with:
2727
fetch-depth: 0
28-
- uses: actions/setup-python@v4.3.0
28+
- uses: actions/setup-python@v4.5.0
2929
with:
3030
python-version: "3.11"
3131
- run: pip install --upgrade tox

.github/workflows/lock.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
action:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: dessant/lock-threads@v3
18+
- uses: dessant/lock-threads@v4.0.0
1919
with:
2020
process-only: 'issues'

.github/workflows/pre_commit.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ jobs:
2929
pre_commit:
3030
runs-on: ubuntu-latest
3131
steps:
32-
- uses: actions/checkout@v3.1.0
33-
- uses: actions/setup-python@v4.3.0
32+
- uses: actions/checkout@v3.3.0
33+
- uses: actions/setup-python@v4.5.0
3434
with:
3535
python-version: "3.11"
3636
- name: install tox

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ jobs:
1010
if: github.repository == 'python-gitlab/python-gitlab'
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3.1.0
13+
- uses: actions/checkout@v3.3.0
1414
with:
1515
fetch-depth: 0
1616
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
1717
- name: Python Semantic Release
18-
uses: relekang/python-semantic-release@v7.32.2
18+
uses: relekang/python-semantic-release@v7.33.0
1919
with:
2020
github_token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
2121
pypi_token: ${{ secrets.PYPI_TOKEN }}

.github/workflows/stale.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
stale:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/stale@v6.0.1
18+
- uses: actions/stale@v7.0.0
1919
with:
2020
any-of-labels: 'need info,Waiting for response'
2121
stale-issue-message: >

.github/workflows/test.yml

+10-9
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
unit:
2323
runs-on: ${{ matrix.os }}
2424
strategy:
25+
fail-fast: false
2526
matrix:
2627
os: [ubuntu-latest]
2728
python:
@@ -45,9 +46,9 @@ jobs:
4546
version: "3.11"
4647
toxenv: py310,smoke
4748
steps:
48-
- uses: actions/checkout@v3.1.0
49+
- uses: actions/checkout@v3.3.0
4950
- name: Set up Python ${{ matrix.python.version }}
50-
uses: actions/setup-python@v4.3.0
51+
uses: actions/setup-python@v4.5.0
5152
with:
5253
python-version: ${{ matrix.python.version }}
5354
- name: Install dependencies
@@ -63,9 +64,9 @@ jobs:
6364
matrix:
6465
toxenv: [api_func_v4, cli_func_v4]
6566
steps:
66-
- uses: actions/checkout@v3.1.0
67+
- uses: actions/checkout@v3.3.0
6768
- name: Set up Python
68-
uses: actions/setup-python@v4.3.0
69+
uses: actions/setup-python@v4.5.0
6970
with:
7071
python-version: "3.11"
7172
- name: Install dependencies
@@ -84,9 +85,9 @@ jobs:
8485
coverage:
8586
runs-on: ubuntu-20.04
8687
steps:
87-
- uses: actions/checkout@v3.1.0
88+
- uses: actions/checkout@v3.3.0
8889
- name: Set up Python ${{ matrix.python-version }}
89-
uses: actions/setup-python@v4.3.0
90+
uses: actions/setup-python@v4.5.0
9091
with:
9192
python-version: "3.11"
9293
- name: Install dependencies
@@ -125,12 +126,12 @@ jobs:
125126
runs-on: ubuntu-latest
126127
needs: [dist]
127128
steps:
128-
- uses: actions/checkout@v3.1.0
129+
- uses: actions/checkout@v3.3.0
129130
- name: Set up Python
130-
uses: actions/setup-python@v4.3.0
131+
uses: actions/setup-python@v4.5.0
131132
with:
132133
python-version: '3.11'
133-
- uses: actions/download-artifact@v3.0.1
134+
- uses: actions/download-artifact@v3.0.2
134135
with:
135136
name: dist
136137
path: dist

.pre-commit-config.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ default_language_version:
33

44
repos:
55
- repo: https://github.com/psf/black
6-
rev: 22.10.0
6+
rev: 22.12.0
77
hooks:
88
- id: black
99
- repo: https://github.com/commitizen-tools/commitizen
10-
rev: v2.37.1
10+
rev: v2.40.0
1111
hooks:
1212
- id: commitizen
1313
stages: [commit-msg]
1414
- repo: https://github.com/pycqa/flake8
15-
rev: 5.0.4
15+
rev: 6.0.0
1616
hooks:
1717
- id: flake8
1818
- repo: https://github.com/pycqa/isort
19-
rev: 5.10.1
19+
rev: 5.12.0
2020
hooks:
2121
- id: isort
2222
- repo: https://github.com/pycqa/pylint
23-
rev: v2.15.7
23+
rev: v2.15.10
2424
hooks:
2525
- id: pylint
2626
additional_dependencies:
@@ -41,12 +41,12 @@ repos:
4141
- types-requests==2.28.11.2
4242
- types-setuptools==64.0.1
4343
- repo: https://github.com/pre-commit/pygrep-hooks
44-
rev: v1.9.0
44+
rev: v1.10.0
4545
hooks:
4646
- id: rst-backticks
4747
- id: rst-directive-colons
4848
- id: rst-inline-touching-normal
4949
- repo: https://github.com/maxbrunet/pre-commit-renovate
50-
rev: 34.48.0
50+
rev: 34.117.1
5151
hooks:
5252
- id: renovate-config-validator

CHANGELOG.md

+23
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22

33
<!--next-version-placeholder-->
44

5+
## v3.13.0 (2023-01-30)
6+
### Feature
7+
* **group:** Add support for group restore API ([`9322db6`](https://github.com/python-gitlab/python-gitlab/commit/9322db663ecdaecf399e3192810d973c6a9a4020))
8+
* **client:** Automatically retry on HTTP 409 Resource lock ([`dced76a`](https://github.com/python-gitlab/python-gitlab/commit/dced76a9900c626c9f0b90b85a5e371101a24fb4))
9+
* **api:** Add support for bulk imports API ([`043de2d`](https://github.com/python-gitlab/python-gitlab/commit/043de2d265e0e5114d1cd901f82869c003413d9b))
10+
* **api:** Add support for resource groups ([`5f8b8f5`](https://github.com/python-gitlab/python-gitlab/commit/5f8b8f5be901e944dfab2257f9e0cc4b2b1d2cd5))
11+
* **api:** Support listing pipelines triggered by pipeline schedules ([`865fa41`](https://github.com/python-gitlab/python-gitlab/commit/865fa417a20163b526596549b9afbce679fc2817))
12+
* Allow filtering pipelines by source ([`b6c0872`](https://github.com/python-gitlab/python-gitlab/commit/b6c08725042380d20ef5f09979bc29f2f6c1ab6f))
13+
* **client:** Bootstrap the http backends concept ([#2391](https://github.com/python-gitlab/python-gitlab/issues/2391)) ([`91a665f`](https://github.com/python-gitlab/python-gitlab/commit/91a665f331c3ffc260db3470ad71fde0d3b56aa2))
14+
* Add resource iteration events (see https://docs.gitlab.com/ee/api/resource_iteration_events.html) ([`ef5feb4`](https://github.com/python-gitlab/python-gitlab/commit/ef5feb4d07951230452a2974da729a958bdb9d6a))
15+
* Allow passing kwargs to Gitlab class when instantiating with `from_config` ([#2392](https://github.com/python-gitlab/python-gitlab/issues/2392)) ([`e88d34e`](https://github.com/python-gitlab/python-gitlab/commit/e88d34e38dd930b00d7bb48f0e1c39420e09fa0f))
16+
* Add keep_base_url when getting configuration from file ([`50a0301`](https://github.com/python-gitlab/python-gitlab/commit/50a03017f2ba8ec3252911dd1cf0ed7df42cfe50))
17+
18+
### Fix
19+
* **client:** Regression - do not automatically get_next if page=# and ([`585e3a8`](https://github.com/python-gitlab/python-gitlab/commit/585e3a86c4cafa9ee73ed38676a78f3c34dbe6b2))
20+
* Change return value to "None" in case getattr returns None to prevent error ([`3f86d36`](https://github.com/python-gitlab/python-gitlab/commit/3f86d36218d80b293b346b37f8be5efa6455d10c))
21+
* **deps:** Bump requests-toolbelt to fix deprecation warning ([`faf842e`](https://github.com/python-gitlab/python-gitlab/commit/faf842e97d4858ff5ebd8ae6996e0cb3ca29881c))
22+
* Use the ProjectIterationManager within the Project object ([`44f05dc`](https://github.com/python-gitlab/python-gitlab/commit/44f05dc017c5496e14db82d9650c6a0110b95cf9))
23+
* **api:** Make description optional for releases ([`5579750`](https://github.com/python-gitlab/python-gitlab/commit/5579750335245011a3acb9456cb488f0fa1cda61))
24+
25+
### Documentation
26+
* **faq:** Describe and group common errors ([`4c9a072`](https://github.com/python-gitlab/python-gitlab/commit/4c9a072b053f12f8098e4ea6fc47e3f6ab4f8b07))
27+
528
## v3.12.0 (2022-11-28)
629
### Feature
730
* Add support for SAML group links ([#2367](https://github.com/python-gitlab/python-gitlab/issues/2367)) ([`1020ce9`](https://github.com/python-gitlab/python-gitlab/commit/1020ce965ff0cd3bfc283d4f0ad40e41e4d1bcee))

docs/api-objects.rst

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ API examples
1111
gl_objects/emojis
1212
gl_objects/badges
1313
gl_objects/branches
14+
gl_objects/bulk_imports
1415
gl_objects/messages
1516
gl_objects/ci_lint
1617
gl_objects/commits
@@ -51,6 +52,7 @@ API examples
5152
gl_objects/remote_mirrors
5253
gl_objects/repositories
5354
gl_objects/repository_tags
55+
gl_objects/resource_groups
5456
gl_objects/search
5557
gl_objects/secure_files
5658
gl_objects/settings

docs/api-usage-advanced.rst

+10-3
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,16 @@ GitLab server can sometimes return a transient HTTP error.
123123
python-gitlab can automatically retry in such case, when
124124
``retry_transient_errors`` argument is set to ``True``. When enabled,
125125
HTTP error codes 500 (Internal Server Error), 502 (502 Bad Gateway),
126-
503 (Service Unavailable), and 504 (Gateway Timeout) are retried. It will retry until reaching
127-
the ``max_retries`` value. By default, ``retry_transient_errors`` is set to ``False`` and an exception
128-
is raised for these errors.
126+
503 (Service Unavailable), 504 (Gateway Timeout), and Cloudflare
127+
errors (520-530) are retried.
128+
129+
Additionally, HTTP error code 409 (Conflict) is retried if the reason
130+
is a
131+
`Resource lock <https://gitlab.com/gitlab-org/gitlab/-/blob/443c12cf3b238385db728f03b2cdbb4f17c70292/lib/api/api.rb#L111>`__.
132+
133+
It will retry until reaching the ``max_retries``
134+
value. By default, ``retry_transient_errors`` is set to ``False`` and an
135+
exception is raised for these errors.
129136

130137
.. code-block:: python
131138

docs/api-usage.rst

+26-10
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ conflict with python or python-gitlab when using them as kwargs:
171171
172172
gl.user_activities.list(query_parameters={'from': '2019-01-01'}, iterator=True) # OK
173173
174+
.. _objects:
175+
174176
Gitlab Objects
175177
==============
176178

@@ -220,21 +222,16 @@ the value on the object is accepted:
220222
issue.my_super_awesome_feature_flag = "random_value"
221223
issue.save()
222224
225+
As a dictionary
226+
---------------
227+
223228
You can get a dictionary representation copy of the Gitlab Object. Modifications made to
224229
the dictionary will have no impact on the GitLab Object.
225230

226-
* ``asdict()`` method. Returns a dictionary representation of the Gitlab object.
227-
* ``attributes`` property. Returns a dictionary representation of the Gitlab
231+
* ``asdict()`` method. Returns a dictionary representation of the Gitlab object.
232+
* ``attributes`` property. Returns a dictionary representation of the Gitlab
228233
object. Also returns any relevant parent object attributes.
229234

230-
.. note::
231-
232-
``attributes`` returns the parent object attributes that are defined in
233-
``object._from_parent_attrs``. What this can mean is that for example a ``ProjectIssue``
234-
object will have a ``project_id`` key in the dictionary returned from ``attributes`` but
235-
``asdict()`` will not.
236-
237-
238235
.. code-block:: python
239236
240237
project = gl.projects.get(1)
@@ -244,6 +241,22 @@ the dictionary will have no impact on the GitLab Object.
244241
issue = project.issues.get(1)
245242
attribute_dict = issue.attributes
246243
244+
# The following will return the same value
245+
title = issue.title
246+
title = issue.attributes["title"]
247+
248+
.. hint::
249+
250+
This can be used to access attributes that clash with python-gitlab's own methods or managers.
251+
Note that:
252+
253+
``attributes`` returns the parent object attributes that are defined in
254+
``object._from_parent_attrs``. For example, a ``ProjectIssue`` object will have a
255+
``project_id`` key in the dictionary returned from ``attributes`` but ``asdict()`` will not.
256+
257+
As JSON
258+
-------
259+
247260
You can get a JSON string represenation of the Gitlab Object. For example:
248261

249262
.. code-block:: python
@@ -380,6 +393,9 @@ The generator exposes extra listing information as received from the server:
380393
Prior to python-gitlab 3.6.0 the argument ``as_list`` was used instead of
381394
``iterator``. ``as_list=False`` is the equivalent of ``iterator=True``.
382395

396+
.. note::
397+
If ``page`` and ``iterator=True`` are used together, the latter is ignored.
398+
383399
Sudo
384400
====
385401

0 commit comments

Comments
 (0)