prow

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	Content  string
	FullName string
}

Artifact stores the full name of the artifact (in GCS) and the content of the file

type ArtifactFilename

type ArtifactFilename string

ArtifactFilename represents the name of the file (including file extension)

type ArtifactFilenameMap

type ArtifactFilenameMap map[ArtifactFilename]Artifact

ArtifactFilenameMap - e.g. "build-log.txt": {Content: "<file-content>", FullName: "/full/gcs/path/build-log.txt"}

type ArtifactScanner

type ArtifactScanner struct {
	Client *storage.Client

	/* Example:
	{
	  "gather-extra": {"build-log.txt": {Content: "<content>", FullName: "/full/gcs/path/build-log.txt"}, "finished.json": ...},
	  "e2e-tests": {"build-log.txt": ...},
	}
	*/
	ArtifactStepMap         map[ArtifactStepName]ArtifactFilenameMap
	ArtifactDirectoryPrefix string
	// contains filtered or unexported fields
}

ArtifactScanner is used for initializing GCS client and scanning and storing files found in defined storage

func NewArtifactScanner

func NewArtifactScanner(cfg ScannerConfig) (*ArtifactScanner, error)

NewArtifactScanner creates a new instance of ArtifactScanner, requires a valid ScannerConfig

func (*ArtifactScanner) Run

func (as *ArtifactScanner) Run() error

Run processes the artifacts associated with the Prow job and store required files with their associated openshift-ci step names and their content in ArtifactStepMap

type ArtifactStepName

type ArtifactStepName string

ArtifactStepName represents the openshift-ci step name

type OpenshiftJobSpec

type OpenshiftJobSpec struct {
	Type string `json:"type"`
	Job  string `json:"job"`
	Refs Refs   `json:"refs"`
}

OpenshiftJobSpec represents the Openshift job spec data

func ParseJobSpec

func ParseJobSpec(jobSpecData string) (*OpenshiftJobSpec, error)

ParseJobSpec parses and then returns the openshift job spec data

type Pull

type Pull struct {
	Number     int    `json:"number"`
	Author     string `json:"author"`
	SHA        string `json:"sha"`
	PRLink     string `json:"link"`
	AuthorLink string `json:"author_link"`
}

Pull represents a GitHub Pull Request

type Refs

type Refs struct {
	RepoLink     string `json:"repo_link"`
	Repo         string `json:"repo"`
	Organization string `json:"org"`
	Pulls        []Pull `json:"pulls"`
}

Refs represent the refs field of an OpenShift job

type ScannerConfig

type ScannerConfig struct {
	FileNameFilter []string
	ProwJobID      string
	ProwJobURL     string
	StepsToSkip    []string
}

ScannerConfig contains fields required for scaning files with ArtifactScanner

Jump to

Keyboard shortcuts

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