Skip to content

Commit

Permalink
Merge branch 'fix/exec_workflow' into 'main'
Browse files Browse the repository at this point in the history
Fix temporal workflow run param

See merge request product/starhub/starhub-server!782
  • Loading branch information
yiling.ji authored and Yiling-J committed Jan 3, 2025
1 parent b758a8b commit 162e160
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
5 changes: 2 additions & 3 deletions api/handler/callback/git_callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ func (h *GitCallbackHandler) handlePush(c *gin.Context) {
TaskQueue: workflow.HandlePushQueueName,
}

we, err := workflowClient.ExecuteWorkflow(c, workflowOptions, workflow.HandlePushWorkflow,
&req,
h.config,
we, err := workflowClient.ExecuteWorkflow(
c, workflowOptions, workflow.HandlePushWorkflow, &req,
)
if err != nil {
slog.Error("failed to handle git push callback", slog.Any("error", err))
Expand Down
5 changes: 2 additions & 3 deletions api/handler/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,8 @@ func (h *InternalHandler) PostReceive(ctx *gin.Context) {
TaskQueue: workflow.HandlePushQueueName,
}

we, err := h.temporalClient.ExecuteWorkflow(ctx, workflowOptions, workflow.HandlePushWorkflow,
callback,
h.config,
we, err := h.temporalClient.ExecuteWorkflow(
ctx, workflowOptions, workflow.HandlePushWorkflow, callback,
)
if err != nil {
slog.Error("failed to handle git push callback", slog.Any("error", err))
Expand Down
2 changes: 1 addition & 1 deletion api/handler/internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func TestInternalHandler_PostReceive(t *testing.T) {
tester.ctx, client.StartWorkflowOptions{
TaskQueue: workflow.HandlePushQueueName,
}, mock.Anything,
&types.GiteaCallbackPushReq{Ref: "ref/heads/main"}, &config.Config{},
&types.GiteaCallbackPushReq{Ref: "ref/heads/main"},
).Return(
runMock, nil,
)
Expand Down
5 changes: 2 additions & 3 deletions cmd/csghub-server/cmd/trigger/git_callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@ var gitCallbackCmd = &cobra.Command{
TaskQueue: workflow.HandlePushQueueName,
}

we, err := workflowClient.ExecuteWorkflow(context.Background(), workflowOptions, workflow.HandlePushWorkflow,
req,
config,
we, err := workflowClient.ExecuteWorkflow(
context.Background(), workflowOptions, workflow.HandlePushWorkflow, req,
)
if err != nil {
slog.Error("failed to handle git push callback", slog.String("repo", repo.Path), slog.Any("error", err))
Expand Down
5 changes: 2 additions & 3 deletions mirror/reposyncer/local_woker.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,8 @@ func (w *LocalMirrorWoker) SyncRepo(ctx context.Context, task queue.MirrorTask)
TaskQueue: workflow.HandlePushQueueName,
}

we, err := workflowClient.ExecuteWorkflow(ctx, workflowOptions, workflow.HandlePushWorkflow,
callback,
w.config,
we, err := workflowClient.ExecuteWorkflow(
ctx, workflowOptions, workflow.HandlePushWorkflow, callback,
)
if err != nil {
return fmt.Errorf("failed to handle git push callback: %w", err)
Expand Down

0 comments on commit 162e160

Please sign in to comment.