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

Commit90134c9

Browse files
nejchJohnVillalovos
authored andcommitted
refactor(artifacts): remove deprecatedartifact()in favor ofartifacts.raw()
BREAKING CHANGE: The deprecated `project.artifact()` method is no longer available.Use `project.artifacts.raw()` instead.
1 parent42639f3 commit90134c9

File tree

4 files changed

+0
-53
lines changed

4 files changed

+0
-53
lines changed

‎docs/gl_objects/pipelines_and_jobs.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,6 @@ Get a single artifact file by branch and job::
300300

301301
project.artifacts.raw('branch', 'path/to/file', 'job')
302302

303-
..attention::
304-
305-
An older method ``project.artifact()`` is deprecated and will be
306-
removed in a future version.
307-
308303
Mark a job artifact as kept when expiration is set::
309304

310305
build_or_job.keep_artifacts()

‎gitlab/v4/objects/projects.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -625,26 +625,6 @@ def transfer(self, to_namespace: Union[int, str], **kwargs: Any) -> None:
625625
path,post_data={"namespace":to_namespace},**kwargs
626626
)
627627

628-
@cli.register_custom_action("Project", ("ref_name","artifact_path","job"))
629-
@exc.on_http_error(exc.GitlabGetError)
630-
defartifact(
631-
self,
632-
*args:Any,
633-
**kwargs:Any,
634-
)->Optional[bytes]:
635-
utils.warn(
636-
message=(
637-
"The project.artifact() method is deprecated and will be "
638-
"removed in a future version. Use project.artifacts.raw() instead."
639-
),
640-
category=DeprecationWarning,
641-
)
642-
data=self.artifacts.raw(*args,**kwargs)
643-
ifTYPE_CHECKING:
644-
assertdataisnotNone
645-
assertisinstance(data,bytes)
646-
returndata
647-
648628

649629
classProjectManager(CRUDMixin,RESTManager):
650630
_path="/projects"

‎tests/functional/cli/test_cli_artifacts.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -97,26 +97,3 @@ def test_cli_project_artifact_raw(gitlab_config, job_with_artifacts):
9797
artifacts=subprocess.run(cmd,capture_output=True,check=True)
9898
assertisinstance(artifacts.stdout,bytes)
9999
assertartifacts.stdout==b"test\n"
100-
101-
102-
deftest_cli_project_artifact_warns_deprecated(gitlab_config,job_with_artifacts):
103-
cmd= [
104-
"gitlab",
105-
"--config-file",
106-
gitlab_config,
107-
"project",
108-
"artifact",
109-
"--id",
110-
str(job_with_artifacts.pipeline["project_id"]),
111-
"--ref-name",
112-
job_with_artifacts.ref,
113-
"--job",
114-
job_with_artifacts.name,
115-
"--artifact-path",
116-
"artifact.txt",
117-
]
118-
119-
artifacts=subprocess.run(cmd,capture_output=True,check=True)
120-
assertisinstance(artifacts.stdout,bytes)
121-
assertb"DeprecationWarning"inartifacts.stderr
122-
assertartifacts.stdout==b"test\n"

‎tests/unit/objects/test_projects.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -767,11 +767,6 @@ def test_transfer_project(project, resp_transfer_project):
767767
project.transfer("test-namespace")
768768

769769

770-
deftest_artifact_project(project,resp_artifact):
771-
withpytest.warns(DeprecationWarning):
772-
project.artifact("ref_name","artifact_path","job")
773-
774-
775770
deftest_project_pull_mirror(project,resp_start_pull_mirroring_project):
776771
project.mirror_pull()
777772

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp