summaryrefslogtreecommitdiff
path: root/gitlab/client.py
Commit message (Collapse)AuthorAgeFilesLines
* feat: add basic GraphQL support (wip)feat/graphqlNejc Habjan2022-12-111-92/+209
|
* 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
* | style: reformat for black v22Nejc Habjan2022-03-101-1/+1
|/
* chore: correct type-hints for per_page attrbuteJohn L. Villalovos2022-02-051-4/+2
| | | | | | | There are occasions where a GitLab `list()` call does not return the `x-per-page` header. For example the listing of custom attributes. Update the type-hints to reflect that.
* chore: require kwargs for `utils.copy_dict()`John L. Villalovos2022-02-031-3/+3
| | | | | | | | The non-keyword arguments were a tiny bit confusing as the destination was first and the source was second. Change the order and require key-word only arguments to ensure we don't silently break anyone.
* chore: remove old-style classesNejc Habjan2022-01-231-2/+2
|
* feat(cli): allow options from args and environment variablesNejc Habjan2022-01-021-0/+82
| | | | | | | | BREAKING-CHANGE: The gitlab CLI will now accept CLI arguments and environment variables for its global options in addition to configuration file options. This may change behavior for some workflows such as running inside GitLab CI and with certain environment variables configured.
* fix: handle situation where GitLab does not return valuesjlvillal/paginationJohn L. Villalovos2021-12-301-16/+17
| | | | | | | | | | | | | | | | If a query returns more than 10,000 records than the following values are NOT returned: x.total_pages x.total Modify the code to allow no value to be set for these values. If there is not a value returned the functions will now return None. Update unit test so no longer `xfail` https://docs.gitlab.com/ee/user/gitlab_com/index.html#pagination-response-headers Closes #1686
* Merge pull request #1766 from python-gitlab/jlvillal/leave_dotNejc Habjan2021-12-211-16/+11
|\ | | | | fix: stop encoding '.' to '%2E'
| * fix: stop encoding '.' to '%2E'jlvillal/leave_dotJohn L. Villalovos2021-12-201-16/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Forcing the encoding of '.' to '%2E' causes issues. It also goes against the RFC: https://datatracker.ietf.org/doc/html/rfc3986.html#section-2.3 From the RFC: For consistency, percent-encoded octets in the ranges of ALPHA (%41-%5A and %61-%7A), DIGIT (%30-%39), hyphen (%2D), period (%2E), underscore (%5F), or tilde (%7E) should not be created by URI producers... Closes #1006 Related #1356 Related #1561 BREAKING CHANGE: stop encoding '.' to '%2E'. This could potentially be a breaking change for users who have incorrectly configured GitLab servers which don't handle period '.' characters correctly.
* | chore: remove '# type: ignore' for new mypy versionrenovate/mypy-0.xJohn L. Villalovos2021-12-201-1/+1
|/ | | | | | mypy 0.920 now understands the type of 'http.client.HTTPConnection.debuglevel' so we remove the 'type: ignore' comment to make mypy pass