summaryrefslogtreecommitdiff
path: root/gitlab
Commit message (Collapse)AuthorAgeFilesLines
* fix(cli): allow custom methods in managersfix/cli-manager-custom-methodsNejc Habjan2022-01-221-4/+6
|
* Merge pull request #1838 from python-gitlab/jlvillal/version_mvNejc Habjan2022-01-153-2/+2
|\ | | | | chore: rename `gitlab/__version__.py` to `gitlab/_version.py`
| * chore: rename `gitlab/__version__.py` -> `gitlab/_version.py`jlvillal/version_mvJohn L. Villalovos2022-01-153-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is confusing to have a `gitlab/__version__.py` because we also create a variable `gitlab.__version__` which can conflict with `gitlab/__version__.py`. For example in `gitlab/const.py` we have to know that `gitlab.__version__` is a module and not the variable due to the ordering of imports. But in most other usage `gitlab.__version__` is a version string. To reduce confusion make the name of the version file `gitlab/_version.py`.
* | chore: create return type-hints for `get_id()` & `encoded_id`John L. Villalovos2022-01-143-3/+6
|/ | | | | | 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: release v3.1.0v3.1.0github-actions2022-01-141-1/+1
|
* chore(groups): use encoded_id for group pathNejc Habjan2022-01-131-1/+1
|
* feat: add support for Groups API method `transfer()`Christian Sattler2022-01-132-1/+27
|
* 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
|/
* feat(api): return result from `SaveMixin.save()`kernelport2022-01-131-4/+7
| | | | | | | | | Return the new object data when calling `SaveMixin.save()`. Also remove check for `None` value when calling `self.manager.update()` as that method only returns a dictionary. Closes: #1081
* Merge pull request #1819 from python-gitlab/jlvillal/encoded_idNejc Habjan2022-01-1320-119/+133
|\ | | | | fix: use url-encoded ID in all paths
| * chore: replace usage of utils._url_encode() with utils.EncodedId()jlvillal/encoded_idJohn L. Villalovos2022-01-137-89/+25
| | | | | | | | | | | | 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-133-9/+67
| | | | | | | | | | | | | | | | | | 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-1317-92/+112
| | | | | | | | | | | | | | | | | | | | | | | | 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
* fix: broken URL for FAQ about attribute-error-listJohn L. Villalovos2022-01-091-1/+1
| | | | | | | | | | | | | | The URL was missing a 'v' before the version number and thus the page did not exist. Previously the URL for python-gitlab 3.0.0 was: https://python-gitlab.readthedocs.io/en/3.0.0/faq.html#attribute-error-list Which does not exist. Change it to: https://python-gitlab.readthedocs.io/en/v3.0.0/faq.html#attribute-error-list add the 'v' --------------------------^
* feat: add support for Group Access Token APIFabio Huser2022-01-092-0/+19
| | | | See https://docs.gitlab.com/ee/api/group_access_tokens.html
* Merge pull request #1812 from python-gitlab/jlvillal/pprintNejc Habjan2022-01-091-0/+9
|\ | | | | chore: add `pprint()` and `pformat()` methods to RESTObject
| * chore: add `pprint()` and `pformat()` methods to RESTObjectJohn L. Villalovos2022-01-081-0/+9
| | | | | | | | | | This is useful in debugging and testing. As can easily print out the values from an instance in a more human-readable form.
* | fix: remove custom URL encodingJohn L. Villalovos2022-01-086-16/+35
| | | | | | | | | | | | | | | | | | | | 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
* | Merge pull request #1809 from python-gitlab/jlvillal/list_apiNejc Habjan2022-01-081-8/+11
|\ \ | | | | | | fix: change to `http_list` for some ProjectCommit methods
| * | fix: change to `http_list` for some ProjectCommit methodsJohn L. Villalovos2022-01-081-8/+11
| |/ | | | | | | | | | | | | | | | | | | | | | | Fix the type-hints and use `http_list()` for the ProjectCommits methods: - diff() - merge_requests() - refs() This will enable using the pagination support we have for lists. Closes: #1805 Closes: #1231
* | chore: fix missing commajlvillal/missing_commaJohn L. Villalovos2022-01-071-1/+2
|/ | | | | There was a missing comma which meant the strings were concatenated instead of being two separate strings.
* chore: release v3.0.0v3.0.0github-actions2022-01-051-1/+1
|
* feat(cli): allow options from args and environment variablesNejc Habjan2022-01-023-7/+187
| | | | | | | | 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-302-18/+19
| | | | | | | | | | | | | | | | 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
* chore: add and document optional parameters for get MRjlvillal/rebase_in_progressJohn L. Villalovos2021-12-231-0/+5
| | | | | | | Add and document (some of the) optional parameters that can be done for a `project.merge_requests.get()` Closes #1775
* feat(api): support file format for repository archiveMax Ludwig2021-12-211-2/+6
|
* Merge pull request #1766 from python-gitlab/jlvillal/leave_dotNejc Habjan2021-12-212-23/+12
|\ | | | | fix: stop encoding '.' to '%2E'
| * fix: stop encoding '.' to '%2E'jlvillal/leave_dotJohn L. Villalovos2021-12-202-23/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* feat: add support for `squash_option` in Projectsjlvillal/squash_optionJohn L. Villalovos2021-12-132-0/+3
| | | | | | | There is an optional `squash_option` parameter which can be used when creating Projects and UserProjects. Closes #1744
* feat(cli): do not require config file to run CLIfeat/cli-without-config-fileNejc Habjan2021-12-131-60/+94
| | | | | | | | | | | BREAKING CHANGE: A config file is no longer needed to run the CLI. python-gitlab will default to https://gitlab.com with no authentication if there is no config file provided. python-gitlab will now also only look for configuration in the provided PYTHON_GITLAB_CFG path, instead of merging it with user- and system-wide config files. If the environment variable is defined and the file cannot be opened, python-gitlab will now explicitly fail.
* chore(api): temporarily remove topic delete endpointNejc Habjan2021-12-111-3/+3
| | | | It is not yet available upstream.
* feat(api): add support for Topics APINejc Habjan2021-12-113-0/+30
|
* Merge pull request #1710 from python-gitlab/jlvillal/get_without_idNejc Habjan2021-12-119-9/+85
|\ | | | | chore: add get() methods for GetWithoutIdMixin based classes
| * chore: add get() methods for GetWithoutIdMixin based classesjlvillal/get_without_idJohn L. Villalovos2021-12-089-9/+85
| | | | | | | | | | | | | | Add the get() methods for the GetWithoutIdMixin based classes. Update the tests/meta/test_ensure_type_hints.py tests to check to ensure that the get methods are defined with the correct return type.
* | feat: add delete on package_file objectSimon Hébert-Deschamps2021-12-091-1/+1
|/
* chore: fix pylint error "expression-not-assigned"John L. Villalovos2021-12-071-28/+20
| | | | | | | | Fix pylint error "expression-not-assigned" and remove check from the disabled list. And I personally think it is much more readable now and is less lines of code.
* chore: add initial pylint checkJohn L. Villalovos2021-12-072-13/+21
| | | | | | Initial pylint check is added. A LONG list of disabled checks is also added. In the future we should work through the list and resolve the errors or disable them on a more granular level.
* chore: enable 'warn_redundant_casts' for mypyjlvillal/mypy_strict_two_stepsJohn L. Villalovos2021-12-051-1/+1
| | | | Enable 'warn_redundant_casts'for mypy and resolve one issue.
* Merge pull request #1709 from python-gitlab/docs/sphinx-annotationsNejc Habjan2021-12-0131-386/+379
|\ | | | | docs: only use type annotations for documentation