Skip to content

Commit

Permalink
[TASK][DEV-1399] Upgrade to PHP 8.2 and Symfony 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaskienast committed Jun 22, 2023
1 parent 631450b commit d4ac6f5
Show file tree
Hide file tree
Showing 284 changed files with 5,707 additions and 15,842 deletions.
4 changes: 2 additions & 2 deletions .ddev/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: intercept
type: php
docroot: public
php_version: "7.4"
php_version: "8.2"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
Expand All @@ -17,7 +17,7 @@ hooks:
pre-start:
- exec-host: php -r "file_exists('.ddev/keycloak-gatekeeper.conf') || copy('.ddev/keycloak-gatekeeper.conf.tmpl', '.ddev/keycloak-gatekeeper.conf');"
omit_containers: [db, dba]
webimage_extra_packages: [php7.4-gmp, ssh]
webimage_extra_packages: [php8.2-gmp, ssh]
use_dns_when_possible: true
web_environment: []
nodejs_version: "16"
Expand Down
20 changes: 0 additions & 20 deletions .ddev/docker-compose.rabbitmq.yaml

This file was deleted.

48 changes: 4 additions & 44 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,8 @@ TRUSTED_HOSTS='intercept.ddev.site|stage.intercept.typo3.com|intercept.typo3.com
# Configure your db driver and server_version in config/packages/doctrine.yaml
DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
###< doctrine/doctrine-bundle ###

###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=null://localhost
###< symfony/swiftmailer-bundle ###

# github acces token to handle pull requests
GITHUB_ACCESS_TOKEN="4711"
GITHUB_API_USERNAME=""
GITHUB_API_PASSWORD_TOKEN=""
GITHUB_HOOK_SECRET=""
GITHUB_CHANGELOG_TO_LOG_REPOSITORY="foobar-documentation/Changelog-To-Doc"
Expand All @@ -32,13 +23,6 @@ FORGE_ACCESS_TOKEN=""
# Forge endpoint url
FORGE_ENDPOINT="https://forge.typo3.org"

# Execute bamboo rst calls - Get your own auth header via https://developer.atlassian.com/server/jira/platform/basic-authentication/
# "Basic base64_encode(user:password)"
BAMBOO_AUTHORIZATION="Basic 12345"
# base64 encoded user:password of a user that has at least "global restricted administration permission"
# in bamboo. This is needed to fetch bamboo status information like agent details via REST
BAMBOO_ELEVATED_AUTHORIZATION="Basic 6789"

# Execute votes and pushes to gerrit
GERRIT_AUTHORIZATION="Basic 12345"
GERRIT_TOKEN="SomeToken"
Expand All @@ -48,31 +32,8 @@ GIT_HOME=""
# Path to private key needed to push patches to gerrit
GIT_SSH_PRIVATE_KEY=""

# Core git split / tagging rabbit queue details
RABBITMQ_HOST="ddev-intercept-rabbitmq"
RABBITMQ_PORT="5672"
RABBITMQ_USER="admin"
RABBITMQ_PASSWORD="foo"
RABBITMQ_MANAGEMENT="http://intercept.ddev.site:15672/"
# The queue core split/tag tasks are pushed to / fetched from. Live uses a different one!
RABBITMQ_SPLIT_QUEUE="intercept-core-split-testing"

# Where the main core repo on github is located
CORE_SPLIT_MAIN_REPO="git@github.com:typo3/typo3.git"
# Base path to where the git-split single extension repos reside
CORE_SPLIT_SINGLE_REPOS_BASE="git@github.com:TYPO3.CMS/"
# Where the main core repo on github is located for version 8
CORE_SPLIT_MAIN_REPO_V8="git@github.com:TYPO3GmbH/elts-8.7-release.git"
# Base path to where the git-split single extension repos reside for version 8
CORE_SPLIT_SINGLE_REPOS_BASE_V8="git@github.com:TYPO3GmbH/elts-8.7-"
# Where the main core repo on github is located for version 9
CORE_SPLIT_MAIN_REPO_V9="git@github.com:TYPO3GmbH/elts-9.5-release.git"
# Base path to where the git-split single extension repos reside for version 9
CORE_SPLIT_SINGLE_REPOS_BASE_V9="git@github.com:TYPO3GmbH/elts-9.5-"

# Slack hook endpoint for core nightly build messages
SLACK_HOOK="https://hooks.slack.com/services/123/456/789"
SLACK_CHANNEL="#typo3-gmbh-issues"

# DN of user that executes the LDAP searches on ldap.typo3.org for login
# and his password. This needs to be set in a .env.local for authentication to work
Expand All @@ -83,11 +44,6 @@ LDAP_SEARCH_PASSWORD="bar"
# WITH trailing /
DOCS_LIVE_SERVER="https://docs.typo3.org/"

