Skip to content

Commit

Permalink
Merge pull request #416 from OpenConext/feature/rejuvination
Browse files Browse the repository at this point in the history
Rejuvinate the Stepup Middleware
  • Loading branch information
pablothedude authored Jan 15, 2025
2 parents d581bb6 + 0a86ed9 commit bdc8b9b
Show file tree
Hide file tree
Showing 895 changed files with 26,806 additions and 25,057 deletions.
9 changes: 1 addition & 8 deletions ...r/Fixtures/invalid_configuration/null.php → .docheader
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

/**
* Copyright 2014 SURFnet bv
* Copyright %regexp:\d{4}% SURFnet %regexp:(B.V.|bv)%
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,8 +13,3 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

return [
'expectedPropertyPath' => '(root)',
'configuration' => null
];
40 changes: 0 additions & 40 deletions .env

This file was deleted.

4 changes: 0 additions & 4 deletions .env.test

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build-push-test-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@v3

- name: Build the app
uses: openconext/build-and-publish-test-container/php72-node14@main
uses: openconext/build-and-publish-test-container/php82-node20@main
with:
use_yarn: false

Expand Down
42 changes: 16 additions & 26 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,22 @@ on:
push:
branches: [ main, feature/*, bugfix/*, release/* ]
jobs:
build:
run-qa-tests:
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
working-directory: /var/www/html/
container:
image: ghcr.io/openconext/openconext-basecontainers/php82-apache2-node20-composer2:latest
volumes:
- .:/var/www/html

steps:
- name: Checkout
uses: actions/checkout@v1
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Init environment
run: |
cd ci/docker
docker compose up -d
- name: Install dependencies
run: |
cd ci/docker && docker compose exec -T stepup-middleware bash -lc '
composer install
'
- name: Run test scripts
run: cd ci/docker && docker compose exec -T stepup-middleware bash -lc ' composer test '
- name: Output log files on failure
if: failure()
run: |
tail -2000 /var/log/syslog
uses: actions/checkout@v2

- name: Composer install
run: composer install

- name: Run QA tests
run: composer check
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/web/app_dev.php
/web/app_test.php
/web/app_dev.php.dist
/config/legacy/parameters.yaml
/config/openconext/parameters.yaml
/var/cache/*
/var/logs/*
!var/cache/.gitkeep
Expand Down Expand Up @@ -36,3 +36,7 @@ config/services.yml
###> symfony/phpunit-bridge ###
.phpunit
###< symfony/phpunit-bridge ###

###> phpstan/phpstan ###
phpstan.neon
###< phpstan/phpstan ###
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Changelog

# 6.0.0
- Move to PHP 8.2
- Move to Synfony 6
- Upgrade composer dependencies
- Bump saml2, xmlseclibs

# 5.2.0
- Some changes for the Docker release of Middleware. This app will get a PHP7.2 release in docker
- Migrate the github actions to reusable actions
Expand Down
43 changes: 9 additions & 34 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,42 +1,17 @@
#!/usr/bin/env php
<?php

use App\Kernel;
use Surfnet\StepupMiddleware\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\ErrorHandler\Debug;

if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;
}

set_time_limit(0);

require dirname(__DIR__).'/vendor/autoload.php';

if (!class_exists(Application::class)) {
throw new LogicException('You need to add "symfony/framework-bundle" as a Composer dependency.');
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}

$input = new ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
}
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
require_once dirname(__DIR__).'/config/bootstrap.php';

if ($input->hasParameterOption('--no-debug', true)) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
}

require dirname(__DIR__).'/config/bootstrap.php';

if ($_SERVER['APP_DEBUG']) {
umask(0000);

if (class_exists(Debug::class)) {
Debug::enable();
}
}
return function (array $context) {
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);

$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$application = new Application($kernel);
$application->run($input);
return new Application($kernel);
};
4 changes: 2 additions & 2 deletions bin/doctrine-migrations-diff.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash

php72 ./bin/console do:mi:di --em=middleware --filter-expression='~^(?!event_stream).*$~'
bin/console doctrine:migrations:diff --em=middleware --env=dev --filter-expression='~^(?!event_stream).*$~'
sleep 1
php72 ./bin/console do:mi:di --em=gateway
bin/console doctrine:migrations:diff --em=gateway --env=dev
2 changes: 1 addition & 1 deletion bin/doctrine-migrations-migrate.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

php72 ./bin/console doctrine:migrations:migrate --env=prod --em=deploy
bin/console doctrine:migrations:migrate --env=prod --em=deploy
3 changes: 2 additions & 1 deletion bin/extract-translations.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/bash
php72 bin/console translation:extract --config=default --env=dev
bin/console translation:extract --env=dev nl_NL --format=xliff --force
bin/console translation:extract --env=dev en_GB --format=xliff --force
8 changes: 0 additions & 8 deletions ci/qa/create-test-db

This file was deleted.

5 changes: 5 additions & 0 deletions ci/qa/docheader
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

cd $(dirname $0)/../../

./vendor/bin/docheader --no-ansi check src/ tests/
6 changes: 6 additions & 0 deletions ci/qa/phpcbf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

cd $(dirname $0)/../../

# https://github.com/squizlabs/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically
./vendor/bin/phpcbf --standard=ci/qa/phpcs.xml --extensions=php src $1
9 changes: 3 additions & 6 deletions ci/qa/phpcpd
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env bash

#cd $(dirname $0)/../../
cd $(dirname $0)/../../
#
## https://github.com/sebastianbergmann/phpcpd
#./vendor/bin/phpcpd --exclude src/*/Tests/* src

# PHPCS is currently disabled due to Xdebug throwing a fatal error.
echo "Skipping PHPCPD due to Xdebug fatal error"
exit 0
./vendor/bin/phpcpd --exclude */Tests/* src
exit 0;
5 changes: 5 additions & 0 deletions ci/qa/phpstan
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

cd $(dirname $0)/../../

vendor/bin/phpstan analyse --memory-limit=-1 --no-ansi -c ./ci/qa/phpstan.neon
Loading

0 comments on commit bdc8b9b

Please sign in to comment.