Skip to content

Commit 9825838

Browse files
Merge branch '11.11' into 11.12
2 parents 6c16615 + c529f59 commit 9825838

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [11.11.1] - 2023-10-XX
9+
10+
* Fixed double encoding of job name in artifacts download
11+
812
## [11.11.0] - 2023-07-17
913

1014
* Add support for `author_id` in `Issues::all`

src/Api/Jobs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function artifacts($project_id, int $job_id)
151151
public function artifactsByRefName($project_id, string $ref_name, string $job_name)
152152
{
153153
return $this->getAsResponse('projects/'.self::encodePath($project_id).'/jobs/artifacts/'.self::encodePath($ref_name).'/download', [
154-
'job' => self::encodePath($job_name),
154+
'job' => $job_name,
155155
])->getBody();
156156
}
157157

@@ -166,7 +166,7 @@ public function artifactsByRefName($project_id, string $ref_name, string $job_na
166166
public function artifactByRefName($project_id, string $ref_name, string $job_name, string $artifact_path)
167167
{
168168
return $this->getAsResponse('projects/'.self::encodePath($project_id).'/jobs/artifacts/'.self::encodePath($ref_name).'/raw/'.self::encodePath($artifact_path), [
169-
'job' => self::encodePath($job_name),
169+
'job' => $job_name,
170170
])->getBody();
171171
}
172172

tests/Api/JobsTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,12 @@ public function shouldGetArtifactsByRefName(): void
171171
$api->expects($this->once())
172172
->method('getAsResponse')
173173
->with('projects/1/jobs/artifacts/master/download', [
174-
'job' => 'job_name',
174+
'job' => 'job name',
175175
])
176176
->will($this->returnValue($returnedStream))
177177
;
178178

179-
$this->assertEquals('foobar', $api->artifactsByRefName(1, 'master', 'job_name')->getContents());
179+
$this->assertEquals('foobar', $api->artifactsByRefName(1, 'master', 'job name')->getContents());
180180
}
181181

182182
/**
@@ -189,11 +189,11 @@ public function shouldGetArtifactByRefName(): void
189189
$api->expects($this->once())
190190
->method('getAsResponse')
191191
->with('projects/1/jobs/artifacts/master/raw/artifact_path', [
192-
'job' => 'job_name',
192+
'job' => 'job name',
193193
])
194194
->will($this->returnValue($returnedStream))
195195
;
196-
$this->assertEquals('foobar', $api->artifactByRefName(1, 'master', 'job_name', 'artifact_path')->getContents());
196+
$this->assertEquals('foobar', $api->artifactByRefName(1, 'master', 'job name', 'artifact_path')->getContents());
197197
}
198198

199199
/**

0 commit comments

Comments
 (0)