Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit42639f3

Browse files
nejchJohnVillalovos
authored andcommitted
refactor(artifacts): remove deprecatedartifacts()in favor ofartifacts.download()
BREAKING CHANGE: The deprecated `project.artifacts()` method is no longer available.Use `project.artifacts.download()` instead.
1 parent5c8b7c1 commit42639f3

File tree

4 files changed

+0
-61
lines changed

4 files changed

+0
-61
lines changed

‎docs/gl_objects/pipelines_and_jobs.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,6 @@ a branch or tag::
255255

256256
project.artifacts.download(ref_name='main', job='build')
257257

258-
..attention::
259-
260-
An older method ``project.artifacts()`` is deprecated and will be
261-
removed in a future version.
262-
263258
..warning::
264259

265260
Artifacts are entirely stored in memory in this example.

‎gitlab/v4/objects/artifacts.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,6 @@ class ProjectArtifactManager(RESTManager):
2525
_path="/projects/{project_id}/jobs/artifacts"
2626
_from_parent_attrs= {"project_id":"id"}
2727

28-
@cli.register_custom_action(
29-
"Project", ("ref_name","job"), ("job_token",),custom_action="artifacts"
30-
)
31-
def__call__(
32-
self,
33-
*args:Any,
34-
**kwargs:Any,
35-
)->Optional[bytes]:
36-
utils.warn(
37-
message=(
38-
"The project.artifacts() method is deprecated and will be removed in a "
39-
"future version. Use project.artifacts.download() instead.\n"
40-
),
41-
category=DeprecationWarning,
42-
)
43-
data=self.download(
44-
*args,
45-
**kwargs,
46-
)
47-
ifTYPE_CHECKING:
48-
assertdataisnotNone
49-
assertisinstance(data,bytes)
50-
returndata
51-
5228
@exc.on_http_error(exc.GitlabDeleteError)
5329
defdelete(self,**kwargs:Any)->None:
5430
"""Delete the project's artifacts on the server.

‎tests/functional/cli/test_cli_artifacts.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,29 +77,6 @@ def test_cli_project_artifact_download(gitlab_config, job_with_artifacts):
7777
assertis_zipfile(artifacts_zip)
7878

7979

80-
deftest_cli_project_artifacts_warns_deprecated(gitlab_config,job_with_artifacts):
81-
cmd= [
82-
"gitlab",
83-
"--config-file",
84-
gitlab_config,
85-
"project",
86-
"artifacts",
87-
"--id",
88-
str(job_with_artifacts.pipeline["project_id"]),
89-
"--ref-name",
90-
job_with_artifacts.ref,
91-
"--job",
92-
job_with_artifacts.name,
93-
]
94-
95-
artifacts=subprocess.run(cmd,capture_output=True,check=True)
96-
assertisinstance(artifacts.stdout,bytes)
97-
assertb"DeprecationWarning"inartifacts.stderr
98-
99-
artifacts_zip=BytesIO(artifacts.stdout)
100-
assertis_zipfile(artifacts_zip)
101-
102-
10380
deftest_cli_project_artifact_raw(gitlab_config,job_with_artifacts):
10481
cmd= [
10582
"gitlab",

‎tests/unit/objects/test_job_artifacts.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,3 @@ def test_project_artifacts_download_by_ref_name(
4646
project=gl.projects.get(1,lazy=True)
4747
artifacts=project.artifacts.download(ref_name=ref_name,job=job)
4848
assertartifacts==binary_content
49-
50-
51-
deftest_project_artifacts_by_ref_name_warns(
52-
gl,binary_content,resp_artifacts_by_ref_name
53-
):
54-
project=gl.projects.get(1,lazy=True)
55-
withpytest.warns(DeprecationWarning):
56-
artifacts=project.artifacts(ref_name=ref_name,job=job)
57-
assertartifacts==binary_content

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp