From 1fe1f91295d1601606c8cfd192414379a2e41106 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:00:47 +0000 Subject: [PATCH 1/4] feat: Add design proposal: Rosetta x86-64 emulation for vz Linux guests --- .stats.yml | 4 ++-- image.go | 8 ++++++++ image_test.go | 3 ++- instance.go | 9 +++++++++ instance_test.go | 1 + 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index ba9cc44..cc2f129 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 52 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/hypeman-f9fed11ca56bb499302232ce70b65d8fa6c0f88c5274dbf16670283303449c63.yml -openapi_spec_hash: 24530949a7f53ab57694443c45088190 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/hypeman-6c73c988bf5930a45cafe6d304d97479842354d4181bc77f2aa39838b531d431.yml +openapi_spec_hash: 1bcecb92c1a31dcb09a659272be61633 config_hash: 99e93e381d8384de5a44c6eeed4bd4b1 diff --git a/image.go b/image.go index babf0db..a53b7e5 100644 --- a/image.go +++ b/image.go @@ -98,6 +98,8 @@ type Image struct { Env map[string]string `json:"env"` // Error message if status is failed Error string `json:"error" api:"nullable"` + // Resolved image platform as os/arch[/variant] (e.g. "linux/amd64") + Platform string `json:"platform"` // Position in build queue (null if not queued) QueuePosition int64 `json:"queue_position" api:"nullable"` // Disk size in bytes (null until ready) @@ -116,6 +118,7 @@ type Image struct { Entrypoint respjson.Field Env respjson.Field Error respjson.Field + Platform respjson.Field QueuePosition respjson.Field SizeBytes respjson.Field Tags respjson.Field @@ -145,6 +148,11 @@ const ( type ImageNewParams struct { // OCI image reference (e.g., docker.io/library/nginx:latest) Name string `json:"name" api:"required"` + // Target platform as os/arch[/variant] (e.g. "linux/amd64"), matching Docker + // --platform. Omit for the host platform. Not a fixed enum: the os/arch[/variant] + // grammar is validated server-side and invalid values return 400 invalid_platform. + // Only os "linux" with arch amd64 or arm64 is accepted today. + Platform param.Opt[string] `json:"platform,omitzero"` // User-defined key-value tags. Tags map[string]string `json:"tags,omitzero"` paramObj diff --git a/image_test.go b/image_test.go index 9631e75..bb007f4 100644 --- a/image_test.go +++ b/image_test.go @@ -27,7 +27,8 @@ func TestImageNewWithOptionalParams(t *testing.T) { option.WithAPIKey("My API Key"), ) _, err := client.Images.New(context.TODO(), hypeman.ImageNewParams{ - Name: "docker.io/library/nginx:latest", + Name: "docker.io/library/nginx:latest", + Platform: hypeman.String("linux/amd64"), Tags: map[string]string{ "team": "backend", "env": "staging", diff --git a/instance.go b/instance.go index 0b10c37..0f5830d 100644 --- a/instance.go +++ b/instance.go @@ -690,6 +690,9 @@ type Instance struct { // initializing, shutdown). Consumers (e.g. billing) sum the phases they consider // billable. PhaseDurationsMs map[string]int64 `json:"phase_durations_ms"` + // Resolved image platform as os/arch[/variant] (e.g. "linux/amd64"). amd64 images + // on an arm64 host run under Rosetta emulation. + Platform string `json:"platform"` // Whole-instance restart supervision policy. RestartPolicy RestartPolicy `json:"restart_policy"` // Runtime status for restart policy decisions. @@ -732,6 +735,7 @@ type Instance struct { Network respjson.Field OverlaySize respjson.Field PhaseDurationsMs respjson.Field + Platform respjson.Field RestartPolicy respjson.Field RestartStatus respjson.Field Size respjson.Field @@ -1406,6 +1410,11 @@ type InstanceNewParams struct { HotplugSize param.Opt[string] `json:"hotplug_size,omitzero"` // Writable overlay disk size (human-readable format like "10GB", "50G") OverlaySize param.Opt[string] `json:"overlay_size,omitzero"` + // Target platform as os/arch[/variant] (e.g. "linux/amd64"), matching Docker + // --platform. Omit for the host platform. Not a fixed enum: the os/arch[/variant] + // grammar is validated server-side and invalid values return 400 invalid_platform. + // Only os "linux" with arch amd64 or arm64 is accepted today. + Platform param.Opt[string] `json:"platform,omitzero"` // Base memory size (human-readable format like "1GB", "512MB", "2G") Size param.Opt[string] `json:"size,omitzero"` // Skip guest-agent installation during boot. When true, the exec and stat APIs diff --git a/instance_test.go b/instance_test.go index 9299a21..f075ba2 100644 --- a/instance_test.go +++ b/instance_test.go @@ -96,6 +96,7 @@ func TestInstanceNewWithOptionalParams(t *testing.T) { Enabled: hypeman.Bool(true), }, OverlaySize: hypeman.String("20GB"), + Platform: hypeman.String("linux/amd64"), RestartPolicy: hypeman.RestartPolicyParam{ Backoff: hypeman.String("5s"), MaxAttempts: hypeman.Int(10), From a05ed0b3571d085505f5adfe6f4121f79f2d642c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 18 Jul 2026 02:16:24 +0000 Subject: [PATCH 2/4] feat(stlc): configurable CI runner and private-production-repo support in workflow templates --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cda2e5f..8eb7af7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: permissions: contents: read id-token: write - runs-on: ${{ github.repository == 'stainless-sdks/hypeman-go' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: |- github.repository == 'stainless-sdks/hypeman-go' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') @@ -49,7 +49,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: ${{ github.repository == 'stainless-sdks/hypeman-go' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: @@ -65,7 +65,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ${{ github.repository == 'stainless-sdks/hypeman-go' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 From f87b47b2cd1e52b5987a0321c867fc1eb68cf6b9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 19:44:13 +0000 Subject: [PATCH 3/4] feat: Add POST /instances/{id}/auto-standby/reset --- .stats.yml | 8 ++++---- api.md | 1 + instance.go | 3 +++ instanceautostandby.go | 21 +++++++++++++++++++++ instanceautostandby_test.go | 23 +++++++++++++++++++++++ 5 files changed, 52 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index cc2f129..edacf12 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 52 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/hypeman-6c73c988bf5930a45cafe6d304d97479842354d4181bc77f2aa39838b531d431.yml -openapi_spec_hash: 1bcecb92c1a31dcb09a659272be61633 -config_hash: 99e93e381d8384de5a44c6eeed4bd4b1 +configured_endpoints: 53 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/hypeman-eb4f6a68824524c05a939d52eba9b52f2cae6515dac6e6afa1b6d3f4aa5b6a9e.yml +openapi_spec_hash: ed9f74727470b32ac5a41fa21aaa4e24 +config_hash: 6c3d12df98dffe34327778fe148a9556 diff --git a/api.md b/api.md index 7af5e55..65787b7 100644 --- a/api.md +++ b/api.md @@ -86,6 +86,7 @@ Methods: Methods: +- client.Instances.AutoStandby.Hold(ctx context.Context, id string) (\*hypeman.AutoStandbyStatus, error) - client.Instances.AutoStandby.Status(ctx context.Context, id string) (\*hypeman.AutoStandbyStatus, error) ## Volumes diff --git a/instance.go b/instance.go index 0f5830d..6be329d 100644 --- a/instance.go +++ b/instance.go @@ -316,6 +316,8 @@ type AutoStandbyStatus struct { TrackingMode string `json:"tracking_mode" api:"required"` // Remaining time before the controller attempts standby, when applicable. CountdownRemaining string `json:"countdown_remaining" api:"nullable"` + // Until when auto-standby is held off, if a hold is active. + HoldUntil time.Time `json:"hold_until" api:"nullable" format:"date-time"` // When the controller most recently observed the instance become idle. IdleSince time.Time `json:"idle_since" api:"nullable" format:"date-time"` // Configured idle timeout from the auto-standby policy. @@ -336,6 +338,7 @@ type AutoStandbyStatus struct { Supported respjson.Field TrackingMode respjson.Field CountdownRemaining respjson.Field + HoldUntil respjson.Field IdleSince respjson.Field IdleTimeout respjson.Field LastInboundActivityAt respjson.Field diff --git a/instanceautostandby.go b/instanceautostandby.go index 85754c2..2566893 100644 --- a/instanceautostandby.go +++ b/instanceautostandby.go @@ -32,6 +32,27 @@ func NewInstanceAutoStandbyService(opts ...option.RequestOption) (r InstanceAuto return } +// Places a hold that prevents the auto-standby controller from putting the +// instance into standby before `hold_until`, and cancels any queued auto-standby +// attempt. +// +// Callers may use this before opening a connection to a candidate-idle instance: a +// 200 means it is safe to connect until `hold_until`; a 409 means the instance is +// in standby (or irrevocably entering it) and must be restored first. +// +// Instances where auto-standby is disabled, unconfigured, or unsupported return +// 200 with their current status because no auto-standby will occur. +func (r *InstanceAutoStandbyService) Hold(ctx context.Context, id string, opts ...option.RequestOption) (res *AutoStandbyStatus, err error) { + opts = slices.Concat(r.Options, opts) + if id == "" { + err = errors.New("missing required id parameter") + return nil, err + } + path := fmt.Sprintf("instances/%s/auto-standby/hold", id) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &res, opts...) + return res, err +} + // Get auto-standby diagnostic status func (r *InstanceAutoStandbyService) Status(ctx context.Context, id string, opts ...option.RequestOption) (res *AutoStandbyStatus, err error) { opts = slices.Concat(r.Options, opts) diff --git a/instanceautostandby_test.go b/instanceautostandby_test.go index 78c9c0d..16b2419 100644 --- a/instanceautostandby_test.go +++ b/instanceautostandby_test.go @@ -13,6 +13,29 @@ import ( "github.com/kernel/hypeman-go/option" ) +func TestInstanceAutoStandbyHold(t *testing.T) { + t.Skip("Mock server tests are disabled") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := hypeman.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("My API Key"), + ) + _, err := client.Instances.AutoStandby.Hold(context.TODO(), "id") + if err != nil { + var apierr *hypeman.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + func TestInstanceAutoStandbyStatus(t *testing.T) { t.Skip("Mock server tests are disabled") baseURL := "http://localhost:4010" From 6c8e0c6b6ee115e13b49aa4671fd45c24ec3461a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 19:44:41 +0000 Subject: [PATCH 4/4] release: 0.21.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 10 ++++++++++ README.md | 2 +- internal/version.go | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0c2ecec..86b0e83 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.20.0" + ".": "0.21.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 65b2e2b..3e77214 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 0.21.0 (2026-07-28) + +Full Changelog: [v0.20.0...v0.21.0](https://github.com/kernel/hypeman-go/compare/v0.20.0...v0.21.0) + +### Features + +* Add design proposal: Rosetta x86-64 emulation for vz Linux guests ([1fe1f91](https://github.com/kernel/hypeman-go/commit/1fe1f91295d1601606c8cfd192414379a2e41106)) +* Add POST /instances/{id}/auto-standby/reset ([f87b47b](https://github.com/kernel/hypeman-go/commit/f87b47b2cd1e52b5987a0321c867fc1eb68cf6b9)) +* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([a05ed0b](https://github.com/kernel/hypeman-go/commit/a05ed0b3571d085505f5adfe6f4121f79f2d642c)) + ## 0.20.0 (2026-05-18) Full Changelog: [v0.19.0...v0.20.0](https://github.com/kernel/hypeman-go/compare/v0.19.0...v0.20.0) diff --git a/README.md b/README.md index 1f0803c..86fba72 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Or to pin the version: ```sh -go get -u 'github.com/kernel/hypeman-go@v0.20.0' +go get -u 'github.com/kernel/hypeman-go@v0.21.0' ``` diff --git a/internal/version.go b/internal/version.go index 6c84346..b6325aa 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "0.20.0" // x-release-please-version +const PackageVersion = "0.21.0" // x-release-please-version