Skip to content

Commit b38f502

Browse files
committed
fix git address at task start in workflow notify
Signed-off-by: Patrick Zhao <zhaoyu@koderover.com>
1 parent 1ae4e9d commit b38f502

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

pkg/microservice/aslan/core/common/service/instantmessage/workflow_task.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,10 @@ func (w *Service) getNotificationContent(notify *models.NotifyCtl, task *models.
719719
repos = stepSpec.Repos
720720
}
721721
}
722+
723+
reposBytes, _ := json.Marshal(repos)
724+
log.Infof("status: %s, repos: %s", task.Status, string(reposBytes))
725+
722726
branchTag, commitID, gitCommitURL := "", "", ""
723727
commitMsgs := []string{}
724728
var prInfoList []string

pkg/microservice/aslan/core/workflow/service/workflow/controller/job/job_build.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package job
1818

1919
import (
20+
"encoding/json"
2021
"fmt"
2122
"net/url"
2223
"path"
@@ -518,6 +519,9 @@ func (j BuildJobController) ToTask(taskID int64) ([]*commonmodels.JobTask, error
518519
repos := applyRepos(buildInfo.Repos, build.Repos)
519520
renderRepos(repos, jobTaskSpec.Properties.Envs)
520521

522+
gitreposBytes, _ := json.Marshal(repos)
523+
log.Infof("build job %s, git repos: %s", j.jobSpec.JobName, string(gitreposBytes))
524+
521525
gitRepos, p4Repos := splitReposByType(repos)
522526
gitStep := &commonmodels.StepTask{
523527
Name: build.ServiceName + "-git",

pkg/microservice/aslan/core/workflow/service/workflow/workflow_task_v4.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,8 @@ func CreateWorkflowTaskV4(args *CreateWorkflowTaskV4Args, workflow *commonmodels
658658
return resp, e.ErrCreateTask.AddDesc(err.Error())
659659
}
660660

661+
taskBytes, _ := json.Marshal(workflowTask)
662+
log.Infof("create workflow task: %s", string(taskBytes))
661663
if err := instantmessage.NewWeChatClient().SendWorkflowTaskNotifications(workflowTask); err != nil {
662664
log.Errorf("send workflow task notification failed, error: %v", err)
663665
}

0 commit comments

Comments
 (0)