From 8c37ef547e3f47aa9130244c985e6224e09c9cd6 Mon Sep 17 00:00:00 2001 From: anonpenguin23 Date: Thu, 14 May 2026 11:44:47 +0300 Subject: [PATCH] fix(upgrade): forward per-node flags to remote so --with-ntfy actually lands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `orama node upgrade --node --with-ntfy --restart` parsed the flag locally but `upgradeNode()` ran a hardcoded `orama node upgrade --restart` on the remote — dropping --with-ntfy, --nameserver, --force, and --skip-checks on the floor. The remote orchestrator then read the SAVED preference (or default false for nameserver/ntfy), so operator overrides like enabling ntfy on a nameserver were silently ignored. Bug surfaced in devnet today: running --with-ntfy reported success but ntfy was never installed. Fix forwards the four passthrough flags to the remote command, preserving the tri-state semantics for the pointer flags (nil = honor saved preference; non-nil = explicit override). VERSION bumped to 0.122.15. --- VERSION | 2 +- core/pkg/cli/production/upgrade/remote.go | 34 ++++++++++++++++++++++- sdk/package.json | 2 +- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index a09fb81..0ec315c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.122.14 +0.122.15 diff --git a/core/pkg/cli/production/upgrade/remote.go b/core/pkg/cli/production/upgrade/remote.go index 9e8ec9a..09f9211 100644 --- a/core/pkg/cli/production/upgrade/remote.go +++ b/core/pkg/cli/production/upgrade/remote.go @@ -67,9 +67,41 @@ func (r *RemoteUpgrader) Execute() error { return nil } -// upgradeNode runs `orama node upgrade --restart` on a single remote node. +// upgradeNode runs `orama node upgrade --restart` on a single remote node, +// forwarding the per-node flags the operator passed locally (--with-ntfy, +// --nameserver, --force, --skip-checks) so the remote orchestrator sees the +// same intent. Without this forwarding, the remote command would always use +// the saved preference, silently dropping operator overrides like +// `--with-ntfy` on the floor. func (r *RemoteUpgrader) upgradeNode(node inspector.Node) error { sudo := remotessh.SudoPrefix(node) cmd := fmt.Sprintf("%sorama node upgrade --restart", sudo) + + // Tri-state pointer flags: forward only when explicitly set locally. + // nil = "honor saved preference on the remote" — don't pass anything. + if r.flags.NtfyHost != nil { + if *r.flags.NtfyHost { + cmd += " --with-ntfy" + } else { + cmd += " --with-ntfy=false" + } + } + if r.flags.Nameserver != nil { + if *r.flags.Nameserver { + cmd += " --nameserver" + } else { + cmd += " --nameserver=false" + } + } + + // Plain booleans: forward when true. False is the default everywhere + // so no need to send `=false` explicitly. + if r.flags.Force { + cmd += " --force" + } + if r.flags.SkipChecks { + cmd += " --skip-checks" + } + return remotessh.RunSSHStreaming(node, cmd) } diff --git a/sdk/package.json b/sdk/package.json index 58579a9..707d942 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@debros/orama", - "version": "0.122.14", + "version": "0.122.15", "description": "TypeScript SDK for Orama Network - Database, PubSub, Cache, Storage, Vault, and more", "type": "module", "main": "./dist/index.js",