From daaefc12d84d4c7a287cb3b01a42c3c6857d5449 Mon Sep 17 00:00:00 2001 From: Master3395 Date: Thu, 25 Sep 2025 00:16:25 +0200 Subject: [PATCH] Update branch verification process and enhance documentation for v2.5.5-dev - Modified cyberpanel.sh to verify the existence of the development branch using the GitHub API, improving accuracy in branch checks. - Updated BRANCH_PREFIX_FIX.md to include confirmation of GitHub API verification for the v2.5.5-dev branch. - Enhanced test_fixes.sh to include a test for the v2.5.5-dev branch via GitHub API, ensuring reliable branch validation. --- BRANCH_PREFIX_FIX.md | 3 ++- cyberpanel.sh | 9 ++++++--- tools/test_fixes.sh | 7 +++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/BRANCH_PREFIX_FIX.md b/BRANCH_PREFIX_FIX.md index 0d0fadf2d..f8cee87dc 100644 --- a/BRANCH_PREFIX_FIX.md +++ b/BRANCH_PREFIX_FIX.md @@ -43,9 +43,10 @@ v2.3.5-dev (development version with 'v' prefix) ## Verification -✅ **Confirmed**: The `v2.5.5-dev` branch exists and is accessible +✅ **Confirmed**: The `v2.5.5-dev` branch exists and is accessible via [GitHub](https://github.com/usmannasir/cyberpanel/tree/v2.5.5-dev) ✅ **Confirmed**: The requirements file is available at the correct URL ✅ **Confirmed**: The fix handles both formats (`2.5.5-dev` and `v2.5.5-dev`) +✅ **Confirmed**: GitHub API verification works correctly ## Impact diff --git a/cyberpanel.sh b/cyberpanel.sh index b8f103891..70174d3a1 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -553,11 +553,11 @@ if [[ "$1" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-dev)?$ ]]; then fi echo -e "\nSet branch name to $Branch_Name (development version)..." - # Check if the development branch exists + # Check if the development branch exists using GitHub API echo -e "Verifying branch existence..." - if ! curl -s -I "https://raw.githubusercontent.com/usmannasir/cyberpanel/$Branch_Name/README.md" | grep -q "200 OK"; then + if ! curl -s "https://api.github.com/repos/usmannasir/cyberpanel/branches/$Branch_Name" | grep -q '"name"'; then echo -e "\nWarning: The branch '$Branch_Name' does not exist or is not accessible." - echo -e "Available branches include: stable, v2.3.5-dev, v2.3.4, v2.3.3, etc." + echo -e "Available branches include: stable, v2.5.5-dev, v2.4.4, v2.4.3, etc." echo -e "You can also use specific commits like: b05d9cb5bb3c277b22a6070f04844e8a7951585b" echo -e "\nWould you like to continue anyway? This may cause installation issues. [y/N]" read -r continue_choice @@ -566,6 +566,8 @@ if [[ "$1" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-dev)?$ ]]; then exit 1 fi echo -e "Continuing with non-existent branch '$Branch_Name'..." + else + echo -e "✅ Branch '$Branch_Name' verified successfully." fi else Branch_Name="v${1//[[:space:]]/}" @@ -1247,6 +1249,7 @@ echo -e "\nPress \e[31mEnter\e[39m key to continue with latest version or Enter echo -e " \e[31m2.4.4\e[39m (stable version)" echo -e " \e[31m2.5.0\e[39m (stable version)" echo -e " \e[31m2.5.5-dev\e[39m (development version - will auto-add 'v' prefix)" +echo -e " \e[31mv2.5.5-dev\e[39m (development version with 'v' prefix)" echo -e " \e[31mv2.3.5-dev\e[39m (development version with 'v' prefix)" echo -e " \e[31mv2.3.4\e[39m (stable version)" echo -e " \e[31mb05d9cb5bb3c277b22a6070f04844e8a7951585b\e[39m (specific commit)" diff --git a/tools/test_fixes.sh b/tools/test_fixes.sh index a0dadf009..71ac20af2 100644 --- a/tools/test_fixes.sh +++ b/tools/test_fixes.sh @@ -22,6 +22,13 @@ else echo "❌ v2.5.5-dev branch test failed" fi +echo "Testing GitHub API for v2.5.5-dev branch..." +if curl -s "https://api.github.com/repos/usmannasir/cyberpanel/branches/v2.5.5-dev" | grep -q '"name"'; then + echo "✅ v2.5.5-dev branch verified via GitHub API" +else + echo "❌ v2.5.5-dev branch GitHub API test failed" +fi + echo "Testing existing commit (should show 200)..." if curl -s -I "https://raw.githubusercontent.com/usmannasir/cyberpanel/b05d9cb5bb3c277b22a6070f04844e8a7951585b/requirments.txt" | grep -q "200 OK"; then echo "✅ Existing commit correctly returns 200"