Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

26
vendor/k8s.io/test-infra/prow/gitserver/BUILD.bazel generated vendored Normal file
View File

@@ -0,0 +1,26 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"helpers.go",
"types.go",
],
importpath = "k8s.io/test-infra/prow/gitserver",
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

34
vendor/k8s.io/test-infra/prow/gitserver/helpers.go generated vendored Normal file
View File

@@ -0,0 +1,34 @@
package gitserver
import (
"strings"
)
// HasLabel checks if label is in the label set "issueLabels".
func HasLabel(label string, issueLabels []Label) bool {
for _, l := range issueLabels {
if strings.ToLower(l.Name) == strings.ToLower(label) {
return true
}
}
return false
}
// ChangedLabels describe a gitlab PR changed labels
func ChangedLabels(action PullRequestEventAction, previous, current []Label) []Label {
labels := make([]Label, 0)
if action == PullRequestActionLabeled {
for _, l := range current {
if !HasLabel(l.Name, previous) {
labels = append(labels, l)
}
}
} else if action == PullRequestActionUnlabeled {
for _, l := range previous {
if !HasLabel(l.Name, current) {
labels = append(labels, l)
}
}
}
return labels
}

1024
vendor/k8s.io/test-infra/prow/gitserver/types.go generated vendored Normal file

File diff suppressed because it is too large Load Diff