Skip to content

Fix discovery execution and configuration with native and browser regressions - #8461

Open
somethingwithproof wants to merge 9 commits into
developfrom
fix/discovery-correctness-develop
Open

somethingwithproof wants to merge 9 commits into
developfrom
fix/discovery-correctness-develop

Conversation

@somethingwithproof

@somethingwithproof somethingwithproof commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

What changes

Fix discovery on develop (Cacti 1.3): excluded addresses no longer stall enumeration, dry-run mode reaches network masters and workers, overlapping ranges retain every unique target, and missing identification fields cannot satisfy configured device rules. Reject malformed IPv4 range syntax and probe valid hosts ending in .255.

Restore working SNMP security controls, including the username for SNMPv3 without authentication. Fix graph-rule criterion saves to use the validated item ID and retain existing hashes.

Why

Discovery should let an administrator configure a network once and trust the resulting scan. These failures could leave a scan stuck, add devices during a dry run, choose the wrong template, or prevent usable graph rules from being saved. The fixes make onboarding predictable, and the automated checks exercise configuration through to the devices and graphs it creates.

Verification

  • Native discovery: 108 tests executed, 1,500 assertions, no failures or skips; one existing Symfony validator deprecation.
  • Existing production scheduling checks: 9 passed. Full Unit suite: 3,143 passed, 4 skipped.
  • JavaScript: 82 passed, including four SNMP form regressions.
  • Browser: all three scenarios passed on Node 22.22.2, PHP 8.3.36 and MariaDB 10.11. Real forms configure credentials, device rules, both graph-rule criteria and networks. Actual master/worker processes exercise dry-run propagation, exclusions, SNMPv2c/v3, .255, selective graphs, repeat scans, manual fallback, cancellation and permission denial.
  • PHPStan: 465 files, no errors. PHP lint, required formatting and commit hooks, hardening patterns, vendor policy, sink/hotspot inventories, changelog validation, actionlint and ShellCheck passed. The report guard also rejects missing, empty, skipped and failing browser evidence.

CI registers native database, scheduling, JavaScript and browser checks. The isolated browser runner compares container source hashes with the checkout, restricts scan targets, and removes its own containers and database.

The optional profiling run passes 69 native cases (1,296 assertions) and all three browser scenarios. Merging its real HTTP/CLI and native execution with the original failed CI Clover report passes the unchanged changed-PHP gate: 187/219 executable lines, 85.39%, including all 23 changed API lines and both criterion-save lines. Source, producer and scenario fingerprints and final JUnit hashes are verified; missing, stale or unsuccessful phases fail closed. The collection uses token-based function extraction through the existing source helper and retains original source lines. Helper/caller and Python tooling regressions also pass.

The new native and browser discovery jobs pass remotely on the preceding tooling head. The unrelated Deepness multiselect palette assertion also fails on the unchanged develop base a9c73cfc4 (base run, PR run). This PR changes neither the theme files nor that assertion. Remote results for the final coverage update remain pending.

Compatibility and limits

No production schema, template identity, runtime dependency or PHP/Spine protocol changes. Existing matching operators, administrator controls and manual fallback remain. Nontrailing wildcards and malformed prefixes are now rejected. IPv6 and /31 discovery are not added. Simulated agents do not establish hardware qualification, remote-collector failover, installer/upgrade acceptance or production-scale performance.

Refs #8459.

@somethingwithproof
somethingwithproof requested a review from a team as a code owner October 23, 2026 02:05
@somethingwithproof somethingwithproof added bug Undesired behaviour automation Automation related issue gui UI related issue labels Oct 23, 2026
@somethingwithproof
somethingwithproof removed the request for review from a team October 23, 2026 02:05
@somethingwithproof somethingwithproof added poller Data Collection related issue snmp Issue related to SNMP data collection develop Bug in the development branch QA Bug created between releases. So, no CHANGELOG entry required type:bug Namespaced Cacti workflow label labels Oct 23, 2026
Comment thread include/layout.js Fixed
Comment thread include/layout.js Fixed
Comment thread tests/e2e/discovery/run.sh Fixed
Comment thread tests/e2e/discovery/run.sh Fixed
Comment thread tests/e2e/discovery/run.sh Fixed

@TheWitness TheWitness left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaks automation.

Comment thread lib/api_automation.php Resolved
Comment thread lib/api_automation.php Resolved
Comment thread lib/api_automation.php Resolved
@somethingwithproof
somethingwithproof force-pushed the fix/discovery-correctness-develop branch from 7b1315d to 39df34d Compare October 24, 2026 02:54
@github-actions
github-actions Bot force-pushed the fix/discovery-correctness-develop branch from 46bb9d9 to 0e274b3 Compare October 26, 2026 20:50
@github-actions
github-actions Bot force-pushed the fix/discovery-correctness-develop branch from 0e274b3 to 9061a36 Compare October 27, 2026 08:56
Preserve scan options and validated graph criterion identities. Add database-backed and isolated production-function regressions for discovery failures. Refs #8459.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Prevent synchronous Select2 notifications from recursively rendering SNMP controls. Exercise security levels, version changes and exception cleanup. Refs #8459.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Run database, scheduling, SNMP-form and browser acceptance checks in CI, reject empty or failing evidence, and document coverage and limits. Refs #8459.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Reuse token-based source extraction, verify scenario and producer fingerprints, and exercise ping-only discovery behavior. Keep the existing changed-PHP threshold and reject stale, incomplete or unsuccessful evidence. Refs #8459.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…verage

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@somethingwithproof
somethingwithproof force-pushed the fix/discovery-correctness-develop branch from 9061a36 to 605a430 Compare October 27, 2026 19:04
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation Automation related issue bug Undesired behaviour develop Bug in the development branch gui UI related issue poller Data Collection related issue QA Bug created between releases. So, no CHANGELOG entry required snmp Issue related to SNMP data collection type:bug Namespaced Cacti workflow label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants