Skip to content

Commit 8c35c68

Browse files
authored
tools.func: display pin reason in release-check messages (#13095)
* Display pin reason in release-check messages Add an optional pin_reason parameter to check_for_gh_release and check_for_codeberg_release and update the no-update messaging to show the provided reason. If no reason is supplied, show a default message indicating the update is temporarily held back due to issues with newer releases. This improves user feedback when versions are intentionally pinned. * Add informational args to release checks Pass extra informational strings to check_for_gh_release calls to surface release-specific notes. Updated ct/immich.sh (notes for Immich and VectorChord releases), ct/opencloud.sh (note for OpenCloud), and ct/plant-it.sh (note about web frontend presence). These messages clarify testing/compatibility expectations when checking/releases.
1 parent d9addf7 commit 8c35c68

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

ct/immich.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ EOF
110110
fi
111111

112112
RELEASE="v2.5.6"
113-
if check_for_gh_release "Immich" "immich-app/immich" "${RELEASE}"; then
113+
if check_for_gh_release "Immich" "immich-app/immich" "${RELEASE}" "each release is tested individually before the version is updated. Please do not open issues for this"; then
114114
if [[ $(cat ~/.immich) > "2.5.1" ]]; then
115115
msg_info "Enabling Maintenance Mode"
116116
cd /opt/immich/app/bin
@@ -125,7 +125,7 @@ EOF
125125
msg_ok "Stopped Services"
126126
VCHORD_RELEASE="0.5.3"
127127
[[ -f ~/.vchord_version ]] && mv ~/.vchord_version ~/.vectorchord
128-
if check_for_gh_release "VectorChord" "tensorchord/VectorChord" "${VCHORD_RELEASE}"; then
128+
if check_for_gh_release "VectorChord" "tensorchord/VectorChord" "${VCHORD_RELEASE}" "updated together with Immich after testing"; then
129129
fetch_and_deploy_gh_release "VectorChord" "tensorchord/VectorChord" "binary" "${VCHORD_RELEASE}" "/tmp" "postgresql-16-vchord_*_amd64.deb"
130130
systemctl restart postgresql
131131
$STD sudo -u postgres psql -d immich -c "ALTER EXTENSION vector UPDATE;"

ct/opencloud.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function update_script() {
3030
fi
3131

3232
RELEASE="v5.2.0"
33-
if check_for_gh_release "OpenCloud" "opencloud-eu/opencloud" "${RELEASE}"; then
33+
if check_for_gh_release "OpenCloud" "opencloud-eu/opencloud" "${RELEASE}" "each release is tested individually before the version is updated. Please do not open issues for this"; then
3434
msg_info "Stopping services"
3535
systemctl stop opencloud opencloud-wopi
3636
msg_ok "Stopped services"

ct/plant-it.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function update_script() {
2929
exit
3030
fi
3131
setup_mariadb
32-
if check_for_gh_release "plant-it" "MDeLuise/plant-it" "${RELEASE}"; then
32+
if check_for_gh_release "plant-it" "MDeLuise/plant-it" "${RELEASE}" "last version that includes the web frontend"; then
3333
msg_info "Stopping Service"
3434
systemctl stop plant-it
3535
msg_info "Stopped Service"

misc/tools.func

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,6 +2271,7 @@ check_for_gh_release() {
22712271
local app="$1"
22722272
local source="$2"
22732273
local pinned_version_in="${3:-}" # optional
2274+
local pin_reason="${4:-}" # optional reason shown to user
22742275
local app_lc=""
22752276
app_lc="$(echo "${app,,}" | tr -d ' ')"
22762277
local current_file="$HOME/.${app_lc}"
@@ -2444,7 +2445,11 @@ check_for_gh_release() {
24442445
return 0
24452446
fi
24462447

2447-
msg_ok "No update available: ${app} is already on pinned version (${current})"
2448+
if [[ -n "$pin_reason" ]]; then
2449+
msg_ok "No update available: ${app} (${current}) - update held back: ${pin_reason}"
2450+
else
2451+
msg_ok "No update available: ${app} (${current}) - update temporarily held back due to issues with newer releases"
2452+
fi
24482453
return 1
24492454
fi
24502455

@@ -2483,6 +2488,7 @@ check_for_codeberg_release() {
24832488
local app="$1"
24842489
local source="$2"
24852490
local pinned_version_in="${3:-}" # optional
2491+
local pin_reason="${4:-}" # optional reason shown to user
24862492
local app_lc="${app,,}"
24872493
local current_file="$HOME/.${app_lc}"
24882494

@@ -2562,7 +2568,11 @@ check_for_codeberg_release() {
25622568
return 0
25632569
fi
25642570

2565-
msg_ok "No update available: ${app} is already on pinned version (${current})"
2571+
if [[ -n "$pin_reason" ]]; then
2572+
msg_ok "No update available: ${app} (${current}) - update held back: ${pin_reason}"
2573+
else
2574+
msg_ok "No update available: ${app} (${current}) - update temporarily held back due to issues with newer releases"
2575+
fi
25662576
return 1
25672577
fi
25682578

0 commit comments

Comments
 (0)