From c9342554f587a9a5a130185dab92ba120cd58ea7 Mon Sep 17 00:00:00 2001 From: Konstantin Babushkin Date: Sun, 16 Mar 2025 10:59:12 +0100 Subject: [PATCH 1/4] fix github actions (#423) --- .github/workflows/integration_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index c460cf21..69dbadc0 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-${{ matrix.ubuntu_version }} name: Deploy OpenStack ${{ matrix.name }} and run integration tests with php ${{matrix.php_version}} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: get cache directory id: composer-cache @@ -126,7 +126,7 @@ jobs: - name: Save logs if: ${{ failure() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: failure-logs path: failure-logs From 2a23c7b1f9a1dc62e52720d4d68f12d904105494 Mon Sep 17 00:00:00 2001 From: evs-xsarus <44158071+evs-xsarus@users.noreply.github.com> Date: Wed, 30 Apr 2025 16:49:35 +0200 Subject: [PATCH 2/4] Support json-schema v6 for nimbusoft/flysystem-openstack-swift . (#424) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index defad050..f8658c8b 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "guzzlehttp/guzzle": "^7.0", "guzzlehttp/psr7": ">=1.7", "guzzlehttp/uri-template": "^0.2 || ^1.0", - "justinrainbow/json-schema": "^5.2" + "justinrainbow/json-schema": "^5.2 || ^6.0" }, "require-dev": { "ext-json": "*", From 94bac6dbbdcb2261beffcc9b51f7a98ff7bc0b52 Mon Sep 17 00:00:00 2001 From: Konstantin Babushkin Date: Wed, 30 Apr 2025 20:36:28 +0200 Subject: [PATCH 3/4] remove wallaby and yoga due to ubuntu 20.04 deprecation (#425) --- .github/workflows/integration_tests.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 69dbadc0..ffc568dd 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -36,14 +36,7 @@ jobs: ubuntu_version: "22.04" - name: "zed" openstack_version: "unmaintained/zed" - ubuntu_version: "20.04" - - name: "yoga" - openstack_version: "unmaintained/yoga" - ubuntu_version: "20.04" - - name: "wallaby" - openstack_version: "unmaintained/wallaby" - ubuntu_version: "20.04" - block_storage_v2: true + ubuntu_version: "22.04" runs-on: ubuntu-${{ matrix.ubuntu_version }} name: Deploy OpenStack ${{ matrix.name }} and run integration tests with php ${{matrix.php_version}} steps: @@ -128,5 +121,5 @@ jobs: if: ${{ failure() }} uses: actions/upload-artifact@v4 with: - name: failure-logs + name: failure-logs-${{ strategy.job-index }} path: failure-logs From b92ea5581ca91779b88f08b1b44e6ca880b34fc3 Mon Sep 17 00:00:00 2001 From: Konstantin Babushkin Date: Fri, 30 May 2025 11:26:42 +0200 Subject: [PATCH 4/4] merge headers in `OperatorTrait::sendRequest` (#427) * merge headers in `OperatorTrait::sendRequest` * remove bobcat integration tests --- .github/workflows/integration_tests.yml | 3 --- src/Common/Api/OperatorTrait.php | 7 +++++- tests/unit/Common/Api/OperatorTraitTest.php | 24 +++++++++++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index ffc568dd..43ca7262 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -28,9 +28,6 @@ jobs: - name: "caracal" openstack_version: "stable/2024.1" ubuntu_version: "22.04" - - name: "bobcat" - openstack_version: "stable/2023.2" - ubuntu_version: "22.04" - name: "antelope" openstack_version: "unmaintained/2023.1" ubuntu_version: "22.04" diff --git a/src/Common/Api/OperatorTrait.php b/src/Common/Api/OperatorTrait.php index 710bd8ad..56f4d42d 100644 --- a/src/Common/Api/OperatorTrait.php +++ b/src/Common/Api/OperatorTrait.php @@ -101,8 +101,13 @@ protected function sendRequest(Operation $operation, array $userValues = [], boo $uri = Utils::uri_template($operation->getPath(), $userValues); - if (array_key_exists('requestOptions', $userValues)) { + if (isset($userValues['requestOptions'])) { $options += $userValues['requestOptions']; + + // headers are always created in options, merge them + if (isset($userValues['requestOptions']['headers'])) { + $options['headers'] = array_merge($options['headers'], $userValues['requestOptions']['headers']); + } } $options['openstack.skip_auth'] = $operation->getSkipAuth(); diff --git a/tests/unit/Common/Api/OperatorTraitTest.php b/tests/unit/Common/Api/OperatorTraitTest.php index c269b5b1..66b4d61a 100644 --- a/tests/unit/Common/Api/OperatorTraitTest.php +++ b/tests/unit/Common/Api/OperatorTraitTest.php @@ -111,6 +111,30 @@ public function test_guzzle_options_are_forwarded() 'requestOptions' => ['stream' => true], ]); } + + public function test_it_sends_custom_headers_in_request_options() + { + $this->client + ->requestAsync('GET', 'test', + [ + 'headers' => [ + 'Access-Control-Allow-Origin' => '*', + 'Access-Control-Allow-Methods' => 'GET, POST, OPTIONS', + ], + 'openstack.skip_auth' => false, + ]) + ->shouldBeCalled() + ->willReturn(new Promise()); + + $this->operator->executeAsync($this->def, [ + 'requestOptions' => [ + 'headers' => [ + 'Access-Control-Allow-Origin' => '*', + 'Access-Control-Allow-Methods' => 'GET, POST, OPTIONS', + ], + ], + ]); + } }