Skip to content

Feat/check core branch validity#3373

Closed
zoic21 wants to merge 3 commits into
jeedom:developfrom
zoic21:feat/check-core-branch-validity
Closed

Feat/check core branch validity#3373
zoic21 wants to merge 3 commits into
jeedom:developfrom
zoic21:feat/check-core-branch-validity

Conversation

@zoic21

@zoic21 zoic21 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

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() in update.class.php: Fetches and caches the list of available branches and tags from the default GitHub repository for 24 hours. Extracted from duplicate code in administration.php.

  • New method isCoreBranchValid() in update.class.php: Validates that the currently configured core branch or tag exists on the remote repository. Returns true for 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 new getCoreBranchList() method, reducing code duplication.

Implementation Details

  • The branch validation gracefully handles edge cases: custom repository providers, well-known branches, and unavailable remote lists all return true to prevent false alarms.
  • Tag branches are identified by the tag:: prefix and validated separately from regular branches.
  • Caching is leveraged to minimize API calls to GitHub while allowing manual refresh when needed.

Fix #3166

zoic21 added 3 commits June 15, 2026 08:27
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
@zoic21 zoic21 requested review from Mips2648 and Salvialf June 15, 2026 08:37
@zoic21 zoic21 closed this by deleting the head repository Jun 15, 2026
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.

Check config core::branch validity

1 participant