CHANGELOG¶
v5.3.1 (2025-01-07)¶
Bug Fixes¶
api: Allow configuration of keep_base_url from file (
f4f7d7a
)registry-protection: Fix api url (
8c1aaa3
)
See: https://docs.gitlab.com/ee/api/container_repository_protection_rules.html#list-container-repository-protection-rules
Chores¶
v5.3.0 (2024-12-28)¶
Chores¶
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate: Update httpx and respx again (
aa07449
)
Features¶
api: Support the new registry protection rule endpoint (
40af1c8
)
v5.2.0 (2024-12-17)¶
Chores¶
deps: Update all non-major dependencies (
1e02f23
)deps: Update all non-major dependencies (
6532e8c
)deps: Update all non-major dependencies (
8046387
)deps: Update codecov/codecov-action action to v5 (
735efff
)deps: Update dependency commitizen to v4 (
9306362
)deps: Update gitlab/gitlab-ee docker tag to v17.6.1-ee.0 (#3053,
f2992ae
)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
deps: Update pre-commit hook commitizen-tools/commitizen to v4 (
a8518f1
)docs: Fix CHANGELOG tracebacks codeblocks (
9fe372a
)
With v5.1.0 CHANGELOG.md was updated that mangled v1.10.0 triple backtick codeblock Traceback output that made sphinx fail [1] with a non-zero return code.
The resulting docs appears to be processes as text after the failing line [2]. While reviewing other backtick codeblocks fix v1.8.0 [3] to the original traceback.
[1] https://github.com/python-gitlab/python-gitlab/actions/runs/12060608158/job/33631303063#step:5:204 [2] https://python-gitlab.readthedocs.io/en/v5.1.0/changelog.html#v1-10-0-2019-07-22 [3] https://python-gitlab.readthedocs.io/en/v5.0.0/changelog.html#id258
renovate: Pin httpx until respx is fixed (
b70830d
)
Documentation¶
Features¶
feat(api): Added project template classes to templates.py * feat(api): Added project template managers to Project in project.py * docs(merge_requests): Add example of creating mr with description template * test(templates): Added unit tests for templates * docs(templates): added section for project templates
graphql: Add async client (
288f39c
)
v5.1.0 (2024-11-28)¶
Chores¶
deps: Update all non-major dependencies (
9061647
)deps: Update all non-major dependencies (
62da12a
)deps: Update all non-major dependencies (
7e62136
)deps: Update all non-major dependencies (
d4b52e7
)deps: Update all non-major dependencies (
541a7e3
)deps: Update dependency pytest-cov to v6 (
ffa88b3
)deps: Update gitlab/gitlab-ee docker tag to v17.5.1-ee.0 (
8111f49
)deps: Update gitlab/gitlab-ee docker tag to v17.5.2-ee.0 (#3041,
d39129b
)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
deps: Update pre-commit hook maxbrunet/pre-commit-renovate to v39 (
11458e0
)
Features¶
api: Get single project approval rule (
029695d
)api: Support list and delete for group service accounts (#2963,
499243b
)cli: Enable token rotation via CLI (
0cb8171
)const: Add new Planner role to access levels (
bdc8852
)files: Add support for more optional flags (
f51cd52
)
GitLab’s Repository Files API supports additional flags that weren’t implemented before. Notably, the “start_branch” flag is particularly useful, as previously one had to use the “project-branch” command alongside “project-file” to add a file on a separate branch.
[1] https://docs.gitlab.com/ee/api/repository_files.html
v5.0.0 (2024-10-28)¶
Bug Fixes¶
Co-authored-by: Patrick Evans patrick.evans@gehealthcare.com
Chores¶
Mark that Python 3.13 is supported.
Use Python 3.13 for the Mac and Windows tests.
Also remove the ‘py38’ tox environment. We no longer support Python 3.8.
Add testing of Python 3.14 (
14d2a82
)
Also fix annotations not working in Python 3.14 by using the annotation on the ‘class’ instead of on the ‘instance’
Closes: #3013
python-gitlab hasn’t supported the GitLab v3 API since 2018. The last version of python-gitlab to support it was v1.4
Support was removed in:
commit fe89b949922c028830dd49095432ba627d330186 Author: Gauvain Pocentek gauvain@pocentek.net
Date: Sat May 19 17:10:08 2018 +0200
Drop API v3 support
Drop the code, the tests, and update the documentation.
Documentation¶
Features¶
Python 3.8 is End-of-Life (EOL) as of 2024-10 as stated in https://devguide.python.org/versions/ and https://peps.python.org/pep-0569/#lifespan
By dropping support for Python 3.8 and requiring Python 3.9 or higher it allows python-gitlab to take advantage of new features in Python 3.9, which are documented at: https://docs.python.org/3/whatsnew/3.9.html
Closes: #2968
BREAKING CHANGE: As of python-gitlab 5.0.0, Python 3.8 is no longer supported. Python 3.9 or higher is required.
Testing¶
Add test for
to_json()
method (f4bfe19
)
This should get us to 100% test coverage on gitlab/base.py
BREAKING CHANGES¶
As of python-gitlab 5.0.0, Python 3.8 is no longer supported. Python 3.9 or higher is required.
v4.13.0 (2024-10-08)¶
Chores¶
deps: Update all non-major dependencies (
c3efb37
)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Features¶
api: Add support for project Pages API (
0ee0e02
)
v4.12.2 (2024-10-01)¶
Bug Fixes¶
When an error occurs, raise GitlabHeadError
in project.files.head()
method.
Closes: #3004
v4.12.1 (2024-09-30)¶
Bug Fixes¶
Chores¶
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
deps: Update gitlab/gitlab-ee docker tag to v17.4.1-ee.0 (
64eed5d
)
v4.12.0 (2024-09-28)¶
Bug Fixes¶
fix(api): head requests for projectfilemanager
Co-authored-by: Patrick Evans patrick.evans@gehealthcare.com
Co-authored-by: Nejc Habjan hab.nejc@gmail.com
Chores¶
pylint 3.3.1 appears to have added “too-many-positional-arguments” check with a value of 5.
I don’t disagree with this, but we have many functions which exceed this value. We might think about converting some of positional arguments over to keyword arguments in the future. But that is for another time.
For now disable the check across the project.
Features¶
v4.11.1 (2024-09-13)¶
Bug Fixes¶
client: Ensure type evaluations are postponed (
b41b2de
)
v4.11.0 (2024-09-13)¶
Chores¶
Documentation¶
objects: Fix typo in get latest pipeline (
b9f5c12
)
Features¶
Refactoring¶
client: Move retry logic into utility (
3235c48
)
v4.10.0 (2024-08-28)¶
Chores¶
deps: Update all non-major dependencies (
2ade0d9
)deps: Update all non-major dependencies (
0578bf0
)deps: Update all non-major dependencies (
31786a6
)deps: Update dependency myst-parser to v4 (
930d4a2
)deps: Update dependency sphinx to v8 (
cb65ffb
)deps: Update dependency types-setuptools to v73 (
d55c045
)deps: Update gitlab/gitlab-ee docker tag to v17.2.2-ee.0 (
b2275f7
)deps: Update gitlab/gitlab-ee docker tag to v17.3.0-ee.0 (
e5a46f5
)deps: Update gitlab/gitlab-ee docker tag to v17.3.1-ee.0 (
3fdd130
)deps: Update python-semantic-release/upload-to-gh-release digest to 17c75b7 (
12caaa4
)release: Track tags for renovate (
d600444
)
Documentation¶
faq: Correct the attribute fetching example (
43a16ac
)
There is an example about object attributes in the FAQ. It shows how to properly fetch all attributes of all projects, by using list() followed by a get(id) call.
Unfortunately this example used a wrong variable name, which caused it not to work and which could have made it slightly confusing to readers. This commit fixes that, by changing the variable name.
Now the example uses one variable for two Python objects. As they correspond to the same GitLab object and the intended behavior is to obtain that very object, just with all attributes, this is fine and is probably what readers will find most useful in this context.
Features¶
api: Project/group hook test triggering (
9353f54
)
Add the ability to trigger tests of project and group hooks.
Fixes #2924
Testing¶
cli: Allow up to 30 seconds for a project export (
bdc155b
)
Before we allowed a maximum of around 15 seconds for the project-export. Often times the CI was failing with this value.
Change it to a maximum of around 30 seconds.
v4.9.0 (2024-08-06)¶
Chores¶
ci: Make pre-commit check happy (
67370d8
)
pre-commit incorrectly wants double back-quotes inside the code section. Rather than fight it, just use single quotes.
deps: Update all non-major dependencies (
f95ca26
)deps: Update all non-major dependencies (
7adc86b
)deps: Update all non-major dependencies (
e820db0
)deps: Update dependency types-setuptools to v71 (
d6a7dba
)deps: Update gitlab/gitlab-ee docker tag to v17.2.1-ee.0 (
d13a656
)deps: Update pre-commit hook maxbrunet/pre-commit-renovate to v38 (
f13968b
)deps: Update python-semantic-release/upload-to-gh-release digest to 0dcddac (
eb5c6f7
)deps: Update python-semantic-release/upload-to-gh-release digest to e2355e1 (
eb18552
)
Features¶
snippets: Add support for listing all instance snippets (
64ae61e
)
v4.8.0 (2024-07-16)¶
Bug Fixes¶
Have
participants()
method usehttp_list()
(d065275
)
Previously it was using http_get()
but the participants
API returns a list of participants. Also
by using this then we will warn if only a subset of the participants are returned.
Closes: #2913
Issues
closed_by()/related_merge_requests()
usehttp_list
(de2e4dd
)
The closed_by()
and related_merge_requests()
API calls return lists. So use the http_list()
method.
This will also warn the user if only a subset of the data is returned.
cli: Generate UserWarning if
list
does not return all entries (e5a4379
)
Previously in the CLI, calls to list()
would have get_all=False
by default. Therefore hiding the
fact that not all items are being returned if there were more than 20 items.
Added --no-get-all
option to list
actions. Along with the already existing --get-all
.
Closes: #2900
files: Cr: add explicit comparison to
None
(51d8f88
)
Co-authored-by: Nejc Habjan hab.nejc@gmail.com
files: Make
ref
parameter optional in get raw file api (00640ac
)
The ref
parameter was made optional in gitlab v13.11.0.
Chores¶
Add
show_caller
argument toutils.warn()
(7d04315
)
This allows us to not add the caller’s location to the UserWarning message.
Saw the following error in the log: [#2618] Removing the label “Stale” from this issue… ##[error][#2618] Error when removing the label: “Label does not exist”
My theory is that the case doesn’t match (“Stale” != “stale”) and that is why it failed. Our label is “stale” so update this to match. Thought of changing the label name on GitHub but then would also require a change here to the “any-of-labels”. So it seemed simpler to just change it here.
It is confusing though that it detected the label “stale”, but then couldn’t delete it.
ci: Stale: allow issues/PRs that have stale label to be closed (
2ab88b2
)
If a stale
label is manually applied, allow the issue or PR to be closed by the stale job.
Previously it would require the stale
label and to also have one of ‘need info’ or ‘Waiting for
response’ labels added.
ci: Use codecov token when available (
b74a6fb
)deps: Update all non-major dependencies (
4a2b213
)deps: Update all non-major dependencies (
0f59069
)deps: Update all non-major dependencies (
cf87226
)deps: Update gitlab/gitlab-ee docker tag to v17.1.1-ee.0 (
5e98510
)deps: Update gitlab/gitlab-ee docker tag to v17.1.2-ee.0 (
6fedfa5
)deps: Update python-semantic-release/upload-to-gh-release digest to c7c3b69 (
23393fa
)deps: Update python-semantic-release/upload-to-gh-release digest to fe6cc89 (
3f3ad80
)
Documentation¶
Document how to use
sudo
if modifying an object (d509da6
)
Add a warning about using sudo
when saving.
Give an example of how to get
an object, modify it, and then save
it using sudo
Closes: #532
Variables: add note about
filter
for updating (c378817
)
Add a note about using filter
when updating a variable.
Closes: #2835
Closes: #1387
Closes: #1125
Features¶
Refactoring¶
package_protection_rules: Add missing attributes (
c307dd2
)
Testing¶
v4.7.0 (2024-06-28)¶
Bug Fixes¶
Add ability to add help to custom_actions (
9acd2d2
)
Now when registering a custom_action can add help text if desired.
Also delete the VerticalHelpFormatter as no longer needed. When the help value is set to None
or
some other value, the actions will get printed vertically. Before when the help value was not set
the actions would all get put onto one line.
Chores¶
Add a help message for
gitlab project-key enable
(1291dbb
)
Add some help text for gitlab project-key enable
. This both adds help text and shows how to use
the new help
feature.
Example:
$ gitlab project-key –help usage: gitlab project-key [-h] {list,get,create,update,delete,enable} …
options: -h, –help show this help message and exit
action: {list,get,create,update,delete,enable} Action to execute on the GitLab resource. list List the GitLab resources get Get a GitLab resource create Create a GitLab resource update Update a GitLab resource delete Delete a GitLab resource enable Enable a deploy key for the project
Sort CLI behavior-related args to remove (
9b4b0ef
)
Sort the list of CLI behavior-related args that are to be removed.
deps: Update all non-major dependencies (
88de2f0
)deps: Update all non-major dependencies (
a510f43
)deps: Update all non-major dependencies (
d4fdf90
)deps: Update all non-major dependencies (
d5de288
)deps: Update dependency types-setuptools to v70 (
7767514
)deps: Update gitlab/gitlab-ee docker tag to v17.0.1-ee.0 (
df0ff4c
)deps: Update gitlab/gitlab-ee docker tag to v17.0.2-ee.0 (
51779c6
)deps: Update python-semantic-release/upload-to-gh-release digest to 477a404 (
02a551d
)deps: Update python-semantic-release/upload-to-gh-release digest to 6b7558f (
fd0f0b0
)
Features¶
Add
--no-mask-credentials
CLI argument (18aa1fc
)
This gives the ability to not mask credentials when using the --debug
argument.
api: Add support for latest pipeline (
635f5a7
)
v4.6.0 (2024-05-28)¶
Bug Fixes¶
Don’t raise
RedirectError
for redirectedHEAD
requests (8fc13b9
)Handle large number of approval rules (
ef8f0e1
)
Use iterator=True
when going through the list of current approval rules. This allows it to handle
more than the default of 20 approval rules.
Closes: #2825
cli: Don’t require
--id
when enabling a deploy key (98fc578
)
No longer require --id
when doing: gitlab project-key enable
Now only the –project-id and –key-id are required.
deps: Update minimum dependency versions in pyproject.toml (
37b5a70
)
Update the minimum versions of the dependencies in the pyproject.toml file.
This is related to PR #2878
projects: Fix ‘import_project’ file argument type for typings (
33fbc14
)
Signed-off-by: Adrian DC radian.dc@gmail.com
Chores¶
Add an initial .git-blame-ignore-revs (
74db84c
)
This adds the .git-blame-ignore-revs
file which allows ignoring certain commits when doing a git blame --ignore-revs
Ignore the commit that requires keyword arguments for register_custom_action()
https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view
Add type info for ProjectFile.content (
62fa271
)
Closes: #2821
Correct type-hint for
job.trace()
(840572e
)
Closes: #2808
We no longer support Python versions before 3.8. So it isn’t needed anymore.
Require keyword arguments for register_custom_action (
7270523
)
This makes it more obvious when reading the code what each argument is for.
Update commit reference in git-blame-ignore-revs (
d0fd5ad
)cli: Add ability to not add
_id_attr
as an argument (2037352
)
In some cases we don’t want to have _id_attr
as an argument.
Add ability to have it not be added as an argument.
cli: Add some simple help for the standard operations (
5a4a940
)
Add help for the following standard operations: * list: List the GitLab resources * get: Get a GitLab resource * create: Create a GitLab resource * update: Update a GitLab resource * delete: Delete a GitLab resource
For example: $ gitlab project-key –help usage: gitlab project-key [-h] {list,get,create,update,delete,enable} …
options: -h, –help show this help message and exit
action: list get create update delete enable Action to execute on the GitLab resource. list List the GitLab resources get Get a GitLab resource create Create a GitLab resource update Update a GitLab resource delete Delete a GitLab resource
cli: On the CLI help show the API endpoint of resources (
f1ef565
)
This makes it easier for people to map CLI command names to the API.
Looks like this: $ gitlab –help
deps: Update all non-major dependencies (
4c7014c
)deps: Update all non-major dependencies (
ba1eec4
)deps: Update dependency requests to v2.32.0 [security] (
1bc788c
)deps: Update gitlab/gitlab-ee docker tag to v17 (
5070d07
)deps: Update python-semantic-release/upload-to-gh-release digest to 673709c (
1b550ac
)
Features¶
More usernames support for MR approvals (
12d195a
)
I don’t think commit a2b8c8ccfb5d went far enough to enable usernames support. We create and edit a lot of approval rules based on an external service (similar to CODE_OWNERS), but only have the usernames available, and currently, have to look up each user to get their user ID to populate user_ids for .set_approvers() calls. Would very much like to skip the lookup and just send the usernames, which this change should allow.
See: https://docs.gitlab.com/ee/api/merge_request_approvals.html#create-project-level-rule
Signed-off-by: Jarod Wilson jarod@redhat.com
Co-authored-by: Cristiano Casella cristiano.casella@seacom.it
Co-authored-by: Nejc Habjan hab.nejc@gmail.com
Co-authored-by: Nejc Habjan hab.nejc@siemens.com
v4.5.0 (2024-05-13)¶
Bug Fixes¶
Consider
scope
an ArrayAttribute in PipelineJobManager (c5d0404
)
List query params like ‘scope’ were not being handled correctly for pipeline/jobs endpoint. This change ensures multiple values are appended with ‘[]’, resulting in the correct URL structure.
Signed-off-by: Guilherme Gallo guilherme.gallo@collabora.com
Background: If one queries for pipeline jobs with scope=["failed", "success"]
One gets: GET /api/v4/projects/176/pipelines/1113028/jobs?scope=success&scope=failed
But it is supposed to get: GET /api/v4/projects/176/pipelines/1113028/jobs?scope[]=success&scope[]=failed
The current version only considers the last element of the list argument.
User.warn() to show correct filename of issue (
529f1fa
)
Previously would only go to the 2nd level of the stack for determining the offending filename and line number. When it should be showing the first filename outside of the python-gitlab source code. As we want it to show the warning for the user of the libraries code.
Update test to show it works as expected.
api: Fix saving merge request approval rules (
b8b3849
)
Closes #2548
api: Update manual job status when playing it (
9440a32
)
fix(cli): allow exclusive arguments as optional
The CLI takes its arguments from the RequiredOptional, which has three fields: required, optional, and exclusive. In practice, the exclusive options are not defined as either required or optional, and would not be allowed in the CLI. This changes that, so that exclusive options are also added to the argument parser.
fix(cli): inform argument parser that options are mutually exclusive
fix(cli): use correct exclusive options, add unit test
Closes #2769
test: Use different ids for merge request, approval rule, project (
c23e6bd
)
The original bug was that the merge request identifier was used instead of the approval rule
identifier. The test didn’t notice that because it used 1
for all identifiers. Make these
identifiers different so that a mixup will become apparent.
Build System¶
Add “–no-cache-dir” to pip commands in Dockerfile (
4ef94c8
)
This would not leave cache files in the built docker image.
Additionally, also only build the wheel in the build phase.
On my machine, before this PR, size is 74845395; after this PR, size is 72617713.
Chores¶
Even though there isn’t a Python 3.13 at this time, this is done for the future. tox is already configured to just warn about missing Python versions, but not fail if they don’t exist.
Add tox
labels
to enable running groups of environments (d7235c7
)
tox now has a feature of labels
which allows running groups of environments using the command tox -m LABEL_NAME
. For example tox -m lint
which has been setup to run the linters.
Bumped the minimum required version of tox to be 4.0, which was released over a year ago.
Update
mypy
to 1.9.0 and resolve one issue (dd00bfc
)
mypy 1.9.0 flagged one issue in the code. Resolve the issue. Current unit tests already check that a
None
value returns text/plain
. So function is still working as expected.
Update version of
black
forpre-commit
(3501716
)
The version of black
needs to be updated to be in sync with what is in requirements-lint.txt
deps: Update all non-major dependencies (
4f338ae
)deps: Update all non-major dependencies (
65d0e65
)deps: Update all non-major dependencies (
1f0343c
)deps: Update all non-major dependencies (
0e9f4da
)deps: Update all non-major dependencies (
d5b5fb0
)deps: Update all non-major dependencies (
14a3ffe
)deps: Update all non-major dependencies (
3c4dcca
)deps: Update all non-major dependencies (
04c569a
)deps: Update all non-major dependencies (
3c4b27e
)deps: Update all non-major dependencies (
7dc2fa6
)deps: Update all non-major dependencies (
48726fd
)deps: Update codecov/codecov-action action to v4 (
d2be1f7
)deps: Update dependency black to v24 (
f59aee3
)deps: Update dependency black to v24.3.0 [security] (
f6e8692
)deps: Update dependency furo to v2024 (
f6fd02d
)deps: Update dependency jinja2 to v3.1.4 [security] (
8ea10c3
)deps: Update dependency myst-parser to v3 (
9289189
)deps: Update dependency pytest to v8 (
253babb
)deps: Update dependency pytest-cov to v5 (
db32000
)deps: Update dependency pytest-docker to v3 (
35d2aec
)deps: Update gitlab/gitlab-ee docker tag to v16 (
ea8c4c2
)deps: Update gitlab/gitlab-ee docker tag to v16.11.1-ee.0 (
1ed8d6c
)deps: Update gitlab/gitlab-ee docker tag to v16.11.2-ee.0 (
9be48f0
)deps: Update python-semantic-release/python-semantic-release action to v9 (
e11d889
)
Documentation¶
Add FAQ about conflicting parameters (
683ce72
)
We have received multiple issues lately about this. Add it to the FAQ.
Correct rotate token example (
c53e695
)
Rotate token returns a dict. Change example to print the entire dict.
Closes: #2836
How to run smoke tests (
2d1f487
)
Signed-off-by: Tim Knight tim.knight1@engineering.digital.dwp.gov.uk
Note how to use the Docker image from within GitLab CI (
6d4bffb
)
Ref: #2823
To correctly format a code block have to use ::
README: Tweak GitLab CI usage docs (
d9aaa99
)
Features¶
feat(api): allow updating protected branches
Closes #2390
cli: Allow skipping initial auth calls (
001e596
)job_token_scope: Support Groups in job token allowlist API (#2816,
2d1b749
)
feat(job_token_scope): support job token access allowlist API
Signed-off-by: Tim Knight tim.knight1@engineering.digital.dwp.gov.uk
l.dwp.gov.uk> Co-authored-by: Nejc Habjan nejc.habjan@siemens.com
Testing¶
Don’t use weak passwords (
c64d126
)
Newer versions of GitLab will refuse to create a user with a weak password. In order for us to move to a newer GitLab version in testing use a stronger password for the tests that create a user.
Remove approve step (
48a6705
)
Signed-off-by: Tim Knight tim.knight1@engineering.digital.dwp.gov.uk
Tidy up functional tests (
06266ea
)
Signed-off-by: Tim Knight tim.knight1@engineering.digital.dwp.gov.uk
Update api tests for GL 16.10 (
4bef473
)Make sure we’re testing python-gitlab functionality, make sure we’re not awaiting on Gitlab Async functions - Decouple and improve test stability
Signed-off-by: Tim Knight tim.knight1@engineering.digital.dwp.gov.uk
Update tests for gitlab 16.8 functionality (
f8283ae
)use programmatic dates for expires_at in tokens tests - set PAT for 16.8 into tests
Signed-off-by: Tim Knight tim.knight1@engineering.digital.dwp.gov.uk
v4.4.0 (2024-01-15)¶
Bug Fixes¶
cli: Support binary files with
@
notation (57749d4
)
Support binary files being used in the CLI with arguments using the @
notation. For example
--avatar @/path/to/avatar.png
Also explicitly catch the common OSError exception, which is the parent exception for things like: FileNotFoundError, PermissionError and more exceptions.
Remove the bare exception handling. We would rather have the full traceback of any exceptions that we don’t know about and add them later if needed.
Closes: #2752
Chores¶
ci: Add Python 3.13 development CI job (
ff0c11b
)
Add a job to test the development versions of Python 3.13.
ci: Align upload and download action versions (
dcca59d
)deps: Update actions/upload-artifact action to v4 (
7114af3
)deps: Update all non-major dependencies (
550f935
)deps: Update all non-major dependencies (
cbc13a6
)deps: Update all non-major dependencies (
369a595
)deps: Update dependency flake8 to v7 (
20243c5
)deps: Update dependency jinja2 to v3.1.3 [security] (
880913b
)deps: Update pre-commit hook pycqa/flake8 to v7 (
9a199b6
)
Features¶
api: Add reviewer_details manager for mergrequest to get reviewers of merge request (
adbd90c
)
Those changes implements ‘GET /projects/:id/merge_requests/:merge_request_iid/reviewers’ gitlab API call. Naming for call is not reviewers because reviewers atribute already presen in merge request response
v4.3.0 (2023-12-28)¶
Bug Fixes¶
cli: Add ability to disable SSL verification (
3fe9fa6
)
Add a --no-ssl-verify
option to disable SSL verification
Closes: #2714
Chores¶
deps: Update actions/setup-python action to v5 (
fad1441
)deps: Update actions/stale action to v9 (
c01988b
)deps: Update all non-major dependencies (
d7bdb02
)deps: Update all non-major dependencies (
9e067e5
)deps: Update all non-major dependencies (
bb2af7b
)deps: Update all non-major dependencies (
5ef1b4a
)deps: Update dependency types-setuptools to v69 (
de11192
)
Documentation¶
Fix rst link typo in CONTRIBUTING.rst (
2b6da6e
)
Features¶
feat(api): add support for the Draft notes API
fix(client): handle empty 204 reponses in PUT requests
v4.2.0 (2023-11-28)¶
Chores¶
Features¶
Add pipeline status as Enum (
4954bbc
)
https://docs.gitlab.com/ee/api/pipelines.html
Added UploadMixin in mixin module Added UploadMixin dependency for Project, ProjectWiki, GroupWiki Added api tests for wiki upload Added unit test for mixin Added docs sections to wikis.rst
v4.1.1 (2023-11-03)¶
Bug Fixes¶
build: Include py.typed in dists (
b928639
)
Chores¶
Documentation¶
users: Add missing comma in v4 API create runner examples (
b1b2edf
)
The examples which show usage of new runner registration api endpoint are missing commas. This change adds the missing commas.
v4.1.0 (2023-10-28)¶
Bug Fixes¶
Remove depricated MergeStatus (
c6c012b
)
Chores¶
Continuous Integration¶
Remove unneeded GitLab auth (
fd7bbfc
)
Features¶
Add Merge Request merge_status and detailed_merge_status values as constants (
e18a424
)
v4.0.0 (2023-10-17)¶
Bug Fixes¶
cli: Add _from_parent_attrs to user-project manager (#2558,
016d90c
)cli: Fix action display in –help when there are few actions (
b22d662
)
fixes #2656
cli: Remove deprecated
--all
option in favor of--get-all
(e9d48cf
)
BREAKING CHANGE: The --all
option is no longer available in the CLI. Use --get-all
instead.
Chores¶
Add package pipelines API link (
2a2404f
)Change
_update_uses
to_update_method
and use an Enum (7073a2d
)
Change the name of the _update_uses
attribute to _update_method
and store an Enum in the
attribute to indicate which type of HTTP method to use. At the moment it supports POST
and
PUT
. But can in the future support PATCH
.
Closes: #2625
Update PyYAML to 6.0.1 (
3b8939d
)
Fixes issue with CI having error: AttributeError: cython_sources
Closes: #2624
ci: Adapt release workflow and config for v8 (
827fefe
)ci: Fix pre-commit deps and python version (
1e7f257
)ci: Follow upstream config for release build_command (
3e20a76
)ci: Remove Python 3.13 dev job (
e8c50f2
)ci: Update release build for python-semantic-release v8 (#2692,
bf050d1
)deps: Bring furo up to date with sphinx (
a15c927
)deps: Bring myst-parser up to date with sphinx 7 (
da03e9c
)deps: Pin pytest-console-scripts for 3.7 (
6d06630
)deps: Update actions/checkout action to v3 (
e2af1e8
)deps: Update actions/checkout action to v4 (
af13914
)deps: Update actions/setup-python action to v4 (
e0d6783
)deps: Update actions/upload-artifact action to v3 (
b78d6bf
)deps: Update all non-major dependencies (
1348a04
)deps: Update all non-major dependencies (
ff45124
)deps: Update all non-major dependencies (
0d49164
)deps: Update all non-major dependencies (
6093dbc
)deps: Update all non-major dependencies (
bb728b1
)deps: Update all non-major dependencies (
9083787
)deps: Update all non-major dependencies (
b6a3db1
)deps: Update all non-major dependencies (
16f2d34
)deps: Update all non-major dependencies (
5b33ade
)deps: Update all non-major dependencies (
3732841
)deps: Update all non-major dependencies (
511f45c
)deps: Update all non-major dependencies (
d4a7410
)deps: Update all non-major dependencies (
12846cf
)deps: Update all non-major dependencies (
33d2aa2
)deps: Update all non-major dependencies (
5ff56d8
)deps: Update all non-major dependencies (
7586a5c
)deps: Update all non-major dependencies to v23.9.1 (
a16b732
)deps: Update dependency build to v1 (
2e856f2
)deps: Update dependency commitizen to v3.10.0 (
becd8e2
)deps: Update dependency pylint to v3 (
491350c
)deps: Update dependency pytest-docker to v2 (
b87bb0d
)deps: Update dependency setuptools to v68 (
0f06082
)deps: Update dependency sphinx to v7 (
2918dfd
)deps: Update dependency types-setuptools to v68 (
bdd4eb6
)deps: Update dependency ubuntu to v22 (
8865552
)deps: Update pre-commit hook commitizen-tools/commitizen to v3.10.0 (
626c2f8
)deps: Update pre-commit hook maxbrunet/pre-commit-renovate to v36 (
db58cca
)deps: Update pre-commit hook maxbrunet/pre-commit-renovate to v37 (
b4951cd
)deps: Update pre-commit hook pycqa/pylint to v3 (
0f4a346
)deps: Update relekang/python-semantic-release action to v8 (
c57c85d
)helpers: Fix previously undetected flake8 issue (
bf8bd73
)rtd: Use readthedocs v2 syntax (
6ce2149
)
Documentation¶
New linting package update detected the issue.
access_token: Adopt token docs to 16.1 (
fe7a971
)
expires_at is now required Upstream MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/124964
advanced: Document new netrc behavior (
45b8930
)
BREAKING CHANGE: python-gitlab now explicitly passes auth to requests, meaning it will only read netrc credentials if no token is provided, fixing a bug where netrc credentials took precedence over OAuth tokens. This also affects the CLI, where all environment variables now take precedence over netrc files.
files: Fix minor typo in variable declaration (
118ce42
)
Features¶
Added iteration to issue and group filters (
8d2d297
)Officially support Python 3.12 (
2a69c0e
)Remove support for Python 3.7, require 3.8 or higher (
058d5a5
)
Python 3.8 is End-of-Life (EOL) as of 2023-06-27 as stated in https://devguide.python.org/versions/ and https://peps.python.org/pep-0537/
By dropping support for Python 3.7 and requiring Python 3.8 or higher it allows python-gitlab to take advantage of new features in Python 3.8, which are documented at: https://docs.python.org/3/whatsnew/3.8.html
BREAKING CHANGE: As of python-gitlab 4.0.0, Python 3.7 is no longer supported. Python 3.8 or higher is required.
Use requests AuthBase classes (
5f46cfd
)api: Add optional GET attrs for /projects/:id/ci/lint (
40a102d
)api: Add ProjectPackagePipeline (
5b4addd
)
Add ProjectPackagePipeline, which is scheduled to be included in GitLab 16.0
api: Add support for job token scope settings (
59d6a88
)api: Add support for new runner creation API (#2635,
4abcd17
)
Co-authored-by: Nejc Habjan hab.nejc@gmail.com
api: Support project remote mirror deletion (
d900910
)client: Mask tokens by default when logging (
1611d78
)packages: Allow uploading bytes and files (
61e0fae
)
This commit adds a keyword argument to GenericPackageManager.upload() to allow uploading bytes and file-like objects to the generic package registry. That necessitates changing file path to be a keyword argument as well, which then cascades into a whole slew of checks to not allow passing both and to not allow uploading file-like objects as JSON data.
Closes https://github.com/python-gitlab/python-gitlab/issues/1815
releases: Add support for direct_asset_path (
d054917
)
This commit adds support for the “new” alias for filepath
: direct_asset_path
(added in 15.10) in
release links API.
Refactoring¶
artifacts: Remove deprecated
artifact()
in favor ofartifacts.raw()
(90134c9
)
BREAKING CHANGE: The deprecated project.artifact()
method is no longer available. Use
project.artifacts.raw()
instead.
artifacts: Remove deprecated
artifacts()
in favor ofartifacts.download()
(42639f3
)
BREAKING CHANGE: The deprecated project.artifacts()
method is no longer available. Use
project.artifacts.download()
instead.
build: Build project using PEP 621 (
71fca8c
)
BREAKING CHANGE: python-gitlab now stores metadata in pyproject.toml as per PEP 621, with setup.py removed. pip version v21.1 or higher is required if you want to perform an editable install.
const: Remove deprecated global constant import (
e4a1f6e
)
BREAKING CHANGE: Constants defined in gitlab.const
can no longer be imported globally from
gitlab
. Import them from gitlab.const
instead.
groups: Remove deprecated LDAP group link add/delete methods (
5c8b7c1
)
BREAKING CHANGE: The deprecated group.add_ldap_group_link()
and group.delete_ldap_group_link()
methods are no longer available. Use group.ldap_group_links.create()
and
group.ldap_group_links.delete()
instead.
lint: Remove deprecated
lint()
in favor ofci_lint.create()
(0b17a2d
)
BREAKING CHANGE: The deprecated lint()
method is no longer available. Use ci_lint.create()
instead.
list:
as_list
support is removed. (9b6d89e
)
In list()
calls support for the as_list
argument has been removed. as_list
was previously
deprecated and now the use of iterator
will be required if wanting to have same functionality as
using as_list
BREAKING CHANGE: Support for the deprecated as_list
argument in list()
calls has been removed.
Use iterator
instead.
projects: Remove deprecated
project.transfer_project()
in favor ofproject.transfer()
(27ed490
)
BREAKING CHANGE: The deprecated project.transfer_project()
method is no longer available. Use
project.transfer()
instead.
Testing¶
Warnings were being raised. Resolve those warnings.
Fix failing tests that use 204 (No Content) plus content (
3074f52
)
urllib3>=2 now checks for expected content length. Also codes 204 and 304 are set to expect a content length of 0 [1]
So in the unit tests stop setting content to return in these situations.
[1] https://github.com/urllib3/urllib3/blob/88a707290b655394aade060a8b7eaee83152dc8b/src/urllib3/response.py#L691-L693
cli: Add test for user-project list (
a788cff
)
BREAKING CHANGES¶
advanced: Python-gitlab now explicitly passes auth to requests, meaning it will only read netrc credentials if no token is provided, fixing a bug where netrc credentials took precedence over OAuth tokens. This also affects the CLI, where all environment variables now take precedence over netrc files.
build: Python-gitlab now stores metadata in pyproject.toml as per PEP 621, with setup.py removed. pip version v21.1 or higher is required if you want to perform an editable install.
v3.15.0 (2023-06-09)¶
Chores¶
Update copyright year to include 2023 (
511c6e5
)Update sphinx from 5.3.0 to 6.2.1 (
c44a290
)ci: Use OIDC trusted publishing for pypi.org (#2559,
7be09e5
)
chore(ci): use OIDC trusted publishing for pypi.org
chore(ci): explicitly install setuptools in tests
deps: Update all non-major dependencies (
e3de6ba
)deps: Update dependency commitizen to v3 (
784d59e
)deps: Update dependency myst-parser to v1 (
9c39848
)deps: Update dependency requests-toolbelt to v1 (
86eba06
)deps: Update dependency types-setuptools to v67 (
c562424
)deps: Update pre-commit hook commitizen-tools/commitizen to v3 (
1591e33
)deps: Update pre-commit hook maxbrunet/pre-commit-renovate to v35 (
8202e3f
)
Documentation¶
Remove exclusive EE about issue links (
e0f6f18
)
Features¶
Add support for
select="package_file"
in package upload (3a49f09
)
Add ability to use select="package_file"
when uploading a generic package as described in:
https://docs.gitlab.com/ee/user/packages/generic_packages/index.html
Closes: #2557
Usernames support for MR approvals (
a2b8c8c
)
This can be used instead of ‘user_ids’
See: https://docs.gitlab.com/ee/api/merge_request_approvals.html#create-project-level-rule
api: Add support for events scope parameter (
348f56e
)
v3.14.0 (2023-04-11)¶
Bug Fixes¶
Support int for
parent_id
inimport_group
(90f96ac
)
This will also fix other use cases where an integer is passed in to MultipartEncoder.
Added unit tests to show it works.
Closes: #2506
fix(cli): Add ability to escape at-prefixed parameter (#2511)
Co-authored-by: Nejc Habjan hab.nejc@gmail.com
Chores¶
Add Contributor Covenant 2.1 as Code of Conduct (
fe334c9
)
See https://www.contributor-covenant.org/version/2/1/code_of_conduct/
Add Python 3.12 testing (
0867564
)
Add a unit test for Python 3.12. This will use the latest version of Python 3.12 that is available from https://github.com/actions/python-versions/
At this time it is 3.12.0-alpha.4 but will move forward over time until the final 3.12 release and updates. So 3.12.0, 3.12.1, … will be matched.
For users who use tox
having pre-commit
as part of the default environment list is redundant as
it will run the same tests again that are being run in other environments. For example: black,
flake8, pylint, and more.
Use a dataclass to return values from
prepare_send_data
(f2b5e4f
)
I found the tuple of three values confusing. So instead use a dataclass to return the three values. It is still confusing but a little bit less so.
Also add some unit tests
.github: Actually make PR template the default (
7a8a862
)ci: Wait for all coverage reports in CI status (
511764d
)contributing: Refresh development docs (
d387d91
)deps: Update actions/stale action to v8 (
7ac4b86
)deps: Update all non-major dependencies (
8b692e8
)deps: Update all non-major dependencies (
2f06999
)
chore(deps): update all non-major dependencies * chore(fixtures): downgrade GitLab for now * chore(deps): ungroup typing deps, group gitlab instead * chore(deps): downgrade argcomplete for now
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nejc Habjan nejc.habjan@siemens.com
Update the dependency versions: black: 23.1.0
commitizen: 2.40.0
They needed to be updated together as just updating black
caused a dependency conflict.
Updated files by running black
and committing the changes.
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
deps: Update dependency furo to v2023 (
7a1545d
)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
deps: Update mypy (1.0.0) and responses (0.22.0) (
9c24657
)
Update the requirements-*
files.
In order to update mypy==1.0.0 we need to also update responses==0.22.0
Fix one issue found by mypy
Leaving updates for precommit
to be done in a separate commit by someone.
deps: Update pre-commit hook psf/black to v23 (
217a787
)github: Add default pull request template (
bf46c67
)pre-commit: Bumping versions (
e973729
)renovate: Bring back custom requirements pattern (
ae0b21c
)renovate: Do not ignore tests dir (
5b8744e
)renovate: Swith to gitlab-ee (
8da48ee
)setup: Depend on typing-extensions for 3.7 until EOL (
3abc557
)
Documentation¶
Fix update badge behaviour (
3d7ca1c
)
docs: fix update badge behaviour
Earlier: badge.image_link = new_link
Now: badge.image_url = new_image_url badge.link_url = new_link_url
Features¶
Add resource_weight_event for ProjectIssue (
6e5ef55
)backends: Use PEP544 protocols for structural subtyping (#2442,
4afeaff
)
The purpose of this change is to track API changes described in https://github.com/python-gitlab/python-gitlab/blob/main/docs/api-levels.rst, for example, for package versioning and breaking change announcements in case of protocol changes.
This is MVP implementation to be used by #2435.
cli: Add setting of
allow_force_push
for protected branch (929e07d
)
For the CLI: add allow_force_push
as an optional argument for creating a protected branch.
API reference: https://docs.gitlab.com/ee/api/protected_branches.html#protect-repository-branches
Closes: #2466
In order to support some new API calls we need to support the HTTP PATCH
method.
Closes: #2469
Refactoring¶
client: Let mypy know http_password is set (
2dd177b
)
Testing¶
functional: Clarify MR fixture factory name (
d8fd1a8
)meta: Move meta suite into unit tests (
847004b
)
They’re always run with it anyway, so it makes no difference.
v3.13.0 (2023-01-30)¶
Bug Fixes¶
Change return value to “None” in case getattr returns None to prevent error (
3f86d36
)Typo fixed in docs (
ee5f444
)Use the ProjectIterationManager within the Project object (
44f05dc
)
The Project object was previously using the GroupIterationManager resulting in the incorrect API endpoint being used. Utilize the correct ProjectIterationManager instead.
Resolves #2403
Chores¶
If a caller calls a list()
method with both iterator=True
(or as_list=False
) and page=X
then
emit a UserWarning
as the options are mutually exclusive.
Add docs for schedule pipelines (
9a9a6a9
)Add test, docs, and helper for 409 retries (
3e1c625
)Make backends private (
1e629af
)Remove tox
envdir
values (3c7c7fc
)
tox > 4 no longer will re-use the tox directory :( What this means is that with the previous config if you ran: $ tox -e mypy; tox -e isort; tox -e mypy It would recreate the tox environment each time :(
By removing the envdir
values it will have the tox environments in separate directories and not
recreate them.
The have an FAQ entry about this: https://tox.wiki/en/latest/upgrading.html#re-use-of-environments
Update attributes for create and update projects (
aa44f2a
)Use SPDX license expression in project metadata (
acb3a4a
)ci: Complete all unit tests even if one has failed (#2438,
069c6c3
)deps: Update actions/download-artifact action to v3 (
64ca597
)deps: Update actions/stale action to v7 (
76eb024
)deps: Update all non-major dependencies (
ea7010b
)deps: Update all non-major dependencies (
122988c
)deps: Update all non-major dependencies (
49c0233
)deps: Update all non-major dependencies (
10c4f31
)deps: Update all non-major dependencies (
bbd01e8
)deps: Update all non-major dependencies (
6682808
)deps: Update all non-major dependencies (
1816107
)deps: Update all non-major dependencies (
21e767d
)deps: Update dessant/lock-threads action to v4 (
337b25c
)deps: Update pre-commit hook maxbrunet/pre-commit-renovate to v34.48.4 (
985b971
)deps: Update pre-commit hook pycqa/flake8 to v6 (
82c61e1
)tox: Ensure test envs have all dependencies (
63cf4e4
)
Documentation¶
faq: Describe and group common errors (
4c9a072
)
Features¶
Add keep_base_url when getting configuration from file (
50a0301
)Add resource iteration events (see https://docs.gitlab.com/ee/api/resource_iteration_events.html) (
ef5feb4
)Allow filtering pipelines by source (
b6c0872
)
See: https://docs.gitlab.com/ee/api/pipelines.html#list-project-pipelines Added in GitLab 14.3
Allow passing kwargs to Gitlab class when instantiating with
from_config
(#2392,e88d34e
)api: Add support for bulk imports API (
043de2d
)api: Add support for resource groups (
5f8b8f5
)api: Support listing pipelines triggered by pipeline schedules (
865fa41
)client: Automatically retry on HTTP 409 Resource lock (
dced76a
)
Fixes: #2325
Refactoring¶
Testing¶
v3.12.0 (2022-11-28)¶
Bug Fixes¶
Call was incorrectly using a
PUT
method when should have used aPOST
method. * Changed return type to adict
as GitLab only returns {‘status’: ‘success’} on success. Since the function didn’t work previously, this should not impact anyone. * Updated the test fixturemerge_request
to add ability to create a pipeline. * Added functional test formr.cancel_merge_when_pipeline_succeeds()
Fixes: #2349
cli: Enable debug before doing auth (
65abb85
)
Authentication issues are currently hard to debug since --debug
only has effect after gl.auth()
has been called.
For example, a 401 error is printed without any details about the actual HTTP request being sent:
$ gitlab –debug –server-url https://gitlab.com current-user get 401: 401 Unauthorized
By moving the call to gl.enable_debug()
the usual debug logs get printed before the final error
message.
Signed-off-by: Emanuele Aina emanuele.aina@collabora.com
cli: Expose missing mr_default_target_self project attribute (
12aea32
)
Example::
gitlab project update –id 616 –mr-default-target-self 1
References:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/58093 * https://gitlab.com/gitlab-org/gitlab/-/blob/v13.11.0-ee/doc/user/project/merge_requests/creating_merge_requests.md#new-merge-request-from-a-fork
https://gitlab.com/gitlab-org/gitlab/-/blob/v14.7.0-ee/doc/api/projects.md#get-single-project
Chores¶
Correct website for pylint (
fcd72fe
)
Use https://github.com/PyCQA/pylint as the website for pylint.
Validate httpx package is not installed by default (
0ecf3bb
)deps: Update all non-major dependencies (
d8a657b
)deps: Update all non-major dependencies (
b2c6d77
)deps: Update pre-commit hook maxbrunet/pre-commit-renovate to v34 (
623e768
)deps: Update pre-commit hook maxbrunet/pre-commit-renovate to v34.20.0 (
e6f1bd6
)deps: Update pre-commit hook maxbrunet/pre-commit-renovate to v34.24.0 (
a0553c2
)
Documentation¶
Use the term “log file” for getting a job log file (
9d2b1ad
)
The GitLab docs refer to it as a log file: https://docs.gitlab.com/ee/api/jobs.html#get-a-log-file
“trace” is the endpoint name but not a common term people will think of for a “log file”
api: Pushrules remove saying
None
is returned when not found (c3600b4
)
In groups.pushrules.get()
, GitLab does not return None
when no rules are found. GitLab returns a
404.
Update docs to not say it will return None
Also update docs in project.pushrules.get()
to be consistent. Not 100% sure if it returns None
or returns a 404, but we don’t need to document that.
Closes: #2368
groups: Describe GitLab.com group creation limitation (
9bd433a
)
Features¶
Implement secure files API (
d0a0348
)api: Add application statistics (
6fcf3b6
)api: Add support for getting a project’s pull mirror details (
060cfe1
)
Add the ability to get a project’s pull mirror details. This was added in GitLab 15.5 and is a PREMIUM feature.
https://docs.gitlab.com/ee/api/projects.html#get-a-projects-pull-mirror-details
Refactoring¶
Explicitly use ProjectSecureFile (
0c98b2d
)
Testing¶
api: Fix flaky test
test_cancel_merge_when_pipeline_succeeds
(6525c17
)
This is an attempt to fix the flaky test test_cancel_merge_when_pipeline_succeeds
. Were seeing a:
405 Method Not Allowed error when setting the MR to merge_when_pipeline_succeeds.
Closes: #2383
v3.11.0 (2022-10-28)¶
Bug Fixes¶
Intermittent failure in test_merge_request_reset_approvals (
3dde36e
)
Have been seeing intermittent failures in the test: tests/functional/api/test_merge_requests.py::test_merge_request_reset_approvals
Also saw a failure in: tests/functional/cli/test_cli_v4.py::test_accept_request_merge[subprocess]
Add a call to wait_for_sidekiq()
to hopefully resolve the issues.
Remove
project.approvals.set_approvals()
method (91f08f0
)
The project.approvals.set_approvals()
method used the /projects/:id/approvers
end point. That
end point was removed from GitLab in the 13.11 release, on 2-Apr-2021 in commit
27dc2f2fe81249bbdc25f7bd8fe799752aac05e6 via merge commit
e482597a8cf1bae8e27abd6774b684fb90491835. It was deprecated on 19-Aug-2019.
See merge request: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57473
Use epic id instead of iid for epic notes (
97cae38
)cli: Handle list response for json/yaml output (
9b88132
)
Handle the case with the CLI where a list response is returned from GitLab and json/yaml output is requested.
Add a functional CLI test to validate it works.
Closes: #2287
Chores¶
Add
not-callable
to pylint ignore list (f0c02a5
)
The not-callable
error started showing up. Ignore this error as it is invalid. Also mypy
tests
for these issues.
Closes: #2334
Add basic type checks to functional/api tests (
5b642a5
)Add basic type checks to meta tests (
545d6d6
)Add basic typing to functional tests (
ee143c9
)Add basic typing to smoke tests (
64e8c31
)Add basic typing to test root (
0b2f6bc
)Add responses to pre-commit deps (
4b8ddc7
)Fix flaky test (
fdd4114
)Narrow type hints for license API (
50731c1
)Renovate and precommit cleanup (
153d373
)Revert compose upgrade (
dd04e8e
)
This reverts commit f825d70e25feae8cd9da84e768ec6075edbc2200.
Simplify
wait_for_sidekiq
usage (196538b
)
Simplify usage of wait_for_sidekiq
by putting the assert if it timed out inside the function
rather than after calling it.
Have an option to go to the discussions * Have an option to go to the Gitter chat * Move the bug/issue template into the .github/ISSUE_TEMPLATE/ directory
Use kwargs for http_request docs (
124abab
)deps: Group non-major upgrades to reduce noise (
37d14bd
)deps: Pin and clean up test dependencies (
60b9197
)deps: Pin dependencies (
953f38d
)deps: Pin GitHub Actions (
8dbaa5c
)deps: Update all non-major dependencies (
dde3642
)deps: Update all non-major dependencies (
2966234
)deps: Update black to v22.10.0 (
531ee05
)deps: Update dependency commitizen to v2.35.0 (
4ce9559
)deps: Update dependency mypy to v0.981 (
da48849
)deps: Update dependency pylint to v2.15.3 (
6627a60
)deps: Update dependency types-requests to v2.28.11.2 (
d47c0f0
)deps: Update pre-commit hook maxbrunet/pre-commit-renovate to v33 (
932bbde
)deps: Update typing dependencies (
81285fa
)
Documentation¶
Add minimal docs about the
enable_debug()
method (b4e9ab7
)
Add some minimal documentation about the enable_debug()
method.
advanced: Add hint on type narrowing (
a404152
)api: Describe the list() and all() runners’ functions (
b6cc3f2
)api: Describe use of lower-level methods (
b7a6874
)api: Update
merge_requests.rst
:mr_id
tomr_iid
(b32234d
)
Typo: Author probably meant mr_iid
(i.e. project-specific MR ID)
and not mr_id
(i.e. server-wide MR ID)
Closes: https://github.com/python-gitlab/python-gitlab/issues/2295
Signed-off-by: Stavros Ntentos 133706+stdedos@users.noreply.github.com
Features¶
Refactoring¶
Testing¶
Make the test_project_push_rules
test work.
Use false instead of /usr/bin/false (
51964b3
)
On Debian systems false is located at /bin/false (coreutils package). This fixes unit test failure on Debian system:
FileNotFoundError: [Errno 2] No such file or directory: ‘/usr/bin/false’
/usr/lib/python3.10/subprocess.py:1845: FileNotFoundError
v3.10.0 (2022-09-28)¶
Bug Fixes¶
Chores¶
Bump GitLab docker image to 15.4.0-ee.0 (
b87a2bc
)
Use
settings.delayed_group_deletion=False
as that is the recommended method to turn off the delayed group deletion now. * Change test to look fordefault
aspages
is not mentioned in the docs[1]
[1] https://docs.gitlab.com/ee/api/sidekiq_metrics.html#get-the-current-queue-metrics
deps: Update black to v22.8.0 (
86b0e40
)deps: Update dependency commitizen to v2.32.2 (
31aea28
)deps: Update dependency commitizen to v2.32.5 (
e180f14
)deps: Update dependency pytest to v7.1.3 (
ec7f26c
)deps: Update dependency types-requests to v2.28.10 (
5dde7d4
)deps: Update pre-commit hook commitizen-tools/commitizen to v2.32.2 (
31ba64f
)
Features¶
Add reset_approvals api (
88693ff
)
Added the newly added reset_approvals merge request api.
Signed-off-by: Lucas Zampieri lzampier@redhat.com
Add support for deployment approval endpoint (
9c9eeb9
)
Add support for the deployment approval endpoint[1]
[1] https://docs.gitlab.com/ee/api/deployments.html#approve-or-reject-a-blocked-deployment Closes: #2253
v3.9.0 (2022-08-28)¶
Chores¶
Fix issue if only run test_gitlab.py func test (
98f1956
)
Make it so can run just the test_gitlab.py functional test.
For example: $ tox -e api_func_v4 – -k test_gitlab.py
Only check for our UserWarning (
bd4dfb4
)
The GitHub CI is showing a ResourceWarning, causing our test to fail.
Update test to only look for our UserWarning which should not appear.
What was seen when debugging the GitHub CI: {message: ResourceWarning( “unclosed <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=(‘127.0.0.1’, 50862), raddr=(‘127.0.0.1’, 8080)>” ), category: ‘ResourceWarning’, filename: ‘/home/runner/work/python-gitlab/python-gitlab/.tox/api_func_v4/lib/python3.10/site-packages/urllib3/poolmanager.py’, lineno: 271, line: None }
ci: Make pytest annotations work (
f67514e
)deps: Update dependency commitizen to v2.31.0 (
4ff0894
)deps: Update dependency commitizen to v2.32.1 (
9787c5c
)deps: Update dependency types-requests to v2.28.8 (
8e5b86f
)deps: Update dependency types-requests to v2.28.9 (
be932f6
)deps: Update dependency types-setuptools to v64 (
4c97f26
)deps: Update pre-commit hook commitizen-tools/commitizen to v2.31.0 (
71d37d9
)deps: Update pre-commit hook commitizen-tools/commitizen to v2.32.1 (
cdd6efe
)deps: Update pre-commit hook pycqa/flake8 to v5 (
835d884
)
Features¶
Add support for merge_base API (
dd4fbd5
)
v3.8.1 (2022-08-10)¶
Bug Fixes¶
client: Do not assume user attrs returned for auth() (
a07547c
)
This is mostly relevant for people mocking the API in tests.
Chores¶
Add license badge to readme (
9aecc9e
)Consolidate license and authors (
366665e
)Remove broad Exception catching from
config.py
(0abc90b
)
Change “except Exception:” catching to more granular exceptions.
A step in enabling the “broad-except” check in pylint.
v3.8.0 (2022-08-04)¶
Bug Fixes¶
Chores¶
Change
_repr_attr
for Project to bepath_with_namespace
(7cccefe
)
Previously _repr_attr
was path
but that only gives the basename of the path. So
https://gitlab.com/gitlab-org/gitlab would only show “gitlab”. Using path_with_namespace
it will
now show “gitlab-org/gitlab”
Enable mypy check
disallow_any_generics
(24d17b4
)Enable mypy check
no_implicit_optional
(64b208e
)Enable mypy check
warn_return_any
(76ec4b4
)
Update code so that the warn_return_any
check passes.
Make code PEP597 compliant (
433dba0
)
Use encoding="utf-8"
in open()
and open-like functions.
https://peps.python.org/pep-0597/
Use
urlunparse
instead of string replace (6d1b62d
)
Use the urlunparse()
function to reconstruct the URL without the query parameters.
ci: Bump semantic-release for fixed commit parser (
1e063ae
)clusters: Deprecate clusters support (
b46b379
)
Cluster support was deprecated in GitLab 14.5 [1]. And disabled by default in GitLab 15.0 [2]
Update docs to mark clusters as deprecated * Remove testing of clusters
[1] https://docs.gitlab.com/ee/api/project_clusters.html [2] https://gitlab.com/groups/gitlab-org/configure/-/epics/8
deps: Update dependency commitizen to v2.29.2 (
30274ea
)deps: Update dependency flake8 to v5 (
cdc384b
)deps: Update dependency types-requests to v2.28.6 (
54dd4c3
)deps: Update pre-commit hook commitizen-tools/commitizen to v2.29.2 (
4988c02
)topics: ‘title’ is required when creating a topic (
271f688
)
In GitLab >= 15.0 title
is required when creating a topic.
Documentation¶
Describe self-revoking personal access tokens (
5ea48fc
)
Features¶
Refactoring¶
client: Factor out URL check into a helper (
af21a18
)client: Remove handling for incorrect link header (
77c04b1
)
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.
Testing¶
Attempt to make functional test startup more reliable (
67508e8
)
The functional tests have been erratic. Current theory is that we are starting the tests before the GitLab container is fully up and running.
Add checking of the Health Check[1] endpoints. * Add a 20 second delay after we believe it is up and running. * Increase timeout from 300 to 400 seconds
[1] https://docs.gitlab.com/ee/user/admin_area/monitoring/health_check.html
functional: Bump GitLab docker image to 15.2.0-ee.0 (
69014e9
)
Use the GitLab docker image 15.2.0-ee.0 in the functional testing.
unit: Reproduce duplicate encoded query params (
6f71c66
)
v3.7.0 (2022-07-28)¶
Bug Fixes¶
Add the notes attribute to GroupEpic
Ensure path elements are escaped (
5d9c198
)
Ensure the path elements that are passed to the server are escaped. For example a “/” will be changed to “%2F”
Closes: #2116
Results returned by
attributes
property to show updates (e5affc8
)
Previously the attributes
method would show the original values in a Gitlab Object even if they
had been updated. Correct this so that the updated value will be returned.
Also use copy.deepcopy() to ensure that modifying the dictionary returned can not also modify the object.
Support array types for most resources (
d9126cd
)Use the [] after key names for array variables in
params
(1af44ce
)
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
Chores¶
Add a
lazy
boolean attribute toRESTObject
(a7e8cfb
)
This can be used to tell if a RESTObject
was created using lazy=True
.
Add a message to the AttributeError
if attribute access fails for an instance created with
lazy=True
.
Change name of API functional test to
api_func_v4
(8cf5cd9
)
The CLI test is cli_func_v4
and using api_func_v4
matches with that naming convention.
Enable mypy check
strict_equality
(a29cd6c
)
Enable the mypy
strict_equality
check.
Enable using GitLab EE in functional tests (
17c01ea
)
Enable using GitLab Enterprise Edition (EE) in the functional tests. This will allow us to add functional tests for EE only features in the functional tests.
In our fixtures that create: - groups - project merge requests - projects - users
They delete the created objects after use. Now wait to ensure the objects are deleted before continuing as having unexpected objects existing can impact some of our tests.
Make reset_gitlab() better (
d87d6b1
)
Saw issues in the CI where reset_gitlab() would fail. It would fail to delete the group that is created when GitLab starts up. Extending the timeout didn’t fix the issue.
Changed the code to use the new helpers.safe_delete()
function. Which will delete the resource and
then make sure it is deleted before returning.
Also added some logging functionality that can be seen if logging is turned on in pytest.
Revert “test(functional): simplify token creation” (
4b798fc
)
This reverts commit 67ab24fe5ae10a9f8cc9122b1a08848e8927635d.
Simplify multi-nested try blocks (
e734470
)
Instead of have a multi-nested series of try blocks. Convert it to a more readable series of if
statements.
authors: Fix email and do the ABC (
9833632
)ci_lint: Add create attributes (
6e1342f
)deps: Update black to v22.6.0 (
82bd596
)deps: Update dependency commitizen to v2.28.0 (
8703dd3
)deps: Update dependency commitizen to v2.29.0 (
c365be1
)deps: Update dependency mypy to v0.971 (
7481d27
)deps: Update dependency pylint to v2.14.4 (
2cee2d4
)deps: Update dependency pylint to v2.14.5 (
e153636
)deps: Update dependency requests to v2.28.1 (
be33245
)deps: Update pre-commit hook commitizen-tools/commitizen to v2.28.0 (
d238e1b
)deps: Update pre-commit hook commitizen-tools/commitizen to v2.29.0 (
ad8d62a
)deps: Update pre-commit hook pycqa/pylint to v2.14.4 (
5cd39be
)deps: Update pre-commit hook pycqa/pylint to v2.14.5 (
c75a1d8
)deps: Update typing dependencies (
f2209a0
)deps: Update typing dependencies (
e772248
)docs: Convert tabs to spaces (
9ea5520
)
Some tabs snuck into the documentation. Convert them to 4-spaces.
Documentation¶
Describe fetching existing export status (
9c5b8d5
)Describe ROPC flow in place of password authentication (
91c17b7
)Document CI Lint usage (
d5de4b1
)Update return type of pushrules (
53cbecc
)
Update the return type of pushrules to surround None with back-ticks to make it code-formatted.
authors: Add John (
e2afb84
)cli: Showcase use of token scopes (
4a6f8d6
)projects: Document export with upload to URL (
03f5484
)readme: Remove redundant
-v
that breaks the command (c523e18
)users: Add docs about listing a user’s projects (
065a1a5
)
Add docs about listing a user’s projects.
Update docs on the membership API to update the URL to the upstream docs and also add a note that it requires Administrator access to use.
Features¶
Add ‘merge_pipelines_enabled’ project attribute (
fc33c93
)
Boolean. Enable or disable merge pipelines.
See: https://docs.gitlab.com/ee/api/projects.html#edit-project https://docs.gitlab.com/ee/ci/pipelines/merged_results_pipelines.html
Add
asdict()
andto_json()
methods to Gitlab Objects (08ac071
)
Add an asdict()
method that returns a dictionary representation copy of the Gitlab Object. This is
a copy and changes made to it will have no impact on the Gitlab Object.
The asdict()
method name was chosen as both the dataclasses
and attrs
libraries have an
asdict()
function which has the similar purpose of creating a dictionary represenation of an
object.
Also add a to_json()
method that returns a JSON string representation of the object.
Closes: #1116
Add support for filtering jobs by scope (
0e1c0dd
)
See: ‘scope’ here:
https://docs.gitlab.com/ee/api/jobs.html#list-project-jobs
Add support for group and project invitations API (
7afd340
)Add support for group push rules (
b5cdc09
)
Add the GroupPushRules and GroupPushRulesManager classes.
Closes: #1259
See: https://docs.gitlab.com/ee/api/releases/#list-releases
Support validating CI lint results (
3b1ede4
)api: Add support for
get
for a MR approval rule (89c18c6
)
In GitLab 14.10 they added support to get a single merge request approval rule [1]
Add support for it to ProjectMergeRequestApprovalRuleManager
[1] https://docs.gitlab.com/ee/api/merge_request_approvals.html#get-a-single-merge-request-level-rule
api: Add support for instance-level registry repositories (
284d739
)cli: Add a custom help formatter (
005ba93
)
Add a custom argparse help formatter that overrides the output format to list items vertically.
The formatter is derived from argparse.HelpFormatter with minimal changes.
Co-authored-by: John Villalovos john@sodarock.com
Co-authored-by: Nejc Habjan nejc.habjan@siemens.com
cli: Add support for global CI lint (
3f67c4b
)groups: Add support for group-level registry repositories (
70148c6
)groups: Add support for shared projects API (
66461ba
)issues: Add support for issue reorder API (
8703324
)namespaces: Add support for namespace existence API (
4882cb2
)objects: Add Project CI Lint support (
b213dd3
)
Add support for validating a project’s CI configuration [1]
[1] https://docs.gitlab.com/ee/api/lint.html
projects: Add support for project restore API (
4794ecc
)
Refactoring¶
Testing¶
https://github.com/python-gitlab/python-gitlab/issues/1698 has been fixed. Add test to show that.
Allow
podman
users to run functional tests (ff215b7
)
Users of podman
will likely have DOCKER_HOST
set to something like
unix:///run/user/1000/podman/podman.sock
Pass this environment variable so that it will be used during the functional tests.
Use monkeypatch
to ensure that no config files are reported for the test.
Closes: #2172
api_func_v4: Catch deprecation warning for
gl.lint()
(95fe924
)
Catch the deprecation warning for the call to gl.lint()
, so it won’t show up in the log.
cli: Add tests for token scopes (
263fe3d
)ee: Add an EE specific test (
10987b3
)functional: Replace len() calls with list membership checks (
97e0eb9
)functional: Simplify token creation (
67ab24f
)functional: Use both get_all and all in list() tests (
201298d
)projects: Add unit tests for projects (
67942f0
)
v3.6.0 (2022-06-28)¶
Bug Fixes¶
base: Do not fail repr() on lazy objects (
1efb123
)cli: Fix project export download for CLI (
5d14867
)
Since ac1c619cae6481833f5df91862624bf0380fef67 we delete parent arg keys from the args dict so this has been trying to access the wrong attribute.
cli: Project-merge-request-approval-rule (
15a242c
)
Using the CLI the command: gitlab project-merge-request-approval-rule list –mr-iid 1 –project-id foo/bar
Would raise an exception. This was due to the fact that _id_attr
and _repr_attr
were set for
keys which are not returned in the response.
Add a unit test which shows the repr
function now works. Before it did not.
This is an EE feature so we can’t functional test it.
Closes: #2065
Chores¶
Add link to Commitizen in Github workflow (
d08d07d
)
Add a link to the Commitizen website in the Github workflow. Hopefully this will help people when their job fails.
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.
Enable ‘consider-using-sys-exit’ pylint check (
0afcc3e
)
Enable the ‘consider-using-sys-exit’ pylint check and fix errors raised.
Enable pylint check “raise-missing-from” (
1a2781e
)
Enable the pylint check “raise-missing-from” and fix errors detected.
Enable pylint check: “attribute-defined-outside-init” (
d6870a9
)
Enable the pylint check: “attribute-defined-outside-init” and fix errors detected.
Enable pylint check: “no-else-return” (
d0b0811
)
Enable the pylint check “no-else-return” and fix the errors detected.
Enable pylint check: “no-self-use” (
80aadaf
)
Enable the pylint check “no-self-use” and fix the errors detected.
Enable pylint check: “redefined-outer-name”, (
1324ce1
)
Enable the pylint check “redefined-outer-name” and fix the errors detected.
Enable pylint checks (
1e89164
)
Enable the pylint checks: * unnecessary-pass * unspecified-encoding
Update code to resolve errors found
Enable pylint checks which require no changes (
50fdbc4
)
Enabled the pylint checks that don’t require any code changes. Previously these checks were disabled.
Fix issue found with pylint==2.14.3 (
eeab035
)
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.
Have
EncodedId
creation always returnEncodedId
(a1a246f
)
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.
Move
RequiredOptional
to thegitlab.types
module (7d26530
)
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.
Move
utils._validate_attrs
insidetypes.RequiredOptional
(9d629bb
)
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.
Patch sphinx for explicit re-exports (
06871ee
)Remove use of ‘%’ string formatter in
gitlab/utils.py
(0c5a121
)
Replace usage with f-string
Rename
__call__()
torun()
in GitlabCLI (6189437
)
Less confusing to have it be a normal method.
Rename
whaction
andaction
toresource_action
in CLI (fb3f28a
)
Rename the variables whaction
and action
to resource_action
to improve code-readability.
Rename
what
togitlab_resource
(c86e471
)
Naming a variable what
makes it difficult to understand what it is used for.
Rename it to gitlab_resource
as that is what is being stored.
The Gitlab documentation talks about them being resources: https://docs.gitlab.com/ee/api/api_resources.html
This will improve code readability.
Require f-strings (
96e994d
)
We previously converted all string formatting to use f-strings. Enable pylint check to enforce this.
Update type-hints return signature for GetWithoutIdMixin methods (
aa972d4
)
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
Use multiple processors when running PyLint (
7f2240f
)
Use multiple processors when running PyLint. On my system it took about 10.3 seconds to run PyLint before this change. After this change it takes about 5.8 seconds to run PyLint.
ci: Increase timeout for docker container to come online (
bda020b
)
Have been seeing timeout issues more and more. Increase timeout from 200 seconds to 300 seconds (5 minutes).
ci: Pin 3.11 to beta.1 (
7119f2d
)cli: Ignore coverage on exceptions triggering cli.die (
98ccc3c
)cli: Rename “object” to “GitLab resource” (
62e64a6
)
Make the parser name more user friendly by renaming from generic “object” to “GitLab resource”
deps: Ignore python-semantic-release updates (
f185b17
)deps: Update actions/setup-python action to v4 (
77c1f03
)deps: Update dependency commitizen to v2.27.1 (
456f9f1
)deps: Update dependency mypy to v0.960 (
8c016c7
)deps: Update dependency mypy to v0.961 (
f117b2f
)deps: Update dependency pylint to v2.14.3 (
9a16bb1
)deps: Update dependency requests to v2.28.0 (
d361f4b
)deps: Update pre-commit hook commitizen-tools/commitizen to v2.27.1 (
22c5db4
)deps: Update pre-commit hook pycqa/pylint to v2.14.3 (
d1fe838
)deps: Update typing dependencies (
acc5c39
)deps: Update typing dependencies (
aebf9c8
)deps: Update typing dependencies (
f3f79c1
)docs: Ignore nitpicky warnings (
1c3efb5
)gitlab: Fix implicit re-exports for mpypy (
981b844
)mixins: Remove None check as http_get always returns value (
f0152dc
)workflows: Explicitly use python-version (
eb14475
)
Documentation¶
Documentation updates to reflect addition of mutually exclusive attributes (
24b720e
)Drop deprecated setuptools build_sphinx (
048d66a
)Use
as_list=False
orall=True
in Getting started (de8c6e8
)
In the “Getting started with the API” section of the documentation, use either as_list=False
or
all=True
in the example usages of the list()
method.
Also add a warning about the fact that list()
by default does not return all items.
api: Add separate section for advanced usage (
22ae101
)api: Document usage of head() methods (
f555bfb
)api: Fix incorrect docs for merge_request_approvals (#2094,
5583eaa
)
docs(api): fix incorrect docs for merge_request_approvals
The set_approvers()
method is on the ProjectApprovalManager
class. It is not part of the
ProjectApproval
class.
The docs were previously showing to call set_approvers
using a ProjectApproval
instance, which
would fail. Correct the documentation.
This was pointed out by a question on the Gitter channel.
Co-authored-by: Nejc Habjan nejc.habjan@siemens.com
api: Stop linking to python-requests.org (
49c7e83
)api-usage: Add import os in example (
2194a44
)ext: Fix rendering for RequiredOptional dataclass (
4d431e5
)projects: Document 404 gotcha with unactivated integrations (
522ecff
)projects: Provide more detailed import examples (
8f8611a
)usage: Refer to upsteam docs instead of custom attributes (
ae7d3b0
)variables: Instruct users to follow GitLab rules for values (
194b6be
)
Features¶
Add support for Protected Environments (
1dc9d0f
)https://docs.gitlab.com/ee/api/protected_environments.html - https://github.com/python-gitlab/python-gitlab/issues/1130
no write operation are implemented yet as I have no use case right now and am not sure how it should be done
Support mutually exclusive attributes and consolidate validation to fix board lists (#2037,
3fa330c
)
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
api: Convert gitlab.const to Enums (
c3c6086
)
This allows accessing the elements by value, i.e.:
import gitlab.const gitlab.const.AccessLevel(20)
api: Implement HEAD method (
90635a7
)api: Support head() method for get and list endpoints (
ce9216c
)client: Introduce
iterator=True
and deprecateas_list=False
inlist()
(cdc6605
)
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.
docker: Provide a Debian-based slim image (
384031c
)downloads: Allow streaming downloads access to response iterator (#1956,
b644721
)
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
users: Add approve and reject methods to User (
f57139d
)
As requested in #1604.
Co-authored-by: John Villalovos john@sodarock.com
users: Add ban and unban methods (
0d44b11
)
Refactoring¶
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.
Testing¶
Add more tests for RequiredOptional (
ce40fde
)Add tests and clean up usage for new enums (
323ab3c
)Increase client coverage (
00aec96
)Move back to using latest Python 3.11 version (
8c34781
)api: Add tests for HEAD method (
b0f02fa
)cli: Improve coverage for custom actions (
7327f78
)gitlab: Increase unit test coverage (
df072e1
)pylint: Enable pylint “unused-argument” check (
23feae9
)
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.
v3.5.0 (2022-05-28)¶
Bug Fixes¶
Duplicate subparsers being added to argparse (
f553fd3
)
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
fix(cli): change default allow_abbrev
value to fix argument collision
Chores¶
Add
cz
to default tox environment list and skip_missing_interpreters (ba8c052
)
Add the cz
(comittizen
) check by default.
Set skip_missing_interpreters = True so that when a user runs tox and doesn’t have a specific version of Python it doesn’t mark it as an error.
Exclude
build/
directory from mypy check (989a12b
)
The build/
directory is created by the tox environment twine-check
. When the build/
directory
exists mypy
will have an error.
Rename the test which runs
flake8
to beflake8
(78b4f99
)
Previously the test was called pep8
. The test only runs flake8
so call it flake8
to be more
precise.
Run the
pylint
check by default in tox (55ace1d
)
Since we require pylint
to pass in the CI. Let’s run it by default in tox.
ci: Fix prefix for action version (
1c02189
)ci: Pin semantic-release version (
0ea61cc
)ci: Replace commitlint with commitizen (
b8d15fe
)deps: Update dependency pylint to v2.13.8 (
b235bb0
)deps: Update dependency pylint to v2.13.9 (
4224950
)deps: Update dependency types-requests to v2.27.23 (
a6fed8b
)deps: Update dependency types-requests to v2.27.24 (
f88e3a6
)deps: Update dependency types-requests to v2.27.25 (
d6ea47a
)deps: Update pre-commit hook pycqa/pylint to v2.13.8 (
1835593
)deps: Update pre-commit hook pycqa/pylint to v2.13.9 (
1e22790
)renovate: Set schedule to reduce noise (
882fe7a
)
Documentation¶
Add missing Admin access const value (
3e0d4d9
)
As shown here, Admin access is set to 60: https://docs.gitlab.com/ee/api/protected_branches.html#protected-branches-api
Update issue example and extend API usage docs (
aad71d2
)CONTRIBUTING.rst: Fix link to conventional-changelog commit format documentation (
2373a4f
)merge_requests: Add new possible merge request state and link to the upstream docs (
e660fa8
)
The actual documentation do not mention the locked state for a merge request
Features¶
Display human-readable attribute in
repr()
if present (6b47c26
)objects: Support get project storage endpoint (
8867ee5
)ux: Display project.name_with_namespace on project repr (
e598762
)
This change the repr from:
$ gitlab.projects.get(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.
Testing¶
projects: Add tests for list project methods (
fa47829
)
v3.4.0 (2022-04-28)¶
Bug Fixes¶
Chores¶
client: Remove duplicate code (
5cbbf26
)deps: Update black to v22.3.0 (
8d48224
)deps: Update codecov/codecov-action action to v3 (
292e91b
)deps: Update dependency mypy to v0.950 (
241e626
)deps: Update dependency pylint to v2.13.3 (
0ae3d20
)deps: Update dependency pylint to v2.13.4 (
a9a9392
)deps: Update dependency pylint to v2.13.5 (
5709675
)deps: Update dependency pylint to v2.13.7 (
5fb2234
)deps: Update dependency pytest to v7.1.2 (
fd3fa23
)deps: Update dependency types-requests to v2.27.16 (
ad799fc
)deps: Update dependency types-requests to v2.27.21 (
0fb0955
)deps: Update dependency types-requests to v2.27.22 (
22263e2
)deps: Update dependency types-setuptools to v57.4.12 (
6551353
)deps: Update pre-commit hook pycqa/pylint to v2.13.3 (
8f0a3af
)deps: Update pre-commit hook pycqa/pylint to v2.13.4 (
9d0b252
)deps: Update pre-commit hook pycqa/pylint to v2.13.5 (
17d5c6c
)deps: Update pre-commit hook pycqa/pylint to v2.13.7 (
1396221
)deps: Update typing dependencies (
c12466a
)deps: Update typing dependencies (
d27cc6a
)deps: Upgrade gitlab-ce to 14.9.2-ce.0 (
d508b18
)
Documentation¶
api-docs: Docs fix for application scopes (
e1ad93d
)
Features¶
Emit a warning when using a
list()
method returns max (1339d64
)
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
.
api: Re-add topic delete endpoint (
d1d96bd
)
This reverts commit e3035a799a484f8d6c460f57e57d4b59217cd6de.
v3.3.0 (2022-03-28)¶
Bug Fixes¶
Support RateLimit-Reset header (
4060146
)
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
Chores¶
deps: Update actions/checkout action to v3 (
7333cbb
)deps: Update actions/setup-python action to v3 (
7f845f7
)deps: Update actions/stale action to v5 (
d841185
)deps: Update actions/upload-artifact action to v3 (
18a0eae
)deps: Update black to v22 (
3f84f1b
)deps: Update dependency mypy to v0.931 (
33646c1
)deps: Update dependency mypy to v0.940 (
dd11084
)deps: Update dependency mypy to v0.941 (
3a9d4f1
)deps: Update dependency mypy to v0.942 (
8ba0f8c
)deps: Update dependency pylint to v2.13.0 (
5fa403b
)deps: Update dependency pylint to v2.13.1 (
eefd724
)deps: Update dependency pylint to v2.13.2 (
10f15a6
)deps: Update dependency pytest to v7 (
ae8d70d
)deps: Update dependency pytest to v7.1.0 (
27c7e33
)deps: Update dependency pytest to v7.1.1 (
e31f2ef
)deps: Update dependency pytest-console-scripts to v1.3 (
9c202dd
)deps: Update dependency pytest-console-scripts to v1.3.1 (
da392e3
)deps: Update dependency requests to v2.27.1 (
95dad55
)deps: Update dependency sphinx to v4.4.0 (
425d161
)deps: Update dependency sphinx to v4.5.0 (
36ab769
)deps: Update dependency types-requests to v2.27.12 (
8cd668e
)deps: Update dependency types-requests to v2.27.14 (
be6b54c
)deps: Update dependency types-requests to v2.27.15 (
2e8ecf5
)deps: Update dependency types-setuptools to v57.4.10 (
b37fc41
)deps: Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v8 (
5440780
)deps: Update pre-commit hook pycqa/pylint to v2.13.0 (
9fe60f7
)deps: Update pre-commit hook pycqa/pylint to v2.13.1 (
1d0c6d4
)deps: Update pre-commit hook pycqa/pylint to v2.13.2 (
14d367d
)deps: Update typing dependencies (
21e7c37
)deps: Update typing dependencies (
37a7c40
)
Code Style¶
Reformat for black v22 (
93d4403
)
Documentation¶
Features¶
object: Add pipeline test report summary support (
a97e0cf
)
v3.2.0 (2022-02-28)¶
Bug Fixes¶
Remove custom
delete
method for labels (0841a2a
)
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
services: Use slug for id_attr instead of custom methods (
e30f39d
)
Chores¶
Correct type-hints for per_page attrbute (
e825653
)
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.
Create a custom
warnings.warn
wrapper (6ca9aa2
)
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
Create new ArrayAttribute class (
a57334f
)
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
Require kwargs for
utils.copy_dict()
(7cf35b2
)
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.
ci: Do not run release workflow in forks (
2b6edb9
)
Code Style¶
objects: Add spacing to docstrings (
700d25d
)
Documentation¶
Co-authored-by: Nejc Habjan hab.nejc@gmail.com
Add transient errors retry info (
b7a1266
)Enable gitter chat directly in docs (
bd1ecdd
)Revert “chore: add temporary banner for v3” (#1864,
7a13b9b
)
This reverts commit a349793307e3a975bb51f864b48e5e9825f70182.
Co-authored-by: Wadim Klincov wadim.klincov@siemens.com
artifacts: Deprecate artifacts() and artifact() methods (
64d01ef
)
Features¶
Testing¶
functional: Fix GitLab configuration to support pagination (
5b7d00d
)
When pagination occurs python-gitlab uses the URL provided by the GitLab server to use for the next request.
We had previously set the GitLab server configuraiton to say its URL was http://gitlab.test
which
is not in DNS. Set the hostname in the URL to http://127.0.0.1:8080
which is the correct URL for
the GitLab server to be accessed while doing functional tests.
Closes: #1877
v3.1.1 (2022-01-28)¶
Bug Fixes¶
Chores¶
Always use context manager for file IO (
e8031f4
)Consistently use open() encoding and file descriptor (
dc32d54
)Create return type-hints for
get_id()
&encoded_id
(0c3a1d1
)
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.
Don’t explicitly pass args to super() (
618267c
)Remove old-style classes (
ae2a015
)Remove redundant list comprehension (
271cfd3
)Rename
gitlab/__version__.py
->gitlab/_version.py
(b981ce7
)
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
.
Rename
types.ListAttribute
totypes.CommaSeparatedListAttribute
(5127b15
)
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
When doing the functional tests use the new function projects.transfer
instead of the deprecated
function projects.transfer_project()
Code Style¶
Documentation¶
Testing¶
Add a meta test to make sure that v4/objects/ files are imported (
9c8c804
)
Add a test to make sure that all of the gitlab/v4/objects/
files are imported in
gitlab/v4/objects/__init__.py
Convert usage of
match_querystring
tomatch
(d16e41b
)
In the responses
library the usage of match_querystring
is deprecated. Convert to using match
Remove usage of httpmock library (
5254f19
)
Convert all usage of the httpmock
library to using the responses
library.
Use ‘responses’ in test_mixins_methods.py (
208da04
)
Convert from httmock to responses in test_mixins_methods.py
This leaves only one file left to convert
v3.1.0 (2022-01-14)¶
Bug Fixes¶
Broken URL for FAQ about attribute-error-list (
1863f30
)
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’ ————————–^
Change to
http_list
for some ProjectCommit methods (497e860
)
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
Remove custom URL encoding (
3d49e5e
)
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
Remove default arguments for mergerequests.merge() (
8e589c4
)
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
Use url-encoded ID in all paths (
12435d7
)
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
api: Services: add missing
lazy
parameter (888f332
)
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
cli: Add missing list filters for environments (
6f64d40
)cli: Url-encode path components of the URL (
ac1c619
)
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
members: Use new *All objects for *AllManager managers (
755e0a3
)
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
Chores¶
Add
pprint()
andpformat()
methods to RESTObject (d69ba04
)
This is useful in debugging and testing. As can easily print out the values from an instance in a more human-readable form.
Add a stale workflow (
2c036a9
)
Use the stale action to close issues and pull-requests with no activity.
Issues: It will mark them as stale after 60 days and then close
them once they have been stale for 15 days.
Pull-Requests: It will mark pull-requests as stale after 90 days and then close
https://github.com/actions/stale
Closes: #1649
Add EncodedId string class to use to hold URL-encoded paths (
a2e7c38
)
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.
Add functional test of mergerequest.get() (
a92b55b
)
Add a functional test of test mergerequest.get() and mergerequest.get(…, lazy=True)
Closes: #1425
Add logging to
tests/functional/conftest.py
(a1ac9ae
)
I have found trying to debug issues in the functional tests can be difficult. Especially when trying to figure out failures in the CI running on Github.
Add logging to tests/functional/conftest.py
to have a better understanding of what is happening
during a test run which is useful when trying to troubleshoot issues in the CI.
Previously c8256a5933d745f70c7eea0a7d6230b51bac0fbc was done to fix this but it missed two other failures.
Fix missing comma (
7c59fac
)
There was a missing comma which meant the strings were concatenated instead of being two separate strings.
Ignore intermediate coverage artifacts (
110ae91
)Replace usage of utils._url_encode() with utils.EncodedId() (
b07eece
)
utils.EncodedId() has basically the same functionalityy of using utils._url_encode(). So remove utils._url_encode() as we don’t need it.
dist: Add docs *.md files to sdist (
d9457d8
)
build_sphinx to fail due to setup.cfg warning-is-error
docs: Use admonitions consistently (
55c67d1
)groups: Use encoded_id for group path (
868f243
)objects: Use
self.encoded_id
where applicable (75758bf
)
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.
objects: Use
self.encoded_id
where could be a string (c3c3a91
)
Updated a few remaining usages of self.id
to use self.encoded_id
where it could be a string
value.
projects: Fix typing for transfer method (
0788fe6
)
Co-authored-by: John Villalovos john@sodarock.com
Continuous Integration¶
Don’t fail CI if unable to upload the code coverage data (
d5b3744
)
If a CI job can’t upload coverage results to codecov.com it causes the CI to fail and code can’t be merged.
Documentation¶
Features¶
Add support for Group Access Token API (
c01b7c4
)
See https://docs.gitlab.com/ee/api/group_access_tokens.html
Add support for Groups API method
transfer()
(0007006
)api: Add
project.transfer()
and deprecatetransfer_project()
(259668a
)api: Return result from
SaveMixin.save()
(e6258a4
)
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
Testing¶
groups: Enable group transfer tests (
57bb67a
)
v3.0.0 (2022-01-05)¶
Bug Fixes¶
Handle situation where GitLab does not return values (
cb824a4
)
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
Raise error if there is a 301/302 redirection (
d56a434
)
Before we raised an error if there was a 301, 302 redirect but only from an http URL to an https URL. But we didn’t raise an error for any other redirects.
This caused two problems:
PUT requests that are redirected get changed to GET requests which don’t perform the desired action but raise no error. This is because the GET response succeeds but since it wasn’t a PUT it doesn’t update. See issue: https://github.com/python-gitlab/python-gitlab/issues/1432 2. POST requests that are redirected also got changed to GET requests. They also caused hard to debug tracebacks for the user. See issue: https://github.com/python-gitlab/python-gitlab/issues/1477
Correct this by always raising a RedirectError exception and improve the exception message to let them know what was redirected.
Closes: #1485
Closes: #1432
Closes: #1477
Stop encoding ‘.’ to ‘%2E’ (
702e41d
)
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.
fix(api): delete ‘group-runner get’ and ‘group-runner delete’ commands
Co-authored-by: Léo GATELLIER git@leogatellier.fr
BREAKING CHANGE: The deprecated name_regex
attribute has been removed in favor of
name_regex_delete
. (see https://gitlab.com/gitlab-org/gitlab/-/commit/ce99813cf54)
build: Do not include docs in wheel package (
68a97ce
)build: Do not package tests in wheel (
969dccc
)objects: Rename confusing
to_project_id
argument (ce4bc0d
)
BREAKING CHANGE: rename confusing to_project_id
argument in transfer_project to project_id
(--project-id
in CLI). This is used for the source project, not for the target namespace.
Chores¶
Add .env as a file that search tools should not ignore (
c9318a9
)
The .env
file was not set as a file that should not be ignored by search tools. We want to have
the search tools search any .env
files.
Add and document optional parameters for get MR (
bfa3dbe
)
Add and document (some of the) optional parameters that can be done for a
project.merge_requests.get()
Closes #1775
Add get() methods for GetWithoutIdMixin based classes (
d27c50a
)
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.
Add initial pylint check (
041091f
)
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.
Add Python 3.11 testing (
b5ec192
)
Add a unit test for Python 3.11. This will use the latest version of Python 3.11 that is available from https://github.com/actions/python-versions/
At this time it is 3.11.0-alpha.2 but will move forward over time until the final 3.11 release and updates. So 3.11.0, 3.11.1, … will be matched.
Add running unit tests on windows/macos (
ad5d60c
)
Add running the unit tests on windows-latest and macos-latest with Python 3.10.
Add test case to show branch name with period works (
ea97d7a
)
Add a test case to show that a branch name with a period can be fetched with a get()
Closes: #1715
Add type hints for gitlab/v4/objects/commits.py (
dc096a2
)Add type-hints to gitlab/v4/objects/epics.py (
d4adf8d
)Add type-hints to gitlab/v4/objects/files.py (
0c22bd9
)Add type-hints to gitlab/v4/objects/geo_nodes.py (
13243b7
)Add type-hints to gitlab/v4/objects/groups.py (
94dcb06
)
Add type-hints to gitlab/v4/objects/groups.py * Have share() function update object attributes. * Add ‘get()’ method so that type-checkers will understand that getting a group is of type Group.
Add type-hints to gitlab/v4/objects/issues.py (
93e39a2
)Add type-hints to gitlab/v4/objects/jobs.py (
e8884f2
)Add type-hints to gitlab/v4/objects/labels.py (
d04e557
)Add type-hints to gitlab/v4/objects/merge_request_approvals.py (
cf3a99a
)Add type-hints to gitlab/v4/objects/merge_requests.py (
f9c0ad9
)
Add type-hints to gitlab/v4/objects/merge_requests.py * Add return value to cancel_merge_when_pipeline_succeeds() function as GitLab docs show it returns a value. * Add return value to approve() function as GitLab docs show it returns a value. * Add ‘get()’ method so that type-checkers will understand that getting a project merge request is of type ProjectMergeRequest.
Add type-hints to gitlab/v4/objects/milestones.py (
8b6078f
)Add type-hints to gitlab/v4/objects/pipelines.py (
cb3ad6c
)Add type-hints to gitlab/v4/objects/repositories.py (
00d7b20
)Add type-hints to gitlab/v4/objects/services.py (
8da0b75
)Add type-hints to gitlab/v4/objects/sidekiq.py (
a91a303
)Add type-hints to gitlab/v4/objects/snippets.py (
f256d4f
)Add type-hints to gitlab/v4/objects/users.py (
88988e3
)
Adding type-hints to gitlab/v4/objects/users.py
Add type-hints to multiple files in gitlab/v4/objects/ (
8b75a77
)
Add and/or check type-hints for the following files gitlab.v4.objects.access_requests gitlab.v4.objects.applications gitlab.v4.objects.broadcast_messages gitlab.v4.objects.deployments gitlab.v4.objects.keys gitlab.v4.objects.merge_trains gitlab.v4.objects.namespaces gitlab.v4.objects.pages gitlab.v4.objects.personal_access_tokens gitlab.v4.objects.project_access_tokens gitlab.v4.objects.tags gitlab.v4.objects.templates gitlab.v4.objects.triggers
Add a ‘get’ method with the correct type for Managers derived from GetMixin.
Add type-hints to setup.py and check with mypy (
06184da
)Attempt to be more informative for missing attributes (
1839c9e
)
A commonly reported issue from users on Gitter is that they get an AttributeError for an attribute
that should be present. This is often caused due to the fact that they used the list()
method to
retrieve the object and objects retrieved this way often only have a subset of the full data.
Add more details in the AttributeError message that explains the situation to users. This will hopefully allow them to resolve the issue.
Update the FAQ in the docs to add a section discussing the issue.
Closes #1138
Attempt to fix flaky functional test (
487b9a8
)
Add an additional check to attempt to solve the flakiness of the test_merge_request_should_remove_source_branch() test.
Check setup.py with mypy (
77cb7a8
)
Prior commit 06184daafd5010ba40bb39a0768540b7e98bd171 fixed the type-hints for setup.py. But missed removing ‘setup’ from the exclude list in pyproject.toml for mypy checks.
Remove ‘setup’ from the exclude list in pyproject.toml from mypy checks.
Convert our manager usage to be done via type annotations.
Now to define a manager to be used in a RESTObject subclass can simply do: class ExampleClass(CRUDMixin, RESTObject): my_manager: MyManager
Any type-annotation that annotates it to be of type *Manager (with the exception of RESTManager) will cause the manager to be created on the object.
Correct test_groups.py test (
9c878a4
)
The test was checking twice if the same group3 was not in the returned list. Should have been checking for group3 and group4.
Also added a test that only skipped one group and checked that the group was not in the returned list and a non-skipped group was in the list.
Create a ‘tests/meta/’ directory and put test_mro.py in it (
94feb8a
)
The ‘test_mro.py’ file is not really a unit test but more of a ‘meta’ check on the validity of the code base.
Enable ‘warn_redundant_casts’ for mypy (
f40e9b3
)
Enable ‘warn_redundant_casts’for mypy and resolve one issue.
Enable mypy for tests/meta/* (
ba7707f
)Enable subset of the ‘mypy –strict’ options that work (
a86d049
)
Enable the subset of the ‘mypy –strict’ options that work with no changes to the code.
Enforce type-hints on most files in gitlab/v4/objects/ (
7828ba2
)
Add type-hints to some of the files in gitlab/v4/objects/ * Fix issues detected when adding type-hints * Changed mypy exclusion to explicitly list the 13 files that have not yet had type-hints added.
Ensure get() methods have correct type-hints (
46773a8
)
Fix classes which don’t have correct ‘get()’ methods for classes derived from GetMixin.
Add a unit test which verifies that classes have the correct return type in their ‘get()’ method.
Ensure reset_gitlab() succeeds (
0aa0b27
)
Ensure reset_gitlab() succeeds by waiting to make sure everything has been deleted as expected. If the timeout is exceeded fail the test.
Not using wait_for_sidekiq
as it didn’t work. During testing I didn’t see any sidekiq processes as
being busy even though not everything was deleted.
Fix functional test failure if config present (
c8256a5
)
Fix functional test failure if config present and configured with token.
Closes: #1791
Fix issue with adding type-hints to ‘manager’ attribute (
9a451a8
)
When attempting to add type-hints to the the ‘manager’ attribute into a RESTObject derived class it would break things.
This was because our auto-manager creation code would automatically add the specified annotated manager to the ‘manager’ attribute. This breaks things.
Now check in our auto-manager creation if our attribute is called ‘manager’. If so we ignore it.
Fix pylint error “expression-not-assigned” (
a90eb23
)
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.
Fix renovate setup for gitlab docker image (
49af15b
)Fix type-check issue shown by new requests-types (
0ee9aa4
)
types-requests==2.25.9 changed a type-hint. Update code to handle this change.
Closes #1764
Generate artifacts for the docs build in the CI (
85b43ae
)
When building the docs store the created documentation as an artifact so that it can be viewed.
This will create a html-docs.zip file which can be downloaded containing the contents of the
build/sphinx/html/
directory. It can be downloaded, extracted, and then viewed. This can be
useful in reviewing changes to the documentation.
See https://github.com/actions/upload-artifact for more information on how this works.
Github workflow: cancel prior running jobs on new push (
fd81569
)
If new new push is done to a pull-request, then cancel any already running github workflow jobs in order to conserve resources.
renovate is not upgrading the black
package. There is an open issue[1] about this.
Also change .commitlintrc.json to allow 200 character footer lines in the commit message. Otherwise would be forced to split the URL across multiple lines making it un-clickable :(
Use suggested work-arounds from: https://github.com/renovatebot/renovate/issues/7167#issuecomment-904106838 https://github.com/scop/bash-completion/blob/e7497f6ee8232065ec11450a52a1f244f345e2c6/renovate.json#L34-L38
[1] https://github.com/renovatebot/renovate/issues/7167
Improve type-hinting for managers (
c9b5d3b
)
The ‘managers’ are dynamically created. This unfortunately means that we don’t have any type-hints for them and so editors which understand type-hints won’t know that they are valid attributes.
Add the type-hints for the managers we define. * Add a unit test that makes sure that the type-hints and the ‘_managers’ attribute are kept in sync with each other. * Add unit test that makes sure specified managers in ‘_managers’ have a name ending in ‘Managers’ to keep with current convention. * Make RESTObject._managers always present with a default value of None. * Fix a type-issue revealed now that mypy knows what the type is
Remove ‘# type: ignore’ for new mypy version (
34a5f22
)
mypy 0.920 now understands the type of ‘http.client.HTTPConnection.debuglevel’ so we remove the ‘type: ignore’ comment to make mypy pass
Remove duplicate/no-op tests from meta/test_ensure_type_hints (
a2f59f4
)
Before we were generating 725 tests for the meta/test_ensure_type_hints.py tests. Which isn’t a huge concern as it was fairly fast. But when we had a failure we would usually get two failures for each problem as the same test was being run multiple times.
Changed it so that: 1. Don’t add tests that are not for *Manager classes 2. Use a set so that we don’t have duplicate tests.
After doing that our generated test count in meta/test_ensure_type_hints.py went from 725 to 178 tests.
Additionally removed the parsing of pyproject.toml
to generate files to ignore as we have finished
adding type-hints to all files in gitlab/v4/objects/. This also means we no longer use the toml
library so remove installation of types-toml
.
To determine the test count the following command was run: $ tox -e py39 – -k test_ensure_type_hints
Remove pytest-console-scripts specific config (
e80dcb1
)
Remove the pytest-console-scripts specific config from the global ‘[pytest]’ config section.
Use the command line option --script-launch-mode=subprocess
Closes #1713
Rename
master
branch tomain
(545f8ed
)
BREAKING CHANGE: As of python-gitlab 3.0.0, the default branch for development has changed from
master
to main
.
Run pre-commit on changes to the config file (
5f10b3b
)
If .pre-commit-config.yaml or .github/workflows/pre_commit.yml are updated then run pre-commit.
Set pre-commit mypy args to empty list (
b67a6ad
)
https://github.com/pre-commit/mirrors-mypy/blob/master/.pre-commit-hooks.yaml
Sets some default args which seem to be interfering with things. Plus we set all of our args in the
pyproject.toml
file.
Skip a functional test if not using >= py3.9 (
ac9b595
)
One of the tests requires Python 3.9 or higher to run. Mark the test to be skipped if running Python less than 3.9.
Update version in docker-compose.yml (
79321aa
)
When running with docker-compose on Ubuntu 20.04 I got the error:
$ docker-compose up ERROR: The Compose file ‘./docker-compose.yml’ is invalid because:
networks.gitlab-network value Additional properties are not allowed (‘name’ was unexpected)
Changing the version in the docker-compose.yml file fro ‘3’ to ‘3.5’ resolved the issue.
Use constants from gitlab.const module (
6b8067e
)
Have code use constants from the gitlab.const module instead of from the top-level gitlab module.
api: Temporarily remove topic delete endpoint (
e3035a7
)
It is not yet available upstream.
ci: Add workflow to lock old issues (
a7d64fe
)ci: Enable renovate for pre-commit (
1ac4329
)ci: Wait for all coverage jobs before posting comment (
c7fdad4
)deps: Update dependency argcomplete to v2 (
c6d7e9a
)deps: Update dependency black to v21 (
5bca87c
)deps: Update dependency black to v21.12b0 (
ab841b8
)deps: Update dependency flake8 to v4 (
79785f0
)deps: Update dependency isort to v5.10.0 (
ae62468
)deps: Update dependency isort to v5.10.1 (
2012975
)deps: Update dependency mypy to v0.920 (
a519b2f
)deps: Update dependency mypy to v0.930 (
ccf8190
)deps: Update dependency requests to v2.27.0 (
f8c3d00
)deps: Update dependency sphinx to v4 (
73745f7
)deps: Update dependency sphinx to v4.3.0 (
57283fc
)deps: Update dependency sphinx to v4.3.1 (
93a3893
)deps: Update dependency sphinx to v4.3.2 (
2210e56
)deps: Update dependency types-pyyaml to v5.4.10 (
bdb6cb9
)deps: Update dependency types-pyyaml to v6 (
0b53c0a
)deps: Update dependency types-pyyaml to v6.0.1 (
a544cd5
)deps: Update dependency types-requests to v2.25.12 (
205ad5f
)deps: Update dependency types-requests to v2.25.9 (
e3912ca
)deps: Update dependency types-requests to v2.26.0 (
7528d84
)deps: Update dependency types-requests to v2.26.2 (
ac7e329
)deps: Update dependency types-setuptools to v57.4.3 (
ec2c68b
)deps: Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v6 (
fb9110b
)deps: Update pre-commit hook psf/black to v21 (
b86e819
)deps: Update pre-commit hook pycqa/flake8 to v4 (
98a5592
)deps: Update pre-commit hook pycqa/isort to v5.10.1 (
8ac4f4a
)deps: Update python docker tag to v3.10 (
b3d6d91
)deps: Update typing dependencies (
1f95613
)deps: Update typing dependencies (
8d4c953
)deps: Update typing dependencies (
4170dbe
)deps: Update typing dependencies (
4eb8ec8
)deps: Upgrade gitlab-ce to 14.3.2-ce.0 (
5a1678f
)deps: Upgrade mypy pre-commit hook (
e19e4d7
)docs: Link to main, not master (
af0cb4d
)docs: Load autodoc-typehints module (
bd366ab
)docs: Use builtin autodoc hints (
5e9c943
)objects: Remove non-existing trigger ownership method (
8dc7f40
)tests: Apply review suggestions (
381c748
)
Documentation¶
Add links to the GitLab API docs (
e3b5d27
)
Add links to the GitLab API docs for merge_requests.py as it contains code which spans two different API documentation pages.
Consolidate changelogs and remove v3 API docs (
90da8ba
)Correct documentation for updating discussion note (
ee66f4a
)
Closes #1777
Correct documented return type (
acabf63
)
repository_archive() returns ‘bytes’ not ‘str’
https://docs.gitlab.com/ee/api/repositories.html#get-file-archive
Fixes: #1584
Fix a few typos (
7ea4ddc
)
There are small typos in: - docs/gl_objects/deploy_tokens.rst - gitlab/base.py - gitlab/mixins.py - gitlab/v4/objects/features.py - gitlab/v4/objects/groups.py - gitlab/v4/objects/packages.py - gitlab/v4/objects/projects.py - gitlab/v4/objects/sidekiq.py - gitlab/v4/objects/todos.py
Fixes: - Should read treatment
rather than reatment
. - Should read transferred
rather than
transfered
. - Should read registered
rather than registred
. - Should read occurred
rather
than occured
. - Should read overridden
rather than overriden
. - Should read marked
rather
than maked
. - Should read instantiate
rather than instanciate
. - Should read function
rather than fonction
.
Fix API delete key example (
b31bb05
)Only use type annotations for documentation (
b7dde0d
)Rename documentation files to match names of code files (
ee3f865
)
Rename the merge request related documentation files to match the code files. This will make it easier to find the documentation quickly.
Rename: docs/gl_objects/mrs.rst ->
docs/gl_objects/merge_requests.rst
docs/gl_objects/mr_approvals.rst -> docs/gl_objects/merge_request_approvals.rst
Switch to Furo and refresh introduction pages (
ee6b024
)Update docs to use gitlab.const for constants (
b3b0b5f
)
Update the docs to use gitlab.const to access constants.
See issue #1620
Features¶
Add support for projects.groups.list()
endpoint.
Closes #1717
Add support for
squash_option
in Projects (a246ce8
)
There is an optional squash_option
parameter which can be used when creating Projects and
UserProjects.
Closes #1744
Allow global retry_transient_errors setup (
3b1d3a4
)
retry_transient_errors
can now be set through the Gitlab instance and global configuration
Documentation for API usage has been updated and missing tests have been added.
Default to gitlab.com if no URL given (
8236281
)
BREAKING CHANGE: python-gitlab will now default to gitlab.com if no URL is given
Remove support for Python 3.6, require 3.7 or higher (
414009d
)
Python 3.6 is End-of-Life (EOL) as of 2021-12 as stated in https://www.python.org/dev/peps/pep-0494/
By dropping support for Python 3.6 and requiring Python 3.7 or higher it allows python-gitlab to take advantage of new features in Python 3.7, which are documented at: https://docs.python.org/3/whatsnew/3.7.html
Some of these new features that may be useful to python-gitlab are: * PEP 563, postponed evaluation of type annotations. * dataclasses: PEP 557 – Data Classes * importlib.resources * PEP 562, customization of access to module attributes. * PEP 560, core support for typing module and generic types. * PEP 565, improved DeprecationWarning handling
BREAKING CHANGE: As of python-gitlab 3.0.0, Python 3.6 is no longer supported. Python 3.7 or higher is required.
api: Add merge request approval state (
f41b093
)
Add support for merge request approval state
api: Add merge trains (
fd73a73
)
Add support for merge trains
api: Add project label promotion (
6d7c88a
)
Adds a mixin that allows the /promote endpoint to be called.
Signed-off-by: Raimund Hook raimund.hook@exfo.com
api: Add project milestone promotion (
f068520
)
Adds promotion to Project Milestones
Signed-off-by: Raimund Hook raimund.hook@exfo.com
api: Add support for epic notes (
7f4edb5
)
Added support for notes on group epics
Signed-off-by: Raimund Hook raimund.hook@exfo.com
api: Add support for Topics API (
e7559bf
)api: Support file format for repository archive (
83dcabf
)build: Officially support and test python 3.10 (
c042ddc
)cli: Allow options from args and environment variables (
ca58008
)
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.
cli: Do not require config file to run CLI (
92a893b
)
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.
docker: Remove custom entrypoint from image (
80754a1
)
This is no longer needed as all of the configuration is handled by the CLI and can be passed as arguments.
Refactoring¶
Deprecate accessing constants from top-level namespace (
c0aa0e1
)
We are planning on adding enumerated constants into gitlab/const.py, but if we do that than they
will end up being added to the top-level gitlab namespace. We really want to get users to start
using gitlab.const.
to access the constant values in the future.
Add the currently defined constants to a list that should not change. Use a module level getattr function so that we can deprecate access to the top-level constants.
Add a unit test which verifies we generate a warning when accessing the top-level constants.
Use f-strings for string formatting (
7925c90
)Use new-style formatting for named placeholders (
c0d8810
)objects: Remove deprecated branch protect methods (
9656a16
)
BREAKING CHANGE: remove deprecated branch protect methods in favor of the more complete protected branches API.
objects: Remove deprecated constants defined in objects (
3f320af
)
BREAKING CHANGE: remove deprecated constants defined in gitlab.v4.objects, and use only gitlab.const module
objects: Remove deprecated members.all() method (
4d7b848
)
BREAKING CHANGE: remove deprecated members.all() method in favor of members_all.list()
objects: Remove deprecated pipelines() method (
c4f5ec6
)
BREAKING CHANGE: remove deprecated pipelines() methods in favor of pipelines.list()
objects: Remove deprecated project.issuesstatistics (
ca7777e
)
BREAKING CHANGE: remove deprecated project.issuesstatistics in favor of project.issues_statistics
objects: Remove deprecated tag release API (
2b8a94a
)
BREAKING CHANGE: remove deprecated tag release API. This was removed in GitLab 14.0
Testing¶
v2.10.1 (2021-08-28)¶
Bug Fixes¶
deps: Upgrade requests to 2.25.0 (see CVE-2021-33503) (
ce995b2
)mixins: Improve deprecation warning (
57e0187
)
Also note what should be changed
Chores¶
Define root dir in mypy, not tox (
7a64e67
)Fix mypy pre-commit hook (
bd50df6
)deps: Group typing requirements with mypy additional_dependencies (
38597e7
)deps: Update codecov/codecov-action action to v2 (
44f4fb7
)deps: Update dependency isort to v5.9.3 (
ab46e31
)deps: Update dependency types-pyyaml to v5.4.7 (
ec8be67
)deps: Update dependency types-pyyaml to v5.4.8 (
2ae1dd7
)deps: Update dependency types-requests to v2.25.1 (
a2d133a
)deps: Update dependency types-requests to v2.25.2 (
4782678
)deps: Update precommit hook pycqa/isort to v5.9.3 (
e1954f3
)deps: Update typing dependencies (
34fc210
)deps: Update wagoid/commitlint-github-action action to v4 (
ae97196
)
Documentation¶
mergequests: Gl.mergequests.list documentation was missleading (
5b5a7bc
)
v2.10.0 (2021-07-28)¶
Bug Fixes¶
api: Do not require Release name for creation (
98cd03b
)
Stop requiring a name
attribute for creating a Release, since a release name has not been required
since GitLab 12.5.
Chores¶
Documentation¶
Add example for mr.merge_ref (
b30b8ac
)
Signed-off-by: Matej Focko mfocko@redhat.com
project: Add example on getting a single project using name with namespace (
ef16a97
)readme: Move contributing docs to CONTRIBUTING.rst (
edf49a3
)
Move the Contributing section of README.rst to CONTRIBUTING.rst, so it is recognized by GitHub and shown when new contributors make pull requests.
Features¶
api: Add
name_regex_keep
attribute indelete_in_bulk()
(e49ff3f
)api: Add merge_ref for merge requests (
1e24ab2
)
Support merge_ref on merge requests that returns commit of attempted merge of the MR.
Signed-off-by: Matej Focko mfocko@redhat.com
Testing¶
functional: Add mr.merge_ref tests (
a9924f4
)Add test for using merge_ref on non-merged MR - Add test for using merge_ref on MR with conflicts
Signed-off-by: Matej Focko mfocko@redhat.com
v2.9.0 (2021-06-28)¶
Chores¶
Add new required type packages for mypy (
a7371e1
)
New version of mypy flagged errors for missing types. Install the recommended type-* packages that resolve the issues.
Add type-hints to gitlab/v4/objects/projects.py (
872dd6d
)
Adding type-hints to gitlab/v4/objects/projects.py
Skip EE test case in functional tests (
953f207
)deps: Update dependency isort to v5.9.1 (
0479dba
)deps: Update dependency mypy to v0.902 (
19c9736
)deps: Update dependency mypy to v0.910 (
02a56f3
)deps: Update dependency types-pyyaml to v0.1.8 (
e566767
)deps: Update dependency types-pyyaml to v0.1.9 (
1f5b3c0
)deps: Update dependency types-pyyaml to v5 (
5c22634
)deps: Update dependency types-requests to v0.1.11 (
6ba629c
)deps: Update dependency types-requests to v0.1.12 (
f84c2a8
)deps: Update dependency types-requests to v0.1.13 (
c3ddae2
)deps: Update dependency types-requests to v2 (
a81a926
)deps: Update precommit hook pycqa/isort to v5.9.1 (
c57ffe3
)
Documentation¶
Features¶
api: Add group hooks (
4a7e9b8
)api: Add MR pipeline manager in favor of pipelines() method (
954357c
)api: Add support for creating/editing reviewers in project merge requests (
676d1f6
)api: Remove responsibility for API inconsistencies for MR reviewers (
3d985ee
)release: Allow to update release (
b4c4787
)
Release API now supports PUT.
Testing¶
v2.8.0 (2021-06-10)¶
Bug Fixes¶
Add a check to ensure the MRO is correct (
565d548
)
Add a check to ensure the MRO (Method Resolution Order) is correct for classes in gitlab.v4.objects when doing type-checking.
An example of an incorrect definition: class ProjectPipeline(RESTObject, RefreshMixin, ObjectDeleteMixin): ^^^^^^^^^^ This should be at the end.
Correct way would be: class ProjectPipeline(RefreshMixin, ObjectDeleteMixin, RESTObject): Correctly at the end ^^^^^^^^^^
Also fix classes which have the issue.
Catch invalid type used to initialize RESTObject (
c7bcc25
)
Sometimes we have errors where we don’t get a dictionary passed to RESTObject.init() method. This breaks things but in confusing ways.
Check in the init() method and raise an exception if it occurs.
Change mr.merge() to use ‘post_data’ (
cb6a3c6
)
MR https://github.com/python-gitlab/python-gitlab/pull/1121 changed mr.merge() to use ‘query_data’. This appears to have been wrong.
From the Gitlab docs they state it should be sent in a payload body https://docs.gitlab.com/ee/api/README.html#request-payload since mr.merge() is a PUT request.
Request Payload
API Requests can use parameters sent as query strings or as a > payload body. GET requests usually send a query string, while PUT > or POST requests usually send the payload body
Fixes: #1452
Related to: #1120
Ensure kwargs are passed appropriately for ObjectDeleteMixin (
4e690c2
)
chore: fix functional project service test
Iids not working as a list in projects.issues.list() (
45f806c
)
Set the ‘iids’ values as type ListAttribute so it will pass the list as a comma-separated string, instead of a list.
Add a functional test.
Closes: #1407
Chores¶
Add a functional test for issue #1120 (
7d66115
)
Going to switch to putting parameters from in the query string to having them in the ‘data’ body section. Add a functional test to make sure that we don’t break anything.
https://github.com/python-gitlab/python-gitlab/issues/1120
Add a merge_request() pytest fixture and use it (
8be2838
)
Added a pytest.fixture for merge_request(). Use this fixture in tools/functional/api/test_merge_requests.py
Add an isort tox environment and run isort in CI (
dda646e
)
Add an isort tox environment * Run the isort tox environment using –check in the Github CI
https://pycqa.github.io/isort/
Add functional test mr.merge() with long commit message (
cd5993c
)
Functional test to show that https://github.com/python-gitlab/python-gitlab/issues/1452 is fixed.
Added a functional test to ensure that we can use large commit message (10_000+ bytes) in mr.merge()
Related to: #1452
Add missing linters to pre-commit and pin versions (
85bbd1a
)Add missing optional create parameter for approval_rules (
06a6001
)
Add missing optional create parameter (‘protected_branch_ids’) to the project approvalrules.
https://docs.gitlab.com/ee/api/merge_request_approvals.html#create-project-level-rule
Add type-hints to gitlab/v4/cli.py (
2673af0
)
Add type-hints to gitlab/v4/cli.py * Add required type-hints to other files based on adding type-hints to gitlab/v4/cli.py
Co-authored-by: John Villalovos john@sodarock.com
Clean up tox, pre-commit and requirements (
237b97c
)Correct a type-hint (
046607c
)Fix import ordering using isort (
f3afd34
)
Fix the import ordering using isort.
https://pycqa.github.io/isort/
Have black run at the top-level (
429d6c5
)
This will ensure everything is formatted with black, including setup.py.
Have flake8 check the entire project (
ab343ef
)
Have flake8 run at the top-level of the projects instead of just the gitlab directory.
Make certain dotfiles searchable by ripgrep (
e4ce078
)
By explicitly NOT excluding the dotfiles we care about to the .gitignore file we make those files searchable by tools like ripgrep.
By default dotfiles are ignored by ripgrep and other search tools (not grep)
Make Get.*Mixin._optional_get_attrs always present (
3c1a0b3
)
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.
Move ‘gitlab/tests/’ dir to ‘tests/unit/’ (
1ac0722
)
Move the ‘gitlab/tests/’ directory to ‘tests/unit/’ so we have all the tests located under the ‘tests/’ directory.
Mypy: Disallow untyped definitions (
6aef2da
)
Be more strict and don’t allow untyped definitions on the files we check.
Also this adds type-hints for two of the decorators so that now functions/methods decorated by them will have their types be revealed correctly.
Rename the ‘tools/functional/’ directory to ‘tests/functional/’
This makes more sense as these are functional tests and not tools.
This was dicussed in: https://github.com/python-gitlab/python-gitlab/discussions/1468
Simplify functional tests (
df9b5f9
)
Add a helper function to have less code duplication in the functional testing.
Sync create and update attributes for Projects (
0044bd2
)
Sync the create attributes with: https://docs.gitlab.com/ee/api/projects.html#create-project
Sync the update attributes with documentation at: https://docs.gitlab.com/ee/api/projects.html#edit-project
As a note the ordering of the attributes was done to match the ordering of the attributes in the documentation.
Closes: #1497
Use built-in function issubclass() instead of getmro() (
81f6386
)
Code was using inspect.getmro() to replicate the functionality of the built-in function issubclass()
Switch to using issubclass()
ci: Automate releases (
0ef497e
)ci: Ignore .python-version from pyenv (
149953d
)ci: Ignore debug and type_checking in coverage (
885b608
)ci: Use admin PAT for release workflow (
d175d41
)deps: Update dependency docker-compose to v1.29.2 (
fc241e1
)deps: Update gitlab/gitlab-ce docker tag to v13.11.2-ce.0 (
434d15d
)deps: Update gitlab/gitlab-ce docker tag to v13.11.3-ce.0 (
f0b52d8
)deps: Update gitlab/gitlab-ce docker tag to v13.11.4-ce.0 (
4223269
)deps: Update precommit hook alessandrojcm/commitlint-pre-commit-hook to v5 (
9ff349d
)docs: Fix import order for readthedocs build (
c3de1fb
)
Code Style¶
Clean up test run config (
dfa40c1
)
Documentation¶
Fail on warnings during sphinx build (
cbd4d52
)
This is useful when docs aren’t included in the toctree and don’t show up on RTD.
Features¶
Add code owner approval as attribute (
fdc46ba
)
The python API was missing the field code_owner_approval_required as implemented in the GitLab REST API.
Add feature to get inherited member for project/group (
e444b39
)Add keys endpoint (
a81525a
)Add support for lists of integers to ListAttribute (
115938b
)
Previously ListAttribute only support lists of integers. Now be more flexible and support lists of items which can be coerced into strings, for example integers.
This will help us fix issue #1407 by using ListAttribute for the ‘iids’ field.
Indicate that we are a typed package (
e4421ca
)
By adding the file: py.typed it indicates that python-gitlab is a typed package and contains type-hints.
https://www.python.org/dev/peps/pep-0561/
api: Add deployment mergerequests interface (
fbbc0d4
)objects: Add pipeline test report support (
ee9f96e
)objects: Add support for billable members (
fb0b083
)objects: Add support for descendant groups API (
1b70580
)objects: Add support for generic packages API (
79d88bd
)
feat(objects): add support for Group wikis
objects: Support all issues statistics endpoints (
f731707
)
Testing¶
api: Fix issues test (
8e5b0de
)
Was incorrectly using the issue ‘id’ vs ‘iid’.
This is a feature added in 3.8, removing it allows for the test to run with lower python versions.
functional: Add test for skip_groups list filter (
a014774
)functional: Explicitly remove deploy tokens on reset (
19a55d8
)
Deploy tokens would remain in the instance if the respective project or group was deleted without explicitly revoking the deploy tokens first.
functional: Force delete users on reset (
8f81456
)
Timing issues between requesting group deletion and GitLab enacting that deletion resulted in errors while attempting to delete a user which was the sole owner of said group (see: test_groups). Pass the ‘hard_delete’ parameter to ensure user deletion.
functional: Optionally keep containers running post-tests (
4c475ab
)
Additionally updates token creation to make use of first_or_create()
, to avoid errors from the
script caused by GitLab constraints preventing duplicate tokens with the same value.
functional: Start tracking functional test coverage (
f875786
)
v2.7.1 (2021-04-26)¶
Bug Fixes¶
files: Do not url-encode file paths twice (
8e25cec
)
v2.7.0 (2021-04-25)¶
Bug Fixes¶
Argument type was not a tuple as expected (
062f8f6
)
While adding type-hints mypy flagged this as an issue. The third argument to register_custom_action is supposed to be a tuple. It was being passed as a string rather than a tuple of strings.
Better real life token lookup example (
9ef8311
)Checking if RESTManager._from_parent_attrs is set (
8224b40
)
Prior to commit 3727cbd21fc40b312573ca8da56e0f6cf9577d08 RESTManager._from_parent_attrs did not exist unless it was explicitly set. But commit 3727cbd21fc40b312573ca8da56e0f6cf9577d08 set it to a default value of {}.
So the checks using hasattr() were no longer valid.
Update the checks to check if RESTManager._from_parent_attrs has a value.
Correct ProjectFile.decode() documentation (
b180baf
)
ProjectFile.decode() returns ‘bytes’ and not ‘str’.
Update the method’s doc-string and add a type-hint.
ProjectFile.decode() returns the result of a call to base64.b64decode()
The docs for that function state it returns ‘bytes’: https://docs.python.org/3/library/base64.html#base64.b64decode
Fixes: #1403
Correct some type-hints in gitlab/mixins.py (
8bd3124
)
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.
Extend wait timeout for test_delete_user() (
19fde8e
)
Have been seeing intermittent failures of the test_delete_user() functional test. Have made the following changes to hopefully resolve the issue and if it still fails to know better why the failure occurred.
Extend the wait timeout for test_delete_user() from 30 to 60 tries of 0.5 seconds each.
Modify wait_for_sidekiq() to return True if sidekiq process terminated. Return False if the timeout expired.
Modify wait_for_sidekiq() to loop through all processes instead of assuming there is only one process. If all processes are not busy then return.
Modify wait_for_sidekiq() to sleep at least once before checking for processes being busy.
Check for True being returned in test_delete_user() call to wait_for_sidekiq()
Handle tags like debian/2%2.6-21 as identifiers (
b4dac5c
)
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
Gitlab allows setting the defaults for MR to delete the source. Also the inline help of the CLI suggest that a boolean is expected, but no matter what value you set, it will always delete.
Let the homedir be expanded in path of helper (
fc7387a
)Linting issues and test (
b04dd2c
)Make secret helper more user friendly (
fc2798f
)Only add query_parameters to GitlabList once (
ca2c3c9
)
Fixes #1386
Only append kwargs as query parameters (
b9ecc9a
)
Some arguments to http_request
were being read from kwargs, but kwargs is where this function
creates query parameters from, by default. In the absence of a query_parameters
param, the
function would construct URLs with query parameters such as retry_transient_errors=True
despite
those parameters having no meaning to the API to which the request was sent.
This change names those arguments that are specific to http_request
so that they do not end up as
query parameters read from kwargs.
Remove duplicate class definitions in v4/objects/users.py (
7c4e625
)
The classes UserStatus and UserStatusManager were each declared twice. Remove the duplicate declarations.
Test_update_group() dependency on ordering (
e78a8d6
)
Since there are two groups we can’t depend on the one we changed to always be the first one returned.
Instead fetch the group we want and then test our assertion against that group.
Tox pep8 target, so that it can run (
f518e87
)
Previously running the pep8 target would fail as flake8 was not installed.
Now install flake8 for the pep8 target.
NOTE: Running the pep8 target fails as there are many warnings/errors.
But it does allow us to run it and possibly work on reducing these warnings/errors in the future.
In addition, add two checks to the ignore list as black takes care of formatting. The two checks added to the ignore list are: * E501: line too long * W503: line break before binary operator
Undefined name errors (
48ec9e0
)
Discovered that there were some undefined names.
If we want to update email, avatar and do not send email confirmation change (skip_reconfirmation
= True), MultipartEncoder
will try to encode everything except None and bytes. So it tries to
encode bools. Casting bool’s values to their stringified int representation fix it.
Wrong variable name (
15ec41c
)
Discovered this when I ran flake8 on the file. Unfortunately I was the one who introduced this wrong variable name :(
Chores¶
Add _create_attrs & _update_attrs to RESTManager (
147f05d
)
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.
Add additional type-hints for gitlab/base.py (
ad72ef3
)
Add type-hints for the variables which are set via self.dict
mypy doesn’t see them when they are assigned via self.dict. So declare them in the class definition.
Add and fix some type-hints in gitlab/client.py (
8837207
)
Was able to figure out better type-hints for gitlab/client.py
Add test (
f8cf1e1
)Add type hints to gitlab/base.py (
3727cbd
)Add type hints to gitlab/base.py:RESTManager (
9c55593
)
Add some additional type hints to gitlab/base.py
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 :)
Adding some initial type-hints to gitlab/client.py
Add type-hints to gitlab/config.py (
213e563
)Add type-hints to gitlab/const.py (
a10a777
)Bump version to 2.7.0 (
34c4052
)Del ‘import *’ in gitlab/v4/objects/project_access_tokens.py (
9efbe12
)
Remove usage of ‘import *’ in gitlab/v4/objects/project_access_tokens.py.
Disallow incomplete type defs (
907634f
)
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, …]
Explicitly import gitlab.v4.objects/cli (
233b79e
)
As we only support the v4 Gitlab API, explicitly import gitlab.v4.objects and gitlab.v4.clie instead of dynamically importing it depending on the API version.
This has the added benefit of mypy being able to type check the Gitlab init() function as currently it will fail if we enable type checking of init() it will fail.
Also, this also helps by not confusing tools like pyinstaller/cx_freeze with dynamic imports so you don’t need hooks for standalone executables. And according to https://docs.gitlab.com/ee/api/,
“GraphQL co-exists with the current v4 REST API. If we have a v5 API, this should be a compatibility layer on top of GraphQL.”
Fix E711 error reported by flake8 (
630901b
)
E711: Comparison to none should be ‘if cond is none:’
https://www.flake8rules.com/rules/E711.html
Fix E712 errors reported by flake8 (
83670a4
)
E712: Comparison to true should be ‘if cond is true:’ or ‘if cond:’
https://www.flake8rules.com/rules/E712.html
Fix E741/E742 errors reported by flake8 (
380f227
)
Fixes to resolve errors for: https://www.flake8rules.com/rules/E741.html Do not use variables named ‘I’, ‘O’, or ‘l’ (E741)
https://www.flake8rules.com/rules/E742.html Do not define classes named ‘I’, ‘O’, or ‘l’ (E742)
Fix F401 errors reported by flake8 (
ff21eb6
)
F401: Module imported but unused
https://www.flake8rules.com/rules/F401.html
Fix F841 errors reported by flake8 (
40f4ab2
)
Local variable name is assigned to but never used
https://www.flake8rules.com/rules/F841.html
Fix package file test naming (
8c80268
)Fix typo in mr events (
c5e6fb3
)Have _create_attrs & _update_attrs be a namedtuple (
aee1f49
)
Convert _create_attrs and _update_attrs to use a NamedTuple (RequiredOptional) to help with code readability. Update all code to use the NamedTuple.
Determined the base class for obj_cls and adding type-hints for it.
Make _types always present in RESTManager (
924f83e
)
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.
Make lint happy (
7a7c9fd
)Make lint happy (
b5f43c8
)Make lint happy (
732e49c
)Make ListMixin._list_filters always present (
8933113
)
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.
Make RESTObject._short_print_attrs always present (
6d55120
)
Always create RESTObject._short_print_attrs with a default value of None.
This way we don’t need to use hasattr() and we will know the type of the attribute.
Put assert statements inside ‘if TYPE_CHECKING:’ (
b562458
)
To be safe that we don’t assert while running, put the assert statements, which are used by mypy to check that types are correct, inside an ‘if TYPE_CHECKING:’ block.
Also, instead of asserting that the item is a dict, instead assert that it is not a requests.Response object. Theoretically the JSON could return as a list or dict, though at this time we are assuming a dict.
Remove import of gitlab.utils from init.py (
39b9183
)
Initially when extracting out the gitlab/client.py code we tried to remove this but functional tests failed.
Later we fixed the functional test that was failing, so now remove the unneeded import.
Remove Python 2 code (
b5d4e40
)
httplib is a Python 2 library. It was renamed to http.client in Python 3.
https://docs.python.org/2.7/library/httplib.html
Remove unused ALLOWED_KEYSET_ENDPOINTS variable (
3d5d5d8
)
The variable ALLOWED_KEYSET_ENDPOINTS was added in commit f86ef3bbdb5bffa1348a802e62b281d3f31d33ad.
Then most of that commit was removed in commit e71fe16b47835aa4db2834e98c7ffc6bdec36723, but ALLOWED_KEYSET_ENDPOINTS was missed.
Remove unused function _construct_url() (
009d369
)
The function _construct_url() was used by the v3 API. All usage of the function was removed in commit fe89b949922c028830dd49095432ba627d330186
Remove unused function sanitize_parameters() (
443b934
)
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.
Remove usage of ‘from … import *’ (
c83eaf4
)
In gitlab/v4/objects/*.py remove usage of: * from gitlab.base import * * from gitlab.mixins import *
Change them to: * from gitlab.base import CLASS_NAME * from gitlab.mixins import CLASS_NAME
Programmatically update code to explicitly import needed classes only.
After the change the output of: $ flake8 gitlab/v4/objects/*py | grep ‘REST|Mixin’
Is empty. Before many messages about unable to determine if it was a valid name.
Remove usage of ‘from … import *’ in client.py (
bf0c8c5
)
In gitlab/client.py remove usage of: * from gitlab.const import * * from gitlab.exceptions import *
Change them to: * import gitlab.const * import gitlab.exceptions
Update code to explicitly reference things in gitlab.const and gitlab.exceptions
A flake8 run no longer lists any undefined variables. Before it listed possible undefined variables.
Remove usage of getattr() (
2afd18a
)
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.
api: Move repository endpoints into separate module (
1ed154c
)ci: Deduplicate PR jobs (
63918c3
)config: Allow simple commands without external script (
91ffb8e
)deps: Update dependency docker-compose to v1.28.3 (
2358d48
)deps: Update dependency docker-compose to v1.28.4 (
8938484
)deps: Update dependency docker-compose to v1.28.5 (
f4ab558
)deps: Update dependency docker-compose to v1.28.6 (
46b05d5
)deps: Update dependency docker-compose to v1.29.1 (
a89ec43
)deps: Update dependency sphinx to v3.4.3 (
37c992c
)deps: Update dependency sphinx to v3.5.0 (
188c5b6
)deps: Update dependency sphinx to v3.5.1 (
f916f09
)deps: Update dependency sphinx to v3.5.2 (
9dee5c4
)deps: Update dependency sphinx to v3.5.4 (
a886d28
)deps: Update gitlab/gitlab-ce docker tag to v13.10.0-ce.0 (
5221e33
)deps: Update gitlab/gitlab-ce docker tag to v13.10.1-ce.0 (
1995361
)deps: Update gitlab/gitlab-ce docker tag to v13.10.3-ce.0 (
eabe091
)deps: Update gitlab/gitlab-ce docker tag to v13.11.0-ce.0 (
711896f
)deps: Update gitlab/gitlab-ce docker tag to v13.11.1-ce.0 (
3088714
)deps: Update gitlab/gitlab-ce docker tag to v13.8.2-ce.0 (
7c12038
)deps: Update gitlab/gitlab-ce docker tag to v13.8.3-ce.0 (
e6c20f1
)deps: Update gitlab/gitlab-ce docker tag to v13.8.4-ce.0 (
832cb88
)deps: Update gitlab/gitlab-ce docker tag to v13.9.0-ce.0 (
3aef19c
)deps: Update gitlab/gitlab-ce docker tag to v13.9.1-ce.0 (
f6fd995
)deps: Update gitlab/gitlab-ce docker tag to v13.9.2-ce.0 (
933ba52
)deps: Update gitlab/gitlab-ce docker tag to v13.9.3-ce.0 (
2ddf45f
)deps: Update gitlab/gitlab-ce docker tag to v13.9.4-ce.0 (
939f769
)deps: Update precommit hook alessandrojcm/commitlint-pre-commit-hook to v4 (
505a8b8
)deps: Update wagoid/commitlint-github-action action to v3 (
b3274cf
)objects: Make Project refreshable (
958a6aa
)
Helps getting the real state of the project from the server.
objects: Remove noisy deprecation warning for audit events (
2953642
)
It’s mostly an internal thing anyway and can be removed in 3.0.0
tests: Remove unused URL segment (
66f0b6c
)
Documentation¶
Add docs and examples for custom user agent (
a69a214
)Add information about the gitter community (
6ff67e7
)
Add a section in the README.rst about the gitter community. The badge already exists and is useful but very easy to miss.
Features¶
Add an initial mypy test to tox.ini (
fdec039
)
Add an initial mypy test to test gitlab/base.py and gitlab/init.py
Add personal access token API (
2bb16fa
)
See: https://docs.gitlab.com/ee/api/personal_access_tokens.html
Add ProjectPackageFile and the ability to list project package package_files.
Fixes #1372
Import from bitbucket server (
ff3013a
)
I’d like to use this libary to automate importing Bitbucket Server repositories into GitLab. There is a GitLab API endpoint to do this, but it is not exposed through this library.
Add an
import_bitbucket_server
method to theProjectManager
. This method calls this GitLab API endpoint: https://docs.gitlab.com/ee/api/import.html#import-repository-from-bitbucket-server * Modifyimport_gitlab
method docstring for python3 compatibility * Add a skipped stub test for the existingimport_github
method
Option to add a helper to lookup token (
8ecf559
)api,cli: Make user agent configurable (
4bb201b
)issues: Add missing get verb to IssueManager (
f78ebe0
)objects: Add Release Links API support (
28d7518
)objects: Add support for group audit events API (
2a0fbdf
)objects: Add support for resource state events API (
d4799c4
)projects: Add project access token api (
1becef0
)users: Add follow/unfollow API (
e456869
)
Refactoring¶
Move Gitlab and GitlabList to gitlab/client.py (
53a7645
)
Move the classes Gitlab and GitlabList from gitlab/init.py to the newly created gitlab/client.py file.
Update one test case that was depending on requests being defined in gitlab/init.py
Testing¶
Don’t add duplicate fixture (
5d94846
)
Co-authored-by: Nejc Habjan hab.nejc@gmail.com
v2.6.0 (2021-01-29)¶
Bug Fixes¶
Docs changed using the consts (
650b65c
)Typo (
9baa905
)api: Add missing runner access_level param (
92669f2
)api: Use RetrieveMixin for ProjectLabelManager (
1a14395
)
Allows to get a single label from a project, which was missing before even though the GitLab API has the ability to.
base: Really refresh object (
e1e0d8c
)
This fixes and error, where deleted attributes would not show up
Fixes #1155
Chores¶
Added constants for search API (
8ef53d6
)Added docs for search scopes constants (
7565bf0
)Allow overriding docker-compose env vars for tag (
27109ca
)Apply suggestions (
65ce026
)Move .env into docker-compose dir (
55cbd1c
)Offically support and test 3.9 (
62dd07d
)Remove unnecessary random function (
d4ee0a6
)Simplified search scope constants (
16fc048
)Use helper fixtures for test directories (
40ec2f5
)ci: Add .readthedocs.yml (
0ad441e
)ci: Add coverage and docs jobs (
2de64cf
)ci: Add pytest PR annotations (
8f92230
)ci: Fix copy/paste oopsie (
c6241e7
)ci: Fix typo in matrix (
5e1547a
)ci: Force colors in pytest runs (
1502079
)ci: Pin docker-compose install for tests (
1f7a2ab
)
This ensures python-dotenv with expected behavior for .env processing
ci: Pin os version (
cfa27ac
)ci: Reduce renovate PR noise (
f4d7a55
)ci: Replace travis with Actions (
8bb73a3
)cli: Remove python2 code (
1030e0a
)deps: Pin dependencies (
14d8f77
)deps: Pin dependency requests-toolbelt to ==0.9.1 (
4d25f20
)deps: Update dependency requests to v2.25.1 (
9c2789e
)deps: Update gitlab/gitlab-ce docker tag to v13.3.3-ce.0 (
667bf01
)deps: Update gitlab/gitlab-ce docker tag to v13.3.4-ce.0 (
e94c4c6
)deps: Update gitlab/gitlab-ce docker tag to v13.3.5-ce.0 (
c88d870
)deps: Update gitlab/gitlab-ce docker tag to v13.3.6-ce.0 (
57b5782
)deps: Update gitlab/gitlab-ce docker tag to v13.4.3-ce.0 (
bc17889
)deps: Update gitlab/gitlab-ce docker tag to v13.5.0-ce.0 (
fc205cc
)deps: Update gitlab/gitlab-ce docker tag to v13.5.1-ce.0 (
348e860
)deps: Update gitlab/gitlab-ce docker tag to v13.5.2-ce.0 (
4a6831c
)deps: Update gitlab/gitlab-ce docker tag to v13.5.3-ce.0 (
d1b0b08
)deps: Update gitlab/gitlab-ce docker tag to v13.5.4-ce.0 (
265dbbd
)deps: Update gitlab/gitlab-ce docker tag to v13.8.1-ce.0 (
9854d6d
)deps: Update python docker tag to v3.9 (
1fc65e0
)docs: Always edit the file directly on master (
35e43c5
)
There is no way to edit the raw commit
test: Remove hacking dependencies (
9384493
)
Documentation¶
Add Project Merge Request approval rule documentation (
449fc26
)Clean up grammar and formatting in documentation (
aff9bc7
)cli: Add auto-generated CLI reference (
6c21fc8
)cli: Add example for job artifacts download (
375b29d
)cli: Use inline anonymous references for external links (
f2cf467
)
There doesn’t seem to be an obvious way to use an alias for identical text labels that link to different targets. With inline links we can work around this shortcoming. Until we know better.
cli-usage: Fixed term (
d282a99
)groups: Add example for creating subgroups (
92eb4e3
)issues: Add admin, project owner hint (
609c03b
)
Closes #1101
projects: Correct fork docs (
54921db
)
Closes #1126
readme: Also add hint to delete gitlab-runner-test (
8894f2d
)
Otherwise the whole testsuite will refuse to run
readme: Update supported Python versions (
20b1e79
)
Features¶
Add MINIMAL_ACCESS constant (
49eb3ca
)
A “minimal access” access level was introduced in GitLab 13.5.
Added support for pipeline bridges (
05cbdc2
)Adds support for project merge request approval rules (#1199,
c6fbf39
)Support multipart uploads (
2fa3004
)Unit tests added (
f37ebf5
)api: Add support for user identity provider deletion (
e78e121
)api: Added wip filter param for merge requests (
d6078f8
)api: Added wip filter param for merge requests (
aa6e80d
)tests: Test label getter (
a41af90
)
Refactoring¶
tests: Split functional tests (
61e43eb
)
Testing¶
Add test_project_merge_request_approvals.py (
9f6335f
)Add unit tests for badges API (
2720b73
)Add unit tests for resource label events API (
e9a211c
)Ignore failing test for now (
4b4e253
)cli: Add test for job artifacts download (
f4e7950
)env: Replace custom scripts with pytest and docker-compose (
79489c7
)
v2.5.0 (2020-09-01)¶
Bug Fixes¶
Implement Gitlab’s behavior change for owned=True (
9977799
)Tests fail when using REUSE_CONTAINER option (
0078f89
)
Fixes #1146
Wrong reconfirmation parameter when updating user’s email (
b5c267e
)
Since version 10.3 (and later), param to not send (re)confirmation when updating an user is
skip_reconfirmation
(and not skip_confirmation
).
See:
https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/15175?tab= * https://docs.gitlab.com/11.11/ee/api/users.html#user-modification * https://docs.gitlab.com/ee/api/users.html#user-modification
Chores¶
Bump python-gitlab to 2.5.0 (
56fef01
)Make latest black happy with existing code (
6961479
)Make latest black happy with existing code (
4039c8c
)Make latest black happy with existing code (
d299753
)Remove remnants of python2 imports (
402566a
)Remove unnecessary import (
f337b7a
)Run unittest2pytest on all unit tests (
11383e7
)Update tools dir for latest black version (
c2806d8
)Update tools dir for latest black version (
f245ffb
)ci: Pin gitlab-ce version for renovate (
cb79fb7
)ci: Use fixed black version (
9565684
)deps: Update gitlab/gitlab-ce docker tag to v13.3.2-ce.0 (
9fd778b
)deps: Update python docker tag to v3.8 (
a8070f2
)env: Add pre-commit and commit-msg hooks (
82070b2
)test: Use pathlib for paths (
5a56b6b
)
Documentation¶
Additional project file delete example (
9e94b75
)
Showing how to delete without having to pull the file
Features¶
Fixes #1154
Refactoring¶
Testing¶
Add unit tests for resource milestone events API (
1317f4b
)
Fixes #1154
v2.4.0 (2020-07-09)¶
Bug Fixes¶
Co-authored-by: Traian Nedelea tron1point0@pm.me
Chores¶
Bump version to 2.4.0 (
1606310
)
Documentation¶
pipelines: Simplify download (
9a068e0
)
This uses a context instead of inventing your own stream handler which makes the code simpler and should be fine for most use cases.
Signed-off-by: Paul Spooren mail@aparcar.org
Features¶
Added NO_ACCESS const (
dab4d0a
)
This constant is useful for cases where no access is granted, e.g. when creating a protected branch.
The NO_ACCESS
const corresponds to the definition in
https://docs.gitlab.com/ee/api/protected_branches.html
v2.3.1 (2020-06-09)¶
Bug Fixes¶
Disable default keyset pagination (
e71fe16
)
Instead we set pagination to offset on the other paths
Chores¶
Bump version to 2.3.1 (
870e7ea
)
v2.3.0 (2020-06-08)¶
Bug Fixes¶
Use keyset pagination by default for /projects > 50000 (
f86ef3b
)
Workaround for https://gitlab.com/gitlab-org/gitlab/-/issues/218504. Remove this in 13.1
config: Fix duplicate code (
ee2df6f
)
Fixes #1094
project: Add missing project parameters (
ad8c67d
)
Chores¶
Bring commit signatures up to date with 12.10 (
dc382fe
)Bump to 2.3.0 (
01ff865
)Correctly render rst (
f674bf2
)Fix typo in docstring (
c20f5f1
)Remove old builds-email service (
c60e2df
)Use pytest for unit tests and coverage (
9787a40
)ci: Add codecov integration to Travis (
e230568
)services: Update available service attributes (
7afc357
)test: Remove outdated token test (
e6c9fe9
)
Continuous Integration¶
Documentation¶
Features¶
fix: remove version from setup
feat: add pipeline schedule play error exception
docs: add documentation for pipeline schedule play
Allow an environment variable to specify config location (
401e702
)
It can be useful (especially in scripts) to specify a configuration location via an environment variable. If the “PYTHON_GITLAB_CFG” environment variable is defined, treat its value as the path to a configuration file and include it in the set of default configuration locations.
api: Added support in the GroupManager to upload Group avatars (
28eb7ea
)services: Add project service list API (
fc52221
)
Can be used to list available services It was introduced in GitLab 12.7
types: Add dir to RESTObject to expose attributes (
cad134c
)
Testing¶
v2.2.0 (2020-04-07)¶
Bug Fixes¶
Chores¶
Bump to 2.2.0 (
22d4b46
)Clean up for black and flake8 (
4fede5d
)Fix typo in allow_failures (
265bbdd
)Flatten test_import_github (
b8ea96c
)Improve and document testing against different images (
98d3f77
)Move test_import_github into TestProjectImport (
a881fb7
)Pass environment variables in tox (
e06d33c
)Remove references to python2 in test env (
6e80723
)Rename ExportMixin to DownloadMixin (
847da60
)
chore(group): update group_manager attributes
Co-Authored-By: Nejc Habjan hab.nejc@gmail.com
mixins: Factor out export download into ExportMixin (
6ce5d1f
)
Documentation¶
Co-Authored-By: Nejc Habjan hab.nejc@gmail.com
Fix comment of prev_page() (
ac6b2da
)
Co-Authored-By: Nejc Habjan hab.nejc@gmail.com
Fix comment of prev_page() (
7993c93
)
Features¶
Add create from template args to ProjectManager (
f493b73
)
This commit adds the v4 Create project attributes necessary to create a project from a project, instance, or group level template as documented in https://docs.gitlab.com/ee/api/projects.html#create-project
Testing¶
Add unit tests for Project Export (
600dc86
)Add unit tests for Project Import (
f7aad5f
)Create separate module for commit tests (
8c03771
)Move mocks to top of module (
0bff713
)Prepare base project test class for more tests (
915587f
)api: Add tests for group export/import API (
e7b2d6c
)types: Reproduce get_for_api splitting strings (#1057,
babd298
)
v2.1.2 (2020-03-09)¶
Chores¶
Bump version to 2.1.2 (
ad7e2bf
)
v2.1.1 (2020-03-09)¶
Bug Fixes¶
docs: Additional project statistics example (
5ae5a06
)
Chores¶
v2.1.0 (2020-03-08)¶
Bug Fixes¶
Do not require empty data dict for create() (
99d959f
)Remove null values from features POST data, because it fails (
1ec1816
)Return response with commit data (
b77b945
)docs: Fix typo in user memberships example (
33889bc
)docs: Update to new set approvers call for # of approvers (
8e0c526
)
to set the # of approvers for an MR you need to use the same function as for setting the approvers id.
docs and tests: Update docs and tests for set_approvers (
2cf12c7
)
Updated the docs with the new set_approvers arguments, and updated tests with the arg as well.
objects: Add default name data and use http post (
70c0cfb
)
Updating approvers new api needs a POST call. Also It needs a name of the new rule, defaulting this to ‘name’.
objects: Update set_approvers function call (
65ecadc
)
Added a miss paramter update to the set_approvers function
objects: Update to new gitlab api for path, and args (
e512cdd
)
Updated the gitlab path for set_approvers to approvers_rules, added default arg for rule type, and added arg for # of approvals required.
projects: Correct copy-paste error (
adc9101
)
Chores¶
Bump version to 2.1.0 (
47cb58c
)Ensure developers use same gitlab image as Travis (
fab17fc
)Fix broken requests links (
b392c21
)
Another case of the double slash rewrite.
Code Style¶
Fix black violations (
ad3e833
)
Documentation¶
Co-Authored-By: Mitar mitar.git@tnode.com
Features¶
Performance Improvements¶
Prepare environment when gitlab is reconfigured (
3834d9c
)
Testing¶
v2.0.1 (2020-02-05)¶
Chores¶
Bump to 2.1.0 (
a6c0660
)
There are a few more features in there
I’ve misread the tag
user: Update user attributes (
27375f6
)
This also workarounds an GitLab issue, where private_profile, would reset to false if not supplied
Documentation¶
auth: Remove email/password auth (
c9329bb
)
v2.0.0 (2020-01-26)¶
Bug Fixes¶
projects: Adjust snippets to match the API (
e104e21
)
Chores¶
Stepping thru Sphinx versions from 1.6.5 to 1.7.5 build_sphinx fails. Once Sphinx == 1.7.6 build_sphinx finished.
Bump minimum required requests version (
3f78aa3
)
for security reasons
Bump to 2.0.0 (
c817dcc
)
Dropping support for legacy python requires a new major version
Drop legacy python tests (
af8679a
)
Support dropped for: 2.7, 3.4, 3.5
Enforce python version requirements (
70176db
)
Documentation¶
Fixes #969
Features¶
Refactoring¶
This is most likely only useful for the CLI
Testing¶
v1.15.0 (2019-12-16)¶
Bug Fixes¶
Ignore all parameter, when as_list=True (
137d72b
)
Closes #962
Chores¶
Code Style¶
Format with the latest black version (
06a8050
)
Documentation¶
The function file.delete()
requires branch
argument in addition to commit_message
.
Features¶
Access project’s issues statistics (
482e57b
)
Fixes #966
Add support for /import/github (
aa4d41b
)
Addresses python-gitlab/python-gitlab#952
This adds a method to the ProjectManager
called import_github
, which maps to the
/import/github
API endpoint. Calling import_github
will trigger an import operation from
<repo_id> into <target_namespace>, using <personal_access_token> to authenticate against github.
In practice a gitlab server may take many 10’s of seconds to respond to this API call, so we also
take the liberty of increasing the default timeout (only for this method invocation).
Unfortunately since import
is a protected keyword in python, I was unable to follow the endpoint
structure with the manager namespace. I’m open to suggestions on a more sensible interface.
I’m successfully using this addition to batch-import hundreds of github repositories into gitlab.
Add variable_type to groups ci variables (
0986c93
)
This adds the ci variables types for create/update requests.
See https://docs.gitlab.com/ee/api/group_level_variables.html#create-variable
Add variable_type/protected to projects ci variables (
4724c50
)
This adds the ci variables types and protected flag for create/update requests.
See https://docs.gitlab.com/ee/api/project_level_variables.html#create-variable
Adding project stats (
db0b00a
)
Fixes #967
Allow cfg timeout to be overrided via kwargs (
e9a8289
)
On startup, the timeout
parameter is loaded from config and stored on the base gitlab object
instance. This instance parameter is used as the timeout for all API requests (it’s passed into
the session
object when making HTTP calls).
This change allows any API method to specify a timeout
argument to **kwargs
that will override
the global timeout value. This was somewhat needed / helpful for the import_github
method.
I have also updated the docs accordingly.
Fixes #970
Testing¶
v1.14.0 (2019-12-07)¶
Bug Fixes¶
Added missing attributes for project approvals (
460ed63
)
Reference: https://docs.gitlab.com/ee/api/merge_request_approvals.html#change-configuration
Missing attributes: * merge_requests_author_approval * merge_requests_disable_committers_approval
labels: Ensure label.save() works (
727f536
)
Otherwise, we get: File “gitlabracadabra/mixins/labels.py”, line 67, in _process_labels current_label.save() File “gitlab/exceptions.py”, line 267, in wrapped_f return f(*args, **kwargs) File “gitlab/v4/objects.py”, line 896, in save self._update_attrs(server_data) File “gitlab/base.py”, line 131, in _update_attrs self.dict[“_attrs”].update(new_attrs) TypeError: ‘NoneType’ object is not iterable
Because server_data is None.
Chores¶
Documentation¶
Add project and group cluster examples (
d15801d
)Fix typo (
d9871b1
)changelog: Add notice for release-notes on Github (#938,
de98e57
)pipelines_and_jobs: Add pipeline custom variables usage example (
b275eb0
)readme: Fix Docker image reference (
b9a40d8
)
v1.8.0 is not available. ``` Unable to find image ‘registry.gitlab.com/python-gitlab/python-gitlab:v1.8.0’ locally docker: Error response from daemon: manifest for registry.gitlab.com/python-gitlab/python-gitlab:v1.8.0 not found: manifest unknown: manifest unknown.
- **snippets**: Fix snippet docs
([`bbaa754`](https://github.com/python-gitlab/python-gitlab/commit/bbaa754673c4a0bffece482fe33e4875ddadc2dc))
Fixes #954
### Features
- Add audit endpoint
([`2534020`](https://github.com/python-gitlab/python-gitlab/commit/2534020b1832f28339ef466d6dd3edc21a521260))
- Add project and group clusters
([`ebd053e`](https://github.com/python-gitlab/python-gitlab/commit/ebd053e7bb695124c8117a95eab0072db185ddf9))
- Add support for include_subgroups filter
([`adbcd83`](https://github.com/python-gitlab/python-gitlab/commit/adbcd83fa172af2f3929ba063a0e780395b102d8))
## v1.13.0 (2019-11-02)
### Bug Fixes
- **projects**: Support `approval_rules` endpoint for projects
([`2cef2bb`](https://github.com/python-gitlab/python-gitlab/commit/2cef2bb40b1f37b97bb2ee9894ab3b9970cef231))
The `approvers` API endpoint is deprecated [1]. GitLab instead uses the `approval_rules` API
endpoint to modify approval settings for merge requests. This adds the functionality for
project-level merge request approval settings.
Note that there does not exist an endpoint to 'get' a single approval rule at this moment - only
'list'.
[1] https://docs.gitlab.com/ee/api/merge_request_approvals.html
### Chores
- Bump version to 1.13.0
([`d0750bc`](https://github.com/python-gitlab/python-gitlab/commit/d0750bc01ed12952a4d259a13b3917fa404fd435))
- **ci**: Update latest docker image for every tag
([`01cbc7a`](https://github.com/python-gitlab/python-gitlab/commit/01cbc7ad04a875bea93a08c0ce563ab5b4fe896b))
- **dist**: Add test data
([`3133ed7`](https://github.com/python-gitlab/python-gitlab/commit/3133ed7d1df6f49de380b35331bbcc67b585a61b))
Closes #907
- **setup**: We support 3.8 ([#924](https://github.com/python-gitlab/python-gitlab/pull/924),
[`6048175`](https://github.com/python-gitlab/python-gitlab/commit/6048175ef2c21fda298754e9b07515b0a56d66bd))
* chore(setup): we support 3.8
* style: format with black
### Documentation
- Projects get requires id
([`5bd8947`](https://github.com/python-gitlab/python-gitlab/commit/5bd8947bd16398aed218f07458aef72e67f2d130))
Also, add an example value for project_id to the other projects.get() example.
- **project**: Fix group project example
([`e680943`](https://github.com/python-gitlab/python-gitlab/commit/e68094317ff6905049e464a59731fe4ab23521de))
GroupManager.search is removed since 9a66d78, use list(search='keyword') instead
### Features
- Add deployment creation
([`ca256a0`](https://github.com/python-gitlab/python-gitlab/commit/ca256a07a2cdaf77a5c20e307d334b82fd0fe861))
Added in GitLab 12.4
Fixes #917
- Add users activate, deactivate functionality
([`32ad669`](https://github.com/python-gitlab/python-gitlab/commit/32ad66921e408f6553b9d60b6b4833ed3180f549))
These were introduced in GitLab 12.4
- Send python-gitlab version as user-agent
([`c22d49d`](https://github.com/python-gitlab/python-gitlab/commit/c22d49d084d1e03426cfab0d394330f8ab4bd85a))
- **auth**: Remove deprecated session auth
([`b751cdf`](https://github.com/python-gitlab/python-gitlab/commit/b751cdf424454d3859f3f038b58212e441faafaf))
- **doc**: Remove refs to api v3 in docs
([`6beeaa9`](https://github.com/python-gitlab/python-gitlab/commit/6beeaa993f8931d6b7fe682f1afed2bd4c8a4b73))
- **test**: Unused unittest2, type -> isinstance
([`33b1801`](https://github.com/python-gitlab/python-gitlab/commit/33b180120f30515d0f76fcf635cb8c76045b1b42))
### Testing
- Remove warning about open files from test_todo()
([`d6419aa`](https://github.com/python-gitlab/python-gitlab/commit/d6419aa86d6ad385e15d685bf47242bb6c67653e))
When running unittests python warns that the json file from test_todo() was still open. Use with to
open, read, and create encoded json data that is used by resp_get_todo().
- **projects**: Support `approval_rules` endpoint for projects
([`94bac44`](https://github.com/python-gitlab/python-gitlab/commit/94bac4494353e4f597df0251f0547513c011e6de))
## v1.12.1 (2019-10-07)
### Bug Fixes
- Fix not working without auth
([`03b7b5b`](https://github.com/python-gitlab/python-gitlab/commit/03b7b5b07e1fd2872e8968dd6c29bc3161c6c43a))
## v1.12.0 (2019-10-06)
### Bug Fixes
- **cli**: Fix cli command user-project list
([`c17d7ce`](https://github.com/python-gitlab/python-gitlab/commit/c17d7ce14f79c21037808894d8c7ba1117779130))
- **labels**: Don't mangle label name on update
([`1fb6f73`](https://github.com/python-gitlab/python-gitlab/commit/1fb6f73f4d501c2b6c86c863d40481e1d7a707fe))
- **todo**: Mark_all_as_done doesn't return anything
([`5066e68`](https://github.com/python-gitlab/python-gitlab/commit/5066e68b398039beb5e1966ba1ed7684d97a8f74))
### Chores
- Bump to 1.12.0
([`4648128`](https://github.com/python-gitlab/python-gitlab/commit/46481283a9985ae1b07fe686ec4a34e4a1219b66))
- **ci**: Build test images on tag
([`0256c67`](https://github.com/python-gitlab/python-gitlab/commit/0256c678ea9593c6371ffff60663f83c423ca872))
### Code Style
- Format with black
([`fef085d`](https://github.com/python-gitlab/python-gitlab/commit/fef085dca35d6b60013d53a3723b4cbf121ab2ae))
### Documentation
- **project**: Add submodule docs
([`b5969a2`](https://github.com/python-gitlab/python-gitlab/commit/b5969a2dcea77fa608cc29be7a5f39062edd3846))
- **projects**: Add note about project list
([`44407c0`](https://github.com/python-gitlab/python-gitlab/commit/44407c0f59b9602b17cfb93b5e1fa37a84064766))
Fixes #795
- **repository-tags**: Fix typo
([`3024c5d`](https://github.com/python-gitlab/python-gitlab/commit/3024c5dc8794382e281b83a8266be7061069e83e))
Closes #879
- **todo**: Correct todo docs
([`d64edcb`](https://github.com/python-gitlab/python-gitlab/commit/d64edcb4851ea62e72e3808daf7d9b4fdaaf548b))
### Features
- Add support for job token
([`cef3aa5`](https://github.com/python-gitlab/python-gitlab/commit/cef3aa51a6928338c6755c3e6de78605fae8e59e))
See https://docs.gitlab.com/ee/api/jobs.html#get-job-artifacts for usage
- **ci**: Improve functionnal tests
([`eefceac`](https://github.com/python-gitlab/python-gitlab/commit/eefceace2c2094ef41d3da2bf3c46a58a450dcba))
- **project**: Add file blame api
([`f5b4a11`](https://github.com/python-gitlab/python-gitlab/commit/f5b4a113a298d33cb72f80c94d85bdfec3c4e149))
https://docs.gitlab.com/ee/api/repository_files.html#get-file-blame-from-repository
- **project**: Implement update_submodule
([`4d1e377`](https://github.com/python-gitlab/python-gitlab/commit/4d1e3774706f336e87ebe70e1b373ddb37f34b45))
- **user**: Add status api
([`62c9fe6`](https://github.com/python-gitlab/python-gitlab/commit/62c9fe63a47ddde2792a4a5e9cd1c7aa48661492))
### Refactoring
- Remove obsolete test image
([`a14c02e`](https://github.com/python-gitlab/python-gitlab/commit/a14c02ef85bd4d273b8c7f0f6bd07680c91955fa))
Follow up of #896
- Remove unused code, simplify string format
([`c7ff676`](https://github.com/python-gitlab/python-gitlab/commit/c7ff676c11303a00da3a570bf2893717d0391f20))
### Testing
- Re-enabled py_func_v4 test
([`49d84ba`](https://github.com/python-gitlab/python-gitlab/commit/49d84ba7e95fa343e622505380b3080279b83f00))
- **func**: Disable commit test
([`c9c76a2`](https://github.com/python-gitlab/python-gitlab/commit/c9c76a257d2ed3b394f499253d890c2dd9a01e24))
GitLab seems to be randomly failing here
- **status**: Add user status test
([`fec4f9c`](https://github.com/python-gitlab/python-gitlab/commit/fec4f9c23b8ba33bb49dca05d9c3e45cb727e0af))
- **submodules**: Correct test method
([`e59356f`](https://github.com/python-gitlab/python-gitlab/commit/e59356f6f90d5b01abbe54153441b6093834aa11))
- **todo**: Add unittests
([`7715567`](https://github.com/python-gitlab/python-gitlab/commit/77155678a5d8dbbf11d00f3586307694042d3227))
## v1.11.0 (2019-08-31)
### Bug Fixes
- Add project and group label update without id to fix cli
([`a3d0d7c`](https://github.com/python-gitlab/python-gitlab/commit/a3d0d7c1e7b259a25d9dc84c0b1de5362c80abb8))
- Remove empty dict default arguments
([`8fc8e35`](https://github.com/python-gitlab/python-gitlab/commit/8fc8e35c63d7ebd80408ae002693618ca16488a7))
Signed-off-by: Frantisek Lachman <flachman@redhat.com>
- Remove empty list default arguments
([`6e204ce`](https://github.com/python-gitlab/python-gitlab/commit/6e204ce819fc8bdd5359325ed7026a48d63f8103))
Signed-off-by: Frantisek Lachman <flachman@redhat.com>
- **projects**: Avatar uploading for projects
([`558ace9`](https://github.com/python-gitlab/python-gitlab/commit/558ace9b007ff9917734619c05a7c66008a4c3f0))
### Chores
- Bump package version
([`37542cd`](https://github.com/python-gitlab/python-gitlab/commit/37542cd28aa94ba01d5d289d950350ec856745af))
### Features
- Add methods to retrieve an individual project environment
([`29de40e`](https://github.com/python-gitlab/python-gitlab/commit/29de40ee6a20382c293d8cdc8d831b52ad56a657))
- Group labels with subscriptable mixin
([`4a9ef9f`](https://github.com/python-gitlab/python-gitlab/commit/4a9ef9f0fa26e01fc6c97cf88b2a162e21f61cce))
### Testing
- Add group label cli tests
([`f7f24bd`](https://github.com/python-gitlab/python-gitlab/commit/f7f24bd324eaf33aa3d1d5dd12719237e5bf9816))
## v1.10.0 (2019-07-22)
### Bug Fixes
- Convert # to %23 in URLs
([`14f5385`](https://github.com/python-gitlab/python-gitlab/commit/14f538501bfb47c92e02e615d0817675158db3cf))
Refactor a bit to handle this change, and add unit tests.
Closes #779
- Docker entry point argument passing
([`67ab637`](https://github.com/python-gitlab/python-gitlab/commit/67ab6371e69fbf137b95fd03105902206faabdac))
Fixes the problem of passing spaces in the arguments to the docker entrypoint.
Before this fix, there was virtually no way to pass spaces in arguments such as task description.
- Enable use of YAML in the CLI
([`ad0b476`](https://github.com/python-gitlab/python-gitlab/commit/ad0b47667f98760d6a802a9d08b2da8f40d13e87))
In order to use the YAML output, PyYaml needs to be installed on the docker image. This commit adds
the installation to the dockerfile as a separate layer.
- Handle empty 'Retry-After' header from GitLab
([`7a3724f`](https://github.com/python-gitlab/python-gitlab/commit/7a3724f3fca93b4f55aed5132cf46d3718c4f594))
When requests are throttled (HTTP response code 429), python-gitlab assumed that 'Retry-After'
existed in the response headers. This is not always the case and so the request fails due to a
KeyError. The change in this commit adds a rudimentary exponential backoff to the 'http_request'
method, which defaults to 10 retries but can be set to -1 to retry without bound.
- Improve pickle support
([`b4b5dec`](https://github.com/python-gitlab/python-gitlab/commit/b4b5decb7e49ac16d98d56547a874fb8f9d5492b))
- Pep8 errors
([`334f9ef`](https://github.com/python-gitlab/python-gitlab/commit/334f9efb18c95bb5df3271d26fa0a55b7aec1c7a))
Errors have not been detected by broken travis runs.
- Re-add merge request pipelines
([`877ddc0`](https://github.com/python-gitlab/python-gitlab/commit/877ddc0dbb664cd86e870bb81d46ca614770b50e))
- Remove decode() on error_message string
([`16bda20`](https://github.com/python-gitlab/python-gitlab/commit/16bda20514e036e51bef210b565671174cdeb637))
The integration tests failed because a test called 'decode()' on a string-type variable - the
GitLabException class handles byte-to-string conversion already in its __init__. This commit
removes the call to 'decode()' in the test.
``` Traceback (most recent call last): File "./tools/python_test_v4.py", line 801, in <module>
assert 'Retry later' in error_message.decode() AttributeError: 'str' object has no attribute
'decode'
Use python2 compatible syntax for super (
b08efcb
)api: Avoid parameter conflicts with python and gitlab (
4bd027a
)
Provide another way to send data to gitlab with a new query_parameters
argument. This parameter
can be used to explicitly define the dict of items to send to the server, so that **kwargs are
only used to specify python-gitlab specific parameters.
Closes #566 Closes #629
api: Don’t try to parse raw downloads (
35a6d85
)
http_get always tries to interpret the retrieved data if the content-type is json. In some cases (artifact download for instance) this is not the expected behavior.
This patch changes http_get and download methods to always get the raw data without parsing.
Closes #683
api: Make *MemberManager.all() return a list of objects (
d74ff50
)
Fixes #699
api: Make reset_time_estimate() work again (
cb388d6
)
Closes #672
cli: Allow –recursive parameter in repository tree (
7969a78
)
Fixes #718 Fixes #731
cli: Don’t fail when the short print attr value is None (
8d1552a
)
Fixes #717 Fixes #727
cli: Exit on config parse error, instead of crashing (
6ad9da0
)
Exit and hint user about possible errors * test: adjust test cases to config missing error
cli: Fix update value for key not working (
b766203
)cli: Print help and usage without config file (
6bb4d17
)
Fixes #560
docker: Use docker image with current sources (
06e8ca8
)
Chores¶
Add a tox job to run black (
c27fa48
)
Allow lines to be 88 chars long for flake8.
Bump package version to 1.10.0 (
c7c8470
)Disable failing travis test (
515aa9a
)Move checks back to travis (
b764525
)Release tags to PyPI automatically (
3133b48
)
Fixes #609
ci: Add automatic GitLab image pushes (
95c9b6d
)ci: Don’t try to publish existing release (
b4e818d
)ci: Fix gitlab PyPI publish (
3e37df1
)ci: Rebuild test image, when something changed (
2fff260
)ci: Update the GitLab version in the test image (
c410699
)ci: Use reliable ci system (
724a672
)setup: Add 3.7 to supported python versions (
b1525c9
)tests: Add rate limit tests (
e216f06
)
Code Style¶
Format with black again (
22b5082
)
Documentation¶
Add a note for python 3.5 for file content update (
ca014f8
)
The data passed to the JSON serializer must be a string with python 3. Document this in the exemples.
Fix #175
Add an example of trigger token usage (
ea1eefe
)
Closes #752
Add ApplicationSettings API (
ab7d794
)Add builds-related API docs (
8e6a944
)Add deploy keys API (
ea089e0
)Add labales API (
31882b8
)Add licenses API (
4540614
)Add milestones API (
7411907
)Add missing = (
391417c
)Add missing requiredCreateAttrs (
b08d74a
)Add MR API (
5614a7c
)Add MR approvals in index (
0b45afb
)Add pipeline deletion (
2bb2571
)Add project members doc (
dcf31a4
)Commits API (
07c5594
)Crossref improvements (
6f9f42b
)Do not use the :option: markup (
368017c
)Document hooks API (
b21dca0
)Document projects API (
967595f
)Fix “required” attribute (
e64d0b9
)Fix invalid Raise attribute in docstrings (
95a3fe6
)Fork relationship API (
21f48b3
)Groups API documentation (
4d871aa
)Improve the pagination section (
29e2efe
)Issues API (
41cbc32
)Notes API (
3e026d2
)Project repository API (
71a2a4f
)Project search API (
e4cd04c
)Re-order api examples (
5d149a2
)
Pipelines and Jobs
and Protected Branches
are out of order in contents and sometimes hard to
find when looking for examples.
Remove the build warning about _static (
764d3ca
)Remove v3 support (
7927663
)Repository files API (
f00340f
)Snippets API (
35b7f75
)Start a FAQ (
c305459
)System hooks API (
5c51bf3
)Tags API (
dd79eda
)Trigger_pipeline only accept branches and tags as ref (
d63748a
)
Fixes #430
Fixes #798
cli: Add PyYAML requirement notice (
d29a489
)
Fixes #606
groups: Fix typo (
ac2d65a
)
Fixes #635
projects: Add mention about project listings (
f604b25
)
Having exactly 20 internal and 5 private projects in the group spent some time debugging this issue.
Hopefully that helped: https://github.com/python-gitlab/python-gitlab/issues/93
Imho should be definitely mention about all=True
parameter.
Fixes #630
readme: Add docs build information (
6585c96
)readme: Add more info about commitlint, code-format (
286f703
)readme: Fix six url (
0bc30f8
)
six URL was pointing to 404
readme: Provide commit message guidelines (
bed8e1b
)
Fixes #660
Fixes #828
Features¶
Add endpoint to get the variables of a pipeline (
564de48
)
It adds a new endpoint which was released in the Gitlab CE 11.11.
Signed-off-by: Agustin Henze tin@redhat.com
Closes #801
Add support for issue.related_merge_requests (
90a3631
)
Closes #794
Added approve & unapprove method for Mergerequests (
53f7de7
)
Offical GitLab API supports this for GitLab EE
Bump version to 1.9.0 (
aaed448
)Get artifact by ref and job (
cda1174
)Implement artifacts deletion (
76b6e1f
)
Closes #744
Obey the rate limit (
2abf9ab
)
done by using the retry-after header
Fixes #166
feat(GitLab Update): delete ProjectPipeline
As of Gitlab 11.6 it is now possible to delete a pipeline - https://docs.gitlab.com/ee/api/pipelines.html#delete-a-pipeline
Refactoring¶
to MAINTAINER_ACCESS to follow GitLab 11.0 docs
See: https://docs.gitlab.com/ce/user/permissions.html#project-members-permissions
Testing¶
Add project releases test (
8ff8af0
)
Fixes #762
Always use latest version to test (
82b0fc6
)Increase speed by disabling the rate limit faster (
497f56c
)Minor test fixes (
3b523f4
)Update the tests for GitLab 11.11 (
622854f
)
Changes in GitLab make the functional tests fail:
Some actions add new notes and discussions: do not use hardcoded values in related listing asserts
The feature flag API is buggy (errors 500): disable the tests for now