utils

package
v0.0.0-...-9c90d3e Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMultipleFilters

func AddMultipleFilters(argType string, params []string,
	args map[string]interface{}) (inClause string, arg map[string]interface{})

AddMultipleFilters forms the IN query statements

func Chunk

func Chunk(chunkSize, total int, fn func(start int, end int) error) error

func CreateRunnerLabels

func CreateRunnerLabels(id, buildID, jobID, mode, repo string) map[string]string

CreateRunnerLabels returns runner label

func EncodeCursor

func EncodeCursor(value string) string

EncodeCursor base64 encode the cursor value

func EncodeOffset

func EncodeOffset(value int) string

EncodeOffset base64 encode the offset value

func GenerateUUID

func GenerateUUID() string

GenerateUUID generates uuid v4

func GetAuthorName

func GetAuthorName(author *scm.Signature) string

GetAuthorName utility function to identify name in a more reliable manner from scm

func GetBuildHashKey

func GetBuildHashKey(buildID string) string

GetBuildHashKey generates the redis hash from buildID

func GetFileNameFromTestLocator

func GetFileNameFromTestLocator(testLocator string) (fileName string)

GetFileNameFromTestLocator extracts the file name from the test locator

func GetFlakyComment

func GetFlakyComment(flakyTestCount int, frontendURL, gitProvider, repoSlug, buildID string) string

func GetNucleusPodName

func GetNucleusPodName(taskID string) string

GetNucleusPodName generates the nucleus pod name from taskID

func GetOrgHashKey

func GetOrgHashKey(orgID string) string

GetOrgHashKey generates the redis hash from orgID

func GetRepoSecretName

func GetRepoSecretName(buildID string) string

GetRepoSecretName returns the repo secret name for k8s resource

func GetRunnerNamespaceFromOrgID

func GetRunnerNamespaceFromOrgID(orgID string) string

GetRunnerNamespaceFromOrgID generates the namespace from orgID

func GetSpawnedPodsMapKey

func GetSpawnedPodsMapKey(buildID, taskID string) string

GetSpawnedPodsMapKey returns the key for spawned pods map for build abort service

func GetTokenSecretName

func GetTokenSecretName(buildID string) string

GetTokenSecretName returns the token secret name for k8s resource

func Max

func Max(x, y int) int

Max returns the larger of x or y.

func Min

func Min(x, y int) int

Min returns the smaller of x or y.

func QueueJobFinshed

func QueueJobFinshed(status core.QueueStatus) bool

QueueJobFinshed utility function to check if queue job finished.

func QueueStatus

func QueueStatus(status core.Status) core.QueueStatus

QueueStatus utility function to map task status to queue status

func RandString

func RandString(n int) string

RandString generates a random string of size n

func Reverse

func Reverse(list [][]int) (reversedList [][]int)

Reverse reverses the 2d slice.

func TaskFinished

func TaskFinished(status core.Status) bool

TaskFinished utility function to check if task finished.

Types

This section is empty.

Jump to

Keyboard shortcuts

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