api

package
v0.0.0-...-087457d Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 40 Imported by: 0

README

Sippy API

Sippy has a simple REST API at /api. The API is used by the front-end. The docs here may not be fully up-to-date, although we do try not to break backwards compatability where possible.

For exact API usage, you can use your browser's web developer tools to examine the requests we make.

Filtering and sorting

Filtering

The API's that support filtering, as indicated in their docs below, use a filtering format as follows. The format is similar to the filtering options used by Material UI's data tables internally.

An individual filter is JSON, in the following format:

{
  "columnName": "name",
  "operatorValue": "contains",
  "value": "aws"
}
  • String operators are: contains, starts with, ends with, equals, is empty, is not empty.
  • Numerical operators are: =, !=, <, <=, >, >=
  • Array operators are: contains

An optional 'not' field may be specified which inverts the operator. For example, the below filter means name does not contain aws:

{
  "columnName": "name",
  "not": true,
  "operatorValue": "contains",
  "value": "aws"
}

A composed filter consists of one or more filters, along with a link operator. A link operator is either and or or.

Example:

{
  "linkOperator": "and",
  "items": [
    {
      "columnName": "name",
      "operatorValue": "contains",
      "value": "aws"
    },
    {
      "columnName": "name",
      "not": true,
      "operatorValue": "contains",
      "value": "upgrade"
    }
  ]
}

The filter should be URI encoded json in the filter parameter.

Sorting

You may sort results by any sortable field in the item by specifying sortField, as well sort with the value asc or desc.

Release Health

Endpoint: /api/health

Returns a summary of overall release health, including the percentage of successful runs of each, as well as a summary of variant success rates.

Example response
{
  "indicators": {
    "infrastructure": {
      "current": {
        "percentage": 88.88888888888889,
        "runs": 1998
      },
      "previous": {
        "percentage": 95.31914893617022,
        "runs": 1880
      }
    },
    "install": {
      "current": {
        "percentage": 96.53083700440529,
        "runs": 3632
      },
      "previous": {
        "percentage": 98.8409703504043,
        "runs": 3710
      }
    },
    "upgrade": {
      "current": {
        "percentage": 98.50299401197606,
        "runs": 334
      },
      "previous": {
        "percentage": 99.52941176470588,
        "runs": 425
      }
    }
  },
  "variants": {
    "current": {
      "success": 2,
      "unstable": 1,
      "failed": 17
    },
    "previous": {
      "success": 3,
      "unstable": 6,
      "failed": 11
    }
  },
  "last_updated": "2021-08-09T14:12:09.319089659Z"
}
Parameters
Option Type Description Acceptable values
release* String The OpenShift release to return results from (e.g., 4.9) N/A

* indicates a required value.

Install
Option Type Description Acceptable values
release* String The OpenShift release to return results from (e.g., 4.9) N/A

* indicates a required value.

Example response
{
  "column_names": [
    "All",
    "aws"
  ],
  "description": "Install Rates by Operator by Variant",
  "tests": {
    "Overall": {
      "All": {
        "id": 0,
        "name": "All",
        "current_successes": 4045,
        "current_failures": 166,
        "current_flakes": 0,
        "current_pass_percentage": 96.05794348135834,
        "current_runs": 4211,
        "previous_successes": 4260,
        "previous_failures": 54,
        "previous_flakes": 0,
        "previous_pass_percentage": 98.74826147426981,
        "previous_runs": 4314,
        "net_improvement": 0,
        "bugs": null,
        "associated_bugs": null
      },
      "aws": {
        "id": 0,
        "name": "aws",
        "current_successes": 361,
        "current_failures": 6,
        "current_flakes": 0,
        "current_pass_percentage": 98.36512261580381,
        "current_runs": 367,
        "previous_successes": 371,
        "previous_failures": 4,
        "previous_flakes": 0,
        "previous_pass_percentage": 98.93333333333332,
        "previous_runs": 375,
        "net_improvement": 0,
        "bugs": null,
        "associated_bugs": null
      }
    }
  },
  "title": "Install Rates by Operator"
}
Upgrade
Option Type Description Acceptable values
release* String The OpenShift release to return results from (e.g., 4.9) N/A

