| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. If a value is of type ArrayAttribute then append '[]' to the name
of the value for query parameters (`params`).
This is step 3 in a series of steps of our goal to add full
support for the GitLab API data types[1]:
* array
* hash
* array of hashes
Step one was: commit 5127b1594c00c7364e9af15e42d2e2f2d909449b
Step two was: commit a57334f1930752c70ea15847a39324fa94042460
Fixes: #1698
[1] https://docs.gitlab.com/ee/api/#encoding-api-parameters-of-array-and-hash-types
|
|
|
|
|
|
|
|
| |
Commit b6447211754e126f64e12fc735ad74fe557b7fb4 inadvertently
introduced a possible breaking change as it added a new argument
`iterator` and added it in between existing (potentially positional) arguments.
This moves the `iterator` argument to the end of the argument list and
requires it to be a keyword-only argument.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* feat(downloads): allow streaming downloads access to response iterator
Allow access to the underlying response iterator when downloading in
streaming mode by specifying `iterator=True`.
Update type annotations to support this change.
* docs(api-docs): add iterator example to artifact download
Document the usage of the `iterator=True` option when downloading
artifacts
* test(packages): add tests for streaming downloads
|
|
|
|
|
|
| |
Move the `validate_attrs` function to be inside the `RequiredOptional`
class. It makes sense for it to be part of the class as it is working
on data related to the class.
|
|
|
|
| |
Replace usage with f-string
|
|
|
|
|
|
|
|
| |
There is no reason to return an `int` as we can always return a `str`
version of the `int`
Change `EncodedId` to always return an `EncodedId`. This removes the
need to have `mypy` ignore the error raised.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fix board lists (#2037)
add exclusive tuple to RequiredOptional data class to support for
mutually exclusive attributes
consolidate _check_missing_create_attrs and _check_missing_update_attrs
from mixins.py into _validate_attrs in utils.py
change _create_attrs in board list manager classes from
required=('label_ld',) to
exclusive=('label_id','asignee_id','milestone_id')
closes https://github.com/python-gitlab/python-gitlab/issues/1897
|
| |
|
|
|
|
|
|
|
| |
Create a custom `warnings.warn` wrapper that will walk the stack trace
to find the first frame outside of the `gitlab/` path to print the
warning against. This will make it easier for users to find where in
their code the error is generated from
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
utils.EncodedId() has basically the same functionalityy of using
utils._url_encode(). So remove utils._url_encode() as we don't need
it.
|
|
|
|
|
|
|
|
|
| |
Add EncodedId string class. This class returns a URL-encoded string
but ensures it will only URL-encode it once even if recursively
called.
Also added some functional tests of 'lazy' objects to make sure they
work.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make sure all usage of the ID in the URL path is encoded. Normally it
isn't an issue as most IDs are integers or strings which don't contain
a slash ('/'). But when the ID is a string with a slash character it
will break things.
Add a test case that shows this fixes wikis issue with subpages which
use the slash character.
Closes: #1079
|
|
|
|
|
|
|
|
|
|
| |
We were using `str.replace()` calls to take care of URL encoding
issues.
Switch them to use our `utils._url_encode()` function which itself uses
`urllib.parse.quote()`
Closes: #1356
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
The function sanitize_parameters() was used when the v3 API was in
use. Since v3 API support has been removed there are no more users of
this function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Git refnames are relatively free-form and can contain all sort for
special characters, not just `/` and `#`, see
http://git-scm.com/docs/git-check-ref-format
In particular, Debian's DEP-14 standard for storing packaging in git
repositories mandates the use of the `%` character in tags in some
cases like `debian/2%2.6-21`.
Unfortunately python-gitlab currently only escapes `/` to `%2F` and in
some cases `#` to `%23`. This means that when using the commit API to
retrieve information about the `debian/2%2.6-21` tag only the slash is
escaped before being inserted in the URL path and the `%` is left
untouched, resulting in something like
`/api/v4/projects/123/repository/commits/debian%2F2%2.6-21`. When
urllib3 seees that it detects the invalid `%` escape and then urlencodes
the whole string, resulting in
`/api/v4/projects/123/repository/commits/debian%252F2%252.6-21`, where
the original `/` got escaped twice and produced `%252F`.
To avoid the issue, fully urlencode identifiers and parameters to avoid
the urllib3 auto-escaping in all cases.
Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
|
|
|
|
|
|
|
|
|
|
| |
Don't allow a partially annotated function definition. Either none of
the function is annotated or all of it must be.
Update code to ensure no-more partially annotated functions.
Update gitlab/cli.py with better type-hints. Changed Tuple[Any, ...]
to Tuple[str, ...]
|
| |
|
| |
|
|
|
|
| |
with HTTP 500
|
| |
|
|
|
|
|
|
| |
Refactor a bit to handle this change, and add unit tests.
Closes #779
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
POST and PUT requests are modified by clients when redirections happen.
A common problem with python-gitlab is a misconfiguration of the server
URL: the http to https redirection breaks some requests.
With this change python-gitlab should detect problematic redirections,
and raise a proper exception instead of failing with a cryptic error.
Closes #565
|
| |
|
| |
|
| |
|
|
Some API calls will download possibly large data, resulting in a high
memory usage and out-of-memory errors. For these API calls use the
requests streaming capabilities and download chunked data. The caller is
responsible of providing a callable to actually store the data.
The default callable just prints the data on stdout.
|