• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / integration-test-runner / 1632184707

20 Jan 2025 07:58AM UTC coverage: 64.315%. Remained the same
1632184707

Pull #347

gitlab-ci

web-flow
chore: bump gitlab.com/gitlab-org/api/client-go

Bumps the golang-dependencies group with 1 update: [gitlab.com/gitlab-org/api/client-go](https://gitlab.com/gitlab-org/api/client-go).


Updates `gitlab.com/gitlab-org/api/client-go` from 0.119.0 to 0.120.0
- [Release notes](https://gitlab.com/gitlab-org/api/client-go/tags)
- [Commits](https://gitlab.com/gitlab-org/api/client-go/compare/v0.119.0...v0.120.0)

---
updated-dependencies:
- dependency-name: gitlab.com/gitlab-org/api/client-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #347: chore: bump gitlab.com/gitlab-org/api/client-go from 0.119.0 to 0.120.0 in the golang-dependencies group

1732 of 2693 relevant lines covered (64.31%)

2.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/util.go
1
package main
2

3
import (
4
        "fmt"
5

6
        "github.com/google/go-github/v28/github"
7
)
8

9
type gitProtocol int
10

11
const (
12
        gitProtocolSSH gitProtocol = iota
13
        gitProtocolHTTP
14
)
15

16
func getRemoteURLGitHub(proto gitProtocol, org, repo string) string {
24✔
17
        if proto == gitProtocolSSH {
26✔
18
                return "git@github.com:/" + org + "/" + repo + ".git"
2✔
19
        } else if proto == gitProtocolHTTP {
46✔
20
                return "https://github.com/" + org + "/" + repo
22✔
21
        }
22✔
22
        return ""
×
23
}
24

25
func getRemoteURLGitLab(org, repo string) (string, error) {
5✔
26
        // By default, the GitLab project is Northern.tech/<group>/<repo>
5✔
27
        group, ok := gitHubOrganizationToGitLabGroup[org]
5✔
28
        if !ok {
6✔
29
                return "", fmt.Errorf("Unrecognized organization %q", org)
1✔
30
        }
1✔
31
        remoteURL := "git@gitlab.com:Northern.tech/" + group + "/" + repo
4✔
32

4✔
33
        // Override for some specific repos have custom GitLab group/project
4✔
34
        if v, ok := gitHubRepoToGitLabProjectCustom[repo]; ok {
5✔
35
                remoteURL = "git@gitlab.com:" + v
1✔
36
        }
1✔
37
        return remoteURL, nil
4✔
38
}
39

40
func getGitHubOrganization(webhookType string, webhookEvent interface{}) (string, error) {
16✔
41
        switch webhookType {
16✔
42
        case "pull_request":
3✔
43
                pr := webhookEvent.(*github.PullRequestEvent)
3✔
44
                return pr.GetOrganization().GetLogin(), nil
3✔
45
        case "push":
3✔
46
                push := webhookEvent.(*github.PushEvent)
3✔
47
                return push.GetRepo().GetOrganization(), nil
3✔
48
        case "issue_comment":
12✔
49
                comment := webhookEvent.(*github.IssueCommentEvent)
12✔
50
                return comment.GetRepo().GetOwner().GetLogin(), nil
12✔
51
        }
52
        return "", fmt.Errorf(
×
53
                "getGitHubOrganization cannot get organization from webhook type %q",
×
54
                webhookType,
×
55
        )
×
56

57
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc