Skip to content

Commit ae24738

Browse files
smarcetromanetar
andauthored
feat: update LV from 10.X to 11.X (#55)
* refactor: update libs, references, uses (WIP) Signed-off-by: romanetar <roman_ag@hotmail.com> * chore: add local docker support need to create a new .env.local file and then run ./start_local_server.sh Change-Id: Ia1dc3704dd60ada34357550e8d352d6a0e79e4dd * chore: remove unused rabbitmq configuration Signed-off-by: romanetar <roman_ag@hotmail.com> * fix: rollback swift svc provider settings Signed-off-by: romanetar <roman_ag@hotmail.com> * feat(dependencies): Remove unused dependency fruitcake/laravel-cors Signed-off-by: romanetar <roman_ag@hotmail.com> * chore: fix composer.lock chore: refactor dev docker file Change-Id: Ic5b4d3ac14d896cb7186615661e94955d762477c * chore: refactor swift League\Flysystem adapter to v3.x * chore: updated dockerfile * refactor: change collective HTML:: and Form:: helpers to custom Signed-off-by: romanetar <roman_ag@hotmail.com> * fix: update instantiation of swift adapter on custom provider see https://laravel.com/docs/9.x/upgrade#flysystem-3 * chore: update sendgrid adapter lib * fix: Zend -> Laminas NS renaming * chore: fix base test migrations * chore: fix on unit tests * chore: fix OIDC protocol test suite * chore: update push github action * chore: fix on OpenID tests Signed-off-by: smarcet <smarcet@gmail.com> * chore: replace hardocded values on github actions by env variables * chore: updated remaining github workflows * chore: store test output on artifact Signed-off-by: smarcet <smarcet@gmail.com> * chore: upgrade LV9.x to LV10.X * removed doctrine deprecated methods * upgraded deps * chore: migrate deps to LV 11.x chore: update auth schemas as suggested on upgrade doc * chore: update github actions * chore: fixed phpunit 11 tests * fix: tx management Change-Id: Ib303237acec136dcd4d54453f814cb975c897e30 * fix: doctrine transaction manager reconnection on server one away Change-Id: I11e4b11563c6725e5b7671a10ec26484ea739bf1 * chore: fixed unit tests Change-Id: I4324b4fe3812f8d15b335464ca13ca5fed9ddb5e --------- Signed-off-by: romanetar <roman_ag@hotmail.com> Signed-off-by: smarcet <smarcet@gmail.com> Co-authored-by: romanetar <roman_ag@hotmail.com>
1 parent 1d8461d commit ae24738

File tree

118 files changed

+5092
-4233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+5092
-4233
lines changed

.github/workflows/nightly_unit_tests.yml

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,59 @@ jobs:
1212
unit-tests:
1313
# The type of runner that the job will run on
1414
runs-on: ubuntu-latest
15-
container:
16-
image: smarcet/openstackid_test:v1.0
17-
# Steps represent a sequence of tasks that will be executed as part of the job
15+
env:
16+
APP_ENV: testing
17+
APP_DEBUG: true
18+
APP_KEY: base64:4vh0op/S1dAsXKQ2bbdCfWRyCI9r8NNIdPXyZWt9PX4=
19+
DEV_EMAIL_TO: smarcet@gmail.com
20+
APP_URL: http://localhost
21+
DB_CONNECTION: mysql
22+
DB_HOST: 127.0.0.1
23+
DB_PORT: 3306
24+
DB_DATABASE: idp_test
25+
DB_USERNAME: root
26+
DB_PASSWORD: 1qaz2wsx
27+
REDIS_HOST: 127.0.0.1
28+
REDIS_PORT: 6379
29+
REDIS_DB: 0
30+
REDIS_PASSWORD: 1qaz2wsx
31+
REDIS_DATABASES: 16
32+
SSL_ENABLED: false
33+
SESSION_DRIVER: redis
34+
PHP_VERSION: 8.3
35+
services:
36+
mysql:
37+
image: mysql:8.0
38+
env:
39+
MYSQL_ROOT_PASSWORD: ${{env.DB_PASSWORD}}
40+
MYSQL_DATABASE: ${{env.DB_DATABASE}}
41+
ports:
42+
- 3306:3306
43+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
1844
steps:
19-
- name: 'Run Unit Tests'
20-
run: cd / && ./tests.sh 2>&1 | tee /output.log
45+
- name: Create Redis
46+
uses: supercharge/redis-github-action@1.7.0
47+
with:
48+
redis-port: ${{env.REDIS_PORT}}
49+
redis-password: ${{env.REDIS_PASSWORD}}
50+
# Downloads a copy of the code in your repository before running CI tests
51+
- name: Check out repository code
52+
uses: actions/checkout@v4
53+
- name: Install PHP
54+
uses: "shivammathur/setup-php@v2"
55+
with:
56+
php-version: ${{env.PHP_VERSION}}
57+
extensions: pdo_mysql, mbstring, exif, pcntl, bcmath, sockets, gettext
58+
- name: Install dependencies
59+
uses: "ramsey/composer-install@v3"
60+
env:
61+
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.PAT }}"} }'
62+
- name: 'Run Tests'
63+
run: |
64+
./update_doctrine.sh
65+
php artisan doctrine:migrations:migrate --no-interaction
66+
php artisan db:seed --force
67+
vendor/bin/phpunit --log-junit results.xml
2168
- name: 'Upload Unit Test Output'
2269
uses: actions/upload-artifact@v4
2370
with:

.github/workflows/pull_request_unit_tests.yml

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,62 @@ jobs:
1515
unit-tests:
1616
# The type of runner that the job will run on
1717
runs-on: ubuntu-latest
18-
container:
19-
image: smarcet/openstackid_test:v1.0
20-
# Steps represent a sequence of tasks that will be executed as part of the job
18+
env:
19+
APP_ENV: testing
20+
APP_DEBUG: true
21+
APP_KEY: base64:4vh0op/S1dAsXKQ2bbdCfWRyCI9r8NNIdPXyZWt9PX4=
22+
DEV_EMAIL_TO: smarcet@gmail.com
23+
APP_URL: http://localhost
24+
DB_CONNECTION: mysql
25+
DB_HOST: 127.0.0.1
26+
DB_PORT: 3306
27+
DB_DATABASE: idp_test
28+
DB_USERNAME: root
29+
DB_PASSWORD: 1qaz2wsx
30+
REDIS_HOST: 127.0.0.1
31+
REDIS_PORT: 6379
32+
REDIS_DB: 0
33+
REDIS_PASSWORD: 1qaz2wsx
34+
REDIS_DATABASES: 16
35+
SSL_ENABLED: false
36+
SESSION_DRIVER: redis
37+
PHP_VERSION: 8.3
38+
services:
39+
mysql:
40+
image: mysql:8.0
41+
env:
42+
MYSQL_ROOT_PASSWORD: ${{env.DB_PASSWORD}}
43+
MYSQL_DATABASE: ${{env.DB_DATABASE}}
44+
ports:
45+
- 3306:3306
46+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
2147
steps:
22-
- name: 'Run Unit Tests'
23-
run: cd / && ./tests.sh ${{ github.event.pull_request.head.sha }} 2>&1 | tee /output.log
24-
- name: 'Upload Unit Test Output'
25-
uses: actions/upload-artifact@v4
26-
with:
27-
name: output
28-
path: /output.log
29-
retention-days: 5
48+
- name: Create Redis
49+
uses: supercharge/redis-github-action@1.7.0
50+
with:
51+
redis-port: ${{env.REDIS_PORT}}
52+
redis-password: ${{env.REDIS_PASSWORD}}
53+
# Downloads a copy of the code in your repository before running CI tests
54+
- name: Check out repository code
55+
uses: actions/checkout@v4
56+
- name: Install PHP
57+
uses: "shivammathur/setup-php@v2"
58+
with:
59+
php-version: ${{env.PHP_VERSION}}
60+
extensions: pdo_mysql, mbstring, exif, pcntl, bcmath, sockets, gettext
61+
- name: Install dependencies
62+
uses: "ramsey/composer-install@v3"
63+
env:
64+
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.PAT }}"} }'
65+
- name: 'Run Tests'
66+
run: |
67+
./update_doctrine.sh
68+
php artisan doctrine:migrations:migrate --no-interaction
69+
php artisan db:seed --force
70+
vendor/bin/phpunit --log-junit results.xml
71+
- name: 'Upload Unit Test Output'
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: output
75+
path: /output.log
76+
retention-days: 5

.github/workflows/push.yml

Lines changed: 54 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,70 @@
33
name: Unit Tests On Push
44

55
# Controls when the workflow will run
6-
on:
7-
# Triggers the workflow on push or pull request events but only for the "main" branch
8-
push:
9-
branches: [ "main" ]
10-
11-
# Allows you to run this workflow manually from the Actions tab
12-
workflow_dispatch:
6+
on: push
137

148
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
159
jobs:
1610
# This workflow contains a single job called "unit-tests"
1711
unit-tests:
1812
# The type of runner that the job will run on
1913
runs-on: ubuntu-latest
20-
container:
21-
image: smarcet/openstackid_test:v1.0
22-
# Steps represent a sequence of tasks that will be executed as part of the job
14+
env:
15+
APP_ENV: testing
16+
APP_DEBUG: true
17+
APP_KEY: base64:4vh0op/S1dAsXKQ2bbdCfWRyCI9r8NNIdPXyZWt9PX4=
18+
DEV_EMAIL_TO: smarcet@gmail.com
19+
APP_URL: http://localhost
20+
DB_CONNECTION: mysql
21+
DB_HOST: 127.0.0.1
22+
DB_PORT: 3306
23+
DB_DATABASE: idp_test
24+
DB_USERNAME: root
25+
DB_PASSWORD: 1qaz2wsx
26+
REDIS_HOST: 127.0.0.1
27+
REDIS_PORT: 6379
28+
REDIS_DB: 0
29+
REDIS_PASSWORD: 1qaz2wsx
30+
REDIS_DATABASES: 16
31+
SSL_ENABLED: false
32+
SESSION_DRIVER: redis
33+
PHP_VERSION: 8.3
34+
services:
35+
mysql:
36+
image: mysql:8.0
37+
env:
38+
MYSQL_ROOT_PASSWORD: ${{env.DB_PASSWORD}}
39+
MYSQL_DATABASE: ${{env.DB_DATABASE}}
40+
ports:
41+
- 3306:3306
42+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
2343
steps:
24-
- name: 'Run Unit Tests'
25-
run: cd / && ./tests.sh 2>&1 | tee /output.log
44+
- name: Create Redis
45+
uses: supercharge/redis-github-action@1.7.0
46+
with:
47+
redis-port: ${{env.REDIS_PORT}}
48+
redis-password: ${{env.REDIS_PASSWORD}}
49+
# Downloads a copy of the code in your repository before running CI tests
50+
- name: Check out repository code
51+
uses: actions/checkout@v4
52+
- name: Install PHP
53+
uses: "shivammathur/setup-php@v2"
54+
with:
55+
php-version: ${{env.PHP_VERSION}}
56+
extensions: pdo_mysql, mbstring, exif, pcntl, bcmath, sockets, gettext
57+
- name: Install dependencies
58+
uses: "ramsey/composer-install@v3"
59+
env:
60+
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.PAT }}"} }'
61+
- name: 'Run Tests'
62+
run: |
63+
./update_doctrine.sh
64+
php artisan doctrine:migrations:migrate --no-interaction
65+
php artisan db:seed --force
66+
vendor/bin/phpunit --log-junit results.xml
2667
- name: 'Upload Unit Test Output'
2768
uses: actions/upload-artifact@v4
2869
with:
2970
name: output
30-
path: /output.log
71+
path: results.xml
3172
retention-days: 5

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ doc/build
1414
Homestead.yaml
1515
Homestead.json
1616
.env
17-
.env.testing
17+
.env.*
1818
storage/proxies
1919
/public/assets/jquery-cookie/
2020
/public/assets/crypto-js/
@@ -50,4 +50,4 @@ model.sql
5050
/public/assets/*.txt
5151
/.env.local
5252
/.phpunit.cache/
53-
docker-compose/mysql/model/*.sql
53+
docker-compose/mysql/model/*.sql

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM php:7.4-fpm
1+
FROM php:8.3-fpm
22

33
ARG DEBIAN_FRONTEND=noninteractive
44
ARG NVM_VERSION="v0.39.7"
55
ARG GITHUB_OAUTH_TOKEN
6-
ARG XDEBUG_VERSION="xdebug-3.1.6"
6+
ARG XDEBUG_VERSION="xdebug-3.3.2"
77

88
ENV NVM_VERSION=$NVM_VERSION
99
ENV NODE_VERSION="18.20.4"

app/Http/Controllers/Api/ClientPublicKeyApiController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function _delete($owner_id, $public_key_id)
9898
protected function getCreatePayloadValidationRules(): array
9999
{
100100
return [
101-
'client_id' => 'required|integer',
101+
'owner_id' => 'required|integer',
102102
'kid' => 'required|text|max:255',
103103
'active' => 'required|boolean',
104104
'valid_from' => 'required|date_format:m/d/Y',

app/Http/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Kernel extends HttpKernel
3030
protected $middleware = [
3131
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
3232
\App\Http\Middleware\SingleAccessPoint::class,
33-
\Fruitcake\Cors\HandleCors::class,
33+
\Illuminate\Http\Middleware\HandleCors::class,
3434
\App\Http\Middleware\ParseMultipartFormDataInputForNonPostRequests::class,
3535
];
3636

app/Http/Utils/Log/LaravelMailerHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ protected function send($content, array $records):void
156156
$message
157157
->to($to)
158158
->subject($subject)
159-
->setBody($content, 'text/html')
160-
->setFrom($this->from);
159+
->html($content)
160+
->from($this->from);
161161
});
162162
}
163163
}

app/Models/OAuth2/OAuth2OTP.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
use OAuth2\Requests\OAuth2AccessTokenRequestPasswordless;
2525
use Utils\IPHelper;
2626
use Utils\Model\Identifier;
27-
use Zend\Math\Rand;
27+
use Laminas\Math\Rand;
2828

2929
/**
3030
* @ORM\Entity(repositoryClass="App\Repositories\DoctrineOAuth2OTPRepository")

app/Providers/AppServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class AppServiceProvider extends ServiceProvider
3737
*/
3838
public function boot()
3939
{
40-
if(!App::isLocal())
40+
if (!App::isLocal())
4141
URL::forceScheme('https');
4242

4343
$logger = Log::getLogger();

0 commit comments

Comments
 (0)