Skip to content

Commit 40a31d0

Browse files
authored
Merge pull request #1529 from diggerhq/fix/jobtype-serialization
fix string serialization
2 parents a65c07f + 469568e commit 40a31d0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libs/comment_utils/summary/updater.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func (b BasicCommentUpdater) UpdateComment(jobs []scheduler.SerializedJob, prNum
2424
}
2525
firstJobSpec := jobSpecs[0]
2626
jobType := firstJobSpec.JobType
27-
isPlan := jobType == orchestrator.DiggerCommandPlan
27+
isPlan := jobType == string(orchestrator.DiggerCommandPlan)
2828
jobTypeTitle := cases.Title(language.AmericanEnglish).String(string(jobType))
2929
message := ""
3030
if isPlan {

libs/orchestrator/json_models.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type StageJson struct {
1818
}
1919

2020
type JobJson struct {
21-
JobType DiggerCommand `json:"job_type"`
21+
JobType string `json:"job_type"`
2222
ProjectName string `json:"projectName"`
2323
ProjectDir string `json:"projectDir"`
2424
ProjectWorkspace string `json:"projectWorkspace"`
@@ -58,7 +58,7 @@ func JobToJson(job Job, jobType DiggerCommand, organisationName string, jobToken
5858
commandRole = project.AwsRoleToAssume.Command
5959
}
6060
return JobJson{
61-
JobType: jobType,
61+
JobType: string(jobType),
6262
ProjectName: job.ProjectName,
6363
ProjectDir: job.ProjectDir,
6464
ProjectWorkspace: job.ProjectWorkspace,

0 commit comments

Comments
 (0)