* indicates a required value.

Jobs

Endpoint: /api/jobs

Example response
[
  {
    "id": 51,
    "name": "periodic-ci-openshift-release-master-ci-4.9-e2e-gcp-upgrade",
    "brief_name": "e2e-gcp-upgrade",
    "variants": [
      "gcp",
      "upgrade"
    ],
    "current_pass_percentage": 10.030395136778116,
    "current_projected_pass_percentage": 10.784313725490197,
    "current_runs": 329,
    "previous_pass_percentage": 35.78274760383386,
    "previous_projected_pass_percentage": 37.45819397993311,
    "previous_runs": 313,
    "net_improvement": -25.752352467055744,
    "test_grid_url": "https://testgrid.k8s.io/redhat-openshift-ocp-release-4.9-informing#periodic-ci-openshift-release-master-ci-4.9-e2e-gcp-upgrade",
    "bugs": [],
    "associated_bugs": [
      {
        "id": 1983758,
        "status": "NEW",
        "last_change_time": "2021-07-27T16:59:31Z",
        "summary": "gcp upgrades are failing on \"Cluster frontend ingress remain available\"",
        "target_release": [
          "---"
        ],
        "component": [
          "Routing"
        ],
        "url": "https://bugzilla.redhat.com/show_bug.cgi?id=1983758"
      }
    ]
  }
]
Parameters
Option Type Description Acceptable values
release* String The OpenShift release to return results from (e.g., 4.9) N/A
filter Filter Filters the results by the specified value. Can be specified multiple times, e.g. filterBy=hasBug&filterBy=name&job=aws See filtering
sortField Field name Sort by this field
sort asc / desc Sort type, ascending or descending "asc" or "desc"
limit Integer The maximum amount of results to return N/A

* indicates a required value.

Job Details

Endpoint: /api/jobs/details

A summary of runs for job(s). Results contains of the following values for each job:

  • S success
  • F failure (e2e )
  • f failure (other tests)
  • U upgrade failure
  • I setup failure (installer)
  • N setup failure (infra)
  • n failure before setup (infra)
  • R running
Example response
{
  "jobs": [
    {
      "name": "periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6",
      "results": [
        {
          "timestamp": 1628207039000,
          "result": "F",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1423429598720299008"
        },
        {
          "timestamp": 1628045973000,
          "result": "F",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1422754032564310016"
        },
        {
          "timestamp": 1628198644000,
          "result": "F",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1423394362347229184"
        },
        {
          "timestamp": 1628485392000,
          "result": "F",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1424597097709047808"
        },
        {
          "timestamp": 1628343908000,
          "result": "F",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1424003666343366656"
        },
        {
          "timestamp": 1628325313000,
          "result": "F",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1423925674229370880"
        },
        {
          "timestamp": 1628289649000,
          "result": "F",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1423776089259380736"
        },
        {
          "timestamp": 1628277370000,
          "result": "S",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1423724523844276224"
        },
        {
          "timestamp": 1628358891000,
          "result": "F",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1424066513538650112"
        },
        {
          "timestamp": 1628190532000,
          "result": "F",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1423360364472438784"
        },
        {
          "timestamp": 1628274962000,
          "result": "F",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1423714481237659648"
        },
        {
          "timestamp": 1627391095000,
          "result": "F",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1420007279679246336"
        },
        {
          "timestamp": 1627473363000,
          "result": "F",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1420352338517823488"
        },
        {
          "timestamp": 1627617630000,
          "result": "F",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1420957438630170624"
        },
        {
          "timestamp": 1627515377000,
          "result": "F",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1420528516700573696"
        },
        {
          "timestamp": 1627396851000,
          "result": "F",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1420031423921786880"
        },
        {
          "timestamp": 1627363991000,
          "result": "F",
          "url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1419893597473345536"
        }
      ]
    }
  ],
  "start": 1627317573000,
  "end": 1628508950000
}
Parameters
Option Type Description Acceptable values
release* String The OpenShift release to return results from (e.g., 4.9) N/A
job String Return only jobs containing only containing this value in their name N/A
limit Integer The maximum amount of results to return N/A

