Skip to content

feat: 4107 first use case template#9

Open
BloggerBust wants to merge 2 commits into
mainfrom
feat/4107-first-use-case-template
Open

feat: 4107 first use case template#9
BloggerBust wants to merge 2 commits into
mainfrom
feat/4107-first-use-case-template

Conversation

@BloggerBust

Copy link
Copy Markdown
Collaborator

Description

This adds the first use-case quickstart template, scheduled, in Go. The template lives at templates/use-cases/scheduled/go and its generated example at examples/use-cases/scheduled/go, and the README documents this layout. cmd/generate-examples is 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 original templates/<language> paths and the three simple examples regenerate identically.

Refs hatchet-dev/hatchet#4107

Type of change

  • New feature (non-breaking change which adds functionality)

What's Changed

  • Add the scheduled Go use-case template under templates/use-cases/scheduled/go and its generated example under examples/use-cases/scheduled/go
  • Extend cmd/generate-examples to generate and drift-check use-case examples by computing the template root for a use case through a single helper
  • Cover the new Go module in cmd/sync-go-template-deps, hack/check-examples.sh, and .github/dependabot.yml, and rename the on-demand trigger to manual-run

Checklist

Changes have been:

  • Tested (unit, integration, or manually with steps specified)
  • Linted and formatted
  • Documented (where applicable)

Testing

Ran go run ./cmd/generate-examples --check and go 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 with go build ./... and go vet ./... from examples/use-cases/scheduled/go, which confirms WithWorkflowCron compiles against v0.88.6. bash hack/check-examples.sh passes on Node 24 with pnpm 10, including the new scheduled Go block alongside the simple Go, TypeScript, and Python checks. Root go build, go vet, and go test also pass.


🤖 AI Disclosure
  • I acknowledge that an LLM was used in the creation of this Pull Request, in accordance with Hatchet's AI_POLICY.md.
  • Details: Claude Code investigated the SDK behavior and release state and ran the validation listed above.

@abelanger5 abelanger5 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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