Skip to content

Commit

Permalink
Merge pull request #159 from hatchet-dev/feat/playground
Browse files Browse the repository at this point in the history
feat: step run playground
  • Loading branch information
abelanger5 committed Feb 19, 2024
2 parents 00111d8 + 7a36166 commit 10ab4d0
Show file tree
Hide file tree
Showing 179 changed files with 11,428 additions and 1,296 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/test.yml
Expand Up @@ -33,7 +33,7 @@ jobs:

- name: Generate
run: |
go run github.com/steebchen/prisma-client-go db push --skip-generate
go run github.com/steebchen/prisma-client-go migrate deploy
task generate
- name: Check for diff
Expand Down Expand Up @@ -80,19 +80,30 @@ jobs:
with:
version: "25.1"

- name: Install Task
uses: arduino/setup-task@v1

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.21"

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Compose
run: docker compose up -d

- name: Go deps
run: go mod download

- name: Generate
run: go run github.com/steebchen/prisma-client-go db push
run: |
go run github.com/steebchen/prisma-client-go migrate deploy
task generate
- name: Test
run: go test -tags integration ./... -v -failfast
Expand Down Expand Up @@ -122,6 +133,12 @@ jobs:
with:
go-version: "1.21"

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Compose
run: docker compose up -d

Expand All @@ -130,7 +147,8 @@ jobs:

- name: Generate
run: |
go run github.com/steebchen/prisma-client-go db push
go run github.com/steebchen/prisma-client-go migrate deploy
task generate
task generate-certs
- name: Prepare
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -51,6 +51,8 @@ node_modules
# Crash log files
crash.log


.venv
# Exclude all .tfvars files, which are likely to contain sentitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
Expand Down
6 changes: 6 additions & 0 deletions Caddyfile
Expand Up @@ -9,3 +9,9 @@ app.dev.hatchet-tools.com {
reverse_proxy localhost:5173
}
}

grpc.dev.hatchet-tools.com {
tls internal

reverse_proxy h2c://127.0.0.1:7070
}
13 changes: 12 additions & 1 deletion Taskfile.yaml
Expand Up @@ -9,7 +9,7 @@ tasks:
- sh ./hack/dev/run-go-with-env.sh run github.com/steebchen/prisma-client-go migrate dev
seed-dev:
cmds:
- sh ./hack/dev/run-npx-with-env.sh prisma db push --force-reset --skip-generate
- sh ./hack/dev/run-go-with-env.sh run github.com/steebchen/prisma-client-go migrate dev --skip-generate
- SEED_DEVELOPMENT=true sh ./hack/dev/run-go-with-env.sh run ./cmd/hatchet-admin seed
start-dev:
deps:
Expand All @@ -25,6 +25,9 @@ tasks:
start-frontend:
cmds:
- sh ./hack/dev/start-frontend.sh
start-ngrok:
cmds:
- ngrok http 8080
generate:
cmds:
- task: deps
Expand Down Expand Up @@ -85,6 +88,14 @@ tasks:
kill-query-engines:
cmds:
- ps -A | grep 'prisma-query-engine-darwin-arm64' | grep -v grep | awk '{print $1}' | xargs kill -9 $1
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
prisma-studio:
cmds:
- sh ./hack/dev/run-npx-with-env.sh prisma studio
18 changes: 18 additions & 0 deletions api-contracts/dispatcher/dispatcher.proto
Expand Up @@ -15,6 +15,8 @@ service Dispatcher {

rpc SendGroupKeyActionEvent(GroupKeyActionEvent) returns (ActionEventResponse) {}

rpc PutOverridesData(OverridesData) returns (OverridesDataResponse) {}

rpc Unsubscribe(WorkerUnsubscribeRequest) returns (WorkerUnsubscribeResponse) {}
}

Expand Down Expand Up @@ -209,3 +211,19 @@ message WorkflowEvent {
// will hang up the connection but clients might want to case
bool hangup = 7;
}

message OverridesData {
// the step run id
string stepRunId = 1;

// the path of the data to set
string path = 2;

// the value to set
string value = 3;

// the filename of the caller
string callerFilename = 4;
}

