schemas

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMergeRequestIIDFromRefName added in v0.5.0

func GetMergeRequestIIDFromRefName(refName string) (string, error)

GetMergeRequestIIDFromRefName parse a refName to extract a merge request IID.

func GetRefRegexp added in v0.5.0

func GetRefRegexp(ppr config.ProjectPullRefs, rk RefKind) (re *regexp.Regexp, err error)

GetRefRegexp returns the expected regexp given a ProjectPullRefs config and a RefKind.

Types

type Deployment

type Deployment struct {
	JobID           int
	RefKind         RefKind
	RefName         string
	Username        string
	Timestamp       float64
	DurationSeconds float64
	CommitShortID   string
	Status          string
}

Deployment ..

type Environment

type Environment struct {
	ProjectName      string
	ID               int
	Name             string
	ExternalURL      string
	Available        bool
	LatestDeployment Deployment

	OutputSparseStatusMetrics bool
}

Environment ..

func (Environment) DefaultLabelsValues

func (e Environment) DefaultLabelsValues() map[string]string

DefaultLabelsValues ..

func (Environment) InformationLabelsValues

func (e Environment) InformationLabelsValues() (v map[string]string)

InformationLabelsValues ..

func (Environment) Key

func (e Environment) Key() EnvironmentKey

Key ..

type EnvironmentKey

type EnvironmentKey string

EnvironmentKey ..

type Environments

type Environments map[EnvironmentKey]Environment

Environments allows us to keep track of all the Environment objects we have discovered.

func (Environments) Count

func (envs Environments) Count() int

Count returns the amount of environments in the map.

type Job

type Job struct {
	ID                    int
	Name                  string
	Stage                 string
	Timestamp             float64
	DurationSeconds       float64
	QueuedDurationSeconds float64
	Status                string
	TagList               string
	ArtifactSize          float64
	FailureReason         string
	Runner                Runner
}

Job ..

func NewJob

func NewJob(gj goGitlab.Job) Job

NewJob ..

type Jobs

type Jobs map[string]Job

Jobs ..

type Metric

type Metric struct {
	Kind   MetricKind
	Labels prometheus.Labels
	Value  float64
}

Metric ..

func (Metric) Key

func (m Metric) Key() MetricKey

Key ..

type MetricKey

type MetricKey string

MetricKey ..

type MetricKind

type MetricKind int32

MetricKind ..

const (
	// MetricKindCoverage refers to the coerage of a job/pipeline.
	MetricKindCoverage MetricKind = iota

	// MetricKindDurationSeconds ..
	MetricKindDurationSeconds

	// MetricKindEnvironmentBehindCommitsCount ..
	MetricKindEnvironmentBehindCommitsCount

	// MetricKindEnvironmentBehindDurationSeconds ..
	MetricKindEnvironmentBehindDurationSeconds

	// MetricKindEnvironmentDeploymentCount ..
	MetricKindEnvironmentDeploymentCount

	// MetricKindEnvironmentDeploymentDurationSeconds ..
	MetricKindEnvironmentDeploymentDurationSeconds

	// MetricKindEnvironmentDeploymentJobID ..
	MetricKindEnvironmentDeploymentJobID

	// MetricKindEnvironmentDeploymentStatus ..
	MetricKindEnvironmentDeploymentStatus

	// MetricKindEnvironmentDeploymentTimestamp ..
	MetricKindEnvironmentDeploymentTimestamp

	// MetricKindEnvironmentInformation ..
	MetricKindEnvironmentInformation

	// MetricKindID ..
	MetricKindID

	// MetricKindJobArtifactSizeBytes ..
	MetricKindJobArtifactSizeBytes

	// MetricKindJobDurationSeconds ..
	MetricKindJobDurationSeconds

	// MetricKindJobID ..
	MetricKindJobID

	// MetricKindJobQueuedDurationSeconds ..
	MetricKindJobQueuedDurationSeconds

	// MetricKindJobRunCount ..
	MetricKindJobRunCount

	// MetricKindJobStatus ..
	MetricKindJobStatus

	// MetricKindJobTimestamp ..
	MetricKindJobTimestamp

	// MetricKindQueuedDurationSeconds ..
	MetricKindQueuedDurationSeconds

	// MetricKindRunCount ..
	MetricKindRunCount

	// MetricKindStatus ..
	MetricKindStatus

	// MetricKindTimestamp ..
	MetricKindTimestamp

	// MetricKindTestReportTotalTime ..
	MetricKindTestReportTotalTime

	// MetricKindTestReportTotalCount ..
	MetricKindTestReportTotalCount

	// MetricKindTestReportSuccessCount ..
	MetricKindTestReportSuccessCount

	// MetricKindTestReportFailedCount ..
	MetricKindTestReportFailedCount

	// MetricKindTestReportSkippedCount ..
	MetricKindTestReportSkippedCount

	// MetricKindTestReportErrorCount ..
	MetricKindTestReportErrorCount

	// MetricKindTestSuiteTotalTime ..
	MetricKindTestSuiteTotalTime

	// MetricKindTestSuiteTotalCount ..
	MetricKindTestSuiteTotalCount

	// MetricKindTestSuiteSuccessCount ..
	MetricKindTestSuiteSuccessCount

	// MetricKindTestSuiteFailedCount ..
	MetricKindTestSuiteFailedCount

	// MetricKindTestSuiteSkippedCount ..
	MetricKindTestSuiteSkippedCount

	// MetricKindTestSuiteErrorCount ..
	MetricKindTestSuiteErrorCount

	// MetricKindTestCaseExecutionTime ..
	MetricKindTestCaseExecutionTime

	// MetricKindTestCaseStatus ..
	MetricKindTestCaseStatus
)

type Metrics

type Metrics map[MetricKey]Metric

Metrics ..

type Pipeline

type Pipeline struct {
	ID                    int
	Coverage              float64
	Timestamp             float64
	DurationSeconds       float64
	QueuedDurationSeconds float64
	Source                string
	Status                string
	Variables             string
	TestReport            TestReport
}

Pipeline ..

func NewPipeline

func NewPipeline(ctx context.Context, gp goGitlab.Pipeline) Pipeline

NewPipeline ..

type Project

type Project struct {
	config.Project

	Topics string
}

Project ..

func NewProject added in v0.5.0

func NewProject(name string) Project

NewProject ..

func (Project) Key

func (p Project) Key() ProjectKey

Key ..

type ProjectKey

type ProjectKey string

ProjectKey ..

type Projects

type Projects map[ProjectKey]Project

Projects ..

type Ref

type Ref struct {
	Kind           RefKind
	Name           string
	Project        Project
	LatestPipeline Pipeline
	LatestJobs     Jobs
}

Ref is what we will use a metrics entity on which we will perform regular pulling operations.

func NewRef

func NewRef(
	project Project,
	kind RefKind,
	name string,
) Ref

NewRef is an helper which returns a new Ref.

func (Ref) DefaultLabelsValues

func (ref Ref) DefaultLabelsValues() map[string]string

DefaultLabelsValues ..

func (Ref) Key

func (ref Ref) Key() RefKey

Key ..

type RefKey

type RefKey string

RefKey ..

type RefKind

type RefKind string

RefKind is used to determine the kind of the ref.

const (

	// RefKindBranch refers to a branch.
	RefKindBranch RefKind = "branch"

	// RefKindTag refers to a tag.
	RefKindTag RefKind = "tag"

	// RefKindMergeRequest refers to a tag.
	RefKindMergeRequest RefKind = "merge-request"
)

type Refs

type Refs map[RefKey]Ref

Refs allows us to keep track of all the Ref we have configured/discovered.

func (Refs) Count

func (refs Refs) Count() int

Count returns the amount of projects refs in the map.

type Runner added in v0.4.6

type Runner struct {
	Description string
}

Runner ..

type TaskType added in v0.5.1

type TaskType string

TaskType represents the type of a task.

const (
	// TaskTypePullProject ..
	TaskTypePullProject TaskType = "PullProject"

	// TaskTypePullProjectsFromWildcard ..
	TaskTypePullProjectsFromWildcard TaskType = "PullProjectsFromWildcard"

	// TaskTypePullProjectsFromWildcards ..
	TaskTypePullProjectsFromWildcards TaskType = "PullProjectsFromWildcards"

	// TaskTypePullEnvironmentsFromProject ..
	TaskTypePullEnvironmentsFromProject TaskType = "PullEnvironmentsFromProject"

	// TaskTypePullEnvironmentsFromProjects ..
	TaskTypePullEnvironmentsFromProjects TaskType = "PullEnvironmentsFromProjects"

	// TaskTypePullEnvironmentMetrics ..
	TaskTypePullEnvironmentMetrics TaskType = "PullEnvironmentMetrics"

	// TaskTypePullMetrics ..
	TaskTypePullMetrics TaskType = "PullMetrics"

	// TaskTypePullRefsFromProject ..
	TaskTypePullRefsFromProject TaskType = "PullRefsFromProject"

	// TaskTypePullRefsFromProjects ..
	TaskTypePullRefsFromProjects TaskType = "PullRefsFromProjects"

	// TaskTypePullRefMetrics ..
	TaskTypePullRefMetrics TaskType = "PullRefMetrics"

	// TaskTypeGarbageCollectProjects ..
	TaskTypeGarbageCollectProjects TaskType = "GarbageCollectProjects"

	// TaskTypeGarbageCollectEnvironments ..
	TaskTypeGarbageCollectEnvironments TaskType = "GarbageCollectEnvironments"

	// TaskTypeGarbageCollectRefs ..
	TaskTypeGarbageCollectRefs TaskType = "GarbageCollectRefs"

	// TaskTypeGarbageCollectMetrics ..
	TaskTypeGarbageCollectMetrics TaskType = "GarbageCollectMetrics"
)

type Tasks added in v0.5.1

type Tasks map[TaskType]map[string]interface{}

Tasks can be used to keep track of tasks.

type TestCase added in v0.5.6

type TestCase struct {
	Name          string
	Classname     string
	ExecutionTime float64
	Status        string
}

TestCase ..

func NewTestCase added in v0.5.6

func NewTestCase(gtc *goGitlab.PipelineTestCases) TestCase

NewTestCase ..

type TestReport added in v0.5.5

type TestReport struct {
	TotalTime    float64
	TotalCount   int
	SuccessCount int
	FailedCount  int
	SkippedCount int
	ErrorCount   int
	TestSuites   []TestSuite
}

TestReport ..

func NewTestReport added in v0.5.5

func NewTestReport(gtr goGitlab.PipelineTestReport) TestReport

NewTestReport ..

type TestSuite added in v0.5.5

type TestSuite struct {
	Name         string
	TotalTime    float64
	TotalCount   int
	SuccessCount int
	FailedCount  int
	SkippedCount int
	ErrorCount   int
	TestCases    []TestCase
}

TestSuite ..

func NewTestSuite added in v0.5.5

func NewTestSuite(gts *goGitlab.PipelineTestSuites) TestSuite

NewTestSuite ..

Jump to

Keyboard shortcuts

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