Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improved ack #213

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "hatchet"]
path = hatchet
url = [email protected]:hatchet-dev/hatchet.git
branch = main
branch = feat--improved-sdk-ack
2 changes: 1 addition & 1 deletion hatchet
Submodule hatchet updated 39 files
+1 −1 .github/workflows/test.yml
+2 −0 api-contracts/dispatcher/dispatcher.proto
+2 −0 api-contracts/openapi/components/schemas/_index.yaml
+7 −0 api-contracts/openapi/components/schemas/tenant.yaml
+2 −0 api-contracts/openapi/components/schemas/workflow_run.yaml
+2 −0 api-contracts/openapi/openapi.yaml
+44 −0 api-contracts/openapi/paths/tenant/tenant.yaml
+24 −0 api/v1/server/handlers/tenants/get_step_run_queue_metrics.go
+282 −179 api/v1/server/oas/gen/openapi.gen.go
+18 −0 frontend/app/src/lib/api/generated/Api.ts
+6 −0 frontend/app/src/lib/api/generated/data-contracts.ts
+5 −0 frontend/app/src/lib/api/queries.ts
+2 −0 frontend/app/src/pages/main/workflow-runs/$run/components/step-run-events.tsx
+2 −0 frontend/app/src/pages/main/workflow-runs/$run/v2components/events-columns.tsx
+1 −1 frontend/app/src/pages/main/workflow-runs/components/workflow-runs-table.tsx
+1 −1 frontend/docs/pages/home/features/webhooks.mdx
+2 −2 go.mod
+4 −4 go.sum
+3 −0 internal/msgqueue/msgqueue.go
+8 −2 internal/msgqueue/rabbitmq/rabbitmq.go
+1 −1 internal/services/admin/contracts/workflows.pb.go
+1 −1 internal/services/admin/contracts/workflows_grpc.pb.go
+6 −2 internal/services/controllers/jobs/queue.go
+5 −1 internal/services/controllers/workflows/controller.go
+21 −11 internal/services/dispatcher/contracts/dispatcher.pb.go
+1 −1 internal/services/dispatcher/contracts/dispatcher_grpc.pb.go
+48 −12 internal/services/dispatcher/server.go
+1 −1 internal/services/ingestor/contracts/events.pb.go
+1 −1 internal/services/ingestor/contracts/events_grpc.pb.go
+5 −4 internal/services/shared/tasktypes/job.go
+140 −0 pkg/client/rest/gen.go
+4 −0 pkg/repository/prisma/db/db_gen.go
+2 −0 pkg/repository/prisma/dbsqlc/models.go
+1 −1 pkg/repository/prisma/dbsqlc/schema.sql
+10 −0 prisma/migrations/20241002170025_tmp/migration.sql
+2 −0 prisma/schema.prisma
+4 −0 sql/migrations/20241002170033_tmp.sql
+2 −1 sql/migrations/atlas.sum
+1 −1 sql/schema/schema.sql
15 changes: 15 additions & 0 deletions hatchet_sdk/clients/rest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from hatchet_sdk.clients.rest.api.healthcheck_api import HealthcheckApi
from hatchet_sdk.clients.rest.api.log_api import LogApi
from hatchet_sdk.clients.rest.api.metadata_api import MetadataApi
from hatchet_sdk.clients.rest.api.rate_limits_api import RateLimitsApi
from hatchet_sdk.clients.rest.api.slack_api import SlackApi
from hatchet_sdk.clients.rest.api.sns_api import SNSApi
from hatchet_sdk.clients.rest.api.step_run_api import StepRunApi
Expand Down Expand Up @@ -122,6 +123,14 @@
from hatchet_sdk.clients.rest.models.pull_request import PullRequest
from hatchet_sdk.clients.rest.models.pull_request_state import PullRequestState
from hatchet_sdk.clients.rest.models.queue_metrics import QueueMetrics
from hatchet_sdk.clients.rest.models.rate_limit import RateLimit
from hatchet_sdk.clients.rest.models.rate_limit_list import RateLimitList
from hatchet_sdk.clients.rest.models.rate_limit_order_by_direction import (
RateLimitOrderByDirection,
)
from hatchet_sdk.clients.rest.models.rate_limit_order_by_field import (
RateLimitOrderByField,
)
from hatchet_sdk.clients.rest.models.recent_step_runs import RecentStepRuns
from hatchet_sdk.clients.rest.models.reject_invite_request import RejectInviteRequest
from hatchet_sdk.clients.rest.models.replay_event_request import ReplayEventRequest
Expand Down Expand Up @@ -165,6 +174,9 @@
from hatchet_sdk.clients.rest.models.tenant_resource import TenantResource
from hatchet_sdk.clients.rest.models.tenant_resource_limit import TenantResourceLimit
from hatchet_sdk.clients.rest.models.tenant_resource_policy import TenantResourcePolicy
from hatchet_sdk.clients.rest.models.tenant_step_run_queue_metrics import (
TenantStepRunQueueMetrics,
)
from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import (
TriggerWorkflowRunRequest,
)
Expand Down Expand Up @@ -240,6 +252,9 @@
WorkflowTriggerEventRef,
)
from hatchet_sdk.clients.rest.models.workflow_triggers import WorkflowTriggers
from hatchet_sdk.clients.rest.models.workflow_update_request import (
WorkflowUpdateRequest,
)
from hatchet_sdk.clients.rest.models.workflow_version import WorkflowVersion
from hatchet_sdk.clients.rest.models.workflow_version_definition import (
WorkflowVersionDefinition,
Expand Down
1 change: 1 addition & 0 deletions hatchet_sdk/clients/rest/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from hatchet_sdk.clients.rest.api.healthcheck_api import HealthcheckApi
from hatchet_sdk.clients.rest.api.log_api import LogApi
from hatchet_sdk.clients.rest.api.metadata_api import MetadataApi
from hatchet_sdk.clients.rest.api.rate_limits_api import RateLimitsApi
from hatchet_sdk.clients.rest.api.slack_api import SlackApi
from hatchet_sdk.clients.rest.api.sns_api import SNSApi
from hatchet_sdk.clients.rest.api.step_run_api import StepRunApi
Expand Down
21 changes: 9 additions & 12 deletions hatchet_sdk/clients/rest/api/api_token_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,9 @@ def _api_token_create_serialize(
_body_params = create_api_token_request

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# set the HTTP header `Content-Type`
if _content_type:
Expand Down Expand Up @@ -567,10 +566,9 @@ def _api_token_list_serialize(
# process the body parameter

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
Expand Down Expand Up @@ -828,10 +826,9 @@ def _api_token_update_revoke_serialize(
# process the body parameter

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
Expand Down
42 changes: 18 additions & 24 deletions hatchet_sdk/clients/rest/api/default_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,9 @@ def _tenant_invite_delete_serialize(
# process the body parameter

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
Expand Down Expand Up @@ -640,10 +639,9 @@ def _tenant_invite_update_serialize(
_body_params = update_tenant_invite_request

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# set the HTTP header `Content-Type`
if _content_type:
Expand Down Expand Up @@ -929,10 +927,9 @@ def _webhook_create_serialize(
_body_params = webhook_worker_create_request

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# set the HTTP header `Content-Type`
if _content_type:
Expand Down Expand Up @@ -1203,10 +1200,9 @@ def _webhook_delete_serialize(
# process the body parameter

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
Expand Down Expand Up @@ -1467,10 +1463,9 @@ def _webhook_list_serialize(
# process the body parameter

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
Expand Down Expand Up @@ -1731,10 +1726,9 @@ def _webhook_requests_list_serialize(
# process the body parameter

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
Expand Down
56 changes: 24 additions & 32 deletions hatchet_sdk/clients/rest/api/event_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,9 @@ def _event_create_serialize(
_body_params = create_event_request

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# set the HTTP header `Content-Type`
if _content_type:
Expand Down Expand Up @@ -612,10 +611,9 @@ def _event_create_bulk_serialize(
_body_params = bulk_create_event_request

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# set the HTTP header `Content-Type`
if _content_type:
Expand Down Expand Up @@ -883,10 +881,9 @@ def _event_data_get_serialize(
# process the body parameter

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
Expand Down Expand Up @@ -1144,10 +1141,9 @@ def _event_get_serialize(
# process the body parameter

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
Expand Down Expand Up @@ -1405,10 +1401,9 @@ def _event_key_list_serialize(
# process the body parameter

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
Expand Down Expand Up @@ -1920,10 +1915,9 @@ def _event_list_serialize(
# process the body parameter

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
Expand Down Expand Up @@ -2205,10 +2199,9 @@ def _event_update_cancel_serialize(
_body_params = cancel_event_request

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# set the HTTP header `Content-Type`
if _content_type:
Expand Down Expand Up @@ -2500,10 +2493,9 @@ def _event_update_replay_serialize(
_body_params = replay_event_request

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# set the HTTP header `Content-Type`
if _content_type:
Expand Down
7 changes: 3 additions & 4 deletions hatchet_sdk/clients/rest/api/github_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,9 @@ def _sns_update_serialize(
# process the body parameter

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = []
Expand Down
7 changes: 3 additions & 4 deletions hatchet_sdk/clients/rest/api/log_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,9 @@ def _log_line_list_serialize(
# process the body parameter

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
Expand Down
21 changes: 9 additions & 12 deletions hatchet_sdk/clients/rest/api/metadata_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,9 @@ def _cloud_metadata_get_serialize(
# process the body parameter

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = []
Expand Down Expand Up @@ -470,10 +469,9 @@ def _metadata_get_serialize(
# process the body parameter

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = []
Expand Down Expand Up @@ -698,10 +696,9 @@ def _metadata_list_integrations_serialize(
# process the body parameter

# set the HTTP header `Accept`
if "Accept" not in _header_params:
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
_header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# authentication setting
_auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
Expand Down
Loading
Loading