message OverridesDataResponse {}
32 changes: 32 additions & 0 deletions api-contracts/openapi/components/schemas/_index.yaml
Expand Up @@ -2,6 +2,10 @@ APIMeta:
$ref: "./metadata.yaml#/APIMeta"
APIMetaAuth:
$ref: "./metadata.yaml#/APIMetaAuth"
ListAPIMetaIntegration:
$ref: "./metadata.yaml#/ListAPIMetaIntegration"
APIMetaIntegration:
$ref: "./metadata.yaml#/APIMetaIntegration"
APIErrors:
$ref: "./metadata.yaml#/APIErrors"
APIError:
Expand Down Expand Up @@ -68,6 +72,8 @@ ReplayEventRequest:
$ref: "./event.yaml#/ReplayEventRequest"
Workflow:
$ref: "./workflow.yaml#/Workflow"
WorkflowDeploymentConfig:
$ref: "./workflow.yaml#/WorkflowDeploymentConfig"
WorkflowVersionMeta:
$ref: "./workflow.yaml#/WorkflowVersionMeta"
WorkflowVersion:
Expand Down Expand Up @@ -120,3 +126,29 @@ RerunStepRunRequest:
$ref: "./workflow_run.yaml#/RerunStepRunRequest"
TriggerWorkflowRunRequest:
$ref: "./workflow_run.yaml#/TriggerWorkflowRunRequest"
LinkGithubRepositoryRequest:
$ref: "./workflow.yaml#/LinkGithubRepositoryRequest"
GithubBranch:
$ref: "./github_app.yaml#/GithubBranch"
GithubRepo:
$ref: "./github_app.yaml#/GithubRepo"
GithubAppInstallation:
$ref: "./github_app.yaml#/GithubAppInstallation"
ListGithubAppInstallationsResponse:
$ref: "./github_app.yaml#/ListGithubAppInstallationsResponse"
ListGithubReposResponse:
$ref: "./github_app.yaml#/ListGithubReposResponse"
ListGithubBranchesResponse:
$ref: "./github_app.yaml#/ListGithubBranchesResponse"
CreatePullRequestFromStepRun:
$ref: "./workflow_run.yaml#/CreatePullRequestFromStepRun"
GetStepRunDiffResponse:
$ref: "./workflow_run.yaml#/GetStepRunDiffResponse"
StepRunDiff:
$ref: "./workflow_run.yaml#/StepRunDiff"
ListPullRequestsResponse:
$ref: "./workflow_run.yaml#/ListPullRequestsResponse"
PullRequest:
$ref: "./workflow_run.yaml#/PullRequest"
PullRequestState:
$ref: "./workflow_run.yaml#/PullRequestState"
61 changes: 61 additions & 0 deletions api-contracts/openapi/components/schemas/github_app.yaml
@@ -0,0 +1,61 @@
GithubBranch:
type: object
properties:
branch_name:
type: string
is_default:
type: boolean
required:
- branch_name
- is_default

GithubRepo:
type: object
properties:
repo_owner:
type: string
repo_name:
type: string
required:
- repo_owner
- repo_name

GithubAppInstallation:
type: object
properties:
metadata:
$ref: "./metadata.yaml#/APIResourceMeta"
installation_settings_url:
type: string
account_name:
type: string
account_avatar_url:
type: string
required:
- metadata
- installation_settings_url
- account_name
- account_avatar_url

ListGithubAppInstallationsResponse:
type: object
properties:
pagination:
$ref: "./metadata.yaml#/PaginationResponse"
rows:
type: array
items:
$ref: "#/GithubAppInstallation"
required:
- pagination
- rows

ListGithubReposResponse:
type: array
items:
$ref: "#/GithubRepo"

ListGithubBranchesResponse:
type: array
items:
$ref: "#/GithubBranch"
17 changes: 17 additions & 0 deletions api-contracts/openapi/components/schemas/metadata.yaml
Expand Up @@ -14,6 +14,23 @@ APIMetaAuth:
example:
- basic
- google
ListAPIMetaIntegration:
type: array
items:
$ref: "#/APIMetaIntegration"
APIMetaIntegration:
type: object
properties:
name:
type: string
description: the name of the integration
example: github
enabled:
type: boolean
description: whether this integration is enabled on the instance
required:
- name
- enabled
APIError:
type: object
properties:
Expand Down
50 changes: 50 additions & 0 deletions api-contracts/openapi/components/schemas/workflow.yaml
Expand Up @@ -24,10 +24,38 @@ Workflow:
items:
$ref: "#/Job"
description: The jobs of the workflow.
deployment:
$ref: "#/WorkflowDeploymentConfig"
required:
- metadata
- name
type: object
WorkflowDeploymentConfig:
properties:
metadata:
$ref: "./metadata.yaml#/APIResourceMeta"
gitRepoName:
type: string
description: The repository name.
gitRepoOwner:
type: string
description: The repository owner.
gitRepoBranch:
type: string
description: The repository branch.
githubAppInstallation:
$ref: "./_index.yaml#/GithubAppInstallation"
description: The Github App installation.
githubAppInstallationId:
type: string
format: uuid
description: The id of the Github App installation.
required:
- metadata
- gitRepoName
- gitRepoOwner
- gitRepoBranch
- githubAppInstallationId

WorkflowTag:
type: object
Expand Down Expand Up @@ -205,3 +233,25 @@ Step:
- jobId
- action
- nextId
LinkGithubRepositoryRequest:
type: object
properties:
installationId:
type: string
description: The repository name.
minLength: 36
maxLength: 36
gitRepoName:
type: string
description: The repository name.
gitRepoOwner:
type: string
description: The repository owner.
gitRepoBranch:
type: string
description: The repository branch.
required:
- installationId
- gitRepoName
- gitRepoOwner
- gitRepoBranch

0 comments on commit 10ab4d0

Please sign in to comment.