From 524aa66b85ddf35c53670c70df2ee2caecf1bda0 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Sat, 7 Nov 2026 15:50:33 -0500 Subject: [PATCH 1/3] ci: add non-blocking PHP 8.6 matrix leg Mirror Cacti/cacti#8633. This plugin already tests PHP 8.5 as a blocking matrix leg, so only PHP 8.6 is added here, as an experimental (non-blocking) leg via continue-on-error. PHP 8.6 is still pre-release and the setup-php nightly ships ABI-skewed bundled extensions, so the 8.6 leg provisions a coherent CLI from Ondrej Sury's PPA instead. The Ondrej PPA has no php8.6-xdebug build yet, so the patch-coverage gate is skipped on the 8.6 leg only. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/plugin-ci-workflow.yml | 49 +++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/.github/workflows/plugin-ci-workflow.yml b/.github/workflows/plugin-ci-workflow.yml index c879487..4dfd743 100644 --- a/.github/workflows/plugin-ci-workflow.yml +++ b/.github/workflows/plugin-ci-workflow.yml @@ -47,12 +47,21 @@ jobs: integration-test: timeout-minutes: 45 runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.experimental }} strategy: fail-fast: false matrix: php: ['8.3', '8.4', '8.5'] os: [ubuntu-latest] + experimental: [false] + include: + # PHP 8.6 runs as a non-blocking (experimental) leg because its + # packages can lag on the runners and in Ondřej Surý's PPA. 8.5 is + # already covered as a blocking leg above. + - php: '8.6' + os: ubuntu-latest + experimental: true services: mariadb: @@ -90,6 +99,7 @@ jobs: fetch-depth: 0 - name: Install PHP ${{ matrix.php }} + if: matrix.php != '8.6' uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 with: php-version: ${{ matrix.php }} @@ -98,6 +108,41 @@ jobs: coverage: xdebug ini-values: "post_max_size=256M, max_execution_time=60, date.timezone=America/New_York" + # PHP 8.6 is still pre-release. shivammathur/setup-php ships a nightly + # 8.6.0-dev build whose bundled extensions are ABI-skewed against their own + # core (undefined symbol: smart_str_ferealloc / _safe_femalloc), so every + # extension fails to load and the CLI install dies. Ondřej Surý's PPA + # provides a coherent 8.6 RC build, so this experimental leg provisions the + # CLI from there instead. + - name: Install PHP 8.6 toolchain from Ondřej Surý's PPA + if: matrix.php == '8.6' + run: | + set -euo pipefail + sudo add-apt-repository -y ppa:ondrej/php + sudo apt-get update + sudo apt-get install -y \ + php8.6-cli php8.6-common \ + php8.6-intl php8.6-mysql php8.6-gd php8.6-ldap \ + php8.6-gmp php8.6-xml php8.6-curl php8.6-mbstring \ + php8.6-snmp php8.6-sqlite3 + # Make the Ondřej 8.6 CLI the default `php` so composer and the tests + # run under the same ABI-coherent build. + sudo update-alternatives --install /usr/bin/php php /usr/bin/php8.6 86 + sudo update-alternatives --set php /usr/bin/php8.6 + # Mirror the ini values the other legs receive via setup-php. + printf '%s\n' \ + 'post_max_size=256M' \ + 'max_execution_time=60' \ + 'date.timezone=America/New_York' \ + | sudo tee /etc/php/8.6/cli/conf.d/99-cacti-ci.ini >/dev/null + # setup-php normally provides Composer; it is skipped for this leg, so + # make sure a Composer binary is available for the dependency steps. + if ! command -v composer >/dev/null 2>&1; then + sudo apt-get install -y composer + fi + php -v + composer --version + - name: Check PHP version run: php -v @@ -209,7 +254,9 @@ jobs: # inside a live Cacti. What is enforceable is that a change covers the # lines it adds. - name: Enforce coverage of changed lines - if: github.event_name == 'pull_request' + # PHP 8.6 installs from the Ondřej PPA, which has no matching xdebug + # build yet, so there is no coverage driver on that experimental leg. + if: github.event_name == 'pull_request' && matrix.php != '8.6' env: BASE_REF: ${{ github.event.pull_request.base.sha }} run: | From ee4938f6641b810b2449b4b1abd31fae8db88937 Mon Sep 17 00:00:00 2001 From: Thomas Vincent Date: Sat, 7 Nov 2026 18:59:13 -0800 Subject: [PATCH 2/3] fix(ci): run the poller with the shared RRD group Use the runner effective group alongside the www-data user so newly created RRD files match the existing CI directory ownership. Covers flat and structured RRD paths without changing directory modes or suppressing warnings. Signed-off-by: Thomas Vincent --- .github/workflows/plugin-ci-workflow.yml | 2 +- CHANGELOG.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/plugin-ci-workflow.yml b/.github/workflows/plugin-ci-workflow.yml index 4dfd743..42f6f27 100644 --- a/.github/workflows/plugin-ci-workflow.yml +++ b/.github/workflows/plugin-ci-workflow.yml @@ -318,7 +318,7 @@ jobs: - name: Run Cacti Poller run: | cd ${{ github.workspace }}/cacti - sudo -u www-data php poller.php --poller=1 --force --debug + sudo runuser -u www-data -g runner -- php poller.php --poller=1 --force --debug if ! grep -q "SYSTEM STATS" log/cacti.log; then echo "Cacti poller did not finish successfully" diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d11086..8e23ac2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ --- develop --- +* dev: Run the CI poller with the shared runner group so RRD files and structured directories pass permission verification * security: Move the plugin's remaining inline event handlers to CSP-safe bindings so the pages no longer trip Cacti's Content-Security-Policy script-src-attr directive: the confirmation-page Cancel buttons use the `cactiReturnTo` class, the filter rows selects are bound via change() in their ready blocks, and the template calc-syntax links use a delegated `reportitAddCalc` handler * dev: Measure CI coverage with xdebug instead of pcov so the plugin's own sources are instrumented (pcov auto-scopes to the Composer root and skipped cacti/plugins/, leaving the patch-coverage gate with nothing to measure) * dev: Enforce patch coverage of changed lines in CI and remove the inert COMPOSER_ROOT_VERSION env from the Pest step From 913ec4a92da1bf43d439295835d816fb392b4afd Mon Sep 17 00:00:00 2001 From: TheWitness Date: Sun, 8 Nov 2026 10:15:03 -0500 Subject: [PATCH 3/3] ci: pin PHP 8.6 leg to ubuntu-24.04 ubuntu-latest has rolled to Ubuntu 26.04 (Resolute). Ondrej Surys Launchpad PPA (ppa:ondrej/php) has no Release file for the resolute suite yet (it is migrating to packages.sury.org), so apt-get update 404s and the experimental 8.6 PPA toolchain install dies with exit code 100. Pin the experimental 8.6 leg to ubuntu-24.04 (Noble), which still serves the latest packaged 8.6 release candidate from the PPA. The other legs use shivammathur/setup-php and are unaffected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/plugin-ci-workflow.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/plugin-ci-workflow.yml b/.github/workflows/plugin-ci-workflow.yml index 42f6f27..b44e27a 100644 --- a/.github/workflows/plugin-ci-workflow.yml +++ b/.github/workflows/plugin-ci-workflow.yml @@ -59,8 +59,11 @@ jobs: # PHP 8.6 runs as a non-blocking (experimental) leg because its # packages can lag on the runners and in Ondřej Surý's PPA. 8.5 is # already covered as a blocking leg above. + # Pinned to Ubuntu 24.04 (Noble): ubuntu-latest is now Ubuntu 26.04 + # (Resolute), which Ondrej Sury's PPA does not yet serve, so the 8.6 + # PPA toolchain install 404s. Noble carries the latest packaged 8.6 RC. - php: '8.6' - os: ubuntu-latest + os: ubuntu-24.04 experimental: true services: