summaryrefslogtreecommitdiff
path: root/gitlab/client.py
Commit message (Collapse)AuthorAgeFilesLines
* feat(client): add http_patch method (#2471)John Villalovos2023-02-051-0/+48
| | | | | In order to support some new API calls we need to support the HTTP `PATCH` method. Closes: #2469
* chore: make backends privateNejc Habjan2023-01-301-10/+10
|
* chore: add a UserWarning if both `iterator=True` and `page=X` are used (#2462)John Villalovos2023-01-261-0/+13
| | | | | If a caller calls a `list()` method with both `iterator=True` (or `as_list=False`) and `page=X` then emit a `UserWarning` as the options are mutually exclusive.
* fix(client): regression - do not automatically get_next if page=# andHelen Koike2023-01-251-1/+1
| | | | | | | | | | | | | iterator=True/as_list=False are used This fix a regression introduced on commit https://github.com/python-gitlab/python-gitlab/commit/1339d645ce58a2e1198b898b9549ba5917b1ff12 If page is used, then get_next should be false. This was found on the mesa ci project, after upgrading the python-gitlab version, the script that monitors the ci was getting killed by consuming too much memory.
* chore: add test, docs, and helper for 409 retriesNejc Habjan2022-12-191-7/+14
|
* feat(client): automatically retry on HTTP 409 Resource lockPetr Špaček2022-12-191-1/+4
| | | | Fixes: #2325
* feat(api): add support for bulk imports APINejc Habjan2022-12-191-0/+4
|
* refactor: remove unneeded requests.utils import (#2426)Liora Milbaum2022-12-191-1/+0
|
* refactor: Migrate MultipartEncoder to RequestsBackend (#2421)Liora Milbaum2022-12-191-34/+3
|
* refactor: move Response object to backends (#2420)Liora Milbaum2022-12-191-2/+2
|
* refactor: move the request call to the backend (#2413)Liora Milbaum2022-12-101-1/+1
|
* refactor: Moving RETRYABLE_TRANSIENT_ERROR_CODES to constLiora Milbaum2022-12-061-2/+1
|
* feat(client): bootstrap the http backends concept (#2391)Liora Milbaum2022-12-051-5/+13
|
* feat: allow passing kwargs to Gitlab class when instantiating with ↵Liora Milbaum2022-12-041-1/+8
| | | | `from_config` (#2392)
* feat(api): add application statisticsShreya2022-11-011-0/+2
|
* chore: narrow type hints for license APINejc Habjan2022-10-271-1/+1
|
* fix(client): do not assume user attrs returned for auth()Nejc Habjan2022-08-101-1/+3
| | | | This is mostly relevant for people mocking the API in tests.
* chore: consolidate license and authorsNejc Habjan2022-08-041-16/+0
|
* feat(client): warn user on misconfigured URL in `auth()`Nejc Habjan2022-08-041-1/+3
|
* refactor(client): factor out URL check into a helperNejc Habjan2022-08-041-27/+33
|
* refactor(client): remove handling for incorrect link headerNejc Habjan2022-08-041-7/+2
| | | | | | | | This was a quirk only present in GitLab 13.0 and fixed with 13.1. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/33714 and https://gitlab.com/gitlab-org/gitlab/-/issues/218504 for more context.
* chore: use `urlunparse` instead of string replaceJohn L. Villalovos2022-08-041-1/+1
| | | | | Use the `urlunparse()` function to reconstruct the URL without the query parameters.
* fix(client): ensure encoded query params are never duplicatedNejc Habjan2022-08-041-2/+7
|
* fix: optionally keep user-provided base URL for pagination (#2149)Omar Mochtar2022-08-031-0/+29
|
* chore: enable mypy check `disallow_any_generics`John L. Villalovos2022-08-011-3/+5
|
* chore: enable mypy check `warn_return_any`John L. Villalovos2022-07-281-3/+13
| | | | Update code so that the `warn_return_any` check passes.
* fix(runners): fix listing for /runners/allNejc Habjan2022-07-231-0/+2
|
* fix: add `get_all` param (and `--get-all`) to allow passing `all` to APINejc Habjan2022-07-211-5/+11
|
* feat(api): add support for instance-level registry repositoriesNejc Habjan2022-07-201-0/+2
|
* feat(cli): add support for global CI lintNejc Habjan2022-07-051-0/+7
|
* test(pylint): enable pylint "unused-argument" checkJohn L. Villalovos2022-06-261-0/+1
| | | | | | | | | | Enable the pylint "unused-argument" check and resolve issues it found. * Quite a few functions were accepting `**kwargs` but not then passing them on through to the next level. Now pass `**kwargs` to next level. * Other functions had no reason to accept `**kwargs`, so remove it * And a few other fixes.
* feat(api): implement HEAD methodGauvain Pocentek2022-06-251-0/+21
|
* chore: fix issue found with pylint==2.14.3John L. Villalovos2022-06-191-3/+1
| | | | | | | A new error was reported when running pylint==2.14.3: gitlab/client.py:488:0: W1404: Implicit string concatenation found in call (implicit-str-concat) Fixed this issue.
* chore: enable pylint check: "redefined-outer-name",John L. Villalovos2022-06-041-4/+3
| | | | | Enable the pylint check "redefined-outer-name" and fix the errors detected.
* chore: enable pylint check: "no-self-use"John L. Villalovos2022-06-041-4/+7
| | | | Enable the pylint check "no-self-use" and fix the errors detected.
* chore: enable pylint check: "no-else-return"John L. Villalovos2022-06-041-2/+1
| | | | Enable the pylint check "no-else-return" and fix the errors detected.
* chore: enable pylint check: "attribute-defined-outside-init"John L. Villalovos2022-06-041-0/+1
| | | | | Enable the pylint check: "attribute-defined-outside-init" and fix errors detected.
* chore: correct ModuleNotFoundError() argumentsJohn L. Villalovos2022-05-291-2/+2
| | | | | | | | | | | Previously in commit 233b79ed442aac66faf9eb4b0087ea126d6dffc5 I had used the `name` argument for `ModuleNotFoundError()`. This basically is the equivalent of not passing any message to `ModuleNotFoundError()`. So when the exception was raised it wasn't very helpful. Correct that and add a unit-test that shows we get the message we expect.
* test(gitlab): increase unit test coverageNejc Habjan2022-05-291-1/+3
|
* feat(client): introduce `iterator=True` and deprecate `as_list=False` in ↵John L. Villalovos2022-05-291-7/+24
| | | | | | | | | | | `list()` `as_list=False` is confusing as it doesn't explain what is being returned. Replace it with `iterator=True` which more clearly explains to the user that an iterator/generator will be returned. This maintains backward compatibility with `as_list` but does issue a DeprecationWarning if `as_list` is set.
* Merge pull request #1965 from python-gitlab/fix/redundant-args-apiMax Wittig2022-04-141-5/+7
|\ | | | | fix: avoid passing redundant arguments to API
| * fix: avoid passing redundant arguments to APINejc Habjan2022-04-051-5/+7
| |
* | Merge pull request #1974 from ↵Nejc Habjan2022-04-141-1/+1
|\ \ | | | | | | | | | | | | Sineaggi/add-chunked-to-list-of-retryable-exceptions Add ChunkedEncodingError to list of retryable exceptions
| * | fix: add ChunkedEncodingError to list of retryable exceptionsClayton Walker2022-04-131-1/+1
| |/
* | feat: emit a warning when using a `list()` method returns maxJohn L. Villalovos2022-04-121-8/+54
|/ | | | | | | | | | | A common cause of issues filed and questions raised is that a user will call a `list()` method and only get 20 items. As this is the default maximum of items that will be returned from a `list()` method. To help with this we now emit a warning when the result from a `list()` method is greater-than or equal to 20 (or the specified `per_page` value) and the user is not using either `all=True`, `all=False`, `as_list=False`, or `page=X`.
* chore(client): remove duplicate codeNejc Habjan2022-04-041-3/+0
|
* fix: add 52x range to retry transient failures and testsClayton Walker2022-04-041-3/+6
|
* fix: also retry HTTP-based transient errorsMitar2022-04-041-11/+25
|
* Merge pull request #1895 from python-gitlab/jlvillal/rate-limitNejc Habjan2022-03-101-0/+4
|\ | | | | fix: support RateLimit-Reset header
| * fix: support RateLimit-Reset headerJohn L. Villalovos2022-02-161-0/+4
| | | | | | | | | | | | | | | | | | | | Some endpoints are not returning the `Retry-After` header when rate-limiting occurrs. In those cases use the `RateLimit-Reset` [1] header, if available. Closes: #1889 [1] https://docs.gitlab.com/ee/user/admin_area/settings/user_and_ip_rate_limits.html#response-headers