diff --git a/Model/Config.php b/Model/Config.php index c00c997..245a4f0 100644 --- a/Model/Config.php +++ b/Model/Config.php @@ -192,11 +192,15 @@ public static function normalizeBoolean(mixed $value, bool $default): bool */ public static function normalizeWaitMilliseconds(mixed $value): int { - if (!is_scalar($value) || !is_numeric($value)) { + if (!is_scalar($value) + || !is_numeric($value) + || (is_float($value) && !is_finite($value)) + ) { return 0; } - return min(self::MAX_WAIT_MS, max(0, (int) $value)); + // PHP 8.5 warns when casting out-of-range floats; bound the value first. + return (int) min(self::MAX_WAIT_MS, max(0, $value)); } /** diff --git a/README.md b/README.md index 203f82a..4b514b1 100644 --- a/README.md +++ b/README.md @@ -72,8 +72,8 @@ Monitoring remains disabled until you configure and enable Basicrum below. ## Compatibility -Tested with **Magento Open Source 2.4.7-p10**, **PHP 8.3**, Luma, and built-in -full-page cache. Other Magento/PHP combinations, Adobe Commerce, Hyvä, +Tested with **Magento Open Source 2.4.7-p10 and 2.4.8-p5**, **PHP 8.3**, Luma, +and built-in full-page cache. Native CI targets 2.4.8-p5. Other Magento/PHP combinations, Adobe Commerce, Hyvä, headless/PWA storefronts, Varnish, and third-party optimizers are not verified. ## Configuration diff --git a/docs/QUALITY-AND-RELEASE-READINESS.md b/docs/QUALITY-AND-RELEASE-READINESS.md index c54da09..f58796c 100644 --- a/docs/QUALITY-AND-RELEASE-READINESS.md +++ b/docs/QUALITY-AND-RELEASE-READINESS.md @@ -202,10 +202,35 @@ CI has not run for these uncommitted changes. This run reused the dedicated disposable installation; it did not reprovision fresh volumes. No release or push was performed. +## Native CI baseline update (2026-11-12) + +Fresh Magento 2.4.7-p10 provisioning was blocked by +[GHSA-cxf4-7mrp-vvpr](https://github.com/thephpleague/flysystem/security/advisories/GHSA-cxf4-7mrp-vvpr): +its Flysystem 2 constraint cannot select a patched version. The baseline now uses +Magento 2.4.8-p5, PHP 8.3, Composer 2.10, MariaDB 11.4, OpenSearch 3.4.0, and +nginx 1.30.6. Composer security blocking remains enabled without exceptions. +Fresh dependency resolution selected Flysystem 3.36.0; the installed production +dependencies passed `composer audit --no-dev --abandoned=ignore` with no security +advisories. Abandoned-package notices remain separate from security findings. + +The new `basicrum-release-baseline-248` Compose project uses fresh application +and database volumes, leaving the previous 2.4.7/10.11 volumes untouched. The +disposable Braintree exclusions also include the two additional 2.4.8 modules. + +Local validation on committed candidate `ac1fd21934751a5de6d1dab36630d2d9dc3fb052` +passed the full archive/install/native gate: baseline checks, upgrade, DI +compilation, static deployment, native configuration saves, and 21 browser tests. +The four existing sample-data/order-creating tests remain explicitly skipped. +The focused PHP suite passed all 18 groups. Logs are retained locally in +`.test-results/native-baseline-248/`; remote checks are attached to +[PR #21](https://github.com/basicrum/basicrum-magento-2/pull/21). +This validates the test baseline, not a new package release or native PHP 8.5. + ## Tested compatibility, not inferred compatibility | Combination | Evidence in this follow-up | | --- | --- | +| Magento Open Source 2.4.8-p5, PHP CLI/FPM 8.3.31, Composer 2.10.3, MariaDB 11.4, OpenSearch 3.4.0, nginx 1.30.6 | Fresh isolated installation and full native gate on the committed candidate above | | Magento Open Source 2.4.7-p10, PHP CLI/FPM 8.3.31, Composer 2.10, MariaDB 10.11, OpenSearch 2.19.4 | Actual isolated installation, native configuration and browser checks | | Luma, en_US, built-in FPC, deployed static files | Actual Admin/storefront, enforcing checkout CSP, consent/beacon/cookie/redaction and two-visitor HIT checks | | PHP 8.2 / 8.4 | Focused PHP checks only; not native Magento runs | diff --git a/tests/integration/README.md b/tests/integration/README.md index e76274e..6398333 100644 --- a/tests/integration/README.md +++ b/tests/integration/README.md @@ -1,16 +1,19 @@ # Disposable Magento integration check -The declared Phase 1 baseline is pinned in `baseline.env`: Magento Open Source -2.4.7-p10 on PHP 8.3, with the listed Composer, MariaDB, and OpenSearch lines. -Adobe's current system-requirements table lists PHP 8.2 and 8.3 for the 2.4.7 -release line. This is a baseline, not a claim that every patch or platform -combination has been verified. +The baseline is pinned in `baseline.env`: Magento Open Source 2.4.8-p5 on PHP +8.3, Composer 2.10, MariaDB 11.4, and OpenSearch 3.4. The web server is nginx +1.30. These versions follow [Adobe's system requirements](https://experienceleague.adobe.com/en/docs/commerce-operations/installation-guide/system-requirements). +This is a baseline, not a claim that every patch or platform combination has +been verified. Magento 2.4.7-p10 requires Flysystem 2, which cannot resolve past +[GHSA-cxf4-7mrp-vvpr](https://github.com/thephpleague/flysystem/security/advisories/GHSA-cxf4-7mrp-vvpr). +The 2.4.8 line permits the patched Flysystem 3 versions; Composer's security +blocking remains enabled without advisory exceptions. ## Magento-version/image-pinned local/CI stack `sh tests/integration/docker/start.sh` creates the dedicated Compose project -`basicrum-release-baseline` using pinned image digests and the anonymous Mage-OS -mirror. It provisions exactly 2.4.7-p10, installs the pinned Playwright runner, +`basicrum-release-baseline-248` using pinned image digests and the anonymous Mage-OS +mirror. It provisions exactly 2.4.8-p5, installs the pinned Playwright runner, and leaves existing Magento stacks alone. Docker, Compose, OpenSSL and several GB of disk/RAM are required. Provisioning refuses to overwrite an installed application; reuse it with the commands below, not `start.sh` again. @@ -18,6 +21,10 @@ The full Magento Composer dependency closure is **not** locked in this repositor Fresh provisioning resolves transitive dependencies from the mirror; upstream releases/advisories can change that resolution or make installation fail. Image digests and the Magento version pin do not promise bit-for-bit reproducibility. +The new Compose project name also gives this baseline fresh application/database +volumes. Existing `basicrum-release-baseline` volumes from 2.4.7 are retained and +never opened by the new MariaDB image; stop any old baseline containers before +using the shared localhost port. The test browser runs inside the PHP container at `https://web:8443/`; the host binding is loopback-only port **9443**, never 443 or the existing local shop's diff --git a/tests/integration/baseline.env b/tests/integration/baseline.env index 0589e74..b44eef4 100644 --- a/tests/integration/baseline.env +++ b/tests/integration/baseline.env @@ -1,6 +1,6 @@ -# Declared Phase 1 disposable-store integration baseline. -MAGENTO_VERSION=2.4.7-p10 +# Declared disposable-store integration baseline. +MAGENTO_VERSION=2.4.8-p5 PHP_VERSION=8.3 COMPOSER_VERSION=2.10 -MARIADB_VERSION=10.11 -OPENSEARCH_VERSION=2.19 +MARIADB_VERSION=11.4 +OPENSEARCH_VERSION=3.4 diff --git a/tests/integration/docker/compose.yaml b/tests/integration/docker/compose.yaml index 58bb89f..b26b35e 100644 --- a/tests/integration/docker/compose.yaml +++ b/tests/integration/docker/compose.yaml @@ -1,4 +1,5 @@ -name: basicrum-release-baseline +# Keep the previous Magento 2.4.7/MariaDB 10.11 volumes untouched. +name: basicrum-release-baseline-248 services: php: build: . @@ -19,7 +20,7 @@ services: search: condition: service_healthy web: - image: markoshust/magento-nginx:1.28-0@sha256:12d211176a5800ef1ebdc909865a0a5ebc691d282a6df438b082ac5587f275de + image: nginx:1.30.6-alpine@sha256:583b7f2fce1cdb8da5ad5c39ebd3c33b98b87d493190e548bdee1fa8c619c311 ports: - '127.0.0.1:9443:8443' volumes: @@ -29,7 +30,7 @@ services: depends_on: - php db: - image: mariadb:10.11@sha256:07c0aaff7396b74cb7975cba78257178d188e30f531a5db2b617c48beef13c41 + image: mariadb:11.4@sha256:5e73baf8179b29f115101bb102763a47a017361f3e9792daccba6646c3ab1532 environment: MARIADB_DATABASE: magento MARIADB_USER: magento @@ -42,7 +43,7 @@ services: interval: 5s retries: 30 search: - image: opensearchproject/opensearch:2.19.4@sha256:9e0b3b3b6805811bd63d9b9503ffe34a58ba33d03cc346000e318c6ff5c05bd9 + image: opensearchproject/opensearch:3.4.0@sha256:1647ce2e07371f1ac8bbad28890a64ef77c5a694a61f656120f0ace09e66bf48 environment: discovery.type: single-node DISABLE_SECURITY_PLUGIN: 'true' diff --git a/tests/integration/docker/provision.sh b/tests/integration/docker/provision.sh index a29a8ad..ecd16c0 100644 --- a/tests/integration/docker/provision.sh +++ b/tests/integration/docker/provision.sh @@ -11,7 +11,7 @@ if [ -f app/etc/env.php ]; then fi composer create-project --repository-url=https://mirror.mage-os.org/ \ - --no-install --no-interaction magento/project-community-edition . 2.4.7-p10 + --no-install --no-interaction magento/project-community-edition . 2.4.8-p5 composer config repositories.magento composer https://mirror.mage-os.org/ composer config --unset repositories.0 composer install --no-dev --prefer-dist --no-interaction @@ -27,7 +27,8 @@ php bin/magento setup:install --base-url="$MAGENTO_STOREFRONT_URL" \ # adds external scripts even without checkout; keep Magento_Paypal for CSP checks. php bin/magento module:disable Magento_AdminAdobeImsTwoFactorAuth Magento_TwoFactorAuth \ Magento_AdminAnalytics PayPal_Braintree PayPal_BraintreeGraphQl \ - PayPal_BraintreeCustomerBalance PayPal_BraintreeGiftCardAccount PayPal_BraintreeGiftWrapping + PayPal_BraintreeCustomerBalance PayPal_BraintreeGiftCardAccount PayPal_BraintreeGiftWrapping \ + PayPal_BraintreeGiftCard PayPal_BraintreeReward php bin/magento deploy:mode:set developer php bin/magento config:set system/smtp/disable 1 # Admin Analytics is already disabled; its admin/usage/enabled field no longer exists. diff --git a/tests/php/run.php b/tests/php/run.php index 1c3aef6..b6cbc28 100644 --- a/tests/php/run.php +++ b/tests/php/run.php @@ -40,19 +40,19 @@ $tests['release baseline rejects wrong or missing platform versions'] = function () use ($root): void { $expected = parse_ini_file($root . '/tests/integration/baseline.env', false, INI_SCANNER_RAW); $matching = [ - 'MAGENTO_VERSION' => '2.4.7-p10', + 'MAGENTO_VERSION' => '2.4.8-p5', 'PHP_VERSION' => '8.3.30', 'COMPOSER_VERSION' => '2.10.0', - 'MARIADB_VERSION' => '10.11.14-MariaDB', - 'OPENSEARCH_VERSION' => '2.19.4', + 'MARIADB_VERSION' => '11.4.10-MariaDB', + 'OPENSEARCH_VERSION' => '3.4.0', ]; basicrum_assert_same([], basicrum_baseline_errors($expected, $matching), 'declared platform passes'); foreach ([ 'MAGENTO_VERSION' => '2.4.9', 'PHP_VERSION' => '8.5.6', 'COMPOSER_VERSION' => '2.1.0', - 'MARIADB_VERSION' => '11.4.0-MariaDB', - 'OPENSEARCH_VERSION' => '2.190.0', + 'MARIADB_VERSION' => '10.11.14-MariaDB', + 'OPENSEARCH_VERSION' => '3.40.0', ] as $key => $version) { $wrong = array_replace($matching, [$key => $version]); basicrum_assert_same([$key], array_keys(basicrum_baseline_errors($expected, $wrong)), $key . ' mismatch'); @@ -678,6 +678,59 @@ function () use ($runDisposableGuard): void { basicrum_assert_same(30000, $wait->getValue(), 'save-time wait bound'); }; +$tests['wait normalization handles numeric extremes without PHP warnings'] = function (): void { + $previousErrorReporting = error_reporting(E_ALL); + set_error_handler(static function (int $severity, string $message, string $file, int $line): never { + throw new ErrorException($message, 0, $severity, $file, $line); + }); + + try { + foreach ([ + 'large float' => [1e20, 30000], + 'negative large float' => [-1e20, 0], + 'positive infinity' => [INF, 0], + 'negative infinity' => [-INF, 0], + 'not a number' => [NAN, 0], + 'maximum integer' => [PHP_INT_MAX, 30000], + 'minimum integer' => [PHP_INT_MIN, 0], + 'large numeric string' => ['1e20', 30000], + 'overflowing numeric string' => ['1e309', 30000], + 'negative overflowing numeric string' => ['-1e309', 0], + 'fractional float' => [500.75, 500], + 'fractional numeric string' => ['500.75', 500], + 'negative fraction' => [-0.5, 0], + 'zero' => [0, 0], + 'upper bound' => [30000, 30000], + 'invalid string' => ['not-a-number', 0], + 'missing value' => [null, 0], + 'non-scalar value' => [[], 0], + ] as $label => [$value, $expected]) { + basicrum_assert_same($expected, Config::normalizeWaitMilliseconds($value), $label . ' normalization'); + + $wait = new WaitMilliseconds(); + $wait->setValue($value); + $wait->beforeSave(); + basicrum_assert_same($expected, $wait->getValue(), $label . ' save normalization'); + + $default = ScopeConfigInterface::SCOPE_TYPE_DEFAULT; + $config = new Config(new BasicrumTestScopeConfig([ + basicrum_test_key($default, 0, Config::XML_PATH_ENABLED) => '1', + basicrum_test_key($default, 0, Config::XML_PATH_BEACON_ENDPOINT) => 'https://collector.test/beacon', + basicrum_test_key($default, 0, Config::XML_PATH_BRUM_SITE_ID) => '550e8400-e29b-41d4-a716-446655440000', + basicrum_test_key($default, 0, Config::XML_PATH_WAIT_ENABLED) => '0', + basicrum_test_key($default, 0, Config::XML_PATH_WAIT_MS) => $value, + ])); + $runtime = $config->getRuntimeConfig(); + basicrum_assert_true(is_array($runtime), $label . ' keeps runtime configuration available'); + basicrum_assert_false($runtime['wait_after_onload'], $label . ' preserves disabled delay'); + basicrum_assert_same($expected, $runtime['delay_ms'], $label . ' runtime normalization'); + } + } finally { + restore_error_handler(); + error_reporting($previousErrorReporting); + } +}; + $tests['runtime gate requires enable endpoint and site identity'] = function (): void { $default = ScopeConfigInterface::SCOPE_TYPE_DEFAULT; $base = [