From e0514df1edc534a68553093295753f793dd5a998 Mon Sep 17 00:00:00 2001 From: Jaakko Varjo Date: Wed, 18 Nov 2026 10:50:22 +0200 Subject: [PATCH 1/4] feat(serverless): release container and batchjob as GA Drop the VERDA_BATCHJOB_ENABLED gate and Hidden flag from `verda batchjob` and the `(beta)` tag from `verda container`. Both trees now register unconditionally and show in `verda --help`. - cmd/cmd.go: register both serverless commands directly; delete batchjobEnabled() - serverless: remove the beta annotation and Hidden flag - tests: replace the env-gate matrix with a single visibility check (gate_test.go -> visibility_test.go) - docs: update root and serverless CLAUDE.md / README.md Co-Authored-By: Claude Fable 5.1 --- CLAUDE.md | 2 +- internal/verda-cli/cmd/cmd.go | 21 +++-------- internal/verda-cli/cmd/cmd_test.go | 37 ++++++------------- internal/verda-cli/cmd/serverless/CLAUDE.md | 2 +- internal/verda-cli/cmd/serverless/README.md | 2 - internal/verda-cli/cmd/serverless/batchjob.go | 4 -- .../verda-cli/cmd/serverless/container.go | 5 +-- .../{gate_test.go => visibility_test.go} | 27 ++++++++------ 8 files changed, 36 insertions(+), 64 deletions(-) rename internal/verda-cli/cmd/serverless/{gate_test.go => visibility_test.go} (60%) diff --git a/CLAUDE.md b/CLAUDE.md index a8f81bea..a2b7630c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -50,7 +50,7 @@ Each command directory has its own `CLAUDE.md` (domain knowledge) and `README.md | `cmd/update/` | CLAUDE.md, README.md | CLI self-update | | `cmd/settings/` | CLAUDE.md, README.md | CLI settings management | | `cmd/objectstorage/` | CLAUDE.md, README.md | S3-style object storage: configure, mb/rb, cp/mv/sync/ls/rm, uploads, presign | -| `cmd/serverless/` | CLAUDE.md, README.md | Serverless containers (beta: create, list, describe, scale, replicas, pause/resume/restart, purge-queue, delete) and batch jobs (hidden, gated by `VERDA_BATCHJOB_ENABLED`) | +| `cmd/serverless/` | CLAUDE.md, README.md | Serverless containers (`verda container`: create, update, list, describe, scale, replicas, pause/resume/restart, purge-queue, delete, env, secret, file-secret, registry-creds) and batch jobs (`verda batchjob`: create, update, list, describe, delete, pause/resume, purge-queue) | | `cmd/doctor/` | — | Environment diagnostics | | `cmd/availability/` | — | Instance availability by location | | `cmd/cost/` | — | Balance, running costs, estimates | diff --git a/internal/verda-cli/cmd/cmd.go b/internal/verda-cli/cmd/cmd.go index efaa0641..5e7691ee 100644 --- a/internal/verda-cli/cmd/cmd.go +++ b/internal/verda-cli/cmd/cmd.go @@ -17,7 +17,6 @@ package cmd import ( "errors" "fmt" - "os" "runtime/debug" "github.com/spf13/cobra" @@ -158,14 +157,13 @@ func NewRootCommand(ioStreams cmdutil.IOStreams) (*cobra.Command, *clioptions.Op }, }, } - serverlessCmds := []*cobra.Command{serverless.NewCmdContainer(f, ioStreams)} - if batchjobEnabled() { - serverlessCmds = append(serverlessCmds, serverless.NewCmdBatchjob(f, ioStreams)) - } groups = append(groups, cmdutil.CommandGroup{ - Message: "Serverless Commands:", - Commands: serverlessCmds, + Message: "Serverless Commands:", + Commands: []*cobra.Command{ + serverless.NewCmdContainer(f, ioStreams), + serverless.NewCmdBatchjob(f, ioStreams), + }, }, cmdutil.CommandGroup{ Message: "Resource Commands:", @@ -203,15 +201,6 @@ func NewRootCommand(ioStreams cmdutil.IOStreams) (*cobra.Command, *clioptions.Op return cmd, opts } -// batchjobEnabled gates the pre-release batchjob subtree behind -// VERDA_BATCHJOB_ENABLED=1/true. Without it `verda batchjob` returns "unknown -// command". The parent command also sets Hidden so it stays out of -// `verda --help` even when a tester flips the env var on. -func batchjobEnabled() bool { - v := os.Getenv("VERDA_BATCHJOB_ENABLED") - return v == "1" || v == "true" -} - // skipCredentialResolution returns true for commands that should work // without valid credentials (diagnostics, profile switching, etc.). func skipCredentialResolution(cmd *cobra.Command) bool { diff --git a/internal/verda-cli/cmd/cmd_test.go b/internal/verda-cli/cmd/cmd_test.go index 4ed71726..de06e489 100644 --- a/internal/verda-cli/cmd/cmd_test.go +++ b/internal/verda-cli/cmd/cmd_test.go @@ -69,31 +69,18 @@ func TestShouldCheckVersion(t *testing.T) { } } -// container is always registered (beta); batchjob only with VERDA_BATCHJOB_ENABLED. +// Both serverless trees are GA: registered unconditionally and visible in `verda --help`. func TestServerlessCommandRegistration(t *testing.T) { - for _, tc := range []struct { - env string - batchjob bool - }{ - {"", false}, - {"1", true}, - {"true", true}, - {"0", false}, - } { - t.Run("VERDA_BATCHJOB_ENABLED="+tc.env, func(t *testing.T) { - t.Setenv("VERDA_HOME", t.TempDir()) - t.Setenv("VERDA_BATCHJOB_ENABLED", tc.env) - root, _ := NewRootCommand(cmdutil.IOStreams{In: &bytes.Buffer{}, Out: &bytes.Buffer{}, ErrOut: &bytes.Buffer{}}) - found := map[string]*cobra.Command{} - for _, c := range root.Commands() { - found[c.Name()] = c - } - if c := found["container"]; c == nil || c.Hidden { - t.Errorf("container: registered=%v, want registered and not hidden", c != nil) - } - if _, ok := found["batchjob"]; ok != tc.batchjob { - t.Errorf("batchjob registered = %v, want %v", ok, tc.batchjob) - } - }) + t.Setenv("VERDA_HOME", t.TempDir()) + root, _ := NewRootCommand(cmdutil.IOStreams{In: &bytes.Buffer{}, Out: &bytes.Buffer{}, ErrOut: &bytes.Buffer{}}) + found := map[string]*cobra.Command{} + for _, c := range root.Commands() { + found[c.Name()] = c + } + for _, name := range []string{"container", "batchjob"} { + c := found[name] + if c == nil || c.Hidden { + t.Errorf("%s: registered=%v, want registered and not hidden", name, c != nil) + } } } diff --git a/internal/verda-cli/cmd/serverless/CLAUDE.md b/internal/verda-cli/cmd/serverless/CLAUDE.md index 5f034006..b818b96a 100644 --- a/internal/verda-cli/cmd/serverless/CLAUDE.md +++ b/internal/verda-cli/cmd/serverless/CLAUDE.md @@ -27,7 +27,7 @@ This rule applies equally to Claude, Codex, Cursor, or a human editing the packa - There is **no** `verda serverless` parent command — the two trees were promoted to root for shorter invocations. They still share this Go package because they share wizard step factories, validators, and the API cache. - Verbs (both trees): `create`, `update`, `list` (alias `ls`), `describe` (aliases `get`, `show`), `delete` (aliases `rm`, `del`), `pause`, `resume`, `purge-queue`. Container also has `restart`, `scale` and `replicas`. - Files: - - `container.go`, `batchjob.go` — Top-level command builders. `NewCmdContainer` and `NewCmdBatchjob` are exported and called directly from `cmd/cmd.go`. **`container` is beta:** always registered, `cmdutil.TagAnnotation: "beta"`. **`batchjob` is two-layer gated:** registered only when `VERDA_BATCHJOB_ENABLED=1` (`batchjobEnabled()` in `cmd/cmd.go`), and `Hidden: true`. Drop both gates when batchjob ships. `gate_test.go` and `cmd/cmd_test.go` guard this. + - `container.go`, `batchjob.go` — Top-level command builders. `NewCmdContainer` and `NewCmdBatchjob` are exported and called directly from `cmd/cmd.go`. Both are GA: registered unconditionally, visible, no `cmdutil.TagAnnotation`. `visibility_test.go` and `cmd/cmd_test.go` guard this (the former `VERDA_BATCHJOB_ENABLED` gate and `(beta)` tag are gone). - `container_create.go` — `containerCreateOptions`, flags, `request()`, validate(), wizard entry point. - `container_update.go` — `containerUpdateOptions`, fetch-merge-PATCH flow. Fetches current deployment + scaling (separate call), overlays only Changed() flags, sends single PATCH. Splits summary rendering and scaling merge into helpers for gocyclo compliance. - `container_list.go` — `GetDeployments` + tabwriter + structured output. diff --git a/internal/verda-cli/cmd/serverless/README.md b/internal/verda-cli/cmd/serverless/README.md index 3de6f1dc..80199ac9 100644 --- a/internal/verda-cli/cmd/serverless/README.md +++ b/internal/verda-cli/cmd/serverless/README.md @@ -7,8 +7,6 @@ verda container # → /container-deployments (continuous; supports spot) verda batchjob # → /job-deployments (one-shot; deadline-based; no spot) ``` -`verda container` is a beta: it shows in `verda --help` as `(beta)`. `verda batchjob` is pre-release: it is registered only with `VERDA_BATCHJOB_ENABLED=1` and stays hidden from `verda --help`. - Both command trees live in the `serverless` Go package (they share wizard step factories, validators, and the API cache), but are registered as top-level commands so users type `verda container ...` rather than `verda serverless container ...`. ## Container deployments diff --git a/internal/verda-cli/cmd/serverless/batchjob.go b/internal/verda-cli/cmd/serverless/batchjob.go index fef8c389..b8cddf83 100644 --- a/internal/verda-cli/cmd/serverless/batchjob.go +++ b/internal/verda-cli/cmd/serverless/batchjob.go @@ -25,10 +25,6 @@ func NewCmdBatchjob(f cmdutil.Factory, ioStreams cmdutil.IOStreams) *cobra.Comma cmd := &cobra.Command{ Use: "batchjob", Short: "Manage serverless batch-job deployments (one-shot runs)", - // Pre-release: cmd/cmd.go (batchjobEnabled) registers it only with - // VERDA_BATCHJOB_ENABLED; Hidden keeps it out of `verda --help` even - // then. Drop both when batchjob ships. - Hidden: true, Long: cmdutil.LongDesc(` Create and manage one-shot batch-job deployments. Jobs accept queued requests, run each to completion within a deadline, and scale the diff --git a/internal/verda-cli/cmd/serverless/container.go b/internal/verda-cli/cmd/serverless/container.go index 54e225a8..6e57d00d 100644 --- a/internal/verda-cli/cmd/serverless/container.go +++ b/internal/verda-cli/cmd/serverless/container.go @@ -23,9 +23,8 @@ import ( // NewCmdContainer creates the top-level `verda container` command tree. func NewCmdContainer(f cmdutil.Factory, ioStreams cmdutil.IOStreams) *cobra.Command { cmd := &cobra.Command{ - Use: "container", - Short: "Manage serverless container deployments (always-on endpoints)", - Annotations: map[string]string{cmdutil.TagAnnotation: "beta"}, + Use: "container", + Short: "Manage serverless container deployments (always-on endpoints)", Long: cmdutil.LongDesc(` Create and manage always-on serverless container deployments. Each deployment exposes an HTTPS endpoint that auto-scales based on queue diff --git a/internal/verda-cli/cmd/serverless/gate_test.go b/internal/verda-cli/cmd/serverless/visibility_test.go similarity index 60% rename from internal/verda-cli/cmd/serverless/gate_test.go rename to internal/verda-cli/cmd/serverless/visibility_test.go index 5c1c8a7e..0fae9a77 100644 --- a/internal/verda-cli/cmd/serverless/gate_test.go +++ b/internal/verda-cli/cmd/serverless/visibility_test.go @@ -18,23 +18,26 @@ import ( "bytes" "testing" + "github.com/spf13/cobra" + cmdutil "github.com/verda-cloud/verda-cli/internal/verda-cli/cmd/util" ) -// container is a visible beta; batchjob stays Hidden (and env-gated in -// cmd/cmd.go) until it ships. -func TestServerlessGate(t *testing.T) { +// Both trees are GA: visible, untagged. A reintroduced Hidden or "beta" tag +// would silently drop them from `verda --help` and the generated docs. +func TestServerlessCommandsVisible(t *testing.T) { f := cmdutil.NewTestFactory(nil) streams := cmdutil.IOStreams{Out: &bytes.Buffer{}, ErrOut: &bytes.Buffer{}} - c := NewCmdContainer(f, streams) - if c.Hidden { - t.Errorf("container command should be visible") - } - if got := c.Annotations[cmdutil.TagAnnotation]; got != "beta" { - t.Errorf("container tag = %q, want beta", got) - } - if c := NewCmdBatchjob(f, streams); !c.Hidden { - t.Errorf("batchjob command should stay Hidden") + for name, c := range map[string]*cobra.Command{ + "container": NewCmdContainer(f, streams), + "batchjob": NewCmdBatchjob(f, streams), + } { + if c.Hidden { + t.Errorf("%s command should be visible", name) + } + if tag := c.Annotations[cmdutil.TagAnnotation]; tag != "" { + t.Errorf("%s tag = %q, want none", name, tag) + } } } From 97fb96677e234b808f8432cdfa085728fc0bf541 Mon Sep 17 00:00:00 2001 From: Jaakko Varjo Date: Wed, 18 Nov 2026 11:17:52 +0200 Subject: [PATCH 2/4] chore(deps): bump OpenTelemetry modules to v1.47.0 (GHSA-q7gw-24fr-5p69) The scanner flagged go.opentelemetry.io/otel/sdk and otel/trace v1.45.0. Bump the whole otel module set together so the indirect dependencies stay on one version; go mod tidy also pulled in otel/log v1.47.0, golang.org/x/sys v0.48.0 and go.yaml.in/yaml/v3 v3.0.5 as their new minimums. Co-Authored-By: Claude Fable 5.1 --- go.mod | 15 ++++++++------- go.sum | 36 ++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/go.mod b/go.mod index dd791670..7a7fae6a 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/spf13/pflag v1.0.10 github.com/spf13/viper v1.21.0 github.com/verda-cloud/verdacloud-sdk-go v1.7.1 - go.yaml.in/yaml/v3 v3.0.4 + go.yaml.in/yaml/v3 v3.0.5 ) require ( @@ -93,13 +93,14 @@ require ( github.com/yosida95/uritemplate/v3 v3.0.2 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect - go.opentelemetry.io/otel v1.45.0 // indirect - go.opentelemetry.io/otel/metric v1.45.0 // indirect - go.opentelemetry.io/otel/sdk v1.45.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.45.0 // indirect - go.opentelemetry.io/otel/trace v1.45.0 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect go.uber.org/multierr v1.10.0 // indirect golang.org/x/sync v0.22.0 // indirect - golang.org/x/sys v0.47.0 // indirect + golang.org/x/sys v0.48.0 // indirect golang.org/x/text v0.41.0 // indirect ) diff --git a/go.sum b/go.sum index 0b4fbb21..ea64682e 100644 --- a/go.sum +++ b/go.sum @@ -82,7 +82,6 @@ github.com/containerd/stargz-snapshotter/estargz v0.18.2 h1:yXkZFYIzz3eoLwlTUZKz github.com/containerd/stargz-snapshotter/estargz v0.18.2/go.mod h1:XyVU5tcJ3PRpkA9XS2T5us6Eg35yM0214Y+wvrZTBrY= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= @@ -149,7 +148,6 @@ github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJw github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= @@ -181,8 +179,9 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/vbatts/tar-split v0.12.2 h1:w/Y6tjxpeiFMR47yzZPlPj/FcPLpXbTUi/9H7d3CPa4= @@ -197,39 +196,40 @@ go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 h1:F7Jx+6hwnZ41NSFTO5q4LYDtJRXBf2PD0rNBkeB/lus= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q= -go.opentelemetry.io/otel v1.45.0 h1:pdrWmLHofpubmArBv1LgFSv1Z0Ie/ppdZzu+kUN5EeU= -go.opentelemetry.io/otel v1.45.0/go.mod h1:XZxIqPapzEYnhNSScF5DIqXhm/rYi0FzCe2XddAwZfQ= -go.opentelemetry.io/otel/metric v1.45.0 h1:7Eg1uH7CJ5cXv9is6tnBe1FI6rj1nwUdbFypRm3br/M= -go.opentelemetry.io/otel/metric v1.45.0/go.mod h1:HAPbm1nd3p1PmFH7v2dR+6BjXxw+Lq4a2+pndMAm08s= -go.opentelemetry.io/otel/sdk v1.45.0 h1:4VVSMgQ83dUgW2aoX5f6JgLvHwIvzcuLnF9lUdCSpCw= -go.opentelemetry.io/otel/sdk v1.45.0/go.mod h1:Sr40LgXV7DsKMMJMKOhUWOgMWTfAaqvm2kF0g7ilwuA= -go.opentelemetry.io/otel/sdk/metric v1.45.0 h1:oVFszMfyj1Am6s24Vtc7wBb8BKLcwepJjNEYILuiE3o= -go.opentelemetry.io/otel/sdk/metric v1.45.0/go.mod h1:vUWUxDZvu1WVRj8JA8S0AdhsPrZoDpA2DdZauIh4mDA= -go.opentelemetry.io/otel/trace v1.45.0 h1:l/mP6Uv7oNO7/TblbhpbgMidxhq1uO/rPsikOyVhxag= -go.opentelemetry.io/otel/trace v1.45.0/go.mod h1:qoJJA2xNMnxRrdISU/kLtfUH2wNeQbiv+jhs/CxI8bc= +go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM= +go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU= +go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI= +go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw= +go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY= +go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU= +go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I= +go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0= +go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw= +go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw= +go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM= +go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc= go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/mod v0.38.0 h1:MECBjubtXD7yj4HrhIUcywNaGeNVUdfVnxmPajOk4yk= golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40= golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= -golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= -golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8= golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M= golang.org/x/tools v0.48.0 h1:3+hClM1aLL5mjMKm5ovokw9epgRXPuu2tILgismM6RE= golang.org/x/tools v0.48.0/go.mod h1:08xX0orndb/F7jJxGDicx061tyd5pcMto75YMAXr6lk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/ini.v1 v1.67.1 h1:tVBILHy0R6e4wkYOn3XmiITt/hEVH4TFMYvAX2Ytz6k= gopkg.in/ini.v1 v1.67.1/go.mod h1:x/cyOwCgZqOkJoDIJ3c1KNHMo10+nLGAhh+kn3Zizss= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 5e348b8e0557a58601bd6f7ab1d1bfc054e54d03 Mon Sep 17 00:00:00 2001 From: Jaakko Varjo Date: Wed, 18 Nov 2026 11:25:40 +0200 Subject: [PATCH 3/4] chore(go): bump toolchain to 1.26.11 (GO-2026-6859) net/http in go1.26.10 has an HTTP/1 server crash via a MaxBytesReader header race, fixed in go1.26.11. The go directive is the single source of the Go version (CI reads it via go-version-file; the Makefile pins GOTOOLCHAIN to it), so this is the whole change. `make fix` found no new modernizers for the patch release. Co-Authored-By: Claude Fable 5.1 --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 7a7fae6a..50c42ae2 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/verda-cloud/verda-cli -go 1.26.10 +go 1.26.11 require ( charm.land/lipgloss/v2 v2.0.2 From d6941983b83cd23265a905d3e474b0f5a1db38c7 Mon Sep 17 00:00:00 2001 From: Jaakko Varjo Date: Wed, 18 Nov 2026 16:02:40 +0200 Subject: [PATCH 4/4] test(serverless): add manual end-to-end smoke test for container and batchjob MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Exercises the full container and batchjob command surface against a real API: catalogs, create (flag-driven and wizard), list/describe/replicas, env set/unset, scale with its validation errors, update, lifecycle actions, agent-mode error contracts, and cleanup. Not run by CI — it creates billable deployments and some steps are interactive. Uses a throwaway VERDA_HOME that is removed on exit unless KEEP_HOME=1; PAUSE/INTERACTIVE/COMPUTE knobs control pacing and the compute type. Co-Authored-By: Claude Opus 4.8 --- test/test_serverless_features.sh | 229 +++++++++++++++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100755 test/test_serverless_features.sh diff --git a/test/test_serverless_features.sh b/test/test_serverless_features.sh new file mode 100755 index 00000000..f59f6327 --- /dev/null +++ b/test/test_serverless_features.sh @@ -0,0 +1,229 @@ +#!/usr/bin/env bash +# Manual end-to-end smoke test of `verda container` and `verda batchjob` +# against a real API. Not run by CI: it creates and deletes billable +# deployments, and several steps are interactive. +# +# make build +# ./test/test_serverless_features.sh # pause after every step +# PAUSE=0 ./test/test_serverless_features.sh # run straight through +# INTERACTIVE=1 ./test/test_serverless_features.sh # also drive wizards/confirm prompts +# KEEP_HOME=1 ./test/test_serverless_features.sh # keep the throwaway VERDA_HOME +# +# VERDA_HOME is always a fresh temp dir (your real ~/.verda is never touched) +# and is removed on exit unless KEEP_HOME=1 — it holds the credentials you +# enter at `auth login`. Set VERDA_HOME yourself to reuse a dir across runs. +# +# Steps that are expected to fail (validation, missing --yes) are marked +# "expect:"; a non-zero exit there is the correct outcome. + +set -u + +cd "$(dirname "$0")/.." +V=${V:-./bin/verda} +PAUSE=${PAUSE:-1} +INTERACTIVE=${INTERACTIVE:-0} +KEEP_HOME=${KEEP_HOME:-0} + +if [[ ! -x "$V" ]]; then + echo "binary $V not found; run 'make build' first" >&2 + exit 1 +fi + +if [[ -z "${VERDA_HOME:-}" ]]; then + VERDA_HOME=$(mktemp -d) + export VERDA_HOME + if [[ "$KEEP_HOME" != "1" ]]; then + trap 'rm -rf "$VERDA_HOME"' EXIT + fi +fi +echo "VERDA_HOME=$VERDA_HOME" + +CT=cli-test-nginx +JOB=cli-test-job +SECRET=cli-test-secret +FILES=cli-test-files +IMG=nginx:1.27.3 +IMG2=nginx:1.27.4 +COMPUTE=${COMPUTE:-RTX PRO 6000} + +step() { printf '\n\033[1;34m### %s\033[0m\n' "$*"; } + +# run: echo the command, run it, report the exit code, optionally pause. +run() { + printf '\033[1;32m$ %s\033[0m\n' "$*" + "$@" + local rc=$? + if [[ $rc -ne 0 ]]; then printf '\033[1;31m(exit %d)\033[0m\n' "$rc"; fi + if [[ "$PAUSE" == "1" ]]; then read -r -p "[enter to continue] "; fi + return 0 +} + +# interactive: like run, but only when INTERACTIVE=1 (prompts, wizards). +interactive() { + if [[ "$INTERACTIVE" != "1" ]]; then + printf '\033[2m(skipped, INTERACTIVE=0) $ %s\033[0m\n' "$*" + return 0 + fi + run "$@" +} + +step "0. Setup and login" +run $V version +run $V auth login +run $V auth show + +step "1. Catalogs and prerequisites" +run $V container registry-creds list +run $V container secret list +run $V container file-secret list +run $V container secret create --name $SECRET --value s3cr3t-value +run $V container secret list +run $V container secret list --agent -o json +echo "hello-from-file" > "$VERDA_HOME/hello.txt" +run $V container file-secret create --name $FILES --file hello.txt="$VERDA_HOME/hello.txt" +run $V container file-secret list + +step "2. Container: create (flag-driven)" +run $V container create \ + --name $CT \ + --image $IMG \ + --compute "$COMPUTE" --compute-size 1 \ + --port 80 --healthcheck-path / \ + --env APP_ENV=test \ + --env-secret APP_TOKEN=$SECRET \ + --secret-mount $FILES:/run/secrets \ + --min-replicas 0 --max-replicas 2 \ + --concurrency 4 --queue-preset balanced \ + --yes --debug + +step "3. Container: read paths" +run $V container list +run $V container list --status healthy +run $V container ls -o json +run $V container describe $CT +run $V container describe $CT -o yaml +run $V container describe $CT --agent -o json +run $V container replicas $CT +run $V container replicas $CT -o json +run $V container env list $CT + +step "4. Container: env vars" +run $V container env set $CT --env LOG_LEVEL=debug --env MODEL_NAME=none +run $V container env set $CT --env-secret API_KEY=$SECRET +run $V container env list $CT +run $V container env unset --deployment $CT LOG_LEVEL --yes +run $V container env unset --deployment $CT MODEL_NAME --agent -o json --yes +run $V container env list $CT -o json + +step "5. Container: scale" +run $V container scale $CT --min-replicas 1 --max-replicas 3 --yes --wait --debug +run $V container scale $CT --cpu-util 70 --yes --wait +run $V container scale $CT --cpu-util off --concurrency 8 --yes --wait +run $V container scale $CT --queue-preset cost-saver --yes --wait +run $V container scale $CT --queue-load 2.5 --scale-up-delay 10s --scale-down-delay 2m --request-ttl 10m --yes --wait +run $V container scale $CT --min-replicas 0 --yes --wait +run $V container describe $CT + +step "5b. Container: scale — expect: client-side rejections" +run $V container scale $CT --max-replicas 0 --yes +run $V container scale $CT --min-replicas 5 --max-replicas 2 --yes +run $V container scale $CT --cpu-util 3 --yes +run $V container scale $CT --agent -o json --min-replicas 1 # expect: --yes required in agent mode +run $V container scale $CT --min-replicas 1 --yes --agent -o json --wait +interactive $V container scale + +step "6. Container: update" +run $V container update $CT --image $IMG2 --yes --debug +run $V container update $CT --env APP_ENV=prod --env EXTRA=1 --yes +run $V container env list $CT +run $V container update $CT --spot --max-replicas 4 --yes +run $V container update $CT --no-spot --yes +run $V container update $CT --healthcheck-off --yes +run $V container update $CT --healthcheck-path / --healthcheck-port 80 --yes +run $V container update $CT --cmd nginx --cmd -g --cmd "daemon off;" --yes +run $V container update $CT --agent -o json --image $IMG # expect: --yes required +run $V container update $CT --agent -o json --image $IMG --yes +run $V container describe $CT + +step "7. Container: lifecycle actions" +run $V container pause $CT +run $V container list --status paused +run $V container resume $CT +run $V container describe $CT +interactive $V container restart $CT +run $V container restart $CT --yes +run $V container restart $CT --agent -o json # expect: --yes required +run $V container restart $CT --agent -o json --yes +run $V container purge-queue $CT --yes +run $V container purge-queue $CT --agent -o json --yes +run $V container pause $CT --agent -o json +run $V container resume $CT --agent -o json + +step "8. Container: interactive create wizard (name it cli-test-wizard)" +interactive $V container create +interactive $V container list +interactive $V container delete cli-test-wizard + +step "9. Batch jobs" +run $V batchjob create \ + --name $JOB \ + --image $IMG \ + --compute "$COMPUTE" --compute-size 1 \ + --port 80 --deadline 10m \ + --env JOB_ENV=test \ + --env-secret JOB_TOKEN=$SECRET \ + --secret-mount $FILES:/run/secrets \ + --max-replicas 2 --request-ttl 5m \ + --yes --debug +run $V batchjob list +run $V batchjob ls -o json +run $V batchjob describe $JOB +run $V batchjob describe $JOB -o yaml +run $V batchjob describe $JOB --agent -o json +run $V batchjob update $JOB --deadline 30m --max-replicas 3 --yes --debug +run $V batchjob update $JOB --image $IMG2 --env JOB_ENV=prod --yes +run $V batchjob update $JOB --agent -o json --max-replicas 1 # expect: --yes required +run $V batchjob update $JOB --agent -o json --max-replicas 1 --yes +run $V batchjob describe $JOB +run $V batchjob pause $JOB +run $V batchjob list +run $V batchjob resume $JOB +interactive $V batchjob purge-queue $JOB +run $V batchjob purge-queue $JOB --yes +run $V batchjob purge-queue $JOB --agent -o json --yes +run $V batchjob pause $JOB --agent -o json +run $V batchjob resume $JOB --agent -o json + +step "9b. Batch jobs — expect: validation errors" +run $V batchjob create --name x --image $IMG --compute "$COMPUTE" --yes # expect: --deadline required +run $V batchjob create --name x --image nginx:latest --compute "$COMPUTE" --deadline 1m --yes # expect: :latest rejected +interactive $V batchjob create +interactive $V batchjob delete cli-test-job-wizard + +step "10. Error contracts (nonexistent deployment)" +run $V container describe does-not-exist +run $V container describe does-not-exist --agent -o json +run $V batchjob describe does-not-exist --agent -o json +run $V container delete does-not-exist --agent -o json --yes + +step "11. Cleanup (deployments first; in-use secrets need --force)" +interactive $V batchjob delete $JOB +run $V batchjob delete $JOB --yes +run $V batchjob list +run $V container delete $CT --agent -o json # expect: --yes required +run $V container delete $CT --timeout-ms 60000 --yes --debug +run $V container list +run $V container file-secret delete $FILES --yes +run $V container secret delete $SECRET --yes +run $V container secret list +run $V container registry-creds list + +step "12. Shell completion" +run $V __complete container "" +run $V __complete batchjob "" +run $V __complete container scale --queue-preset "" + +step "Done" +if [[ "$KEEP_HOME" == "1" ]]; then + echo "kept VERDA_HOME=$VERDA_HOME (contains your credentials; remove it when finished)" +fi