Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions plugins/auto_merge/checks/has_enough_approvals.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ func (check HasEnoughApprovalsCheck) Check(config *config.AutoMergeConfig, proje
missingApprovalForLabels[mergeRequest.ID] = []string{}

for _, neededApproval := range config.NeededApprovals {
if neededApproval.Label == "" || len(neededApproval.Users) == 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukashass We have a check further down where we check if the label is correct by means of existence. We should use this check for validation in my opinion instead of only checking for empty label.

log.Warn("Invalid needed approval config")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukashass Can we make this somehow visible in the gitlab comment of lassie so that users can see it?

return false
}

// skip (don't require approval) if the label does not exists on the MR and the required label is not a wildcard (always check)
if !utils.StringInSlice(neededApproval.Label, mergeRequest.Labels) && neededApproval.Label != "*" {
continue
Expand Down