From 671b76e7c4ffbd006d5da30040c67495782ad954 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 8 Oct 2023 15:17:31 +0100 Subject: [PATCH 1/3] Fixed Laravel package version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b9b0f578..0e3d3c45 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ $ composer require "m4tthumphrey/php-gitlab-api:^11.10" \ #### Laravel: ```bash -$ composer require "graham-campbell/gitlab:^7.2" +$ composer require "graham-campbell/gitlab:^7.1" ``` #### Symfony: From b19aea749bf9c72d0f9f8550a974f141eeb6a3aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20Wilko=C5=82azki?= Date: Sun, 8 Oct 2023 15:51:42 +0200 Subject: [PATCH 2/3] [11.11] Fix double encoding of job name in artifacts download (#773) * Fix double encoding of $job_name Removed call to self::encodePath, as the `job` parameter is part of a url query, which is later encoded by `QueryStringBuilder` in `AbstractApi::prepareUri` * Use `job name` with space to test url encoding --- src/Api/Jobs.php | 4 ++-- tests/Api/JobsTest.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Api/Jobs.php b/src/Api/Jobs.php index 8dcf8692..4e8f5283 100644 --- a/src/Api/Jobs.php +++ b/src/Api/Jobs.php @@ -150,7 +150,7 @@ public function artifacts($project_id, int $job_id) public function artifactsByRefName($project_id, string $ref_name, string $job_name) { return $this->getAsResponse('projects/'.self::encodePath($project_id).'/jobs/artifacts/'.self::encodePath($ref_name).'/download', [ - 'job' => self::encodePath($job_name), + 'job' => $job_name, ])->getBody(); } @@ -165,7 +165,7 @@ public function artifactsByRefName($project_id, string $ref_name, string $job_na public function artifactByRefName($project_id, string $ref_name, string $job_name, string $artifact_path) { return $this->getAsResponse('projects/'.self::encodePath($project_id).'/jobs/artifacts/'.self::encodePath($ref_name).'/raw/'.self::encodePath($artifact_path), [ - 'job' => self::encodePath($job_name), + 'job' => $job_name, ])->getBody(); } diff --git a/tests/Api/JobsTest.php b/tests/Api/JobsTest.php index 5d355b11..39acaef5 100644 --- a/tests/Api/JobsTest.php +++ b/tests/Api/JobsTest.php @@ -147,12 +147,12 @@ public function shouldGetArtifactsByRefName(): void $api->expects($this->once()) ->method('getAsResponse') ->with('projects/1/jobs/artifacts/master/download', [ - 'job' => 'job_name', + 'job' => 'job name', ]) ->will($this->returnValue($returnedStream)) ; - $this->assertEquals('foobar', $api->artifactsByRefName(1, 'master', 'job_name')->getContents()); + $this->assertEquals('foobar', $api->artifactsByRefName(1, 'master', 'job name')->getContents()); } /** @@ -165,11 +165,11 @@ public function shouldGetArtifactByRefName(): void $api->expects($this->once()) ->method('getAsResponse') ->with('projects/1/jobs/artifacts/master/raw/artifact_path', [ - 'job' => 'job_name', + 'job' => 'job name', ]) ->will($this->returnValue($returnedStream)) ; - $this->assertEquals('foobar', $api->artifactByRefName(1, 'master', 'job_name', 'artifact_path')->getContents()); + $this->assertEquals('foobar', $api->artifactByRefName(1, 'master', 'job name', 'artifact_path')->getContents()); } /** From b232aa61d9af026ea0c0a69f1a735f3ef0ed8337 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 8 Oct 2023 15:18:28 +0100 Subject: [PATCH 3/3] Release 11.10.1 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6ec0255..564fdc79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [11.10.1] - 2023-10-08 + +* Fixed double encoding of job name in artifacts download + ## [11.10.0] - 2023-04-30 * Add support for `Packages::addGenericFile`