From bb5437a410d426b4e63345a015ce4e6064c08acf Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Mon, 17 Jul 2023 10:10:02 +0100 Subject: [PATCH 1/5] Update .styleci.yml --- .styleci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.styleci.yml b/.styleci.yml index 0eeb39abb..fd4fc87b5 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -10,6 +10,7 @@ enabled: - declare_strict_types - native_constant_invocation - native_function_invocation + - phpdoc_align - phpdoc_order - void_return From e6ea96390a5243113ba737ee6d45a4a66103598d Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Mon, 17 Jul 2023 10:36:49 +0100 Subject: [PATCH 2/5] Update .styleci.yml --- .styleci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.styleci.yml b/.styleci.yml index fd4fc87b5..e6e775506 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -10,7 +10,6 @@ enabled: - declare_strict_types - native_constant_invocation - native_function_invocation - - phpdoc_align - phpdoc_order - void_return @@ -18,5 +17,6 @@ disabled: - native_constant_invocation_symfony - native_function_invocation_symfony - no_superfluous_phpdoc_tags_symfony + - phpdoc_align - phpdoc_to_comment - phpdoc_var_without_name From 671b76e7c4ffbd006d5da30040c67495782ad954 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 8 Oct 2023 15:17:31 +0100 Subject: [PATCH 3/5] Fixed Laravel package version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b9b0f5780..0e3d3c457 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 4/5] [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 8dcf8692d..4e8f52830 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 5d355b116..39acaef56 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 5/5] Release 11.10.1 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6ec02558..564fdc793 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`