utils

package
v0.0.0-...-25a8327 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BodyMatches = map[string][]string{
	"kind/panic": {
		"panic",
		"invalid memory address or nil pointer",
	},
}

BodyMatches is a map in which key is the label, and value is a slice of string which can be treated as the label.

View Source
var CIFailsComment = fmt.Sprintf(
	"ping @%s \n%s",
	"%s",
	CIFailsCommentSubStr,
)

CIFailsComment is a string used to attach comment to CI failed PRs.

View Source
var CIFailsCommentSubStr = `` /* 250-byte string literal not displayed */

CIFailsCommentSubStr is a substring of CI failing comments

View Source
var CIFailureLable = "CI-failure"

CIFailureLable is a label which means ci failure.

View Source
var FirstCommitComment = fmt.Sprintf(
	"We found this is your first time to contribute to %s, @%s \n%s",
	"%s",
	"%s",
	FirstCommitCommentSubStr,
)

FirstCommitComment is a comment used to thank a user's first contribution.

View Source
var FirstCommitCommentSubStr = `` /* 234-byte string literal not displayed */

FirstCommitCommentSubStr is a string which is substring of FirstCommitComment

View Source
var IssueDescriptionTooShort = fmt.Sprintf(
	"Thanks for your contribution. 🍻 @%s \n%s",
	"%s",
	IssueDescriptionTooShortSubStr,
)

IssueDescriptionTooShort is a string used to construct the comment.

View Source
var IssueDescriptionTooShortSubStr = `` /* 318-byte string literal not displayed */

IssueDescriptionTooShortSubStr is a sub string used to construct the comment.

View Source
var IssueNeedP1Comment = fmt.Sprintf(
	"Thanks for your report, @%s \n%s",
	"%s",
	IssueNeedP1CommentSubStr,
)

IssueNeedP1Comment is a string used to attach comment on P1 issue.

View Source
var IssueNeedP1CommentSubStr = `😱 This is a **priority/P1** issue which is highest.
Seems to be severe enough.
ping @%s/%s , PTAL.
`

IssueNeedP1CommentSubStr is a string used to attach comment on P1 issue.

View Source
var IssueTitleTooShort = fmt.Sprintf(
	"Thanks for your contribution. 🍻 @%s \n%s",
	"%s",
	IssueTitleTooShortSubStr,
)

IssueTitleTooShort is a string used to construct the comment.

View Source
var IssueTitleTooShortSubStr = `` /* 215-byte string literal not displayed */

IssueTitleTooShortSubStr is a sub string used to construct the comment.

View Source
var Maintainers = []string{
	"allencloud",
	"yyb196",
	"Ace-Tang",
	"skoo87",
	"sunyuan3",
	"furykerry",
	"WIZARD-CXY",
	"skyline09",
	"rudyfly",
	"houqianming",
	"Letty5411",
	"HusterWan",
	"shaloulcy",
}

Maintainers is a list of the maintainers, TODO: this part will be auto-generated according to MAINTAINERS file in repo.

View Source
var PRConflictComment = fmt.Sprintf(
	"ping @%s \n%s",
	"%s",
	PRConflictSubStr,
)

PRConflictComment is a string used to attach comment on conflict PR.

View Source
var PRConflictLabel = "conflict/needs-rebase"

PRConflictLabel is a label which means conflict for pull request.

View Source
var PRConflictSubStr = `` /* 128-byte string literal not displayed */

PRConflictSubStr is a substring of conflict message.

View Source
var PRDescriptionTooShort = fmt.Sprintf(
	"Thanks for your contribution. 🍻  @%s \n%s",
	"%s",
	PRDescriptionTooShortSubStr,
)

PRDescriptionTooShort is a string used to construct the comment.

View Source
var PRDescriptionTooShortSubStr = `` /* 221-byte string literal not displayed */

PRDescriptionTooShortSubStr is a sub string used to construct the comment.

View Source
var PRGapComment = fmt.Sprintf(
	"ping @%s \nWe found that this PR is %s %s",
	"%s", "%s",
	PRGapSubStr,
)

PRGapComment is a string used to attach comment on gap PR.

View Source
var PRGapLabel = "gap/needs-rebase"

PRGapLabel is a label which means gap for pull request.

View Source
var PRGapSubStr = `` /* 133-byte string literal not displayed */

PRGapSubStr is a substring of gap message.

View Source
var PRNeedsSignOff = fmt.Sprintf(
	"@%s %s",
	"%s",
	PRNeedsSignOffStr,
)

PRNeedsSignOff is a string used to remind user to sign off.

View Source
var PRNeedsSignOffStr = ` Thanks for your contribution. 🍻
Please sign off in each of your commits.`