# Discord Details for connecting webhooks
# This needs to be set in a .env.local to work
DISCORD_SERVER_ID=12345
DISCORD_BOT_TOKEN=SomeRandomToken

USERCENTRICS_ID="R9wBKTwzv"

# used for live re-rendering of all docs, see readme
Expand All @@ -105,3 +61,7 @@ KEYCLOAK_CLIENT_ID=intercept-typo3-com
KEYCLOAK_CLIENT_SECRET=bla
KEYCLOAK_TOKEN_URI="realms/TYPO3/protocol/openid-connect/token"
KEYCLOAK_BASE_URI="https://login.typo3.com"

###> symfony/mailer ###
MAILER_DSN="smtp://localhost:1025"
###< symfony/mailer ###
2 changes: 2 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ GIT_SSH_PRIVATE_KEY="/var/www/local/intercept/home/.ssh/intercept_rsa"
DISCORD_SERVER_ID=1234567890
DISCORD_BOT_TOKEN=TestToken
TRUSTED_HOSTS='localhost'

MAILER_DSN="null://null"
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
php-versions:
- '7.4'
- '8.2'

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -98,8 +98,9 @@ jobs:
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require twinh/php-coveralls --no-progress --no-suggest --no-interaction
composer global require coveralls/php-coveralls --no-progress --no-interaction --ansi
/home/runner/.composer/vendor/bin/php-coveralls --coverage_clover=var/phpunit/coverage.xml -vvv --json_path=var/log/coveralls-upload.json
continue-on-error: true


deployment:
Expand Down
16 changes: 2 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

bin/
!bin/console
!bin/splitsh-lite-darwin
!bin/splitsh-lite-linux

# JIRA plugin
atlassian-ide-plugin.xml

###> symfony/framework-bundle ###
.env.local
Expand All @@ -18,8 +13,7 @@ atlassian-ide-plugin.xml
###< symfony/framework-bundle ###

###> friendsofphp/php-cs-fixer ###
/.php_cs
/.php_cs.cache
.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###

###> phpunit/phpunit ###
Expand All @@ -31,18 +25,12 @@ atlassian-ide-plugin.xml
/public/build/
/public/docs-build-information/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###
/.ddev/keycloak-gatekeeper.conf
/auth.json
/build/.phpunit.result.cache
.phpunit.result.cache

###> symfony/phpunit-bridge ###
build/.phpunit.cache
.phpunit
.phpunit.result.cache
.php-cs-fixer.cache
/phpunit.xml
###< symfony/phpunit-bridge ###
/build/docker-compose.yml
/build/jobfile.json
16 changes: 4 additions & 12 deletions .mage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ magephp:
host_path: /srv/vhosts/intercept.typo3.com/site/mage/
releases: 3
hosts:
- srv001.typo3.com
- shared-small.typo3.com
pre-deploy:
- exec: { cmd: "echo \"APP_ENV=prod\" >> .env.local"}
- composer/install: { flags: "--no-dev --optimize-autoloader"}
Expand All @@ -48,20 +48,14 @@ magephp:
- fs/link: { from: "../../../../shared/var/patches", to: "var/patches" }
- fs/link: { from: "../../../../shared/var/data.db", to: "var/data.db" }
- fs/link: { from: "../../../shared/.env.local", to: ".env.local" }
- fs/link: { from: "../../../../shared/var/git-core-split", to: "var/git-core-split" }
- fs/link: { from: "../../../../shared/var/git-core-split-extensions", to: "var/git-core-split-extensions" }
- fs/link: { from: "../../../../shared/var/git-core-split-extensions-v8", to: "var/git-core-split-extensions-v8" }
- fs/link: { from: "../../../../shared/var/git-core-split-extensions-v9", to: "var/git-core-split-extensions-v9" }
- fs/link: { from: "../../../../shared/var/git-core-pr", to: "var/git-core-pr" }
- fs/link: { from: "../../../../shared/var/git-core-split-v8", to: "var/git-core-split-v8" }
- fs/link: { from: "../../../../shared/var/git-core-split-v9", to: "var/git-core-split-v9" }
on-release:
post-release:
- exec: { cmd: "[ -d ../../../cachetool ] || mkdir -p ../../../cachetool"}
- exec: { cmd: "[ -f ../../../cachetool/cachetool.phar ] || curl -L -o ../../../cachetool/cachetool.phar https://gordalina.github.io/cachetool/downloads/cachetool.phar && chmod +x ../../../cachetool/cachetool.phar"}
- exec: { cmd: "php ../../../cachetool/cachetool.phar opcache:reset --fcgi=/var/run/intercept.typo3.com_fpm.sock --tmp-dir=/srv/vhosts/intercept.typo3.com/site/cachetool"}
- exec: { cmd: "rm -rf var/cache"}
- exec: { cmd: "php7.4 ./bin/console cache:warmup"}
- exec: { cmd: "php8.2 ./bin/console cache:warmup"}
post-deploy:

develop:
Expand All @@ -70,7 +64,7 @@ magephp:
host_path: /srv/vhosts/stage.intercept.typo3.com/site/mage/
releases: 3
hosts:
- srv001.typo3.com
- shared-small.typo3.com
pre-deploy:
- exec: { cmd: "echo \"APP_ENV=prod\" >> .env.local"}
- composer/install: { flags: "--no-dev --optimize-autoloader"}
Expand All @@ -85,13 +79,11 @@ magephp:
- fs/link: { from: "../../../../shared/var/data.db", to: "var/data.db" }
- fs/link: { from: "../../../shared/.env.local", to: ".env.local" }
- fs/link: { from: "../../../../shared/var/git-core-pr", to: "var/git-core-pr" }
- fs/link: { from: "../../../../shared/var/git-core-split", to: "var/git-core-split" }
- fs/link: { from: "../../../../shared/var/git-core-split-v8", to: "var/git-core-split-v8" }
on-release:
post-release:
- exec: { cmd: "[ -d ../../../cachetool ] || mkdir -p ../../../cachetool"}
- exec: { cmd: "[ -f ../../../cachetool/cachetool.phar ] || curl -L -o ../../../cachetool/cachetool.phar https://gordalina.github.io/cachetool/downloads/cachetool.phar && chmod +x ../../../cachetool/cachetool.phar"}
- exec: { cmd: "php ../../../cachetool/cachetool.phar opcache:reset --fcgi=/var/run/stage.intercept.typo3.com_fpm.sock --tmp-dir=/srv/vhosts/stage.intercept.typo3.com/site/cachetool"}
- exec: { cmd: "rm -rf var/cache"}
- exec: { cmd: "php7.4 ./bin/console cache:warmup"}
- exec: { cmd: "php8.2 ./bin/console cache:warmup"}
post-deploy:
32 changes: 32 additions & 0 deletions .phpstorm.meta.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

/**
* Extend PhpStorms code completion capabilities by providing a meta file
*
* @link https://www.jetbrains.com/help/phpstorm/ide-advanced-metadata.html
*/

namespace PHPSTORM_META {
override(\Redmine\Client\Client::getApi(), map([
'attachment' => \Redmine\Api\Attachment::class,
'group' => \Redmine\Api\Group::class,
'custom_fields' => \Redmine\Api\CustomField::class,
'issue' => \Redmine\Api\Issue::class,
'issue_category' => \Redmine\Api\IssueCategory::class,
'issue_priority' => \Redmine\Api\IssuePriority::class,
'issue_relation' => \Redmine\Api\IssueRelation::class,
'issue_status' => \Redmine\Api\IssueStatus::class,
'membership' => \Redmine\Api\Membership::class,
'news' => \Redmine\Api\News::class,
'project' => \Redmine\Api\Project::class,
'query' => \Redmine\Api\Query::class,
'role' => \Redmine\Api\Role::class,
'time_entry' => \Redmine\Api\TimeEntry::class,
'time_entry_activity' => \Redmine\Api\TimeEntryActivity::class,
'tracker' => \Redmine\Api\Tracker::class,
'user' => \Redmine\Api\User::class,
'version' => \Redmine\Api\Version::class,
'wiki' => \Redmine\Api\Wiki::class,
'search' => \Redmine\Api\Search::class,
]));
}
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,9 @@ Interface to link other services to Discord webhooks.
- github.com - repository hooks trigger: git subtree split, git subtree tagging, pull request
handling, documentation rendering. intercept pushes patches and tags to core subtree split
repositories.
- rabbitmq.typo3.com - intercept web controls push new subtree split & tag jobs to a rabbitmq queue,
a intercept cli job connects to rabbit to handle these jobs.
- typo3.slack.com - intercept pushs messages to slack for failed nightly builds
- sqlite - a local sqlite, stores users, documentation details, information if a single core
nightly build has been rebuild already
- Discord - Creating and sending webhooks in Discord

## Architecture

Expand Down
35 changes: 7 additions & 28 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,15 @@

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

set_time_limit(0);

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

if (!class_exists(Application::class)) {
throw new RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}

$input = new ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}

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

require dirname(__DIR__).'/config/bootstrap.php';
require_once dirname(__DIR__).'/vendor/autoload_runtime.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);
};
Binary file removed bin/splitsh-lite-darwin
Binary file not shown.
Binary file removed bin/splitsh-lite-linux
Binary file not shown.
Loading

0 comments on commit d4ac6f5

Please sign in to comment.