From 922f50af9737b7b6c78513d4026353b665f31075 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Mon, 2 Nov 2026 15:10:41 -0500 Subject: [PATCH 1/2] CI: set Cacti fixture ownership to runner:www-data in Setup Permissions Composer runs as the runner user in a later CI step and calls touch() while generating the fixture autoloader; utime() only succeeds for the file owner, so the runner user must own the tree. www-data is retained as group and ownership is handed back before polling. Mirrors the fix in Cacti/plugin_evidence#63. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/plugin-ci-workflow.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/plugin-ci-workflow.yml b/.github/workflows/plugin-ci-workflow.yml index cfe9f521..afd006a0 100644 --- a/.github/workflows/plugin-ci-workflow.yml +++ b/.github/workflows/plugin-ci-workflow.yml @@ -112,7 +112,11 @@ jobs: - name: Setup Permissions run: | - sudo chown -R www-data:runner ${{ github.workspace }}/cacti + # Composer runs as the runner user in a later step and calls touch() + # while generating the fixture autoloader. utime() only succeeds for the + # file owner, so the runner user must own the tree here; www-data keeps + # group access. Ownership is handed back to www-data before polling. + sudo chown -R runner:www-data ${{ github.workspace }}/cacti sudo find ${{ github.workspace }}/cacti -type d -exec chmod 775 {} \; sudo find ${{ github.workspace }}/cacti -type f -exec chmod 664 {} \; sudo chmod +x ${{ github.workspace }}/cacti/cmd.php From 26cb06d333aa2e2c1684bea8555fe58b32ca455f Mon Sep 17 00:00:00 2001 From: TheWitness Date: Tue, 3 Nov 2026 23:06:37 -0500 Subject: [PATCH 2/2] tests: stub cacti_object_hash() in the quality_must_fix DB regression harness The quality_must_fix database regression test loads the real Cacti lib/database.php but only the Cacti functions it needs as inline stubs. Cacti core now routes connection tracking through cacti_object_hash() (the spl_object_hash() replacement for PHP 8.6), which lives in lib/functions.php and is not loaded by this harness. As a result the test aborted with "Call to undefined function cacti_object_hash()" once the harness exercised db_table_exists()/sql_save(). Add a faithful cacti_object_hash() stub alongside the other cacti_* stubs, mirroring the core implementation so the connection-tracking array keys stay stable per object. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/regression/quality_must_fix_database_test.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/regression/quality_must_fix_database_test.php b/tests/regression/quality_must_fix_database_test.php index a5fb8189..323c20f1 100644 --- a/tests/regression/quality_must_fix_database_test.php +++ b/tests/regression/quality_must_fix_database_test.php @@ -34,6 +34,7 @@ require $cacti . '/lib/database.php'; function cacti_log(...$args) {} function cacti_debug_backtrace(...$args) {} +function cacti_object_hash($object) { return is_object($object) ? (string) sprintf('%016x0000000000000000', spl_object_id($object)) : false; } function clean_up_lines($value) { return $value; } function cacti_count($value) { return is_countable($value) ? count($value) : 0; } function cacti_sizeof($value) { return is_array($value) ? count($value) : 0; }