Tests

Endpoint: /api/tests

Parameters
Option Type Description Acceptable values
release* String The OpenShift release to return results from (e.g., 4.9) N/A
filter Filter Filters the results by the specified value. See filtering
sortField Field name Sort by this field
sort asc / desc Sort type, ascending or descending "asc" or "desc"
limit Integer The maximum amount of results to return N/A
Example response
[
  {
    "id": 253,
    "name": "[sig-network-edge] Cluster frontend ingress remain available",
    "current_successes": 554,
    "current_failures": 31,
    "current_flakes": 201,
    "current_pass_percentage": 94.70085470085469,
    "current_runs": 786,
    "previous_successes": 734,
    "previous_failures": 25,
    "previous_flakes": 242,
    "previous_pass_percentage": 96.70619235836627,
    "previous_runs": 1001,
    "net_improvement": -2.005337657511575,
    "bugs": [
      {
        "id": 1980141,
        "status": "POST",
        "last_change_time": "2021-08-03T14:02:12Z",
        "summary": "NetworkPolicy e2e tests are flaky in 4.9, especially in stress",
        "target_release": [
          "4.9.0"
        ],
        "component": [
          "Networking"
        ],
        "url": "https://bugzilla.redhat.com/show_bug.cgi?id=1980141"
      },
      {
        "id": 1983829,
        "status": "NEW",
        "last_change_time": "0001-01-01T00:00:00Z",
        "summary": "ovn-kubernetes upgrade jobs are failing disruptive tests",
        "target_release": [
          "4.9.0"
        ],
        "component": [
          "Networking"
        ],
        "url": "https://bugzilla.redhat.com/show_bug.cgi?id=1983829"
      },
      {
        "id": 1981872,
        "status": "NEW",
        "last_change_time": "2021-08-03T17:13:35Z",
        "summary": "SDN networking failures during GCP upgrades",
        "target_release": [
          "4.9.0"
        ],
        "component": [
          "Networking"
        ],
        "url": "https://bugzilla.redhat.com/show_bug.cgi?id=1981872"
      }
    ],
    "associated_bugs": [
      {
        "id": 1983758,
        "status": "NEW",
        "last_change_time": "2021-07-27T16:59:31Z",
        "summary": "gcp upgrades are failing on \"Cluster frontend ingress remain available\"",
        "target_release": [
          "---"
        ],
        "component": [
          "Routing"
        ],
        "url": "https://bugzilla.redhat.com/show_bug.cgi?id=1983758"
      },
      {
        "id": 1943334,
        "status": "POST",
        "last_change_time": "2021-07-23T10:58:19Z",
        "summary": "[ovnkube] node pod should taint NoSchedule on termination; clear on startup",
        "target_release": [
          "---"
        ],
        "component": [
          "Networking"
        ],
        "url": "https://bugzilla.redhat.com/show_bug.cgi?id=1943334"
      },
      {
        "id": 1987046,
        "status": "POST",
        "last_change_time": "2021-07-30T07:02:22Z",
        "summary": "periodic ci-4.8-upgrade-from-stable-4.7-e2e-*-ovn-upgrade are permafailing on service/ingress disruption",
        "target_release": [
          "4.8.z"
        ],
        "component": [
          "Networking"
        ],
        "url": "https://bugzilla.redhat.com/show_bug.cgi?id=1987046"
      }
    ]
  }
]

Documentation

Index

Constants

View Source
const PeriodDay = "day"
View Source
const PeriodHour = "hour"

Variables

This section is empty.

Functions

func BuildReleasesResponse

