version: "3" tasks: setup: cmds: - task: install-dependencies - task: generate-certs - task: set-env-db - task: migrate - task: generate-all - task: generate-local-encryption-keys - task: set-env-all - task: seed-dev - task: copy-ca-to-sdks - task: docs set-env-db: cmds: - | cat > .env < .env </dev/null || true' EXIT task start-db task write-e2e-env task generate-local-encryption-keys task migrate task seed-cypress bash ./hack/ci/start-api.sh & bash ./hack/ci/start-engine.sh & # API readiness server runs on the healthcheck port (default 8733) bash ./hack/ci/wait-for-http.sh http://127.0.0.1:8733/ready 120 cd frontend/app # Start Vite bound to app.localtest.me (see vite.config.ts) pnpm run dev -- --host app.localtest.me --port 5173 & bash ../../hack/ci/wait-for-http.sh http://app.localtest.me:5173 120 CYPRESS_BASE_URL=http://app.localtest.me:5173 pnpm run e2e:run start-ngrok: cmds: - ngrok http 8080 start-lite: cmds: - bash ./hack/dev/start-lite.sh generate-all: cmds: - task: install-dependencies - task: generate-api - task: generate-go - task: generate-proto - task: generate-sqlc - task: pre-commit-run install-dependencies: cmds: - go mod download - cd frontend/app/ && pnpm install - cd frontend/docs/ && pnpm install - npm install -g vite generate-api: cmds: - task: generate-api-server - task: generate-api-client generate-certs: cmds: - bash ./hack/dev/generate-x509-certs.sh ./hack/dev/certs generate-local-encryption-keys: cmds: - bash ./hack/dev/generate-local-encryption-keys.sh ./hack/dev/encryption-keys init-dev-env: - bash ./hack/dev/init-dev-token-and-env.sh generate-dev-api-token: cmds: - bash ./hack/dev/generate-dev-api-token.sh generate-api-server: cmds: - bash ./hack/oas/generate-server.sh silent: true generate-api-client: cmds: - bash ./hack/oas/generate-clients.sh silent: true generate-go: cmds: - go generate ./... generate-proto: cmds: - bash ./hack/proto/proto.sh generate-proto-python: dir: ./python-sdk cmds: - sh ./generate.sh generate-sqlc: cmds: - go run github.com/sqlc-dev/sqlc/cmd/sqlc@v1.29.0 generate --file pkg/repository/sqlcv1/sqlc.yaml lint: cmds: - task: lint-go - task: lint-frontend lint-go: cmds: - golangci-lint run ./... --config .golangci.yml lint-frontend: cmds: - cd frontend/app/ && pnpm run lint:check kill-apis: cmds: - ps -A | grep 'cmd/hatchet-api' | grep -v grep | awk '{print $1}' | xargs kill -9 $1 - ps -A | grep 'exe/hatchet-api' | grep -v grep | awk '{print $1}' | xargs kill -9 $1 kill-engines: cmds: - ps -A | grep 'cmd/hatchet-engine' | grep -v grep | awk '{print $1}' | xargs kill -9 $1 - ps -A | grep 'exe/hatchet-engine' | grep -v grep | awk '{print $1}' | xargs kill -9 $1 copy-ca-to-sdks: cmds: - mkdir -p ./python-sdk/certs/ && cp ./hack/dev/certs/ca.cert ./python-sdk/certs/ pre-commit-install: cmds: - pip install pre-commit # can use brew install pre-commit if you are on macOS - pre-commit install pre-commit-run: cmds: - cd frontend/app/ && pnpm run lint:fix && pnpm run prettier:check - cd frontend/docs/ && pnpm run lint:fix && pnpm run prettier:check - pre-commit run --all-files || pre-commit run --all-files docs: cmds: - | # Create a trap to kill the watcher when the task exits trap 'kill $(jobs -p) 2>/dev/null' EXIT npx chokidar "sdks/**/*.{py,ts,go}" --ignore "**/node_modules/**" --ignore "**/.git/**" --ignore "**/dist/**" --ignore "**/build/**" --initial -c "echo 'TODO: Add a task to generate and sync the docs'" & cd frontend/docs/ && pnpm run taskfile-dev pytest: dir: ./sdks/python vars: WORKERS: '{{.WORKERS | default "auto"}}' RETRIES: '{{.RETRIES | default "3"}}' EXTRA_ARGS: '{{.EXTRA_ARGS | default ""}}' cmds: - poetry run pytest -n auto --retries 3 --retry-delay 5 start-telemetry: cmds: - docker compose -f docker-compose.infra.yml up -d