github

package
v0.0.0-...-13b476a Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const StatusError = "error"
View Source
const StatusFailure = "failure"
View Source
const StatusPending = "pending"
View Source
const StatusSuccess = "success"

Variables

This section is empty.

Functions

func AppMarkdownEnd

func AppMarkdownEnd() string

Helper to generate markdown for the end of argo-diff's PR comment

func AppMarkdownStart

func AppMarkdownStart(appName, warnStr string, syncStatus v1alpha1.SyncStatusCode, healthStatus health.HealthStatusCode, healthMsg string) string

Helper to generate markdown for pre-amble of argo-diff's PR comment

func Comment

func Comment(ctx context.Context, owner, repo string, prNum int, sha string, commentBodies []string) ([]*github.IssueComment, error)

Creates or updates comment on the specified pull request

func ConnectivityCheck

func ConnectivityCheck() error

func GetPullRequest

func GetPullRequest(ctx context.Context, owner, repo string, prNum int) (*github.PullRequest, error)

Gets the specified pull request

func ResourceDiffMarkdown

func ResourceDiffMarkdown(apiVersion, kind, name, ns, diffStr string) string

Helper to generate markdown a diff in argo-diff's PR comment

func Status

func Status(ctx context.Context, isPr bool, status, description, repoOwner, repoName, commitSha string, dryRun bool) error

Helper that sets commit status for the request commit sha

Types

type ArgoAppMarkdown

type ArgoAppMarkdown struct {
	AppName      string
	WarnStr      string
	SyncStatus   v1alpha1.SyncStatusCode
	HealthStatus health.HealthStatusCode
	HealthMsg    string
	Preamble     string
	Resources    []string
	Closing      string
}

func (*ArgoAppMarkdown) AddResourceDiff

func (a *ArgoAppMarkdown) AddResourceDiff(apiVersion, kind, name, ns, diffStr string)

func (ArgoAppMarkdown) OverviewStr

func (a ArgoAppMarkdown) OverviewStr(continued bool) string

type CommentMarkdown

type CommentMarkdown struct {
	Preamble string
	ArgoApps []ArgoAppMarkdown
	Closing  string
}

func (*CommentMarkdown) AppMarkdown

func (c *CommentMarkdown) AppMarkdown(appName, warnStr string, syncStatus v1alpha1.SyncStatusCode, healthStatus health.HealthStatusCode, healthMsg string) *ArgoAppMarkdown

func (CommentMarkdown) String

func (c CommentMarkdown) String() []string

Jump to

Keyboard shortcuts

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