Repository navigation
v3.4.7 - #262
Merged
Merged
v3.4.7#262
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.
Updates three GitHub Actions workflows (`checkPHP.yml`, `checkPHPCompat.yml`, and `js-check.yml`) to use `actions/checkout@v7` instead of `@v6`, keeping CI dependencies current and consistent.
Bump actions/checkout to v7 in CI workflows
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 improvements to the codebase, focusing on enhancing PHP compatibility, improving type safety, and adding new CI workflows for syntax and compatibility checks. The main changes include stricter PHP type declarations, better logging, and the addition of GitHub Actions for PHP and JavaScript checks.
CI/CD and Compatibility Improvements:
.github/workflows/checkPHPCompat.ymlto run PHPStan compatibility checks across PHP 7.4, 8.2, and 8.4, ensuring the code remains compatible with older PHP versions..github/workflows/checkPHP.ymlto only run on PHP files, upgraded the checkout action, and clarified the PHP version used for linting..github/workflows/js-check.ymlfor JavaScript syntax checking using Node.js 22, to catch JS errors early in CI.PHP Compatibility and Type Safety:
.github/copilot-instructions.mdto clarify that, while development targets PHP 8.2, the code must remain compatible with PHP 7.4. Explicitly avoid PHP 8+ syntax (e.g., union types, new string functions, etc.) and document union types in docblocks instead of native type hints.Monitoring.class.phpto add or improve type declarations for parameters and return types, while maintaining PHP 7.4 compatibility (e.g., using docblocks for union types instead of native hints). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]Logging and Code Quality:
Monitoring.class.phpby combining usage and peak memory into a single log entry for better readability. [1] [2] [3]Miscellaneous:
.vscode/cspell.jsonto avoid false positives in spell checking for terms likephpstan,shivammathur, andsshmanager. [1] [2]These changes collectively improve code maintainability, ensure cross-version compatibility, and strengthen CI checks for both PHP and JavaScript.