Repository navigation
v3.4.7 - #260
Merged
Merged
v3.4.7#260
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
.github/workflows/checkPHPCompat.ymlto run PHPStan compatibility checks across PHP 7.4, 8.2, and 8.4, ensuring the codebase remains compatible with older and newer PHP versions..github/workflows/js-check.ymlfor automated JavaScript syntax checking using Node.js 22..github/workflows/checkPHP.ymlto only run on PHP files and added a workflow dispatch trigger.PHP Compatibility and Documentation:
.github/copilot-instructions.mdto 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.Monitoring.class.phpto 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:
Monitoring.class.php, improving log clarity. [1] [2] [3]Other Minor Improvements:
.vscode/cspell.jsonfor spell checking, including "phpstan" and "shivammathur". [1] [2]Monitoring.class.php. [1] [2] [3] [4]These changes collectively enhance the maintainability, reliability, and cross-version compatibility of the codebase.