Skip to content

Commit

Permalink
Upstream sync (#12)
Browse files Browse the repository at this point in the history
* 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

* Apply php-cs-fixer changes

---------

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: Kamil Kozłowski <kamil.kozlowski@cdex.cloud>
Co-authored-by: giogurto-grande <giogurto-grande@users.noreply.github.com>
  • Loading branch information
9 people authored Jun 19, 2024
1 parent f2c5293 commit baa4872
Show file tree
Hide file tree
Showing 581 changed files with 9,531 additions and 7,448 deletions.
5 changes: 3 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs.dist export-ignore
/.php-cs-fixer.dist.php export-ignore
/.readthedocs.yaml export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/phpunit.sample.xml.dist export-ignore
/phpunit.xml.dist export-ignore
50 changes: 50 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "Format"
on:
push:
branches:
- '*'

jobs:
composer-normalize:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- uses: shivammathur/setup-php@v2
with:
coverage: none
extensions: mbstring
php-version: 8.2

- run: composer install --no-interaction --no-progress --no-suggest

- run: composer normalize

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Normalize composer.json

php-cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- uses: shivammathur/setup-php@v2
with:
coverage: none
extensions: mbstring
php-version: 8.1

- run: composer install --no-interaction --no-progress --no-suggest

- run: vendor/bin/php-cs-fixer fix

- run: git pull

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply php-cs-fixer changes
67 changes: 0 additions & 67 deletions .github/workflows/integration_identity.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,25 +1,53 @@
name: Run Object Storage Integration Tests
name: Integration Tests

on:
workflow_dispatch:
pull_request:
paths:
- '**ObjectStore**'
push:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
tests:
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
if: |
!contains(github.event.pull_request.body, 'skip ci')
&& !contains(github.event.pull_request.body, 'skip integration')
strategy:
fail-fast: false
matrix:
openstack_version: [ "stable/zed" ]
openstack_version: [ "stable/2023.2" ]
php_version: [ 8.1 ]
ubuntu_version: [ 20.04 ]
include:
- name: "bobcat"
openstack_version: "stable/2023.2"
ubuntu_version: "22.04"
- name: "antelope"
openstack_version: "stable/2023.1"
ubuntu_version: "22.04"
- name: "zed"
openstack_version: "stable/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
runs-on: ubuntu-${{ matrix.ubuntu_version }}
name: Deploy OpenStack ${{ matrix.name }} and run ObjectStore integration tests with php ${{matrix.php_version}}
name: Deploy OpenStack ${{ matrix.name }} and run integration tests with php ${{matrix.php_version}}
steps:
- uses: actions/checkout@v2

- name: get cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v3
with:
path: |
Expand All @@ -28,13 +56,16 @@ jobs:
key: ${{ runner.os }}-composer-${{ matrix.php_version }}-${{ hashFiles('**.composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php_version }}-
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: curl
tools: composer:v2
coverage: none

- run: composer install --prefer-dist --no-interaction --no-progress

- name: Restore devstack cache
uses: actions/cache@v3
with:
Expand All @@ -43,17 +74,21 @@ jobs:
!/opt/stack/data
~/devstack/
key: ${{ runner.os }}-openstack-${{ matrix.openstack_version }}-${{ github.workflow }}

- name: Deploy devstack
uses: EmilienM/devstack-action@v0.11
uses: EmilienM/devstack-action@v0.15
with:
branch: ${{ matrix.openstack_version }}
conf_overrides: |
CINDER_ISCSI_HELPER=lioadm
SWIFT_ENABLE_TEMPURLS=True
SWIFT_TEMPURL_KEY=secretkey
TARGET_BRANCH=${{ matrix.openstack_version }}
[[post-config|\$SWIFT_CONFIG_PROXY_SERVER]]
[filter:versioned_writes]
allow_object_versioning = true
enabled_services: 's-account,s-container,s-object,s-proxy'
enabled_services: 's-account,s-container,s-object,s-proxy,s-bak'

- name: Set env variables
run: |
{
Expand All @@ -65,10 +100,27 @@ jobs:
echo OS_PASSWORD=secret
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
echo OS_PROJECT_NAME=admin
echo OS_RESIZE_FLAVOR=2
echo OS_RESIZE_FLAVOR=c1
echo OS_FLAVOR=1
echo OS_DOMAIN_ID=default
} >> "$GITHUB_ENV"
- name: Execute integration tests
run: php ./tests/integration/run.php -s=ObjectStore
- name: Check if Block Storage API v2 must be tested
if: matrix.block_storage_v2 == true
run: echo "OS_BLOCK_STORAGE_V2=1" >> "$GITHUB_ENV"

- name: Execute Integration tests via PhpUnit
run: vendor/bin/phpunit --configuration ./phpunit.sample.xml.dist

- name: Collect logs
if: ${{ failure() }}
run: |
set -x
journalctl >failure-logs
- name: Save logs
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: failure-logs
path: failure-logs
34 changes: 28 additions & 6 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,57 @@
name: Run Unit Tests
name: Unit Tests
on:
workflow_dispatch:
pull_request:
push:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-22.04
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
if: |
!contains(github.event.pull_request.body, 'skip ci')
&& !contains(github.event.pull_request.body, 'skip unit')
strategy:
fail-fast: false
matrix:
php: [ 7.2, 7.3, 7.4, 8.0, 8.1 ]
name: "php-${{ matrix.php }}"
php: [ 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3 ]
composer:
- name: lowest
arg: "--prefer-lowest --prefer-stable"
- name: highest
arg: "" # No args added as highest is default
name: PHPUnit on PHP ${{ matrix.php }} with ${{ matrix.composer.name }} dependencies
steps:
- uses: actions/checkout@v2

- name: get cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: |
~/.php_cs.cache
${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-cache-${{ matrix.php }}-${{ hashFiles('**.composer.lock') }}
key: ${{ runner.os }}-cache-${{ matrix.php }}-${{ matrix.composer.name }}-${{ hashFiles('**.composer.lock') }}

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl
tools: composer:v2
coverage: none
- run: composer install --prefer-dist --no-interaction --no-progress

- run: composer update --prefer-dist --no-interaction --no-progress ${{ matrix.composer.arg }}

- run: vendor/bin/parallel-lint --exclude vendor .

- name: execute unit tests
run: vendor/bin/phpunit --configuration phpunit.xml.dist

2 changes: 1 addition & 1 deletion .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
exit(0);
}

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRules(
[
'@PSR2' => true,
Expand Down
22 changes: 22 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the "doc/" directory with Sphinx
sphinx:
configuration: doc/conf.py

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: doc/requirements.txt
Loading

0 comments on commit baa4872

Please sign in to comment.