Skip to content

chore(deps): update verdacloud-sdk-go to v1.7.0 and add go fix check - #65

Merged
yutkin merged 11 commits into
mainfrom
chore/sdk-v1.7.0-go-fix
Oct 28, 2026
Merged

yutkin merged 11 commits into
mainfrom
chore/sdk-v1.7.0-go-fix

Conversation

@yutkin

@yutkin yutkin commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Update verdacloud-sdk-go from v1.4.2 to v1.7.0. Copy the CI changes from verda-cloud/verdacloud-sdk-go#65.

 go.mod
-go 1.26.9
+go 1.26.10            # minimum Go version of the SDK
-verdacloud-sdk-go v1.4.2
+verdacloud-sdk-go v1.7.0

 Makefile
+GO_VERSION     (read from go.mod)
+GOLANGCI_LINT  (v2.5.0, pinned here only)
+fix, fix.check
 ci.yml
+go-fix job     (make fix.check, required by ci-success)
 security.yml
+make security  (replaces the local golangci-lint install)

Commits:

  1. chore(deps): Update the SDK. Replace Instances.Get with Instances.List. Add the new SDK fields to the output views.
  2. refactor: Apply go fix. One rewrite in skills/uninstall.go did not compile. We changed it manually.
  3. ci: Add the go fix check. Pin golangci-lint in the Makefile.
  4. fix(batchjob): The SDK rejects a job deadline under 10 minutes or over 7 days. The CLI now uses the same range, and the wizard default changes from 5m to 30m.
  5. fix(githooks): The pre-commit hook runs make fix.check and make lint. The hook file is now executable. Before, git did not run it.
  6. fix(githooks): The hook step that starts claude to update docs runs only when you set VERDA_DOC_UPDATE=1.
  7. fix(serverless): The wizard steps and flag checks use the SDK limits from constants in shared.go. The wizard now rejects an out-of-range value at the prompt. Before, the error came after the last step.

SDK changes that break compatibility

Change Since CLI effect
NewTestClient has a new first parameter, testing.TB v1.6.2 One test changed
The bool parameter of DeleteVolume changed from "force" to "permanent delete" v1.5.0 None. The CLI always sends false
The minimum Go version is 1.26.10 v1.7.0 go.mod changed
A job deadline must be from 10 minutes to 7 days v1.7.0 batchjob create uses the same range
New limits for serverless create requests (see below) v1.7.0 The wizard and flags use the same limits

Serverless limits that the SDK now checks:

Field Range
Compute size 1..128
Min / max replicas 0..1000 / 1..1000
Concurrency 1..5000
CPU / GPU utilization 0 (off) or 5..100
Scale-up / scale-down delay 0s..1h
Request TTL 0s..24h (container), 0s..168h (batch job)

We did not test these values against the live API. The limits agree with the current public API schema.

Proposed CLI version: v1.9.1. Changes that users can see:

  • The JSON and YAML output has new keys.
  • batchjob create rejects a --deadline under 10m or over 168h. The wizard default is now 30m.
  • container create and batchjob create reject out-of-range values at the wizard prompt or with a flag error. The --cpu-util and --gpu-util help shows the new range.

Evidence

  • Before: go vet failed on NewTestClient. views_test found 5 missing SDK keys. Lint found 17 issues.
  • After: make build, make test, make lint, make fix.check and make security pass.
  • New tests run the SDK Validate() on the wizard default deadline and on the default container request. With the old 5m default, the deadline test fails.

Merge Danger

Door: two-way

Blast Radius: small

JSON, YAML and MCP output for instances and volumes has new keys. Out-of-range serverless values now fail in the CLI, before the CLI sends the request. The request payload for valid values does not change. After each change to the go line in go.mod, run make fix. The pre-commit hook now runs. Its doc-update step is off unless you set VERDA_DOC_UPDATE=1.

🤖 Generated with Claude Code

