diff --git a/pkg/microservice/aslan/core/common/service/workflowcontroller/jobcontroller/job_apisix.go b/pkg/microservice/aslan/core/common/service/workflowcontroller/jobcontroller/job_apisix.go index 0ccf544bdd..8306bf4ca9 100644 --- a/pkg/microservice/aslan/core/common/service/workflowcontroller/jobcontroller/job_apisix.go +++ b/pkg/microservice/aslan/core/common/service/workflowcontroller/jobcontroller/job_apisix.go @@ -20,6 +20,7 @@ import ( "context" "encoding/json" "fmt" + "log" "go.uber.org/zap" @@ -288,6 +289,7 @@ func (c *ApisixJobCtl) executeServiceTask(client *apisix.Client, task *commonmod } func (c *ApisixJobCtl) executeProtoTask(client *apisix.Client, task *commonmodels.ApisixItemUpdateSpec) error { + log.Printf("execute proto task: %v", task.UserSpec) proto, err := convertToProto(task.UserSpec) if err != nil { @@ -296,6 +298,7 @@ func (c *ApisixJobCtl) executeProtoTask(client *apisix.Client, task *commonmodel switch task.Action { case config.ApisixActionTypeCreate: + log.Printf("create proto: %v", proto) resp, err := client.UpdateProto(proto.ID, proto) if err != nil { return err @@ -306,6 +309,7 @@ func (c *ApisixJobCtl) executeProtoTask(client *apisix.Client, task *commonmodel return nil case config.ApisixActionTypeUpdate: + log.Printf("update proto: %v", proto) if proto.ID == "" { return fmt.Errorf("proto id is required for update operation") } @@ -399,6 +403,18 @@ func convertToProto(spec interface{}) (*apisix.Proto, error) { if err := json.Unmarshal(data, proto); err != nil { return nil, fmt.Errorf("failed to unmarshal to proto: %v", err) } + + log.Printf("userSpec convertToProto: %v", proto) + + // bug point dont touch it! + // if delete it , proto in apisix will fail to run + if proto.Name == "" { + proto.Desc = proto.ID + proto.Name = proto.ID + log.Printf("proto for name is empty: %v", proto) + return proto, nil + } + proto.Desc = proto.Name proto.ID = proto.Name diff --git a/pkg/microservice/aslan/core/system/service/apisix.go b/pkg/microservice/aslan/core/system/service/apisix.go index c63c83cf5d..cc84c08003 100644 --- a/pkg/microservice/aslan/core/system/service/apisix.go +++ b/pkg/microservice/aslan/core/system/service/apisix.go @@ -153,6 +153,7 @@ func ListApisixProtos(id string, page, pageSize int, log *zap.SugaredLogger) (*S // Extract only the values from the response protos := make([]*apisix.Proto, 0, len(resp.List)) for _, item := range resp.List { + log.Infof("proto response key: %s, value: %+v", item.Key, item.Value) if item.Value != nil { protos = append(protos, item.Value) } diff --git a/pkg/microservice/aslan/core/workflow/handler/workflow_task_v4.go b/pkg/microservice/aslan/core/workflow/handler/workflow_task_v4.go index b5a7294464..62f13bde4a 100644 --- a/pkg/microservice/aslan/core/workflow/handler/workflow_task_v4.go +++ b/pkg/microservice/aslan/core/workflow/handler/workflow_task_v4.go @@ -75,6 +75,7 @@ func CreateWorkflowTaskV4(c *gin.Context) { } ticketID := c.Query("approval_ticket_id") + ctx.Logger.Infof("CreateWorkflowTaskV4 request params: projectName=%s, approvalTicketID=%s, workflowName=%s, workflowDisplayName=%s, userName=%s, userID=%s, isSystemAdmin=%v, body=%s", c.Query("projectName"), ticketID, args.Name, args.DisplayName, ctx.UserName, ctx.UserID, ctx.Resources.IsSystemAdmin, data) internalhandler.InsertOperationLog(c, ctx.UserName, args.Project, "新建", "工作流任务", args.Name, args.Name, data, types.RequestBodyTypeJSON, ctx.Logger) @@ -283,6 +284,7 @@ func CloneWorkflowTaskV4(c *gin.Context) { ctx.RespErr = e.ErrInvalidParam.AddDesc("invalid task id") return } + ctx.Logger.Infof("CloneWorkflowTaskV4 request params: projectName=%s, workflowName=%s, taskID=%d, userName=%s, userID=%s, isSystemAdmin=%v", projectKey, workflowName, taskID, ctx.UserName, ctx.UserID, ctx.Resources.IsSystemAdmin) internalhandler.InsertOperationLog(c, ctx.UserName, projectKey, "克隆", "工作流任务", c.Param("workflowName"), c.Param("workflowName"), "", types.RequestBodyTypeJSON, ctx.Logger) // authorization check diff --git a/pkg/microservice/aslan/core/workflow/service/workflow/workflow_task_v4.go b/pkg/microservice/aslan/core/workflow/service/workflow/workflow_task_v4.go index 5dae8fa0df..b70663ef75 100644 --- a/pkg/microservice/aslan/core/workflow/service/workflow/workflow_task_v4.go +++ b/pkg/microservice/aslan/core/workflow/service/workflow/workflow_task_v4.go @@ -514,6 +514,8 @@ func CreateWorkflowTaskV4ByBuildInTrigger(triggerName string, args *commonmodels } func CreateWorkflowTaskV4(args *CreateWorkflowTaskV4Args, workflow *commonmodels.WorkflowV4, log *zap.SugaredLogger) (*CreateTaskV4Resp, error) { + log.Infof("CreateWorkflowTaskV4 service params: workflowName=%s, projectName=%s, creator=%s, creatorID=%s, type=%s, approvalTicketID=%s, skipWorkflowUpdate=%v", workflow.Name, workflow.Project, args.Name, args.UserID, args.Type, args.ApprovalTicketID, args.SkipWorkflowUpdate) + resp := &CreateTaskV4Resp{ ProjectName: workflow.Project, WorkflowName: workflow.Name, @@ -914,6 +916,8 @@ func GetManualExecWorkflowTaskV4Info(workflowName string, taskID int64, logger * } func CloneWorkflowTaskV4(workflowName string, taskID int64, isView bool, logger *zap.SugaredLogger) (*commonmodels.WorkflowV4, error) { + logger.Infof("CloneWorkflowTaskV4 service params: workflowName=%s, taskID=%d, isView=%v", workflowName, taskID, isView) + originalWorkflow, err := commonrepo.NewWorkflowV4Coll().Find(workflowName) if err != nil { logger.Errorf("find workflowV4 error: %s", err)