summaryrefslogtreecommitdiff
path: root/gitlab/v4
Commit message (Collapse)AuthorAgeFilesLines
...
* feat: support mutually exclusive attributes and consolidate validation to ↵Walter Rowe2022-05-314-8/+12
| | | | | | | | | | | | | | | 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
* chore: move `RequiredOptional` to the `gitlab.types` moduleJohn L. Villalovos2022-05-3143-43/+86
| | | | | | By having `RequiredOptional` in the `gitlab.base` module it makes it difficult with circular imports. Move it to the `gitlab.types` module which has no dependencies on any other gitlab module.
* chore: update type-hints return signature for GetWithoutIdMixin methodsJohn L. Villalovos2022-05-3010-62/+46
| | | | | | | Commit f0152dc3cc9a42aa4dc3c0014b4c29381e9b39d6 removed situation where `get()` in a `GetWithoutIdMixin` based class could return `None` Update the type-hints to no longer return `Optional` AKA `None`
* feat(client): introduce `iterator=True` and deprecate `as_list=False` in ↵John L. Villalovos2022-05-296-25/+13
| | | | | | | | | | | `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.
* feat(objects): support get project storage endpointNejc Habjan2022-05-271-0/+19
|
* fix: duplicate subparsers being added to argparseJohn L. Villalovos2022-05-091-7/+18
| | | | | | | | | | Python 3.11 added an additional check in the argparse libary which detected duplicate subparsers being added. We had duplicate subparsers being added. Make sure we don't add duplicate subparsers. Closes: #2015
* feat: display human-readable attribute in `repr()` if presentNejc Habjan2022-05-0816-46/+36
|
* feat(ux): display project.name_with_namespace on project reprLaurent Peuch2022-04-291-0/+10
| | | | | | | | | | | | | | | This change the repr from: $ gitlab.projects.get(id=some_id) <Project id:some_id> To: $ gitlab.projects.get(id=some_id) <Project id:some_id name_with_namespace:"group_name / project_name"> This is especially useful when working on random projects or listing of projects since users generally don't remember projects ids.
* Merge pull request #1963 from python-gitlab/feat/deploy-token-getMax Wittig2022-04-131-3/+21
|\ | | | | feat(objects): support getting project/group deploy tokens by id
| * feat(objects): support getting project/group deploy tokens by idNejc Habjan2022-04-041-3/+21
| |
* | Merge pull request #1962 from python-gitlab/feat/user-ssh-keyMax Wittig2022-04-131-1/+4
|\ \ | | | | | | feat(user): support getting user SSH key by id
| * | feat(user): support getting user SSH key by idNejc Habjan2022-04-011-1/+4
| |/
* | fix(cli): add missing filters for project commit listNejc Habjan2022-04-041-0/+10
|/
* feat(api): re-add topic delete endpointNejc Habjan2022-04-011-3/+3
| | | | This reverts commit e3035a799a484f8d6c460f57e57d4b59217cd6de.
* feat(object): add pipeline test report summary supportkinbald2022-03-071-0/+20
|
* feat(merge_request_approvals): add support for deleting MR approval rulesNejc Habjan2022-02-131-2/+2
|
* feat(artifacts): add support for project artifacts delete APINejc Habjan2022-02-101-0/+17
|
* chore: create a custom `warnings.warn` wrapperJohn L. Villalovos2022-02-062-14/+18
| | | | | | | 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
* fix(services): use slug for id_attr instead of custom methodsNejc Habjan2022-02-031-49/+3
|
* style(objects): add spacing to docstringsNejc Habjan2022-02-011-1/+10
|
* feat(objects): add a complete artifacts managerNejc Habjan2022-02-013-81/+133
|
* fix: remove custom `delete` method for labelsJohn L. Villalovos2022-02-011-41/+7
| | | | | | | | | | | | | | The usage of deleting was incorrect according to the current API. Remove custom `delete()` method as not needed. Add tests to show it works with labels needing to be encoded. Also enable the test_group_labels() test function. Previously it was disabled. Add ability to do a `get()` for group labels. Closes: #1867
* chore: create new ArrayAttribute classJohn L. Villalovos2022-01-308-36/+24
| | | | | | | | | | | | | | | | | | | | | Create a new ArrayAttribute class. This is to indicate types which are sent to the GitLab server as arrays https://docs.gitlab.com/ee/api/#array At this stage it is identical to the CommaSeparatedListAttribute class but will be used later to support the array types sent to GitLab. This is the second step 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 [1] https://docs.gitlab.com/ee/api/#encoding-api-parameters-of-array-and-hash-types Related: #1698
* fix(cli): make 'per_page' and 'page' type explicitThomas de Grenier de Latour2022-01-251-2/+2
|
* chore: don't explicitly pass args to super()Nejc Habjan2022-01-235-6/+6
|
* style: use literals to declare data structuresNejc Habjan2022-01-235-10/+10
|
* chore: remove old-style classesNejc Habjan2022-01-231-4/+4
|
* chore: rename `types.ListAttribute` to `types.CommaSeparatedListAttribute`John L. Villalovos2022-01-2211-35/+50
| | | | | | | | | | | This name more accurately describes what the type is. Also this is the first step in a series of steps of our goal to add full support for the GitLab API data types[1]: * array * hash * array of hashes [1] https://docs.gitlab.com/ee/api/#encoding-api-parameters-of-array-and-hash-types
* fix(cli): allow custom methods in managersNejc Habjan2022-01-221-4/+6
|
* fix(objects): make resource access tokens and repos available in CLINejc Habjan2022-01-221-0/+3
|
* chore: create return type-hints for `get_id()` & `encoded_id`John L. Villalovos2022-01-141-0/+2
| | | | | | Create return type-hints for `RESTObject.get_id()` and `RESTObject.encoded_id`. Previously was saying they return Any. Be more precise in saying they can return either: None, str, or int.
* chore(groups): use encoded_id for group pathNejc Habjan2022-01-131-1/+1
|
* feat: add support for Groups API method `transfer()`Christian Sattler2022-01-131-1/+23
|
* chore(objects): use `self.encoded_id` where applicableJohn L. Villalovos2022-01-132-7/+7
| | | | | | | | Updated a few remaining usages of `self.id` to use `self.encoded_id` as for the most part we shouldn't be using `self.id` There are now only a few (4 lines of code) remaining uses of `self.id`, most of which seem that they should stay that way.
* Merge pull request #1835 from python-gitlab/jlvillal/id_to_encodedidNejc Habjan2022-01-142-3/+3
|\ | | | | chore(objects): use `self.encoded_id` where could be a string
| * chore(objects): use `self.encoded_id` where could be a stringJohn L. Villalovos2022-01-132-3/+3
| | | | | | | | | | Updated a few remaining usages of `self.id` to use `self.encoded_id` where it could be a string value.
* | chore(projects): fix typing for transfer methodNejc Habjan2022-01-131-1/+1
| | | | | | Co-authored-by: John Villalovos <john@sodarock.com>
* | feat(api): add `project.transfer()` and deprecate `transfer_project()`Nejc Habjan2022-01-131-1/+11
|/
* Merge pull request #1819 from python-gitlab/jlvillal/encoded_idNejc Habjan2022-01-1317-82/+82
|\ | | | | fix: use url-encoded ID in all paths
| * chore: replace usage of utils._url_encode() with utils.EncodedId()jlvillal/encoded_idJohn L. Villalovos2022-01-134-9/+9
| | | | | | | | | | | | utils.EncodedId() has basically the same functionalityy of using utils._url_encode(). So remove utils._url_encode() as we don't need it.
| * chore: add EncodedId string class to use to hold URL-encoded pathsJohn L. Villalovos2022-01-131-1/+1
| | | | | | | | | | | | | | | | | | 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.
| * fix: use url-encoded ID in all pathsJohn L. Villalovos2022-01-1314-72/+72
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge pull request #1827 from python-gitlab/jlvillal/all_objectsNejc Habjan2022-01-131-6/+16
|\ \ | | | | | | fix: members: use new *All objects for *AllManager managers
| * | fix(members): use new *All objects for *AllManager managersJohn L. Villalovos2022-01-131-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change it so that: GroupMemberAllManager uses GroupMemberAll object ProjectMemberAllManager uses ProjectMemberAll object Create GroupMemberAll and ProjectMemberAll objects that do not support any Mixin type methods. Previously we were using GroupMember and ProjectMember which support the `save()` and `delete()` methods but those methods will not work with objects retrieved using the `/members/all/` API calls. `list()` API calls: [1] GET /groups/:id/members/all GET /projects/:id/members/all `get()` API calls: [2] GET /groups/:id/members/all/:user_id GET /projects/:id/members/all/:user_id Closes: #1825 Closes: #848 [1] https://docs.gitlab.com/ee/api/members.html#list-all-members-of-a-group-or-project-including-inherited-and-invited-members [2] https://docs.gitlab.com/ee/api/members.html#get-a-member-of-a-group-or-project-including-inherited-and-invited-members
* | | fix(cli): add missing list filters for environmentsNejc Habjan2022-01-131-0/+1
| |/ |/|
* | fix(api): services: add missing `lazy` parameterjlvillal/lazy_serviceJohn L. Villalovos2022-01-131-1/+9
|/ | | | | | | | Commit 8da0b758c589f608a6ae4eeb74b3f306609ba36d added the `lazy` parameter to the services `get()` method but missed then using the `lazy` parameter when it called `super(...).get(...)` Closes: #1828
* feat: add support for Group Access Token APIFabio Huser2022-01-092-0/+19
| | | | See https://docs.gitlab.com/ee/api/group_access_tokens.html
* fix: remove custom URL encodingJohn L. Villalovos2022-01-084-10/+12
| | | | | | | | | | 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
* fix: remove default arguments for mergerequests.merge()John L. Villalovos2022-01-081-4/+4
| | | | | | | | | | The arguments `should_remove_source_branch` and `merge_when_pipeline_succeeds` are optional arguments. We should not be setting any default value for them. https://docs.gitlab.com/ee/api/merge_requests.html#accept-mr Closes: #1750
* fix(cli): url-encode path components of the URLJohn L. Villalovos2022-01-081-2/+18
| | | | | | | | | | | | | In the CLI we need to make sure the components put into the path portion of the URL are url-encoded. Otherwise they will be interpreted as part of the path. For example can specify the project ID as a path, but in the URL it must be url-encoded or it doesn't work. Also stop adding the components of the path as query parameters in the URL. Closes: #783 Closes: #1498