Kaynağa Gözat

fix: address release PR review comments on upgrade notes and toggle docs (#1198)

James Read 1 gün önce
ebeveyn
işleme
f175ba9eaa

+ 5 - 4
.github/workflows/release-upgrade-notes.yml

@@ -49,11 +49,12 @@ jobs:
       - name: Move released upgrade notes
       - name: Move released upgrade notes
         run: |
         run: |
           released_notes="${RUNNER_TEMP}/upgrade_notes_released.adoc"
           released_notes="${RUNNER_TEMP}/upgrade_notes_released.adoc"
-          if ! git rev-parse -q --verify "refs/tags/${RELEASE_TAG}" > /dev/null; then
-            echo "Tag ${RELEASE_TAG} does not exist."
+          release_tags="$(git tag -l '3*.*.*' | grep -v -e '-' | sort -V)"
+          if [[ "${RELEASE_TAG}" == *$'\n'* ]] || ! grep -qxF -- "${RELEASE_TAG}" <<< "${release_tags}"; then
+            echo "Tag ${RELEASE_TAG} does not exist or is not a stable 3k release tag."
             exit 1
             exit 1
           fi
           fi
-          git tag -l '3*.*.*' | grep -v -e '-' | sort -V | while read -r tag; do
+          while read -r tag; do
             if ! git show "refs/tags/${tag}:${NOTES_PATH}" > "${released_notes}" 2>/dev/null; then
             if ! git show "refs/tags/${tag}:${NOTES_PATH}" > "${released_notes}" 2>/dev/null; then
               echo "Tag ${tag} has no ${NOTES_PATH}; skipping."
               echo "Tag ${tag} has no ${NOTES_PATH}; skipping."
             else
             else
@@ -62,7 +63,7 @@ jobs:
             if [ "${tag}" = "${RELEASE_TAG}" ]; then
             if [ "${tag}" = "${RELEASE_TAG}" ]; then
               break
               break
             fi
             fi
-          done
+          done <<< "${release_tags}"
 
 
       - name: Commit and push
       - name: Commit and push
         run: |
         run: |

+ 3 - 2
docs/modules/ROOT/pages/solutions/single-button-toggle/index.adoc

@@ -1,9 +1,9 @@
 [#single-button-toggle]
 [#single-button-toggle]
 = Single Button Toggle
 = Single Button Toggle
 
 
-A single button toggle controls something that has two states, using just one action. Each press flips the state, and the button's icon changes to show the current state - a "closed" icon when the state is `closed`, and an "open" icon when the state is `open`.
+A single button toggle controls something that has two states, using just one action. Each press flips the state (unless the action is still running from a previous press, see <<how-it-works>>), and the button's icon changes to show the current state - a "closed" icon when the state is `closed`, and an "open" icon when the state is `open`.
 
 
-Unlike the xref:solutions/latching-toggle/index.adoc[Latching Toggle], which uses two interlocked actions, the button here is never disabled. It can always be pressed, and it always does the opposite of the current state.
+Unlike the xref:solutions/latching-toggle/index.adoc[Latching Toggle], which uses two interlocked actions, the button here is never disabled. It can always be pressed, and each successful execution changes the state to the opposite of the current state.
 
 
 In OliveTin, the state is stored in an xref:entities/intro.adoc[entity file], which the action updates itself, and the icon is chosen with an xref:action_customization/icons.adoc[image icon] whose file name comes from the entity's state.
 In OliveTin, the state is stored in an xref:entities/intro.adoc[entity file], which the action updates itself, and the icon is chosen with an xref:action_customization/icons.adoc[image icon] whose file name comes from the entity's state.
 
 
@@ -17,6 +17,7 @@ a| image::solutions/single-button-toggle/dashboard-closed.png[]
 a| image::solutions/single-button-toggle/dashboard-open.png[]
 a| image::solutions/single-button-toggle/dashboard-open.png[]
 |===
 |===
 
 
+[#how-it-works]
 == How it works
 == How it works
 
 
 * The entity file `/etc/OliveTin/entities/water_valve.yaml` holds the state of the valve (`open` or `closed`). It is the single source of truth for the dashboard.
 * The entity file `/etc/OliveTin/entities/water_valve.yaml` holds the state of the valve (`open` or `closed`). It is the single source of truth for the dashboard.

+ 1 - 1
docs/modules/ROOT/pages/upgrade/2k3k.adoc

@@ -106,7 +106,7 @@ xref:install/container.adoc[More information about installing OliveTin in contai
 
 
 === What does GitHub "latest" point to?
 === What does GitHub "latest" point to?
 
 
-GitHub's "latest" release tag isn't super helpful. It currently points to the "release that was pushed last". So sometimes this will be 2k, and sometimes this will be 3k. We're trying to find a way to fix this.
+GitHub's "latest" release always points to the latest 3k release, because 2k releases are not marked as "latest". If you need the final 2k version in a script, see xref:upgrade/github_latest.adoc[Warning - GitHub Latest].
 
 
 == What are the changes I need to make to upgrade from OliveTin 2k to 3k?
 == What are the changes I need to make to upgrade from OliveTin 2k to 3k?
 
 

+ 5 - 0
service/internal/api/api_login_gate.go

@@ -62,6 +62,11 @@ func (interceptor *loginRequiredInterceptor) checkLoginRequired(procedure string
 	}
 	}
 
 
 	cfg := interceptor.api.cfg
 	cfg := interceptor.api.cfg
+
+	if !cfg.AuthRequireGuestsToLogin {
+		return nil
+	}
+
 	user := auth.UserFromHeaders(header, procedure, cfg)
 	user := auth.UserFromHeaders(header, procedure, cfg)
 
 
 	if user.MustLogIn(cfg) {
 	if user.MustLogIn(cfg) {