formatting

package
v0.21.4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Age

func Age(t *metav1.Time, c clockwork.Clock) string

func CamelCasit

func CamelCasit(s string) string

CamelCasit pull_request > PullRequest

func CleanValueKubernetes added in v0.18.0

func CleanValueKubernetes(s string) string

CleanValueKubernetes k8s do not like slash in labels value and on push we have the full ref, we replace the "/" by "-". The tools probably need to be aware of it when querying.

valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')

func ConditionEmoji

func ConditionEmoji(c knative1.Conditions) string

func ConditionSad added in v0.12.0

func ConditionSad(c knative1.Conditions) string

func Duration

func Duration(t1, t2 *metav1.Time) string

func GetRepoOwnerFromURL

func GetRepoOwnerFromURL(ghURL string) (string, error)

func GetRepoOwnerSplitted

func GetRepoOwnerSplitted(u string) (string, string, error)

func PRDuration added in v0.13.0

func PRDuration(runStatus v1alpha1.RepositoryRunStatus) string

PRDuration calculates the duration of a repository run, given its status. It takes a RepositoryRunStatus object as input. It returns a string with the duration of the run, or nonAttributedStr if the run has not started or completed.

func PipelineRunStatus

func PipelineRunStatus(pr *tektonv1.PipelineRun) string

PipelineRunStatus return status of PR success failed or skipped

func SanitizeBranch

func SanitizeBranch(s string) string

SanitizeBranch remove refs/heads from string, only removing the first prefix in case we have branch that are actually called refs-heads 🙃

func ShortSHA

func ShortSHA(sha string) string

ShortSHA returns a shortsha

func ShowLastAge

func ShowLastAge(repository v1alpha1.Repository, cw clockwork.Clock) string

func ShowLastSHA

func ShowLastSHA(repository v1alpha1.Repository) string

func ShowStatus

func ShowStatus(repository v1alpha1.Repository, cs *cli.ColorScheme) string

func Timeout

func Timeout(t *metav1.Duration) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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