Documentation ¶
Overview ¶
Package report contains helpers for writing comments and updating statuses in GitHub.
Index ¶
- func Report(ctx context.Context, ghc GitHubClient, reportTemplate *template.Template, ...) error
- func ReportComment(ctx context.Context, ghc GitHubClient, reportTemplate *template.Template, ...) error
- func ReportStatusContext(ctx context.Context, ghc GitHubClient, pj prowapi.ProwJob, ...) error
- func ShouldReport(pj prowapi.ProwJob, validTypes []prowapi.ProwJobType) bool
- type GitHubClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Report ¶
func Report(ctx context.Context, ghc GitHubClient, reportTemplate *template.Template, pj prowapi.ProwJob, config config.GitHubReporter) error
Report is creating/updating/removing reports in GitHub based on the state of the provided ProwJob.
func ReportComment ¶
func ReportComment(ctx context.Context, ghc GitHubClient, reportTemplate *template.Template, pjs []prowapi.ProwJob, config config.GitHubReporter, mustCreate bool) error
ReportComment takes multiple prowjobs as input. When there are more than one prowjob, they are required to have identical refs, aka they are the same repo and the same pull request.
func ReportStatusContext ¶
func ReportStatusContext(ctx context.Context, ghc GitHubClient, pj prowapi.ProwJob, config config.GitHubReporter) error
ReportStatusContext reports prowjob status on a PR.
func ShouldReport ¶
func ShouldReport(pj prowapi.ProwJob, validTypes []prowapi.ProwJobType) bool
TODO(krzyzacy): Move this logic into github/reporter, once we unify all reporting logic to crier
Types ¶
type GitHubClient ¶
type GitHubClient interface { BotUserCheckerWithContext(ctx context.Context) (func(candidate string) bool, error) CreateStatusWithContext(ctx context.Context, org, repo, ref string, s github.Status) error ListIssueCommentsWithContext(ctx context.Context, org, repo string, number int) ([]github.IssueComment, error) CreateCommentWithContext(ctx context.Context, org, repo string, number int, comment string) error DeleteCommentWithContext(ctx context.Context, org, repo string, ID int) error EditCommentWithContext(ctx context.Context, org, repo string, ID int, comment string) error }
GitHubClient provides a client interface to report job status updates through GitHub comments.
Click to show internal directories.
Click to hide internal directories.