Update dependency python-gitlab to v5 #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
==3.15.0
->==5.3.0
Release Notes
python-gitlab/python-gitlab (python-gitlab)
v5.3.0
Compare Source
Chores
(#3070,
62b7eb7
)Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
(
aa07449
)Features
(
40af1c8
)v5.2.0
Compare Source
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>
(#3065,
db0db26
)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
(
b70830d
)Documentation
(#3059,
f460d95
)Features
0d41da3
)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
(
288f39c
)v5.1.0
Compare Source
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>
(#3044,
79113d9
)Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
(
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
Compare Source
Bug Fixes
(#3011,
1a68f1c
)Co-authored-by: Patrick Evans [email protected]
Chores
b565e78
)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.
(
14d2a82
)Also fix annotations not working in Python 3.14 by using the annotation on the 'class' instead
of on the 'instance'
Closes: #3013
(#3017,
482f2fe
)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
fe89b94
Author: Gauvain Pocentek [email protected]Date: Sat May 19 17:10:08 2018 +0200
Drop API v3 support
Drop the code, the tests, and update the documentation.
deps: Update all non-major dependencies
(
1e4326b
)deps: Update all non-major dependencies
(
b3834dc
)deps: Update dependency ubuntu to v24
(
6fda15d
)deps: Update gitlab/gitlab-ee docker tag to v17.4.2-ee.0
(
1cdfe40
)deps: Update gitlab/gitlab-ee docker tag to v17.5.0-ee.0
(
c02a392
)Documentation
(#3022,
3739b5d
)Features
(#3005,
9734ad4
)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
to_json()
method(
f4bfe19
)This should get us to 100% test coverage on
gitlab/base.py
BREAKING CHANGES
v4.13.0
Compare Source
Chores
deps: Update all non-major dependencies
(
c3efb37
)deps: Update dependency pre-commit to v4
(#3008,
5c27546
)Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Features
(
0ee0e02
)v4.12.2
Compare Source
Bug Fixes
project.files.head()
method(#3006,
9bf26df
)When an error occurs, raise
GitlabHeadError
inproject.files.head()
method.Closes: #3004
v4.12.1
Compare Source
Bug Fixes
ci: Do not rely on GitLab.com runner arch variables
(#3003,
c848d12
)files: Correctly raise GitlabGetError in get method
(
190ec89
)Chores
(#3000,
d3da326
)Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
(
64eed5d
)v4.12.0
Compare Source
Bug Fixes
(#2977,
96a18b0
)Co-authored-by: Patrick Evans [email protected]
Co-authored-by: Nejc Habjan [email protected]
Chores
(#2997,
a0729b8
)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.
deps: Update all non-major dependencies
(
ae132e7
)deps: Update all non-major dependencies
(
10ee58a
)deps: Update dependency types-setuptools to v75
(
a2ab54c
)deps: Update gitlab/gitlab-ee docker tag to v17.3.2-ee.0
(
5cd1ab2
)deps: Update gitlab/gitlab-ee docker tag to v17.4.0-ee.0
(
8601808
)Features
Introduce related_issues to merge requests
(#2996,
174d992
)build: Build multi-arch images
(#2987,
29f617d
)v4.11.1
Compare Source
Bug Fixes
(
b41b2de
)v4.11.0
Compare Source
Chores
deps: Update all non-major dependencies
(
fac8bf9
)deps: Update all non-major dependencies
(
88c7529
)deps: Update dependency types-setuptools to v74
(
bdfaddb
)pre-commit: Add deps
(
fe5e608
)Documentation
(
b9f5c12
)Features
Add a minimal GraphQL client
(
d6b1b0a
)api: Add exclusive GET attrs for /groups/:id/members
(
d44ddd2
)api: Add exclusive GET attrs for /projects/:id/members
(
e637808
)client: Add retry handling to GraphQL client
(
8898c38
)client: Make retries configurable in GraphQL
(
145870e
)Refactoring
(
3235c48
)v4.10.0
Compare Source
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
(
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
(
9353f54
)Add the ability to trigger tests of project and group hooks.
Fixes #2924
Testing
(
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
Compare Source
Chores
(
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
(
64ae61e
)v4.8.0
Compare Source
Bug Fixes
participants()
method usehttp_list()
(
d065275
)Previously it was using
http_get()
but theparticipants
API returns a list of participants. Alsoby using this then we will warn if only a subset of the participants are returned.
Closes: #2913
closed_by()/related_merge_requests()
usehttp_list
(
de2e4dd
)The
closed_by()
andrelated_merge_requests()
API calls return lists. So use thehttp_list()
method.
This will also warn the user if only a subset of the data is returned.
list
does not return all entries(
e5a4379
)Previously in the CLI, calls to
list()
would haveget_all=False
by default. Therefore hiding thefact that not all items are being returned if there were more than 20 items.
Added
--no-get-all
option tolist
actions. Along with the already existing--get-all
.Closes: #2900
None
(
51d8f88
)Co-authored-by: Nejc Habjan [email protected]
ref
parameter optional in get raw file api(
00640ac
)The
ref
parameter was made optional in gitlab v13.11.0.Chores
show_caller
argument toutils.warn()
(
7d04315
)This allows us to not add the caller's location to the UserWarning message.
Use correct type-hint for
die()
(
9358640
)ci: Specify name of "stale" label
(
44f62c4
)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.
(
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 forresponse' 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
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 thensave
it usingsudo
Closes: #532
filter
for updating(
c378817
)Add a note about using
filter
when updating a variable.Closes: #2835
Closes: #1387
Closes: #1125
Features
api: Add support for commit sequence
(
1f97be2
)api: Add support for container registry protection rules
(
6d31649
)api: Add support for package protection rules
(
6b37811
)api: Add support for project cluster agents
(
32dbc6f
)Refactoring
(
c307dd2
)Testing
files: Omit optional
ref
parameter in test case(
9cb3396
)files: Test with and without
ref
parameter in test case(
f316b46
)fixtures: Remove deprecated config option
(
2156949
)registry: Disable functional tests for unavailable endpoints
(
ee393a1
)v4.7.0
Compare Source
Bug Fixes
(
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
orsome 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
gitlab project-key enable
(
1291dbb
)Add some help text for
gitlab project-key enable
. This both adds help text and shows how to usethe 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
(
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
--no-mask-credentials
CLI argument(
18aa1fc
)This gives the ability to not mask credentials when using the
--debug
argument.(
635f5a7
)v4.6.0
Compare Source
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 handlemore than the default of 20 approval rules.
Closes: #2825
--id
when enabling a deploy key(
98fc578
)No longer require
--id
when doing: gitlab project-key enableNow only the --project-id and --key-id are required.
(
37b5a70
)Update the minimum versions of the dependencies in the pyproject.toml file.
This is related to PR #2878
(
33fbc14
)Signed-off-by: Adrian DC [email protected]
Chores
(
74db84c
)This adds the
.git-blame-ignore-revs
file which allows ignoring certain commits when doing agit 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
(
62fa271
)Closes: #2821
job.trace()
(
840572e
)Closes: #2808
Create a CustomAction dataclass
(
61d8679
)Remove typing-extensions from requirements.txt
(
d569128
)We no longer support Python versions before 3.8. So it isn't needed anymore.
(
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.
(
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
(
f1ef565
)This makes it easier for people to map CLI command names to the API.
Looks like this: $ gitlab --help The GitLab resource to manipulate. application API endpoint:
/applications application-appearance API endpoint: /application/appearance application-settings
API endpoint: /application/settings application-statistics API endpoint: /application/statistics
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
(
12d195a
)I don't think commit
a2b8c8c
went far enough to enable usernames support. We create and edit alot 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 [email protected]
(#2796,
623dac9
)Co-authored-by: Cristiano Casella [email protected]
Co-authored-by: Nejc Habjan [email protected]
(#2851,
b187dea
)Co-authored-by: Nejc Habjan [email protected]
v4.5.0
Compare Source
Bug Fixes
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 [email protected]
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.
(
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.
(
b8b3849
)Closes #2548
api: Update manual job status when playing it
(
9440a32
)cli: Allow exclusive arguments as optional
(#2770,
7ec3189
)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
(
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 theseidentifiers different so that a mixup will become apparent.
Build System
(
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
7484539
; after this PR, size is7261771
.Chores
Adapt style for black v24
(
4e68d32
)Add py312 & py313 to tox environment list
(
679ddc7
)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.
labels
to enable running groups of environments(
d7235c7
)tox now has a feature of
labels
which allows running groups of environments using the commandtox -m LABEL_NAME
. For exampletox -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.
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 returnstext/plain
. So function is still working as expected.black
forpre-commit
(
3501716
)The version of
black
needs to be updated to be in sync with what is inrequirements-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
(
683ce72
)We have received multiple issues lately about this. Add it to the FAQ.
(
c53e695
)Rotate token returns a dict. Change example to print the entire dict.
Closes: #2836
(
2d1f487
)Signed-off-by: Tim Knight <tim.knight1@engineering.digital.dwp.gov.uk>
([
6d4bffb
](https://redirect.github.com/python-gitlConfiguration
📅 Schedule: Branch creation - "every weekday" in timezone Europe/Berlin, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.