summaryrefslogtreecommitdiff
path: root/gitlab/mixins.py
Commit message (Collapse)AuthorAgeFilesLines
* fix(base): allow persisting attributes when updating objectfix/persist-attributes-on-saveNejc Habjan2021-05-021-2/+12
|
* Merge pull request #1412 from JohnVillalovos/jlvillal/optional_get_attrsNejc Habjan2021-04-261-0/+2
|\ | | | | chore: make Get.*Mixin._optional_get_attrs always present
| * chore: make Get.*Mixin._optional_get_attrs always presentJohn L. Villalovos2021-04-241-0/+3
| | | | | | | | | | | | | | | | Always create GetMixin/GetWithoutIdMixin._optional_get_attrs attribute with a default value of tuple() This way we don't need to use hasattr() and we will know the type of the attribute.
* | chore: make ListMixin._list_filters always presentJohn L. Villalovos2021-04-241-0/+2
|/ | | | | | | | Always create ListMixin._list_filters attribute with a default value of tuple(). This way we don't need to use hasattr() and we will know the type of the attribute.
* Merge pull request #1397 from JohnVillalovos/jlvillal/flake8Max Wittig2021-04-231-1/+0
|\ | | | | Fix all issues reported by running: tox -e pep8 and enable pep8 as a linter check
| * chore: fix F401 errors reported by flake8John L. Villalovos2021-04-181-1/+0
| | | | | | | | | | | | F401: Module imported but unused https://www.flake8rules.com/rules/F401.html
* | fix: correct some type-hints in gitlab/mixins.pyJohn L. Villalovos2021-04-181-24/+26
|/ | | | | | | | | | | | | Commit baea7215bbbe07c06b2ca0f97a1d3d482668d887 introduced type-hints for gitlab/mixins.py. After starting to add type-hints to gitlab/v4/objects/users.py discovered a few errors. Main error was using '=' instead of ':'. For example: _parent = Optional[...] should be _parent: Optional[...] Resolved those issues.
* Merge pull request #1375 from JohnVillalovos/jlvillal/update_uses_postNejc Habjan2021-04-171-1/+2
|\ | | | | chore: remove usage of getattr()
| * chore: remove usage of getattr()John L. Villalovos2021-03-151-1/+2
| | | | | | | | | | | | | | | | | | Remove usage of getattr(self, "_update_uses_post", False) Instead add it to class and set default value to False. Add a tests that shows it is set to True for the ProjectMergeRequestApprovalManager and ProjectApprovalManager classes.
* | chore: have _create_attrs & _update_attrs be a namedtupleJohn L. Villalovos2021-04-171-3/+3
|/ | | | | | Convert _create_attrs and _update_attrs to use a NamedTuple (RequiredOptional) to help with code readability. Update all code to use the NamedTuple.
* chore: add _create_attrs & _update_attrs to RESTManagerJohn L. Villalovos2021-03-101-25/+7
| | | | | | | Add the attributes: _create_attrs and _update_attrs to the RESTManager class. This is so that we stop using getattr() if we don't need to. This also helps with type-hints being available for these attributes.
* chore: make _types always present in RESTManagerJohn L. Villalovos2021-03-071-11/+8
| | | | | | | | | | We now create _types = {} in RESTManager class. By making _types always present in RESTManager it makes the code simpler. We no longer have to do: types = getattr(self, "_types", {}) And the type checker now understands the type.
* chore: add type-hints for gitlab/mixins.pyJohn L. Villalovos2021-03-061-57/+313
| | | | | | | * Added type-hints for gitlab/mixins.py * Changed use of filter with a lambda expression to list-comprehension. mypy was not able to understand the previous code. Also list-comprehension is better :)
* refactor(api): explicitly export classes for star importsrefactor/split-objectsNejc Habjan2021-02-071-0/+25
|
* chore: rename ExportMixin to DownloadMixinfeat/group-import-exportNejc Habjan2020-04-051-1/+1
|
* feat(api): add support for Group Import/Export API (#1037)Nejc Habjan2020-04-051-1/+1
|
* chore(mixins): factor out export download into ExportMixinNejc Habjan2020-04-051-0/+29
|
* fix: do not require empty data dict for create()Nejc Habjan2020-03-071-1/+4
|
* feat: add global order_by option to ease paginationfeat/keyset-paginationMax Wittig2020-01-261-0/+3
|
* feat: support keyset pagination globallyMax Wittig2020-01-261-0/+4
|
* fix: remove empty dict default argumentsFrantisek Lachman2019-08-141-1/+2
| | | | Signed-off-by: Frantisek Lachman <flachman@redhat.com>
* feat: group labels with subscriptable mixinAlberto López Martín2019-07-261-2/+6
|
* fix(cli): fix update value for key not workingproject-variable-updatenateatkins2019-07-211-0/+2
|
* fix: convert # to %23 in URLsfix/779Gauvain Pocentek2019-06-081-3/+4
| | | | | | Refactor a bit to handle this change, and add unit tests. Closes #779
* refactor: format everything blackrefactor/blackMax Wittig2019-05-161-57/+55
|
* fix(api): make reset_time_estimate() work againfix/672Gauvain Pocentek2019-01-081-1/+1
| | | | Closes #672
* Use the same description for **kwargs everywhereGauvain Pocentek2018-06-171-7/+7
|
* Add project push rules configuration (#520)Eric Sabouraud2018-06-111-3/+8
|
* Add support for project-level MR approval configurationEric Sabouraud2018-06-081-2/+14
|
* time_stats(): use an existing attribute if availableGauvain Pocentek2018-05-301-0/+5
| | | | | | | | A time_stats attribute is returned by GitLab when fetching issues and merge requests (on reasonably recent GitLab versions). Use this info instead of making a new API call if possible. Fixes #510
* Add support for group badgesGauvain Pocentek2018-05-291-0/+24
| | | | | | Also consolidate project/group badges tests, and add some docs Fixes #469
* Fix the participants() decoratorGauvain Pocentek2018-05-281-1/+1
|
* Issues: add missing attributes and methodsGauvain Pocentek2018-05-281-0/+26
|
* Implement user_agent_detail for snippetsGauvain Pocentek2018-05-271-0/+17
| | | | Add a new UserAgentDetail mixin to avoid code duplication.
* add per_page config optionCyril Jouve2018-05-221-0/+2
|
* Add support for project import/exportGauvain Pocentek2018-05-211-1/+4
| | | | Fixes #471
* pep8 fixGauvain Pocentek2018-05-211-1/+1
|
* Add support for user avatar uploadGauvain Pocentek2018-05-211-9/+30
| | | | Fixes #308
* Drop GetFromListMixinGauvain Pocentek2018-05-191-37/+0
|
* pep8 fixGauvain Pocentek2018-05-191-1/+1
|
* Deprecate GetFromListMixinGauvain Pocentek2018-05-191-0/+9
| | | | | | | | | This mixin provides a workaround for get() for GitLab objects that don't implement a 'get a single object' API. We are now getting conflicts because GitLab adds GET methods, and this is against the "Implement only what exists in the API" strategy. Also use the proper GET API call for objects that support it.
* Get rid of _sanitize_dataGauvain Pocentek2018-03-171-14/+4
| | | | It was used in one class only, no need for added complexity.
* Implement attribute types to handle special casesGauvain Pocentek2018-03-171-2/+37
| | | | | | | | Some attributes need to be parsed/modified to work with the API (for instance lists). This patch provides two attribute types that will simplify parts of the code, and fix some CLI bugs. Fixes #443
* introduce RefreshMixinPierre Tardy2018-03-041-0/+19
| | | | | RefreshMixin allows to update a REST object so that you can poll on it. This is mostly useful for pipelines and jobs, but could be set on most of other objects, with unknown usecases.
* Add support for features flagsGauvain Pocentek2018-01-011-1/+1
| | | | Fixes #360
* mixins.py: Avoid sending empty update data to issue.save (#389)Carlos Soriano2017-12-161-0/+3
|
* Make todo() raise GitlabTodoError on errorGauvain Pocentek2017-12-161-2/+7
|
* Revert "Add unit tests for mixin exceptions"Gauvain Pocentek2017-11-161-7/+2
| | | | This reverts commit 4ee139ad5c58006da1f9af93fdd4e70592e6daa0.
* Add unit tests for mixin exceptionsGauvain Pocentek2017-11-111-2/+7
|
* Add a SetMixinGauvain Pocentek2017-11-111-0/+23
| | | | | Use it for UserCustomAttribute, will be useful for {Project,Group}CustomAttribute (#367)