Skip to content

Commit 7104354

Browse files
giogurto-grandek0kasmarcetjarragon-slash2peter279k
authored
Feature/ck 2099 merge upstream (#13)
* GitHub workflows (php-opencloud#369) Add integration workflows for services: - BlockStorage - Compute - Images - Networking * always recheck all tests on push to master (php-opencloud#370) * Restore read the docs (php-opencloud#371) * add readthedocs.yaml * remove button * move to python 3 * Fix documentation (php-opencloud#372) * fix php-opencloud#351 * fix documentation requirements, remove unused links in docs * add badges, remove old contacts from README.md * Fix documentation (php-opencloud#373) * clarify versioning * change documentation copyright * Fix sort_key and sort_dir parameters for BlockStorage/v2/listSnapshots and Images/v2/listImages * fix list formating in documentation (php-opencloud#375) remove custom theme * added phpdocs for better type hinting (php-opencloud#376) * one integration workflow (php-opencloud#377) * one integration workflow to rule them all * update README.md with new badge * create BlockStorage v3 as copy of v2 (php-opencloud#378) * Chores (php-opencloud#379) * format via php-cs-fixer * add unit tests with the lowest possible dependencies * add unit tests with php 8.2 and 8.3 * add integration tests for 2023.1 antelope and yoga * allow skipping integration, unit or both tests in pull requests --------- Co-authored-by: k0ka <k0ka@users.noreply.github.com> * Application credentials (php-opencloud#380) * add endpoints to create/get/remove application credentials * add token creation using application credentials * cancel running workflows on new commit --------- Co-authored-by: smarcet <smarcet@gmail.com> Co-authored-by: k0ka <k0ka@users.noreply.github.com> * fix doc for application credentials (php-opencloud#381) * Handler stack factory (php-opencloud#382) * Changed guzzle final HandlerStack extension to factory class HandlerStackFactory --------- Co-authored-by: k0ka <k0ka@users.noreply.github.com> Co-authored-by: jarragon-slash2 <jarragon-slash2@users.noreply.github.com> * Fix testing class namespaces (php-opencloud#383) Co-authored-by: peter279k <peter279k@gmail.com> * Refactor tests (php-opencloud#384) use `include_once $this->sampleFile(` instead of `$path = $this->sampleFile(..); include_once $path` * Move integration tests to phpunit (php-opencloud#387) * moved integration tests to phpunit * updated integration tests description in CONTRIBUTING.md * added `name` parameter to `patchUser` so the sample file works properly * added `Retrievable` interface to `VolumeType` * added `HasWaiterTrait` to `Compute::Image` * added `Token::validate()` function to check if Identity token is valid --------- Co-authored-by: k0ka <k0ka@users.noreply.github.com> * License: add full text, remove rackspace (php-opencloud#388) * added bigger rescue timeouts (php-opencloud#390) * return HandlerStack for BC (php-opencloud#391) * return HandlerStack for Backward Compatibility - php-opencloud#382 * Merge network services (php-opencloud#392) * Merge all network service extensions into main one using traits * Add unit test error_reporting * Increase volume attachment test timeout * Clarify docs (php-opencloud#389) * Rewrite most of documentation. * Make creating the `$openstack` object more clear. * Rename and rearrange main operations as CRUDL (Create, Read, Update, Delete, List) * Resume suspend server (php-opencloud#394) * Implement resuming and suspending of servers --------- Co-authored-by: Martin Zurowietz <martin@zurowietz.de> * fix resume/suspend doc (php-opencloud#395) * refactor unit tests: use `mockRequest` for all requests (php-opencloud#397) * Fix Swift container requests with "tokens" in its name (php-opencloud#396) * add errorVerbosity (php-opencloud#400) fixes php-opencloud#335 fixes php-opencloud#398 * add docs for volume attachement (php-opencloud#401) fixes php-opencloud#399 * fix doc links (php-opencloud#402) * enchance error builder: output body only for json, limit body to 5 Kb (php-opencloud#405) fixes php-opencloud#403 supersedes php-opencloud#404 * make swift metadata header case insensitive (php-opencloud#407) * compare headers case insensitively * drop support of unmaintained releases in CI (until they are returned in github action). * return unmaintaned openstack versions into ci (php-opencloud#408) * override TARGET_BRANCH * new openstack versions (php-opencloud#416) new openstack versions: * zed moved to unmaintained * added caracal and dalmatian * increase sleep before testing detach. The VM must be completely up. (php-opencloud#417) * revert sleep time, add more debug to the failed test (php-opencloud#418) fix volume detach test for dalmatian * feat: Add PHP 8.4 support (php-opencloud#415) Signed-off-by: Joas Schilling <coding@schilljs.com> Co-authored-by: Konstantin Babushkin <koka@idwrx.com> * antelope unmaintained (php-opencloud#420) * antelope unmaintained * change actions/cache@v2 to v3 due to deprecation * extend FloatingIP with description and subnet_id (php-opencloud#421) Add optional `description` and `subnet_id` parameters to Floating IPs creation endpoint. * fix github actions (php-opencloud#423) * Support json-schema v6 for nimbusoft/flysystem-openstack-swift . (php-opencloud#424) * remove wallaby and yoga due to ubuntu 20.04 deprecation (php-opencloud#425) * merge headers in `OperatorTrait::sendRequest` (php-opencloud#427) * merge headers in `OperatorTrait::sendRequest` * remove bobcat integration tests --------- Signed-off-by: Joas Schilling <coding@schilljs.com> Co-authored-by: Konstantin Babushkin <koka@idwrx.com> Co-authored-by: k0ka <k0ka@users.noreply.github.com> Co-authored-by: smarcet <smarcet@gmail.com> Co-authored-by: jarragon-slash2 <jarragon-slash2@users.noreply.github.com> Co-authored-by: peter279k <peter279k@gmail.com> Co-authored-by: Martin Zurowietz <martin@zurowietz.de> Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com> Co-authored-by: Anton Dollmaier <a.dollmaier@aditsystems.de> Co-authored-by: evs-xsarus <44158071+evs-xsarus@users.noreply.github.com>
1 parent baa4872 commit 7104354

File tree

35 files changed

+153
-66
lines changed

35 files changed

+153
-66
lines changed

.github/workflows/integration_tests.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,22 @@ jobs:
2222
openstack_version: [ "stable/2023.2" ]
2323
php_version: [ 8.1 ]
2424
include:
25-
- name: "bobcat"
26-
openstack_version: "stable/2023.2"
25+
- name: "dalmatian"
26+
openstack_version: "stable/2024.2"
27+
ubuntu_version: "22.04"
28+
- name: "caracal"
29+
openstack_version: "stable/2024.1"
2730
ubuntu_version: "22.04"
2831
- name: "antelope"
29-
openstack_version: "stable/2023.1"
32+
openstack_version: "unmaintained/2023.1"
3033
ubuntu_version: "22.04"
3134
- name: "zed"
32-
openstack_version: "stable/zed"
33-
ubuntu_version: "20.04"
34-
- name: "yoga"
35-
openstack_version: "unmaintained/yoga"
36-
ubuntu_version: "20.04"
37-
- name: "wallaby"
38-
openstack_version: "unmaintained/wallaby"
39-
ubuntu_version: "20.04"
40-
block_storage_v2: true
35+
openstack_version: "unmaintained/zed"
36+
ubuntu_version: "22.04"
4137
runs-on: ubuntu-${{ matrix.ubuntu_version }}
4238
name: Deploy OpenStack ${{ matrix.name }} and run integration tests with php ${{matrix.php_version}}
4339
steps:
44-
- uses: actions/checkout@v2
40+
- uses: actions/checkout@v4
4541

4642
- name: get cache directory
4743
id: composer-cache
@@ -120,7 +116,7 @@ jobs:
120116
121117
- name: Save logs
122118
if: ${{ failure() }}
123-
uses: actions/upload-artifact@v3
119+
uses: actions/upload-artifact@v4
124120
with:
125-
name: failure-logs
121+
name: failure-logs-${{ strategy.job-index }}
126122
path: failure-logs

.github/workflows/unit_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
php: [ 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3 ]
22+
php: [ 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4 ]
2323
composer:
2424
- name: lowest
2525
arg: "--prefer-lowest --prefer-stable"
@@ -34,7 +34,7 @@ jobs:
3434
run: |
3535
echo "::set-output name=dir::$(composer config cache-files-dir)"
3636
37-
- uses: actions/cache@v2
37+
- uses: actions/cache@v3
3838
with:
3939
path: |
4040
~/.php_cs.cache

COVERAGE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# OpenStack versions coverage
22

33
While we strive to support all versions of OpenStack, we can only test limited number of versions. The current set:
4+
* 2024.2 Dalmatian
5+
* 2024.1 Caracal
46
* 2023.2 Bobcat
57
* 2023.1 Antelope
68
* Zed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"guzzlehttp/guzzle": "^7.0",
3232
"guzzlehttp/psr7": ">=1.7",
3333
"guzzlehttp/uri-template": "^0.2 || ^1.0",
34-
"justinrainbow/json-schema": "^5.2"
34+
"justinrainbow/json-schema": "^5.2 || ^6.0"
3535
},
3636
"require-dev": {
3737
"ext-json": "*",

samples/Networking/v2/floatingIPs/create.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
$floatingIp = $networking->createFloatingIp([
1818
"floatingNetworkId" => "{networkId}",
1919
"portId" => "{portId}",
20-
'fixedIpAddress' => '{fixedIpAddress}',
20+
"fixedIpAddress" => "{fixedIpAddress}",
21+
"description" => "{description}",
2122
]);

src/Common/Api/OperatorTrait.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,13 @@ protected function sendRequest(Operation $operation, array $userValues = [], boo
101101

102102
$uri = Utils::uri_template($operation->getPath(), $userValues);
103103

104-
if (array_key_exists('requestOptions', $userValues)) {
104+
if (isset($userValues['requestOptions'])) {
105105
$options += $userValues['requestOptions'];
106+
107+
// headers are always created in options, merge them
108+
if (isset($userValues['requestOptions']['headers'])) {
109+
$options['headers'] = array_merge($options['headers'], $userValues['requestOptions']['headers']);
110+
}
106111
}
107112

108113
$options['openstack.skip_auth'] = $operation->getSkipAuth();

src/Common/Auth/AuthHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AuthHandler
2525
/** @var Token */
2626
private $token;
2727

28-
public function __construct(callable $nextHandler, callable $tokenGenerator, Token $token = null)
28+
public function __construct(callable $nextHandler, callable $tokenGenerator, ?Token $token = null)
2929
{
3030
$this->nextHandler = $nextHandler;
3131
$this->tokenGenerator = $tokenGenerator;

src/Common/Error/Builder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Builder
3535
*/
3636
private $client;
3737

38-
public function __construct(ClientInterface $client = null)
38+
public function __construct(?ClientInterface $client = null)
3939
{
4040
$this->client = $client ?: new Client();
4141
}
@@ -164,7 +164,7 @@ private function getStatusCodeMessage(int $statusCode): string
164164
* @param mixed $userValue The incorrect value the user actually provided
165165
* @param string|null $furtherLink a link to further information if necessary (optional)
166166
*/
167-
public function userInputError(string $expectedType, $userValue, string $furtherLink = null): UserInputError
167+
public function userInputError(string $expectedType, $userValue, ?string $furtherLink = null): UserInputError
168168
{
169169
$message = $this->header('User Input Error');
170170

src/Common/HydratorStrategyTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function hydrate(array $data, array $aliases = [])
2525
}
2626
}
2727

28-
public function set(string $key, $property, array $data, callable $fn = null)
28+
public function set(string $key, $property, array $data, ?callable $fn = null)
2929
{
3030
if (isset($data[$key]) && property_exists($this, $property)) {
3131
$value = $fn ? call_user_func($fn, $data[$key]) : $data[$key];

src/Common/JsonSchema/Schema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Schema
1414
/** @var Validator */
1515
private $validator;
1616

17-
public function __construct($body, Validator $validator = null)
17+
public function __construct($body, ?Validator $validator = null)
1818
{
1919
$this->body = (object) $body;
2020
$this->validator = $validator ?: new Validator();

0 commit comments

Comments
 (0)