Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/cli-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
- "cmd/hatchet-cli/cli/tui/**"
- "cmd/hatchet-cli/cli/testharness/**"
push:
tags:
- "v*"
branches:
- main
paths:
Expand Down Expand Up @@ -69,9 +71,11 @@ 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:
CLI_VERSION: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || 'v0.1.0-alpha.0' }}

- name: Start Hatchet server
run: |
Expand All @@ -87,9 +91,13 @@ 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' }}
GOPROXY: https://proxy.golang.org,direct

- name: Run resource E2E tests
run: |
Expand Down
1 change: 1 addition & 0 deletions cmd/hatchet-cli/cli/internal/templater/templater.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
16 changes: 16 additions & 0 deletions cmd/hatchet-cli/cli/quickstart.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,28 @@ support a subset of languages.`,
},
}

const devDefaultVersion = "v0.1.0-alpha.0"

const fallbackHatchetVersion = "v0.98.9"

func hatchetSDKVersion() string {
v := Version
if !strings.HasPrefix(v, "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()
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
Loading