Documentation ¶
Overview ¶
Package reporter implements a reporter interface for gerrit
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a gerrit reporter client
func NewReporter ¶
func NewReporter(orgRepoConfigGetter func() *config.GerritOrgRepoConfigs, cookiefilePath string, pjclientset ctrlruntimeclient.Client) (*Client, error)
NewReporter returns a reporter client
type Job ¶
type Job struct { Name string State v1.ProwJobState Icon string URL string }
Job is the view of a prowjob scoped for a report
type JobReport ¶
JobReport is the structured job report format
func GenerateReport ¶
GenerateReport generates a JobReport based on pjs passed in. As URLs are very long string, including them in the report could easily make the report exceed the maxCommentSizeLimit of 14400 characters. Unfortunately we need info for all prowjobs for /retest to work, which is by far the most reliable way of retrieving prow jobs results (this is because prowjob custom resources are garbage-collected by sinker after max_pod_age, which normally is 48 hours). So to ensure that all prow jobs results are displayed, URLs for some of the jobs are omitted from this report to keep it under 14400 characters.
Note that even if we drop all URLs, it may be that we're forced to drop jobs names entirely if there are just too many jobs. So there is actually no guarantee that we'll always report all job names (although this is rare in practice).
customCommentSizeLimit is used by unit tests that actually test that we perform job serialization with or without URLs (without this, our unit tests would have to be very large to hit the default maxCommentSizeLimit to trigger the "don't print URLs" behavior).
func ParseReport ¶
ParseReport creates a jobReport from a string, nil if cannot parse