feat: 4107 first use case template#9
Open
BloggerBust wants to merge 2 commits into
Open
Conversation
abelanger5
approved these changes
Jun 25, 2026
abelanger5
left a comment
There was a problem hiding this comment.
Nice! One small comment, but otherwise looks good.
Comment on lines
+12
to
+17
| if _, err := os.Stat(".env"); os.IsExist(err) { | ||
| err := godotenv.Load() | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| } |
There was a problem hiding this comment.
nit: I think we should remove the dependency on godotenv, it's not that common in Go applications and our CLI injects the HATCHET_CLIENT_TOKEN anyway
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This adds the first use-case quickstart template,
scheduled, in Go. The template lives attemplates/use-cases/scheduled/goand its generated example atexamples/use-cases/scheduled/go, and the README documents this layout.cmd/generate-examplesis extended to generate and drift-check use-case examples. It computes the template root for a use case through a single helper, so a variant with an empty use case still reads the originaltemplates/<language>paths and the three simple examples regenerate identically.Refs hatchet-dev/hatchet#4107
Type of change
What's Changed
scheduledGo use-case template undertemplates/use-cases/scheduled/goand its generated example underexamples/use-cases/scheduled/gocmd/generate-examplesto generate and drift-check use-case examples by computing the template root for a use case through a single helpercmd/sync-go-template-deps,hack/check-examples.sh, and.github/dependabot.yml, and rename the on-demand trigger tomanual-runChecklist
Changes have been:
Testing
Ran
go run ./cmd/generate-examples --checkandgo run ./cmd/sync-go-template-deps --check, both pass, and confirmed the simple examples regenerate byte-identically. The scheduled example builds and vets against the pinned SDK withgo build ./...andgo vet ./...fromexamples/use-cases/scheduled/go, which confirmsWithWorkflowCroncompiles againstv0.88.6.bash hack/check-examples.shpasses on Node 24 with pnpm 10, including the new scheduled Go block alongside the simple Go, TypeScript, and Python checks. Rootgo build,go vet, andgo testalso pass.🤖 AI Disclosure