Feat/check core branch validity#3373
Closed
zoic21 wants to merge 3 commits into
Closed
Conversation
Add update::getCoreBranchList() and update::isCoreBranchValid() to verify that the configured core branch (or tag) still exists on the repository. Surface the result as a new 'Branche du core' entry on the health page so the user is warned when the branch no longer exists. Reuse the new helper in the administration page to remove the duplicated fetch logic. Closes #3166
During the core update check, raise a message in the message center when the configured core branch no longer exists, and clear it automatically once a valid branch is selected again. Refs #3166
Verify stable branches, existing/missing branches and tags, custom provider and unreachable remote list (no false positive). Refs #3166
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.
Summary
This PR adds functionality to validate that the configured core branch/tag still exists on the GitHub repository, and integrates this validation into the system health check and update process.
Key Changes
New method
getCoreBranchList()inupdate.class.php: Fetches and caches the list of available branches and tags from the default GitHub repository for 24 hours. Extracted from duplicate code inadministration.php.New method
isCoreBranchValid()inupdate.class.php: Validates that the currently configured core branch or tag exists on the remote repository. Returnstruefor custom providers, known stable branches (master/release/stable), or when the remote list is unavailable to avoid false positives.Branch validation in
checkUpdate(): Added validation check that creates a user-facing message if the configured branch is no longer available on the repository, alerting users to select a valid branch in Settings.Health check integration in
jeedom.class.php: Added a new health check item that reports the validity of the configured core branch, displaying the branch name and an error message if it's no longer found on the repository.Code refactoring in
administration.php: Replaced inline branch/tag fetching logic with a call to the newgetCoreBranchList()method, reducing code duplication.Implementation Details
trueto prevent false alarms.tag::prefix and validated separately from regular branches.Fix #3166