From f572d71c4213a9a14c7f6ae52e226c9393303480 Mon Sep 17 00:00:00 2001 From: Ian Littman Date: Sat, 7 Feb 2026 00:48:39 -0600 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=A4=96=20Handle=20branch/prerelease?= =?UTF-8?q?=20build=20version=20extraction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitOps side of #39522. OpenCode + Kimi K2.5; prompt: In .github/gitops-action/action.yml, strip anything after `-` or `+` when determining the FLEET_VERSION variable, such that 4.81.0-rc.1234567 or 4.81.0+foobar raw versions both resolve to 4.81.0. --- .github/gitops-action/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/gitops-action/action.yml b/.github/gitops-action/action.yml index 606330c..ed79ada 100644 --- a/.github/gitops-action/action.yml +++ b/.github/gitops-action/action.yml @@ -20,6 +20,8 @@ runs: working-directory: ${{ inputs.working-directory }} run: | FLEET_VERSION="$(curl "$FLEET_URL/api/v1/fleet/version" --header "Authorization: Bearer $FLEET_API_TOKEN" --fail --silent | jq --raw-output '.version')" + # Strip anything after - or + (e.g., 4.81.0-rc.1234567 or 4.81.0+foobar -> 4.81.0) + FLEET_VERSION="${FLEET_VERSION%%[-+]*}" DEFAULT_FLEETCTL_VERSION="4.80.0" # Decide which fleetctl version to install: From 64a157d5a2c16095643d98b245eed200108477ea Mon Sep 17 00:00:00 2001 From: Ian Littman Date: Sat, 7 Feb 2026 01:16:31 -0600 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=A4=96=20Add=20exception=20for=20snap?= =?UTF-8?q?shot=20builds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpenCode + Kimi K2.5; prompt: In .github/gitops-action/action.yml, pass FLEET_VERSION verbatim rather than stripping ending characters when it starts with 0.0.0-SNAPSHOT --- .github/gitops-action/action.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/gitops-action/action.yml b/.github/gitops-action/action.yml index ed79ada..207ab38 100644 --- a/.github/gitops-action/action.yml +++ b/.github/gitops-action/action.yml @@ -20,8 +20,6 @@ runs: working-directory: ${{ inputs.working-directory }} run: | FLEET_VERSION="$(curl "$FLEET_URL/api/v1/fleet/version" --header "Authorization: Bearer $FLEET_API_TOKEN" --fail --silent | jq --raw-output '.version')" - # Strip anything after - or + (e.g., 4.81.0-rc.1234567 or 4.81.0+foobar -> 4.81.0) - FLEET_VERSION="${FLEET_VERSION%%[-+]*}" DEFAULT_FLEETCTL_VERSION="4.80.0" # Decide which fleetctl version to install: @@ -29,10 +27,18 @@ runs: # If the server returns a snapshot (e.g. 0.0.0-SNAPSHOT-xxxxx) or is empty, pin to DEFAULT_FLEETCTL_VERSION. if [[ -z "$FLEET_VERSION" ]]; then INSTALL_VERSION="$DEFAULT_FLEETCTL_VERSION" + elif [[ "$FLEET_VERSION" == 0.0.0-SNAPSHOT* ]]; then + INSTALL_VERSION="$DEFAULT_FLEETCTL_VERSION" elif [[ "$FLEET_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then INSTALL_VERSION="$FLEET_VERSION" else - INSTALL_VERSION="$DEFAULT_FLEETCTL_VERSION" + # Strip anything after - or + (e.g., 4.81.0-rc.1234567 or 4.81.0+foobar -> 4.81.0) + FLEET_VERSION="${FLEET_VERSION%%[-+]*}" + if [[ "$FLEET_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + INSTALL_VERSION="$FLEET_VERSION" + else + INSTALL_VERSION="$DEFAULT_FLEETCTL_VERSION" + fi fi echo "Installing fleetctl v$INSTALL_VERSION..." From 6f1f39c833b2918ec5e0822c2392d79ae8a72ce0 Mon Sep 17 00:00:00 2001 From: Ian Littman Date: Sat, 7 Feb 2026 22:16:05 -0600 Subject: [PATCH 3/4] Don't strip suffix on RCs RCs won't have a fleetctl published yet, so we should fall back to the default. --- .github/gitops-action/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/gitops-action/action.yml b/.github/gitops-action/action.yml index 207ab38..8bad8fb 100644 --- a/.github/gitops-action/action.yml +++ b/.github/gitops-action/action.yml @@ -33,7 +33,7 @@ runs: INSTALL_VERSION="$FLEET_VERSION" else # Strip anything after - or + (e.g., 4.81.0-rc.1234567 or 4.81.0+foobar -> 4.81.0) - FLEET_VERSION="${FLEET_VERSION%%[-+]*}" + FLEET_VERSION="${FLEET_VERSION%%\+*}" if [[ "$FLEET_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then INSTALL_VERSION="$FLEET_VERSION" else From df0688daa0596f84c922229b6858188f35a42e50 Mon Sep 17 00:00:00 2001 From: Ian Littman Date: Sat, 7 Feb 2026 22:19:29 -0600 Subject: [PATCH 4/4] Fix comment --- .github/gitops-action/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/gitops-action/action.yml b/.github/gitops-action/action.yml index 8bad8fb..db139b5 100644 --- a/.github/gitops-action/action.yml +++ b/.github/gitops-action/action.yml @@ -32,7 +32,7 @@ runs: elif [[ "$FLEET_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then INSTALL_VERSION="$FLEET_VERSION" else - # Strip anything after - or + (e.g., 4.81.0-rc.1234567 or 4.81.0+foobar -> 4.81.0) + # Strip anything after + (e.g. 4.81.0+foobar -> 4.81.0) FLEET_VERSION="${FLEET_VERSION%%\+*}" if [[ "$FLEET_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then INSTALL_VERSION="$FLEET_VERSION"