Skip to content

Commit

Permalink
fix: periodic interval did not handle empty values correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
jippi committed Aug 30, 2024
1 parent 2c986a0 commit 7009838
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/scm/gitlab/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ package gitlab
// "project_topics": ["scm-engine"],
// "project_membership": true,
// "mr_ignore_labels": ["security", "do-not-close"],
// "mr_ignore_labels": []
// "mr_require_labels": null
// }

type PeriodicEvaluationResult struct {
Expand Down
12 changes: 9 additions & 3 deletions pkg/scm/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,21 @@ func (filter *MergeRequestListFilters) AsGraphqlVariables() map[string]any {
}

if len(filter.IgnoreMergeRequestWithLabels) == 0 {
output["mr_ignore_labels"] = []string{}
var emptyStringSlice []string

output["mr_ignore_labels"] = Ptr(emptyStringSlice)
}

if len(filter.OnlyMergeRequestsWithLabels) == 0 {
output["mr_require_labels"] = []string{}
var emptyStringSlice []string

output["mr_require_labels"] = Ptr(emptyStringSlice)
}

if len(filter.OnlyProjectsWithTopics) == 0 {
output["project_topics"] = []string{}
var emptyStringSlice []string

output["project_topics"] = Ptr(emptyStringSlice)
}

if len(filter.SCMConfigurationFilePath) == 0 {
Expand Down

0 comments on commit 7009838

Please sign in to comment.