func BuildReleasesResponse(releases []sippyv1.Release, lastUpdated time.Time) apitype.Releases

BuildReleasesResponse creates the API response structure for releases

func BuildTestsResults

func BuildTestsResults(dbc *db.DB, release, period string, collapse, includeOverall bool, fil *filter.Filter) (testsAPIResult, *apitype.Test, error)

func BuildTestsResultsFromBigQuery

func BuildTestsResultsFromBigQuery(bqc *bq.Client, release, period string, collapse, includeOverall bool, fil *filter.Filter) (testsAPIResultBQ, *apitype.TestBQ, error)

func CacheSet

func CacheSet[T any](ctx context.Context, c cache.Cache, result T, cacheKey []byte, cacheDuration time.Duration)

func CalculateRoundedCacheDuration

func CalculateRoundedCacheDuration(cacheOptions cache.RequestOptions) time.Duration

func FetchJobRun

func FetchJobRun(dbc *db.DB, jobRunID int64, unknownTests bool, preloads []string, logger *log.Entry) (*models.ProwJobRun, error)

FetchJobRun returns a single job run loaded from postgres and populated with the ProwJob and test results. If unknownTests is true, all tests not registered in test_ownerships are loaded; otherwise any failed tests are loaded.

func FetchTestResultsFromBQ

func FetchTestResultsFromBQ(ctx context.Context, q *bigquery.Query) ([]apitype.TestBQ, []error)

func GetBaseURL

func GetBaseURL(req *http.Request) string

GetBaseURL returns the base URL (protocol + host) from the request. It handles TLS and X-Forwarded-Proto header to determine the protocol.

func GetBuildClusterHealthAnalysis

func GetBuildClusterHealthAnalysis(dbc *db.DB, period string) (map[string]apitype.BuildClusterHealthAnalysis, error)

func GetBuildClusterHealthReport

func GetBuildClusterHealthReport(dbc *db.DB, start, boundary, end time.Time) ([]apitype.BuildClusterHealth, error)

func GetDataFromCacheOrGenerate

func GetDataFromCacheOrGenerate[T any](
	ctx context.Context, c cache.Cache, cacheOptions cache.RequestOptions, cacheData CacheData,
	generateFn func(context.Context) (T, []error),
	defaultVal T,
) (T, []error)

GetDataFromCacheOrGenerate attempts to find a cached record otherwise generates new data.

func GetDisruptionVsPrevGAReportFromBigQuery

func GetDisruptionVsPrevGAReportFromBigQuery(ctx context.Context, client *bqcachedclient.Client) (apitype.DisruptionReport, []error)

func GetDisruptionVsTwoWeeksAgoReportFromBigQuery

func GetDisruptionVsTwoWeeksAgoReportFromBigQuery(ctx context.Context, client *bqcachedclient.Client) (apitype.DisruptionReport, []error)

func GetJIRAIncidentsFromDB

func GetJIRAIncidentsFromDB(dbClient *db.DB, start, end *time.Time) ([]apitype.CalendarEvent, error)

func GetPayloadDiffPullRequests

func GetPayloadDiffPullRequests(dbc *db.DB, fromPayload, toPayload string) ([]models.ReleasePullRequest, error)

func GetPayloadEvents

func GetPayloadEvents(dbClient *db.DB, release string, filterOpts *filter.FilterOptions,
	start, end *time.Time) ([]apitype.CalendarEvent, error)

GetPayloadEvents returns the list of release tags in a format suitable for a calendar like FullCalendar.

func GetPayloadStreamTestFailures

func GetPayloadStreamTestFailures(dbc *db.DB, release, stream, arch string, filterOpts *filter.FilterOptions, reportEnd time.Time) ([]*apitype.TestFailureAnalysis, error)

GetPayloadStreamTestFailures loads the most recent payloads for a stream and attempts to search for most commonly failing tests, possible perma-failing blockers, etc.

func GetPayloadTestFailures

func GetPayloadTestFailures(dbc *db.DB, payloadTag string, logger log.FieldLogger) ([]*apitype.TestFailureAnalysis, error)

GetPayloadTestFailures loads the test failures for a specific payload across all of it's jobs. At present, aggregated sub-jobs are not included and we assume only what bubbles up to failing the aggregated job is sufficient.

func GetPullRequestsReportFromDB

func GetPullRequestsReportFromDB(dbc *db.DB, release string, filterOpts *filter.FilterOptions) ([]apitype.PullRequest, error)

func GetReleases

func GetReleases(ctx context.Context, bqc *bqclient.Client, forceRefresh bool) ([]v1.Release, error)

GetReleases gets all the releases defined in the BQ Releases table.

func GetReleasesFromBigQuery

func GetReleasesFromBigQuery(ctx context.Context, client *bqcachedclient.Client) ([]sippyv1.Release, error)

GetReleasesFromBigQuery gets all releases defined in the Releases table in BigQuery

func GetRepositoriesReportFromDB

func GetRepositoriesReportFromDB(dbc *db.DB, release string, filterOpts *filter.FilterOptions, reportEnd time.Time) ([]apitype.Repository, error)

func GetTestAnalysisByJobFromDB

func GetTestAnalysisByJobFromDB(dbc *db.DB, filters *filter.Filter, release, testName string, reportEnd time.Time) (map[string][]CountByDate, error)

func GetTestAnalysisByVariantFromDB

func GetTestAnalysisByVariantFromDB(dbc *db.DB, filters *filter.Filter, release, testName string, reportEnd time.Time) (map[string][]CountByDate, error)

func GetTestAnalysisOverallFromDB

func GetTestAnalysisOverallFromDB(dbc *db.DB, filters *filter.Filter, release, testName string, reportEnd time.Time) (map[string][]CountByDate, error)

func GetTestCapabilitiesFromDB

func GetTestCapabilitiesFromDB(bqClient *bq.Client) ([]string, error)

GetTestCapabilitiesFromDB returns a sorted list of capabilities from the BQ component_mapping_latest table

func GetTestDurationsFromDB

func GetTestDurationsFromDB(dbc *db.DB, release, test string, filters *filter.Filter) (map[string]float64, error)

func GetTestLifecyclesFromDB

func GetTestLifecyclesFromDB(bqClient *bq.Client) ([]string, error)

GetTestLifecyclesFromDB returns a sorted list of lifecycles from the BQ junit table

func GetTestOutputsFromDB

func GetTestOutputsFromDB(dbc *db.DB, release, test string, filters *filter.Filter, quantity int) ([]apitype.TestOutput, error)

func JobReportsFromDB

func JobReportsFromDB(dbc *db.DB, release, period string, filterOpts *filter.FilterOptions, start, boundary, end, reportEnd time.Time) ([]apitype.Job, error)

func JobRunRiskAnalysis

func JobRunRiskAnalysis(dbc *db.DB, bqc *bigquery.Client, jobRun *models.ProwJobRun, logger *log.Entry, compareOtherPRs bool) (apitype.ProwJobRunRiskAnalysis, error)

JobRunRiskAnalysis checks the test failures and linked bugs for a job run, and reports back an estimated risk level for each failed test, and the job run overall.

func JobsRunsReportFromDB

func JobsRunsReportFromDB(dbc *db.DB, filterOpts *filter.FilterOptions, release string, pagination *apitype.Pagination, reportEnd time.Time) (*apitype.PaginationResult, error)

JobsRunsReportFromDB renders a filtered summary of matching jobs.

func ListPayloadJobRuns

func ListPayloadJobRuns(dbClient *db.DB, filterOpts *filter.FilterOptions, release string) ([]models.ReleaseJobRun, error)

func PayloadForJobRun

func PayloadForJobRun(ctx context.Context, bigQueryClient *bqcachedclient.Client, jobRunID string) ([]apitype.JobPayload, error)

PayloadForJobRun returns the payload release tag that was used for a given job run.

func PrintAutocompleteFromDB

func PrintAutocompleteFromDB(w http.ResponseWriter, req *http.Request, dbc *db.DB)

PrintAutocompleteFromDB returns autocomplete results for a particular field, such as test or job names. It optionally takes a release and search query filter.

func PrintCanaryTestsFromDB

func PrintCanaryTestsFromDB(release string, w http.ResponseWriter, dbc *db.DB)

func PrintInstallJSONReportFromDB

func PrintInstallJSONReportFromDB(w http.ResponseWriter, dbc *db.DB, release string)

PrintInstallJSONReportFromDB renders a report showing the success/fail rates of operator installation.

func PrintJobAnalysisJSONFromDB

func PrintJobAnalysisJSONFromDB(
	dbc *db.DB,
	release string,
	jobFilter *filter.Filter,
	jobRunsFilter *filter.Filter,
	start, boundary, end time.Time,
	limit int,
	sortField string,
	sort apitype.Sort,
	period string,
	reportEnd time.Time) (apitype.JobAnalysisResult, error)

func PrintJobDetailsReportFromDB

func PrintJobDetailsReportFromDB(w http.ResponseWriter, req *http.Request, dbc *db.DB, release, jobSearchStr string, reportEnd time.Time) error

PrintJobDetailsReportFromDB renders the detailed list of runs for matching jobs.

func PrintJobsReportFromDB

func PrintJobsReportFromDB(w http.ResponseWriter, req *http.Request,
	dbc *db.DB, release string, reportEnd time.Time)

PrintJobsReportFromDB renders a filtered summary of matching jobs.

func PrintOverallReleaseHealthFromDB

func PrintOverallReleaseHealthFromDB(w http.ResponseWriter, dbc *db.DB, release string, reportEnd time.Time)

PrintOverallReleaseHealthFromDB gives a summarized status of the overall health, including infrastructure, install, upgrade, and variant success rates.

func PrintPullRequestsReport

func PrintPullRequestsReport(w http.ResponseWriter, req *http.Request, dbClient *db.DB)

func PrintReleasesReport

func PrintReleasesReport(w http.ResponseWriter, req *http.Request, dbClient *db.DB)

func PrintTestsDetailsJSONFromDB

func PrintTestsDetailsJSONFromDB(w http.ResponseWriter, release string, testSubstrings []string, dbc *db.DB)

func PrintTestsJSONFromBigQuery

func PrintTestsJSONFromBigQuery(release string, w http.ResponseWriter, req *http.Request, bqc *bq.Client)

func PrintTestsJSONFromDB

func PrintTestsJSONFromDB(release string, w http.ResponseWriter, req *http.Request, dbc *db.DB)

func PrintUpgradeJSONReportFromDB

func PrintUpgradeJSONReportFromDB(w http.ResponseWriter, req *http.Request, dbc *db.DB, release string)

PrintUpgradeJSONReportFromDB reports on the success/fail of operator upgrades.

func PrintVariantReportFromDB

func PrintVariantReportFromDB(w http.ResponseWriter, req *http.Request,
	dbc *db.DB, release string, reportEnd time.Time)

PrintVariantReportFromDB

func ReleaseHealthReports

func ReleaseHealthReports(dbClient *db.DB, release string, reportEnd time.Time) ([]apitype.ReleaseHealthReport, error)

ReleaseHealthReports returns a report on the most recent payload status for each arch/stream in the given release.

func RespondWithJSON

func RespondWithJSON(statusCode int, w http.ResponseWriter, data interface{})

func ValidateVariants

func ValidateVariants(allJobVariants crtest.JobVariants, variantsMap map[string][]string, source string) []string

ValidateVariants checks if variant names and values exist in BigQuery and returns warnings for any that don't. The source parameter is appended to warning messages to indicate where the variants came from (e.g., " from view").

func VariantListToMap

func VariantListToMap(allJobVariants crtest.JobVariants, variants []string) (map[string][]string, error)

VariantListToMap collects a list of variants like "Architecture:amd64" into a map [Architecture -> amd64]; it also validates that the variants are known

func VariantListToMapWithWarnings

func VariantListToMapWithWarnings(allJobVariants crtest.JobVariants, variants []string) (map[string][]string, []string, error)

VariantListToMapWithWarnings collects a list of variants like "Architecture:amd64" into a map [Architecture -> amd64]; it validates that the variants are known, but collects warnings instead of failing for invalid variants

func VariantTestsReport

func VariantTestsReport(dbc *db.DB, release string, reportType v1.ReportType,
	testNames, testPrefixes, testSubStrings sets.String, excludedVariants []string) (sets.String, map[string]map[string]apitype.Test, error)

VariantTestsReport returns a set of all variant columns plus "All", and a map of testName to variant column to test results for that variant. Caller can provide exact test names to match, test name prefixes, or test substrings.

func VariantsStringToSet

func VariantsStringToSet(allJobVariants crtest.JobVariants, variantsString string) (sets.String, error)

VariantsStringToSet converts comma separated variant string into a set; also validates that the variants are known

Types

type CacheData

type CacheData struct {
	// contains filtered or unexported fields
}

func GetPrefixedCacheKey

func GetPrefixedCacheKey(prefix string, cacheKey interface{}) CacheData

func (*CacheData) GetCacheKey

func (c *CacheData) GetCacheKey() ([]byte, error)

type ClusterOperatorStatus

type ClusterOperatorStatus struct {
	Name    string `json:"name"`
	Status  string `json:"status"`
	Reason  string `json:"reason"`
	Message string `json:"message"`
}

ClusterOperatorStatus represents the status of a cluster operator

type CountByDate

type CountByDate struct {
	Date            string  `json:"date"`
	Group           string  `json:"group"`
	PassPercentage  float64 `json:"pass_percentage"`
	FlakePercentage float64 `json:"flake_percentage"`
	FailPercentage  float64 `json:"fail_percentage"`
	Runs            int     `json:"runs"`
	Passes          int     `json:"passes"`
	Flakes          int     `json:"flakes"`
	Failures        int     `json:"failures"`
}

type JobRunData

type JobRunData struct {
	// Basic job information
	ID        uint   `json:"id"`
	Name      string `json:"name"`
	Release   string `json:"release"`
	Cluster   string `json:"cluster"`
	URL       string `json:"url"`
	GCSBucket string `json:"gcsBucket"`

	// Timing information
	StartTime       time.Time     `json:"startTime"`
	Duration        time.Duration `json:"duration"`
	DurationSeconds float64       `json:"durationSeconds"`

	// Status and results
	OverallResult         string `json:"overallResult"`
	Reason                string `json:"reason"`
	Succeeded             bool   `json:"succeeded"`
	Failed                bool   `json:"failed"`
	InfrastructureFailure bool   `json:"infrastructureFailure"`
	KnownFailure          bool   `json:"knownFailure"`

	// Test information
	TestCount        int               `json:"testCount"`
	TestFailureCount int               `json:"testFailureCount"`
	TestFailures     map[string]string `json:"testFailures,omitempty"`

	// Job metadata
	Variants []string `json:"variants,omitempty"`

	// Cluster and infrastructure information
	ClusterOperators []ClusterOperatorStatus `json:"clusterOperators,omitempty"`
}

JobRunData contains the comprehensive data for a job run including test failures and cluster operator status

func GetJobRunSummary

func GetJobRunSummary(ctx context.Context, dbc *db.DB, gcsClient *storage.Client, jobRunID int64) (*JobRunData, error)

GetJobRunSummary extracts and returns the raw job run data

type LabelOption

type LabelOption struct {
	Name  string `json:"name"`
	Title string `json:"title"`
}

LabelOption represents a label with ID and title for autocomplete

Jump to

Keyboard shortcuts

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