From 7b13ce4a65e6b09556d4730f707fbe22b14e8f9d Mon Sep 17 00:00:00 2001 From: Mohammed Nafees Date: Fri, 14 Aug 2026 14:00:16 +0200 Subject: [PATCH 1/3] update quickstart func --- .github/workflows/cli-e2e-tests.yml | 14 +++++++++++-- .../cli/internal/templater/templater.go | 1 + cmd/hatchet-cli/cli/quickstart.go | 20 +++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cli-e2e-tests.yml b/.github/workflows/cli-e2e-tests.yml index 8bc0807925..d3c542e4c3 100644 --- a/.github/workflows/cli-e2e-tests.yml +++ b/.github/workflows/cli-e2e-tests.yml @@ -12,6 +12,8 @@ on: - "cmd/hatchet-cli/cli/tui/**" - "cmd/hatchet-cli/cli/testharness/**" push: + tags: + - "v*" branches: - main paths: @@ -69,9 +71,12 @@ jobs: - name: Build CLI run: | cd cmd/hatchet-cli - go build -o hatchet-cli + go build -ldflags "-X github.com/hatchet-dev/hatchet/cmd/hatchet-cli/cli.Version=${CLI_VERSION}" -o hatchet-cli sudo mv hatchet-cli /usr/local/bin/hatchet hatchet --version + env: + # On release tags, quickstart templates pin the SDK release under test + CLI_VERSION: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || 'v0.1.0-alpha.0' }} - name: Start Hatchet server run: | @@ -87,9 +92,14 @@ jobs: - name: Run template E2E tests run: | cd cmd/hatchet-cli/cli - go test -tags e2e_cli -run TestQuickstartTemplates -v -timeout 15m + go test -tags e2e_cli \ + -ldflags "-X github.com/hatchet-dev/hatchet/cmd/hatchet-cli/cli.Version=${CLI_VERSION}" \ + -run TestQuickstartTemplates -v -timeout 15m env: CI: true + CLI_VERSION: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || 'v0.1.0-alpha.0' }} + # A just-pushed release tag may not be on the module proxy yet + GOPROXY: https://proxy.golang.org,direct - name: Run resource E2E tests run: | diff --git a/cmd/hatchet-cli/cli/internal/templater/templater.go b/cmd/hatchet-cli/cli/internal/templater/templater.go index 25bd1f46eb..f168c10b9e 100644 --- a/cmd/hatchet-cli/cli/internal/templater/templater.go +++ b/cmd/hatchet-cli/cli/internal/templater/templater.go @@ -14,6 +14,7 @@ import ( type Data struct { Name string PackageManager string + HatchetVersion string } // Process reads all files from the specified directory within the provided filesystem, diff --git a/cmd/hatchet-cli/cli/quickstart.go b/cmd/hatchet-cli/cli/quickstart.go index 2496cfa0ed..59da7e1afa 100644 --- a/cmd/hatchet-cli/cli/quickstart.go +++ b/cmd/hatchet-cli/cli/quickstart.go @@ -114,12 +114,32 @@ support a subset of languages.`, }, } +const devDefaultVersion = "v0.1.0-alpha.0" + +const fallbackHatchetVersion = "v0.98.9" + +// hatchetSDKVersion returns the Go SDK version go templates pin: the SDK +// module and the CLI are released from the same tag, so the CLI's own version +// is the SDK version, except in unstamped dev builds. +func hatchetSDKVersion() string { + v := Version + if !strings.HasPrefix(v, "v") { + // goreleaser stamps the version without the leading v + v = "v" + v + } + if v == devDefaultVersion { + return fallbackHatchetVersion + } + return v +} + // GenerateQuickstart generates a quickstart project without interactive forms. // Returns the post-quickstart content that should be displayed to the user. func GenerateQuickstart(selection templater.Selection, projectName, dir string) (string, error) { templateData := templater.Data{ Name: projectName, PackageManager: selection.PackageManager, + HatchetVersion: hatchetSDKVersion(), } templatesFS := quickstarts.TemplatesFS() From 926229bb2acd5261bd12a3cef8d5f0693690ecfe Mon Sep 17 00:00:00 2001 From: Mohammed Nafees Date: Fri, 14 Aug 2026 14:04:21 +0200 Subject: [PATCH 2/3] comments --- .github/workflows/cli-e2e-tests.yml | 2 -- cmd/hatchet-cli/cli/quickstart.go | 4 ---- 2 files changed, 6 deletions(-) diff --git a/.github/workflows/cli-e2e-tests.yml b/.github/workflows/cli-e2e-tests.yml index d3c542e4c3..4e8c74a8c8 100644 --- a/.github/workflows/cli-e2e-tests.yml +++ b/.github/workflows/cli-e2e-tests.yml @@ -75,7 +75,6 @@ jobs: sudo mv hatchet-cli /usr/local/bin/hatchet hatchet --version env: - # On release tags, quickstart templates pin the SDK release under test CLI_VERSION: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || 'v0.1.0-alpha.0' }} - name: Start Hatchet server @@ -98,7 +97,6 @@ jobs: env: CI: true CLI_VERSION: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || 'v0.1.0-alpha.0' }} - # A just-pushed release tag may not be on the module proxy yet GOPROXY: https://proxy.golang.org,direct - name: Run resource E2E tests diff --git a/cmd/hatchet-cli/cli/quickstart.go b/cmd/hatchet-cli/cli/quickstart.go index 59da7e1afa..e64b949008 100644 --- a/cmd/hatchet-cli/cli/quickstart.go +++ b/cmd/hatchet-cli/cli/quickstart.go @@ -118,13 +118,9 @@ const devDefaultVersion = "v0.1.0-alpha.0" const fallbackHatchetVersion = "v0.98.9" -// hatchetSDKVersion returns the Go SDK version go templates pin: the SDK -// module and the CLI are released from the same tag, so the CLI's own version -// is the SDK version, except in unstamped dev builds. func hatchetSDKVersion() string { v := Version if !strings.HasPrefix(v, "v") { - // goreleaser stamps the version without the leading v v = "v" + v } if v == devDefaultVersion { From 865b1ec4c6f174b26e06736532d44a24c765037b Mon Sep 17 00:00:00 2001 From: Mohammed Nafees Date: Mon, 17 Aug 2026 12:50:09 +0200 Subject: [PATCH 3/3] bump quickstarts tag --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index b342fdf33d..c408f0143e 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( github.com/gorilla/sessions v1.4.0 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/golang-lru/v2 v2.0.7 - github.com/hatchet-dev/hatchet-quickstarts v0.3.1 + github.com/hatchet-dev/hatchet-quickstarts v0.4.0 github.com/hatchet-dev/pgoutbox v0.4.0 github.com/hatchet-dev/timediff v0.0.4 github.com/jackc/pgerrcode v0.0.0-20250907135507-afb5586c32a6 diff --git a/go.sum b/go.sum index 2e57fca22d..05edcf32f8 100644 --- a/go.sum +++ b/go.sum @@ -279,6 +279,8 @@ github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hatchet-dev/hatchet-quickstarts v0.3.1 h1:h6Ve8z75FMFgmmeNdj+OxVDw3gLHfpGTa8bcigUoFqw= github.com/hatchet-dev/hatchet-quickstarts v0.3.1/go.mod h1:kuGRjIxJUqfY6MR8x1oOrozo+G1Yo3q6A/GQqoDRp6M= +github.com/hatchet-dev/hatchet-quickstarts v0.4.0 h1:4MU/OiuQTe3Jjm8dMFmXZFQqZdxrqF5Tb/ym6k1y+iQ= +github.com/hatchet-dev/hatchet-quickstarts v0.4.0/go.mod h1:Lc4v6Fd7wlYh/akNwHy7Wd/hMlTittsOQYI+SPjqks0= github.com/hatchet-dev/pgoutbox v0.4.0 h1:+q9l14zzl/IVnxQ5PHZUyuZ+5D+leXqPJzJrt2iE+2I= github.com/hatchet-dev/pgoutbox v0.4.0/go.mod h1:x7wEFajIrOJ+goWri49MjzlkdwLHMdr+dZkXjVCm9ho= github.com/hatchet-dev/timediff v0.0.4 h1:RfYX1ehoa/qxHKAGQBMAvmkPx+FRQfUV37tDy/G1pOY=