Repository navigation
fix(installer): [develop] preflight dependencies and verify populated upgrades - #8306
somethingwithproof wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Downloadable reports omit web migration versions and can exceed the database column used to persist them.
2 open findings
What changed in this PR
Adds installer dependency preflight, upgrade diagnostics, postcondition checks, collector synchronization reporting, and populated upgrade validation.
Changes:
- Adds offline dependency checks and preparation tooling.
- Adds upgrade plans, reports, schema/authentication verification, and collector warnings.
- Expands upgrade coverage across release, database, LDAP, plugin, and browser fixtures.
| File | Description |
|---|---|
.github/workflows/installer-components-coverage.yml |
Adds component coverage matrix. |
.github/workflows/installer-coverage.yml |
Expands installer integration matrix. |
.github/workflows/release-artifact.yml |
Validates packaged dependencies. |
cli/install_cacti.php |
Displays plans and warnings. |
cli/prepare_install.sh |
Prepares source dependencies. |
cli/upgrade_database.php |
Adds postconditions and reporting. |
docs/INSTALLER_RECOVERY.md |
Documents upgrade recovery. |
include/global_arrays.php |
Registers report authorization. |
install/background.php |
Adds dependency preflight. |
install/functions.php |
Adds synchronization and verification helpers. |
install/install.php |
Adds dependency preflight. |
install/preflight.php |
Implements shared entry-point guard. |
install/report.php |
Serves authorized diagnostics. |
install/step_json.php |
Adds dependency preflight. |
install/upgrades/1_3_0.php |
Adds missing template column. |
lib/Installer/AuthenticationRequirements.php |
Validates authentication mappings. |
lib/Installer/CollectorSynchronizer.php |
Classifies collector outcomes. |
lib/Installer/CommandRunner.php |
Runs bounded subprocesses. |
lib/Installer/CompletionWarnings.php |
Serializes completion warnings. |
lib/Installer/DependencyPreflight.php |
Checks runtime dependencies and assets. |
lib/Installer/RunReport.php |
Models installer diagnostics. |
lib/Installer/RunState.php |
Defines report states. |
lib/Installer/SchemaRequirements.php |
Parses required schema columns. |
lib/Installer/UpgradePlan.php |
Models planned upgrade effects. |
lib/installer.php |
Integrates plans, reports, and postconditions. |
lib/poller.php |
Handles nullable collector TLS fields. |
locales/po/cacti.pot |
Updates translation messages. |
phpunit-installer-components.xml |
Configures component coverage. |
tests/e2e/installer_application_check.sh |
Verifies upgraded application behavior. |
tests/e2e/installer_failure_paths.php |
Adds failure-injection scenarios. |
tests/e2e/installer_populated_fixture.sql |
Provides populated upgrade data. |
tests/e2e/installer_resilience_docker.sh |
Expands Docker upgrade scenarios. |
tests/e2e/tests/installer-upgrade.spec.ts |
Adds browser upgrade checks. |
tests/fixtures/InstallerPlugin/INFO |
Defines fixture plugin metadata. |
tests/fixtures/InstallerPlugin/setup.php |
Implements fixture plugin hooks. |
tests/integration/InstallerVendorRefreshContractTest.php |
Verifies preflight ordering. |
tests/security/baselines/architectural_hotspots.baseline.tsv |
Updates architectural inventory. |
tests/security/baselines/sink_inventory.baseline.tsv |
Updates security sink inventory. |
tests/Unit/Installer/InstallerComponentsTest.php |
Tests new installer components. |
tests/Unit/Installer/InstallerResilienceTest.php |
Updates resilience contracts. |
tests/Unit/Installer/VendorBootGuardTest.php |
Removes obsolete refresh tests. |
tests/Unit/Security/Csrf/ItemActionPostOnlyTest.php |
Normalizes test quoting. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
TheWitness
left a comment
There was a problem hiding this comment.
It's a nit but put in the full copyright header
somethingwithproof
left a comment
There was a problem hiding this comment.
Added the full project copyright and license header to the new PHP files in 5bd7a6e, as requested in your review.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
196bb36 to
94cb034
Compare
fe597f6 to
095c00b
Compare
|
The new PHP files now have the full project copyright and license header. The report-size and migration-version fixes remain in place at 095c00b, and current checks pass. Please take another look at the copyright request. |
dca6fa8 to
2cbaa31
Compare
|
The full copyright and license headers are present in the new PHP files at |
2cbaa31 to
2b87ff3
Compare
|
The copyright request is addressed at 2b87ff3: all 13 newly added PHP files have the full Cacti copyright and GPL header. Current-head CI is running; the earlier green results belong to the previous revision. @TheWitness, please re-review the header change. |
6622dc9 to
4dd8a15
Compare
9f7e161 to
0837db4
Compare
1d9ea53 to
192f79d
Compare
… upgrades Adds a shared offline dependency preflight for web and CLI installs, schema and authentication postconditions before the target version is recorded, and a bounded run report that records each migration version. Fixes Cacti#7885. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
192f79d to
df13ef1
Compare
|




This change makes Cacti installation and upgrades check their prerequisites and results before reporting completion. Shared web and CLI components perform an offline dependency preflight, prepare an upgrade plan, verify required schema and authentication state, and retain a bounded diagnostic report. This makes partial upgrades easier to detect and recover from while keeping database restoration a separate operator action.
Implementation details
An incomplete dependency tree or partially applied upgrade could reach database changes before an actionable failure. This adds a shared offline preflight for web and CLI entry points, an explicit source-checkout preparation command, a reviewable upgrade plan with backup/recovery guidance, and schema/authentication postconditions before recording the target version.
The installer retains an administrator-downloadable report containing controlled operation names, migration versions, timings and outcomes. It excludes credentials, commands, SQL and exception text. Collector synchronization now visits every collector, preserves incomplete outcomes as completion warnings, and propagates unexpected failures to CLI exit status. A missing 1.3 template column migration and nullable collector TLS arguments were found by populated upgrade tests and corrected.
This follows #8266 and includes its current head. The installer-only formatting changes in #8302 have been removed from that PR to keep ownership clear. Security baseline entries are placed to merge with #7790 without changing queue behavior.
Recorded local validation:
Complete local Docker suites pass for 1.2.22 on MariaDB 11.8 and 1.2.31 on MariaDB 10.11, including all four Chromium checks in each run, repeated upgrades, failure injection and lock exclusion. The recorded validation reported passing required GitHub checks, including the four tagged release/database jobs and the PHP 8.3/8.4/8.5 component coverage gates. Each local complete suite passes 22 scenarios. CI adds tagged 1.2.22 and 1.2.31 fixtures on MariaDB 10.11 and 11.8, containing LDAP users/providers, compatible and missing plugins, two collector databases, customized templates, an existing RRD file and 100,000 buffered samples. Tests verify preservation, real local/LDAP login, key pages/assets, sessions/CSRF, diagnostics authorization, repeat execution, and injected failure paths.
The report retains the latest run and supports diagnosis/manual recovery. It does not implement automatic migration replay or transactional DDL rollback. Synthetic fixtures are preservation tests, not production-scale polling benchmarks. The component gate enforces 100% line coverage for new components; it does not claim 100% coverage of the legacy installer.
Fixes #7885. Related / partial implementation: #3816, #7285.
Release notes are consolidated in #8320. Review and merge this child before that final documentation PR.
Conflict resolution against develop 9899fdf preserves #8317’s LDAP-table guard and prevents intermediate version downgrades during forced replays, while retaining dependency preflight, schema/authentication postconditions, run diagnostics and the shared CommandRunner. The preflight design continues to replace runtime Composer installs; its dependency-failure tests remain, and the obsolete refreshVendorDependencies fixture is not restored. Regenerated security baselines contain three substantive changes relative to develop (two controlled dependency-loader entries added and the old inline process launch removed), plus indentation changes. Both inventory verifiers pass.
Validation on mise-selected PHP 8.5.11: all 2,482 Unit tests pass (four skips), 69 installer Unit/Integration cases pass, PHP-CS-Fixer and full level-8 PHPStan pass. The complete disposable PHP 8.4 Docker installer matrix passes for release 1.2.22/MariaDB 11.8 and release 1.2.31/MariaDB 10.11, including populated LDAP/plugin/template/collector state, four browser scenarios per run, repeated forced repairs and failed-replay version/lock protection. No live databases were modified and no changelog entries were added to this child.
Review fixes: installer reports preserve valid JSON within the 4096-byte settings column, retain the newest operation and disclose omitted entries. Web and CLI installation now record each migration version, including failures. Native successful and failed upgrade checks pass; the component suite passes 29 tests at 100% coverage on PHP 8.3.35. New PHP files carry the full project copyright and license header.
Revision and checks
Description scope: target
develop, 44 changed files, head4dd8a15b2. Checked 2026-10-23 03:06:04 UTC.GitHub check snapshot: 2 passed. Local test figures and earlier CI runs above are recorded evidence for their stated revisions and environments; they do not assert that every check passes at this head.