yutkin and others added 6 commits October 28, 2026 15:31
Raises the go directive to 1.26.10 (the SDK's floor) and pulls
ozzo-validation v4.4.1.

Adapt to the SDK:
- NewTestClient now takes testing.TB.
- Instances.Get is deprecated: call Instances.List (nil for all,
  ListInstancesOptions{Status} otherwise), which is what Get wraps.
- Hibernate is deprecated upstream but the CLI still supports it, so its
  uses get a staticcheck SA1019 nolint.
- Instance/Volume/VolumeInTrash views carry the new SDK fields (tags,
  private_ip, private_network_id, subnet_id); the views coverage test
  requires it. JSON/YAML output gains these keys (additive).
- Two volume loops index instead of copying the larger SDK struct.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Output of `go fix -tags=integration ./...` (Go 1.26.10, two passes):
new(expr), min/max clamps, strings.Cut/CutPrefix/CutSuffix/SplitSeq,
slices.Contains, wg.Go, range over int. No behavior changes.

Manual edits:
- skills/uninstall.go: the stringscut fixer emitted
  `before, _, ok := ...; _, after, ok := ...; if !ok || !ok`, which does
  not compile and would drop the start-marker check. Use okStart/okEnd.
- Delete strPtr/stringPtr/ptrOf, unused once their call sites were
  inlined as new(...).
- Preallocate two test slices that prealloc flags after range-over-int.
- Reflow three min/max/Cut rewrites that go fix left awkwardly formatted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mirrors verdacloud-sdk-go#65.

- Makefile derives GO_VERSION from the go directive in go.mod, which CI
  already reads via go-version-file, so go.mod is the single source.
- golangci-lint is pinned once (GOLANGCI_LINT_VERSION, still v2.5.0) and
  run via `go run` on that toolchain. lint, lint.fix and security use it;
  the lint and gosec jobs drop their own `go install` of the same version.
  `make security` gains --default=none so it matches CI exactly.
- New `make fix` (two passes) and `make fix.check` (go fix -diff, which
  exits non-zero on a pending fix), with -tags=integration and the
  toolchain pinned because the fixer set changes between Go releases.
- New "Go Fix Check" CI job, required by ci-success; a pre-commit hook
  runs `make fix`. CLAUDE.md and AGENTS.md document both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDK v1.7.0 validates JobScalingOptions before sending and rejects
deadline_seconds outside 600..604800. The CLI only checked > 0 and the
wizard defaulted to 5m, so accepting the default failed after the whole
wizard.

validateBatchjobDeadline now backs both request() and the wizard step,
and the wizard defaults to 30m (the value the help example uses). New
tests run the SDK's own Validate() on the wizard default, the range
edges and the default container request, so a future SDK limit change
fails here instead of in front of a user.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pre-commit hook used whatever golangci-lint was on PATH (and skipped
lint when there was none) and never ran go fix, so a commit could pass
locally and fail the required Go Fix Check job. It now runs
`make fix.check` and `make lint`, the same pinned targets as CI.

The file was also stored as 100644. Git ignores a hook that is not
executable, so `make hooks.install` never ran it. Mark it 100755. This
also activates the hook's existing doc-update step (skip it with
SKIP_DOC_UPDATE=1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nicksemin
nicksemin previously approved these changes Oct 28, 2026
yutkin and others added 2 commits October 28, 2026 17:37
The hook's last step starts a headless claude session with
--dangerously-skip-permissions (up to $0.50 per commit) and stages any
unstaged cmd/*/README.md and CLAUDE.md changes. It never ran while the
hook was non-executable. Now that it is executable, run that step only
when VERDA_DOC_UPDATE=1, so a commit does not start paid AI edits by
default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDK v1.7.0 validates create requests before sending them. Several
wizard steps accepted wider ranges, so the user finished the whole
wizard and only then got a validation error, with no way to correct the
value. The CPU/GPU prompts and flag help also advertised 1..100 while an
enabled threshold now needs at least 5.

The limits now live once in shared.go and back the wizard validators,
the validate()/request() flag checks and the flag help:

  compute size 1..128, min replicas 0..1000, max replicas 1..1000,
  concurrency 1..5000, CPU/GPU util 0 (off) or 5..100, scale delays
  0s..1h, request TTL 0s..24h (container) and 0s..168h (batch job),
  healthcheck port 0..65535.

Container and job TTL keep separate steps because their ceilings
differ. Disabled triggers, zero durations and all defaults behave as
before. Flag-only and agent runs were already rejected by the SDK; they
now get an error that names the flag. The request payload is unchanged.

sdk_limits_test.go runs the SDK's Validate() at each boundary for both
command families. We did not establish that these out-of-range values
ever succeeded against the live API; they match the current public API
schema.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yutkin and others added 2 commits October 28, 2026 17:41
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restore the original help text, wizard descriptions and error messages,
and the serverless README. Only the new upper-bound checks and the two
ranges that changed (CPU/GPU util, batch job deadline) produce new text,
and that text is built from the constants in shared.go and
batchjob_create.go, so a limit changes in one place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yutkin
yutkin force-pushed the chore/sdk-v1.7.0-go-fix branch from f289705 to dc629f1 Compare October 28, 2026 15:54
@yutkin
yutkin requested a review from nicksemin October 28, 2026 15:54
TestResumableDownload_BreakThenResume was flaky on main and on this
branch (about 1 in 75 runs with -cpu 1,2,4). After a chunk failed, the
worker could pull the next chunk before the consumer called cancel(),
so a "concurrency 1" download kept going past the failed chunk.

The worker now returns after it reports an error. Other workers still
stop on the first error's cancel(), as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yutkin
yutkin merged commit 2a464bc into main Oct 28, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants