Skip to content

Commit

Permalink
resolve pr fails
Browse files Browse the repository at this point in the history
Signed-off-by: Umesh Lumbhani <[email protected]>
  • Loading branch information
umeshlumbhani247 committed Jul 21, 2023
1 parent 1fab081 commit dbed639
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 9 additions & 4 deletions cla-backend-go/utils/gitlab.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright The Linux Foundation and each contributor to CommunityBridge.
// SPDX-License-Identifier: MIT

package utils

import (
Expand Down Expand Up @@ -39,17 +42,19 @@ func PrepareMrCommentContent(missingUsers []*GatedGitlabUser, signedUsers []*git

var body string

const startUl = "<ul>"
const endUl = "<ul>"
result := ""
failed := ":x:"
success := ":white_check_mark:"

if len(signedUsers) > 0 {
result += "<ul>"
result += startUl
for _, signed := range signedUsers {
authorInfo := GetAuthorInfo(signed)
result += fmt.Sprintf("<li>%s %s</li>", success, authorInfo)
}
result += "</ul>"
result += endUl
body = coveredBadge
}

Expand All @@ -58,7 +63,7 @@ func PrepareMrCommentContent(missingUsers []*GatedGitlabUser, signedUsers []*git
// faq := "https://docs.linuxfoundation.org/lfx/easycla/v2-current/getting-started/easycla-troubleshooting#github-unable-to-contribute-to-easycla-enforced-repositories"

if len(missingUsers) > 0 {
result += "<ul>"
result += startUl
for _, missingUser := range missingUsers {
authorInfo := GetAuthorInfo(missingUser.User)
if errors.Is(missingUser.Err, missingCompanyAffiliation) {
Expand All @@ -79,7 +84,7 @@ func PrepareMrCommentContent(missingUsers []*GatedGitlabUser, signedUsers []*git
body = failedBadge
}
}
result += "</ul>"
result += endUl
}

if result != "" {
Expand Down
3 changes: 3 additions & 0 deletions cla-backend-go/v2/gitlab-activity/models/models.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright The Linux Foundation and each contributor to CommunityBridge.
// SPDX-License-Identifier: MIT

package models

// ProcessMergeActivityInput is used to pass the data needed to trigger a gitlab mr check
Expand Down

0 comments on commit dbed639

Please sign in to comment.