Skip to content

v3.4.7 - #260

Merged
TiTidom-RC merged 12 commits into
betafrom
dev
Aug 16, 2026
Merged

v3.4.7#260
TiTidom-RC merged 12 commits into
betafrom
dev

Conversation

@TiTidom-RC

Copy link
Copy Markdown
Owner

This pull request introduces several important improvements focused on code quality, compatibility, and CI automation for both PHP and JavaScript. The main changes include stricter type signatures and docblocks for PHP 7.4 compatibility, enhanced memory usage logging, and the addition of new GitHub Actions workflows to automatically check PHP and JavaScript code for syntax and compatibility issues. Below are the most significant changes:

CI/CD Improvements:

  • Added .github/workflows/checkPHPCompat.yml to run PHPStan compatibility checks across PHP 7.4, 8.2, and 8.4, ensuring the codebase remains compatible with older and newer PHP versions.
  • Introduced .github/workflows/js-check.yml for automated JavaScript syntax checking using Node.js 22.
  • Updated .github/workflows/checkPHP.yml to only run on PHP files and added a workflow dispatch trigger.

PHP Compatibility and Documentation:

  • Updated .github/copilot-instructions.md to clarify that while development targets PHP 8.2, the code must remain compatible with PHP 7.4, avoiding PHP 8+ syntax and using docblocks for union types.
  • Refactored method signatures in Monitoring.class.php to add explicit type hints where possible, document union types via docblocks for PHP 7.4 compatibility, and improve parameter clarity. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]

Logging and Monitoring Enhancements:

  • Consolidated memory usage and peak logging into a single log entry in various pull methods in Monitoring.class.php, improving log clarity. [1] [2] [3]

Other Minor Improvements:

  • Added new terms to .vscode/cspell.json for spell checking, including "phpstan" and "shivammathur". [1] [2]
  • Minor code style and return value adjustments for better consistency and error handling in Monitoring.class.php. [1] [2] [3] [4]

These changes collectively enhance the maintainability, reliability, and cross-version compatibility of the codebase.

TiTidom-RC added 12 commits May 23, 2026 13:52
Introduce a new GitHub Action (checkPHPCompat.yml) to run PHPStan compatibility checks across PHP 7.4, 8.2 and 8.4 for PRs targeting the beta branch. The workflow sets up PHP via shivammathur/setup-php, installs PHPStan, sparse-checkouts Jeedom Core, generates a phpstan.neon file with the target phpVersion, and runs phpstan analyse. Also add phpstan.neon.dist (reportUnmatchedIgnoredErrors: true), rename the existing PHP lint job to indicate PHP 8.4, and update cspell dictionary to include phpstan and shivammathur.
Add a sparse checkout step to clone the SSH-Manager repo and include its core/class directory in the PHPStan scanDirectories. The workflow now clones SSH-Manager (depth 1, blob filter, sparse) into /tmp/sshmanager and appends /tmp/sshmanager/core/class to the generated phpstan.neon so PHP compatibility checks cover that code as well.
Replace direct cmd->event() calls with checkAndUpdateCmd for SSH failure and cron status updates to centralize state updates and simplify code. Add a TODO comment advising evaluation of migrating other event() usages to checkAndUpdateCmd and note the impact on historical graphs (recommend enabling repeatEventManagement = always for stable numeric metrics). Bump pluginVersion to 3.4.7 in plugin_info/info.json.
Move the trimming of $cmd_srv into $_cmd before entering the try block so the command is normalized prior to timeout checks. Removes the redundant trim() inside the try and includes minor whitespace cleanup.
Add path filtering to .github/workflows/checkPHP.yml and checkPHPCompat.yml so PHP CI jobs only run for changes to '**/*.php' on the beta branch. Introduce .github/workflows/js-check.yml: a new workflow that runs on beta PRs touching '**/*.js', checks out the repo, sets up Node 22, and runs `node --check` against JavaScript files (excluding node_modules) to validate syntax. This reduces unnecessary CI runs by scoping jobs to relevant file types.
Add workflow_dispatch to .github/workflows/checkPHP.yml, checkPHPCompat.yml, and js-check.yml so these workflows can be triggered manually from the GitHub Actions UI. Existing path and branch triggers are unchanged; this makes it easier to run lint/compatibility checks on demand for debugging or ad-hoc verification.
Update .github/workflows/js-check.yml to use actions/setup-node@v5 instead of @v4. This brings the workflow onto the latest major release of the setup-node action to pick up improvements and fixes.
Reduce log noise by grouping memory, swap, disk, and pull memory usage details into single entries instead of multiple lines. The stats helper is now typed and returns trend log data so tendency values can be collected and logged once per equipment.
Updated Monitoring debug messages for swap, memory, and HDD metrics to use consistent `key = value` formatting instead of `key=value`. This improves log readability and makes parsing/debugging output more uniform.
Adds PHP 7.4-safe signatures and docblocks across Monitoring, fixes nullable/default type mismatches, and normalizes default values for command results. The change also consolidates debug logging to reduce noise and clarifies the repository guidance around supported PHP versions and compatibility constraints.
Update Monitoring local debug output to include `ARMv` alongside distribution name, bits, and OS version. This improves hardware/platform visibility in logs for troubleshooting.
Add a scoped PHPStan `ignoreErrors` rule for `core/class/Monitoring.class.php` to suppress false positives on `hdd_value`, `cpu_freq`, and `cpu_temp` variables created dynamically via `extract()`. This keeps static analysis strict while handling this known dynamic pattern.
@TiTidom-RC
TiTidom-RC merged commit 4c0a9e6 into beta Aug 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant