From c577773e071804ae186de833915c6391f0718483 Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 15 Mar 2024 22:55:48 +0100 Subject: [PATCH 1/7] [CI] Add PHP 8.3 --- .woodpecker/.phpunit.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.woodpecker/.phpunit.yml b/.woodpecker/.phpunit.yml index 97ea09d374..d056f9a850 100644 --- a/.woodpecker/.phpunit.yml +++ b/.woodpecker/.phpunit.yml @@ -8,6 +8,8 @@ matrix: PHP_VERSION: 8.1.23 - PHP_MAJOR_VERSION: 8.2 PHP_VERSION: 8.2.11 + - PHP_MAJOR_VERSION: 8.3 + PHP_VERSION: 8.3.3 # This forces PHP Unit executions at the "opensocial" labeled location (because of much more power...) labels: From adeb9af50278b0bfba45c27aa0cc4bd47ba1e4a3 Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 15 Mar 2024 23:03:44 +0100 Subject: [PATCH 2/7] Update PHP 8.1 and PHP 8.2 CI image --- .woodpecker/.phpunit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker/.phpunit.yml b/.woodpecker/.phpunit.yml index d056f9a850..2b03d209ba 100644 --- a/.woodpecker/.phpunit.yml +++ b/.woodpecker/.phpunit.yml @@ -5,9 +5,9 @@ matrix: - PHP_MAJOR_VERSION: 8.0 PHP_VERSION: 8.0.30 - PHP_MAJOR_VERSION: 8.1 - PHP_VERSION: 8.1.23 + PHP_VERSION: 8.1.27 - PHP_MAJOR_VERSION: 8.2 - PHP_VERSION: 8.2.11 + PHP_VERSION: 8.2.16 - PHP_MAJOR_VERSION: 8.3 PHP_VERSION: 8.3.3 From 0eec20d20319a44dabef06d8c33e6d8e6a0d71de Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 15 Mar 2024 23:06:13 +0100 Subject: [PATCH 3/7] Use PHP 8.2 for codecoverage --- .woodpecker/.phpunit.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.woodpecker/.phpunit.yml b/.woodpecker/.phpunit.yml index 2b03d209ba..0699d78b5b 100644 --- a/.woodpecker/.phpunit.yml +++ b/.woodpecker/.phpunit.yml @@ -66,7 +66,7 @@ steps: - cp config/local-sample.config.php config/local.config.php - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql - - if [ "${PHP_MAJOR_VERSION}" = "7.4" -a "${CI_REPO}" = "friendica/friendica" ]; then + - if [ "${PHP_MAJOR_VERSION}" = "8.2" -a "${CI_REPO}" = "friendica/friendica" ]; then phpenmod xdebug; export XDEBUG_MODE=coverage; phpunit --configuration tests/phpunit.xml -d memory_limit=-1 --coverage-clover clover.xml; @@ -77,8 +77,8 @@ steps: image: friendicaci/codecov when: matrix: - PHP_MAJOR_VERSION: 7.4 - PHP_VERSION: 7.4.33 + PHP_MAJOR_VERSION: 8.2 + PHP_VERSION: 8.2.16 repo: - friendica/friendica commands: From 4f24247aa728a93a60be6e28ee710f822a49dee1 Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 15 Mar 2024 23:08:53 +0100 Subject: [PATCH 4/7] Use PHP 8.2 for other pipelines --- .woodpecker/.continuous-deployment.yml | 2 +- .woodpecker/.database_checks.yml | 4 ++-- .woodpecker/.releaser.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.woodpecker/.continuous-deployment.yml b/.woodpecker/.continuous-deployment.yml index 4ff956b3b6..4ce8a70930 100644 --- a/.woodpecker/.continuous-deployment.yml +++ b/.woodpecker/.continuous-deployment.yml @@ -39,7 +39,7 @@ steps: branch: [ develop, '*-rc' ] event: push composer_install: - image: friendicaci/php7.4:php7.4.33 + image: friendicaci/php8.2:php8.2.16 commands: - export COMPOSER_HOME=.composer - composer validate diff --git a/.woodpecker/.database_checks.yml b/.woodpecker/.database_checks.yml index 7d25536749..e713ce07d6 100644 --- a/.woodpecker/.database_checks.yml +++ b/.woodpecker/.database_checks.yml @@ -1,7 +1,7 @@ matrix: include: - - PHP_MAJOR_VERSION: 7.4 - PHP_VERSION: 7.4.33 + - PHP_MAJOR_VERSION: 8.2 + PHP_VERSION: 8.2.16 branches: exclude: [ stable ] diff --git a/.woodpecker/.releaser.yml b/.woodpecker/.releaser.yml index 006bcfec37..175ab7d514 100644 --- a/.woodpecker/.releaser.yml +++ b/.woodpecker/.releaser.yml @@ -37,7 +37,7 @@ steps: branch: stable event: tag composer_install: - image: friendicaci/php7.4:php7.4.33 + image: friendicaci/php8.2:php8.2.16 commands: - export COMPOSER_HOME=.composer - composer validate From 9ce2142d9993aafd2589c6b54faa2e677d1e77dd Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 15 Mar 2024 23:48:49 +0100 Subject: [PATCH 5/7] Adhere deprecation notes - Use `when:` - Remove `group: lint` --- .woodpecker/.database_checks.yml | 5 +++-- .woodpecker/.messages.po_check.yml | 5 +++-- .woodpecker/.phpunit.yml | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.woodpecker/.database_checks.yml b/.woodpecker/.database_checks.yml index e713ce07d6..390df0a6be 100644 --- a/.woodpecker/.database_checks.yml +++ b/.woodpecker/.database_checks.yml @@ -3,8 +3,9 @@ matrix: - PHP_MAJOR_VERSION: 8.2 PHP_VERSION: 8.2.16 -branches: - exclude: [ stable ] +when: + - branch: + exclude: [ stable ] # This forces CI executions at the "opensocial" labeled location (because of much more power...) labels: diff --git a/.woodpecker/.messages.po_check.yml b/.woodpecker/.messages.po_check.yml index 9c25095940..d568aa49fe 100644 --- a/.woodpecker/.messages.po_check.yml +++ b/.woodpecker/.messages.po_check.yml @@ -8,5 +8,6 @@ steps: commands: - /check-messages.sh -branches: - exclude: [ stable ] +when: + - branch: + exclude: [ stable ] diff --git a/.woodpecker/.phpunit.yml b/.woodpecker/.phpunit.yml index 0699d78b5b..7141ef8943 100644 --- a/.woodpecker/.phpunit.yml +++ b/.woodpecker/.phpunit.yml @@ -18,7 +18,6 @@ labels: steps: php-lint: image: php:${PHP_MAJOR_VERSION} - group: lint commands: - find . -name \*.php -not -path './vendor/*' -not -path './view/asset/*' -print0 | xargs -0 -n1 php -l restore_cache: From f1be6d5181d81b821859e83bb82d0bd6149cf46e Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 16 Mar 2024 07:53:12 +0000 Subject: [PATCH 6/7] Issue 14001: Fix "Incorrect integer value" --- src/Network/Probe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Network/Probe.php b/src/Network/Probe.php index 712c3c6dfd..f923e6c162 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -140,7 +140,7 @@ class Probe } else { $newdata[$field] = trim($data[$field]); } - } elseif (!in_array($field, $numeric_fields)) { + } elseif (!in_array($field, $numeric_fields) && !in_array($field, $boolean_fields)) { $newdata[$field] = ''; } else { $newdata[$field] = null; From 28363a54163c5ee108449168de20e4284f59417f Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 16 Mar 2024 07:58:51 +0000 Subject: [PATCH 7/7] Fix "Undefined variable $success" --- src/Protocol/Delivery.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Protocol/Delivery.php b/src/Protocol/Delivery.php index 436e949f30..d479ad4422 100644 --- a/src/Protocol/Delivery.php +++ b/src/Protocol/Delivery.php @@ -338,16 +338,13 @@ class Delivery if ($public_dfrn) { Logger::info('Relay delivery to ' . $contact['url'] . ' with guid ' . $target_item['guid'] . ' returns ' . $deliver_status); - if ($cmd == Delivery::POST) { - if (($deliver_status >= 200) && ($deliver_status <= 299)) { - Post\DeliveryData::incrementQueueDone($target_item['uri-id'], $protocol); + $success = ($deliver_status >= 200) && ($deliver_status <= 299); - GServer::setProtocol($contact['gsid'] ?? 0, $protocol); - $success = true; - } else { - Post\DeliveryData::incrementQueueFailed($target_item['uri-id']); - $success = false; - } + if ($cmd == Delivery::POST) { + Post\DeliveryData::incrementQueueDone($target_item['uri-id'], $protocol); + GServer::setProtocol($contact['gsid'] ?? 0, $protocol); + } else { + Post\DeliveryData::incrementQueueFailed($target_item['uri-id']); } return $success; }