Skip to content

Commit

Permalink
fix: use description during NewProjectTrigger creation
Browse files Browse the repository at this point in the history
  • Loading branch information
lourens-octopus committed Dec 4, 2024
1 parent d53c52f commit ff8eb73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions pkg/triggers/project_trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ type ProjectTrigger struct {

func NewProjectTrigger(name string, description string, isDisabled bool, project *projects.Project, action actions.ITriggerAction, filter filters.ITriggerFilter) *ProjectTrigger {
return &ProjectTrigger{
Action: action,
Filter: filter,
IsDisabled: isDisabled,
Name: name,
ProjectID: project.GetID(),
SpaceID: project.SpaceID,
Resource: *resources.NewResource(),
Action: action,
Filter: filter,
IsDisabled: isDisabled,
Name: name,
Description: description,
ProjectID: project.GetID(),
SpaceID: project.SpaceID,
Resource: *resources.NewResource(),
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/triggers/project_trigger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestTriggerJsonSerialization(t *testing.T) {

// note that Go puts a 'Z' on the time
assert.Equal(t, heredoc.Doc(`
{"Action":{"ShouldRedeployWhenMachineHasBeenDeployedTo":true,"ActionType":"AutoDeploy"},"Filter":{"MonthlyScheduleType":"DayOfMonth","DayNumberOfMonth":"1","StartTime":"2021-12-14T09:00:00Z","Timezone":"Asia/Kuala_Lumpur","FilterType":"DaysPerMonthSchedule"},"IsDisabled":false,"Name":"triggerName","ProjectId":"Projects-123","SpaceId":""}
{"Action":{"ShouldRedeployWhenMachineHasBeenDeployedTo":true,"ActionType":"AutoDeploy"},"Description":"triggerDescription","Filter":{"MonthlyScheduleType":"DayOfMonth","DayNumberOfMonth":"1","StartTime":"2021-12-14T09:00:00Z","Timezone":"Asia/Kuala_Lumpur","FilterType":"DaysPerMonthSchedule"},"IsDisabled":false,"Name":"triggerName","ProjectId":"Projects-123","SpaceId":""}
`), output.String())
})

Expand Down

0 comments on commit ff8eb73

Please sign in to comment.