Skip to content

Commit 34c8a47

Browse files
lroolleclaude
andcommitted
fix(versions): always fetch upstream latest, never compare pin-vs-pin
load_versions used env vars as "latest", but versions.env always populates them via version-pins.sh — so the check compared pinned values against themselves and reported "up-to-date" unconditionally, even when npm had newer releases. - Remove env-var shortcut from load_versions; always fetch from upstream (npm/github) for the reporting path - Snapshot CLI overrides in version-upgrade.sh BEFORE version-pins.sh fills defaults, so explicit `CLAUDE_CODE_VERSION=X make versions-up` still forces that version at build time - Plain `make versions-up` now correctly detects and upgrades to the real latest upstream versions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3fcdd03 commit 34c8a47

2 files changed

Lines changed: 34 additions & 35 deletions

File tree

scripts/release-utils.sh

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -418,36 +418,21 @@ load_versions() {
418418
set_current "$tool" ""
419419
fi
420420

421-
# Latest from source (respect env overrides)
422-
local env_var latest_val
423-
case $tool in
424-
claude-code) env_var="CLAUDE_CODE_VERSION" ;;
425-
claude-trace) env_var="CLAUDE_TRACE_VERSION" ;;
426-
codex) env_var="CODEX_VERSION" ;;
427-
gemini-cli) env_var="GEMINI_CLI_VERSION" ;;
428-
atlas-cli) env_var="ATLAS_CLI_VERSION" ;;
429-
copilot-api) env_var="COPILOT_API_VERSION" ;;
430-
playwright) env_var="PLAYWRIGHT_VERSION" ;;
431-
*) env_var="" ;;
432-
esac
433-
434-
eval "latest_val=\"\${$env_var:-}\""
435-
if [[ -n $latest_val ]]; then
436-
set_latest "$tool" "$latest_val"
421+
# Always fetch latest from upstream. versions.env populates env vars
422+
# unconditionally, so checking them here would compare pin-vs-pin and
423+
# always report "up-to-date". CLI overrides are respected at BUILD
424+
# time (version-upgrade.sh), not at CHECK time.
425+
local fetched
426+
fetched=$(fetch_latest_version "$tool")
427+
if [[ -n $fetched ]]; then
428+
set_latest "$tool" "$fetched"
437429
else
438-
local fetched
439-
fetched=$(fetch_latest_version "$tool")
440-
if [[ -n $fetched ]]; then
441-
set_latest "$tool" "$fetched"
430+
local current=$(get_current "$tool")
431+
if [[ -n $current ]]; then
432+
echo -e "${YELLOW}Warning: Failed to fetch latest $tool, using current: $current${RESET}" >&2
433+
set_latest "$tool" "$current"
442434
else
443-
# Network failure - fallback to current image version
444-
local current=$(get_current "$tool")
445-
if [[ -n $current ]]; then
446-
echo -e "${YELLOW}Warning: Failed to fetch latest $tool, using current: $current${RESET}" >&2
447-
set_latest "$tool" "$current"
448-
else
449-
echo -e "${RED}Error: Cannot determine version for $tool${RESET}" >&2
450-
fi
435+
echo -e "${RED}Error: Cannot determine version for $tool${RESET}" >&2
451436
fi
452437
fi
453438

scripts/version-upgrade.sh

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ set -euo pipefail
77
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
88
# shellcheck source=./release-utils.sh
99
source "$SCRIPT_DIR/release-utils.sh"
10+
11+
# Snapshot explicit CLI overrides BEFORE version-pins fills defaults from
12+
# versions.env. Makefile VERSION_QUERY_OVERRIDES only forwards vars whose
13+
# $(origin) is command-line/environment/override, so anything already set
14+
# here is a genuine user override — not a pin default.
15+
_CLI_CLAUDE_CODE="${CLAUDE_CODE_VERSION:-}"
16+
_CLI_CLAUDE_TRACE="${CLAUDE_TRACE_VERSION:-}"
17+
_CLI_CODEX="${CODEX_VERSION:-}"
18+
_CLI_GEMINI="${GEMINI_CLI_VERSION:-}"
19+
_CLI_ATLAS="${ATLAS_CLI_VERSION:-}"
20+
_CLI_COPILOT="${COPILOT_API_VERSION:-}"
21+
_CLI_PLAYWRIGHT="${PLAYWRIGHT_VERSION:-}"
22+
1023
# shellcheck disable=SC1091
1124
source "$SCRIPT_DIR/version-pins.sh"
1225

@@ -83,14 +96,15 @@ main() {
8396
echo -e "${GREEN}Proceeding with build...${RESET}"
8497
echo ""
8598

99+
# CLI override wins; otherwise use whatever load_versions fetched.
86100
local claude_ver claude_trace_ver codex_ver gemini_ver atlas_ver copilot_ver playwright_ver
87-
claude_ver=$(get_latest "claude-code")
88-
claude_trace_ver=$(get_latest "claude-trace")
89-
codex_ver=$(get_latest "codex")
90-
gemini_ver=$(get_latest "gemini-cli")
91-
atlas_ver=$(get_latest "atlas-cli")
92-
copilot_ver=$(get_latest "copilot-api")
93-
playwright_ver=$(get_latest "playwright")
101+
claude_ver="${_CLI_CLAUDE_CODE:-$(get_latest "claude-code")}"
102+
claude_trace_ver="${_CLI_CLAUDE_TRACE:-$(get_latest "claude-trace")}"
103+
codex_ver="${_CLI_CODEX:-$(get_latest "codex")}"
104+
gemini_ver="${_CLI_GEMINI:-$(get_latest "gemini-cli")}"
105+
atlas_ver="${_CLI_ATLAS:-$(get_latest "atlas-cli")}"
106+
copilot_ver="${_CLI_COPILOT:-$(get_latest "copilot-api")}"
107+
playwright_ver="${_CLI_PLAYWRIGHT:-$(get_latest "playwright")}"
94108

95109
# Verify all required versions are set
96110
local missing=()

0 commit comments

Comments
 (0)