PRNeedsSignOffStr is a string used to remind user to sign off.

View Source
var PRTitleTooShort = fmt.Sprintf(
	"Thanks for your contribution. 🍻  @%s \n%s",
	"%s",
	PRTitleTooShortSubStr,
)

PRTitleTooShort is a string used to construct the comment.

View Source
var PRTitleTooShortSubStr = `` /* 214-byte string literal not displayed */

PRTitleTooShortSubStr is a sub string used to construct the comment.

View Source
var PriorityP1Label = "priority/P1"

PriorityP1Label is a lable which represent P1 priority which is highest.

View Source
var SizeLabelPrefix = "size/"

SizeLabelPrefix presents the prefix of size label name.

View Source
var TitleMatches = map[string][]string{
	"areas/cli": {
		"cli:",
		"cli :",
		"command",
		"command line",
		"command-line",
	},
	"areas/docs": {
		"doc:",
		"docs:",
		"doc :",
		"docs :",
		"document",
	},
	"areas/log": {
		"gelf",
		"fluentd",
		"journald",
		"log",
		"splunk",
		"syslog",
	},
	"areas/images": {
		"docker image",
		"image-spec",
		"pouch pull",
	},
	"areas/monitoring": {
		"monitoring",
		"prometheus",
		"health check",
	},
	"areas/network": {
		"cni",
		"ipvlan",
		"ipsec",
		"macvlan",
		"network",
		"overlay",
		"vlan",
		"vxlan",
	},
	"areas/orchestration": {
		"kubernetes",
		"marathon",
		"mesos",
		"swarm",
		"swarmkit",
	},
	"areas/runv": {
		"runv",
	},
	"areas/storage": {
		"csi",
		"storage",
		"volume",
	},
	"areas/test": {
		"ci",
		"test",
	},
	"areas/typo": {
		"typo",
	},
	"kind/bug": {
		"bug",
		"bugfix",
		"cannot",
		"can not",
		"can't",
		"error",
		"failure",
		"failed to ",
		"fix:",
	},
	"kind/design": {
		"design",
	},
	"kind/feature": {
		"feature",
	},
	"kind/feature-request": {
		"feature request",
		"feature-request",
		"feature_request",
	},
	"kind/panic": {
		"invalid memory address or nil pointer",
		"panic",
	},
	"kind/performance": {
		"performance",
	},
	"kind/proposal": {
		"proposal",
	},
	"kind/question": {
		"can i",
		"can you",
		"confusion",
		"does pouch",
		"how to",
		"question",
		"where to",
	},
	"kind/refactor": {
		"refactor",
	},
	"os/windows": {
		"windows",
		"windows server",
		".net",
	},
	"os/ubuntu": {
		"ubuntu",
	},
	"os/macos": {
		"macos",
		"osx",
	},
	"os/centos": {
		"centos",
	},
	"os/fedora": {
		"fedora",
	},
	"os/suse": {
		"suse",
	},
	"os/freebsd": {
		"freebsd",
	},
	"priority/P1": {
		"panic",
		"invalid memory address or nil pointer",
	},
	"DO-NOT-MERGE": {
		"do not merge",
		"do-not-merge",
		"don't merge",
	},
	"WeeklyReport": {
		"weekly report",
		"weeklyreport",
		"weekreport",
		"week report",
	},
}

TitleMatches is a map in which key is the label, and value is a slice of string which can be treated as the label.

Functions

func DeltaSlice

func DeltaSlice(base, compare []string) []string

DeltaSlice returns a slice which contains element in compare but out of base.

func ExactIssue

func ExactIssue(data []byte) (github.Issue, error)

ExactIssue extracts the issue from request body.

func ExactIssueComment

func ExactIssueComment(data []byte) (github.IssueComment, error)

ExactIssueComment extracts the issue comment from request body.

func ExactIssueLabels

func ExactIssueLabels(data []byte) ([]string, error)

ExactIssueLabels extracts the issue labels from request body.

func ExactPR

func ExactPR(data []byte) (github.PullRequest, error)

ExactPR extracts the pull request from request body.

func ExtractActionType

func ExtractActionType(data []byte) (string, error)

ExtractActionType extracts the action type.

func HasChineseChar

func HasChineseChar(str string) bool

HasChineseChar is function return whether str has Chinese character or not

func SliceContainsElement

func SliceContainsElement(input []string, data string) bool

SliceContainsElement returns true if data is in current slice.

func SliceContainsSlice

func SliceContainsSlice(old, new []string) bool

SliceContainsSlice returns true if a slice contains another one

func UniqueElementSlice

func UniqueElementSlice(data []string) []string

UniqueElementSlice returns a slice with no element duplicated.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL