ci

package
v0.0.0-...-be47510 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: Apache-2.0 Imports: 4 Imported by: 6 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ci defines the internal representation of a continuous integration reports.

Index

Constants

View Source
const (
	// Ref defines the git-notes ref that we expect to contain CI reports.
	Ref = "refs/notes/devtools/ci"

	// StatusSuccess is the status string representing that a build and/or test passed.
	StatusSuccess = "success"
	// StatusFailure is the status string representing that a build and/or test failed.
	StatusFailure = "failure"

	// FormatVersion defines the latest version of the request format supported by the tool.
	FormatVersion = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Report

type Report struct {
	Timestamp string `json:"timestamp,omitempty"`
	URL       string `json:"url,omitempty"`
	Status    string `json:"status,omitempty"`
	Agent     string `json:"agent,omitempty"`
	// Version represents the version of the metadata format.
	Version int `json:"v,omitempty"`
}

Report represents a build/test status report generated by a continuous integration tool.

Every field is optional.

func GetLatestCIReport

func GetLatestCIReport(reports []Report) (*Report, error)

GetLatestCIReport takes the collection of reports and returns the one with the most recent timestamp.

func Parse

func Parse(note repository.Note) (Report, error)

Parse parses a CI report from a git note.

func ParseAllValid

func ParseAllValid(notes []repository.Note) []Report

ParseAllValid takes collection of git notes and tries to parse a CI report from each one. Any notes that are not valid CI reports get ignored, as we expect the git notes to be a heterogenous list, with only some of them being valid CI status reports.

Jump to

Keyboard shortcuts

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