types

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestCaseStatusFailed  = "failed"
	TestCaseStatusError   = "error"
	TestCaseStatusSkipped = "skipped"
	TestCaseStatusSuccess = "success"
)

Variables

This section is empty.

Functions

func ConvertTestReport

func ConvertTestReport(xmlReport junitxml.TestReport, job JobReference) (TestReport, []TestSuite, []TestCase)

Types

type CoverageClass

type CoverageClass struct {
	Id      string
	Package CoveragePackageReference

	Name       string
	Filename   string
	LineRate   float32
	BranchRate float32
	Complexity float32
}

type CoverageClassReference

type CoverageClassReference struct {
	Id   string
	Name string

	Package CoveragePackageReference
}

type CoverageLine

type CoverageLine struct {
	ClassId   string
	MethodId  string
	PackageId string
	Report    CoverageReportReference

	Number int32
	Hits   int32
	Branch bool

	ConditionCoverage float32
	ConditionsCovered int32
	ConditionsValid   int32
}

type CoverageMethod

type CoverageMethod struct {
	Id    string
	Class CoverageClassReference

	Name       string
	Signature  string
	LineRate   float32
	BranchRate float32
	Complexity float32
}

type CoveragePackage

type CoveragePackage struct {
	Id     string
	Report CoverageReportReference

	Name       string
	LineRate   float32
	BranchRate float32
	Complexity float32
}

type CoveragePackageReference

type CoveragePackageReference struct {
	Id   string
	Name string

	Report CoverageReportReference
}

type CoverageReport

type CoverageReport struct {
	Id  string
	Job JobReference

	LineRate     float32
	LinesCovered int32
	LinesValid   int32

	BranchRate      float32
	BranchesCovered int32
	BranchesValid   int32

	Complexity float32

	Version   string
	Timestamp int64

	SourcePaths []string
}

type CoverageReportReference

type CoverageReportReference struct {
	Id  string
	Job JobReference
}

type CoverageSource

type CoverageSource struct {
	Report CoverageReportReference

	Path string
}

type Deployment

type Deployment struct {
	Id  int64
	Iid int64

	Job         JobReference
	Triggerer   UserReference
	Environment EnvironmentReference

	CreatedAt  *time.Time
	FinishedAt *time.Time
	UpdatedAt  *time.Time

	Status string
	Ref    string
	Sha    string
}

type Environment

type Environment struct {
	Id      int64
	Project ProjectReference

	CreatedAt *time.Time
	UpdatedAt *time.Time

	Name        string
	Slug        string
	Description string

	State string
	Tier  string
}

type EnvironmentReference

type EnvironmentReference struct {
	Id   int64
	Name string
	Tier string

	Project ProjectReference
}

type Issue added in v0.18.0

type Issue struct {
	Id      int64
	Iid     int64
	Project ProjectReference

	CreatedAt *time.Time
	UpdatedAt *time.Time
	ClosedAt  *time.Time

	Title  string
	Labels []string

	Type     IssueType
	Severity IssueSeverity
	State    IssueState
}

type IssueSeverity added in v0.18.0

type IssueSeverity string
const (
	IssueSeverityUnspecified IssueSeverity = ""
	IssueSeverityCritical    IssueSeverity = "CRITICAL"
	IssueSeverityHigh        IssueSeverity = "HIGH"
	IssueSeverityLow         IssueSeverity = "LOW"
	IssueSeverityMedium      IssueSeverity = "MEDIUM"
	IssueSeverityUnknown     IssueSeverity = "UNKNOWN"
)

type IssueState added in v0.18.0

type IssueState string
const (
	IssueStateUnknown IssueState = ""
	IssueStateOpened  IssueState = "opened"
	IssueStateClosed  IssueState = "closed"
	IssueStateLocked  IssueState = "locked"
	IssueStateAll     IssueState = "all"
)

type IssueType added in v0.18.0

type IssueType string
const (
	IssueTypeUnspecified IssueType = ""
	IssueTypeEpic        IssueType = "EPIC" // (experimental) introduced in 16.7
	IssueTypeIncident    IssueType = "INCIDENT"
	IssueTypeIssue       IssueType = "ISSUE"
	IssueTypeKeyResult   IssueType = "KEY_RESULT" // (experimental) introduced in 15.7
	IssueTypeObjective   IssueType = "OBJECTIVE"  // (experimental) introduced in 15.6
	IssueTypeRequirement IssueType = "REQUIREMENT"
	IssueTypeTask        IssueType = "TASK"
	IssueTypeTestCase    IssueType = "TEST_CASE"
	IssueTypeTicket      IssueType = "TICKET"
	IssueTypeUnknown     IssueType = "UNKNOWN"
)

type Job

type Job struct {
	Id       int64
	Name     string
	Pipeline PipelineReference

	Ref           string
	RefPath       string
	Status        string
	FailureReason string

	CreatedAt  *time.Time
	QueuedAt   *time.Time
	StartedAt  *time.Time
	FinishedAt *time.Time
	ErasedAt   *time.Time

	QueuedDuration time.Duration
	Duration       time.Duration
	Coverage       float64

	Stage      string
	Tags       []string
	Properties []JobLogProperty

	ExitCode int64

	AllowFailure bool
	Manual       bool
	Retried      bool
	Retryable    bool

	Kind               JobKind
	DownstreamPipeline *PipelineReference

	Runner RunnerReference
}

type JobArtifact

type JobArtifact struct {
	Job JobReference

	FileType     string
	Name         string
	DownloadPath string
}

type JobKind

type JobKind string
const (
	JobKindUnkown JobKind = "unknown"
	JobKindBuild  JobKind = "build"
	JobKindBridge JobKind = "bridge"
)

type JobLogProperty added in v0.17.0

type JobLogProperty struct {
	Name  string
	Value string
}

type JobReference

type JobReference struct {
	Id   int64
	Name string

	Pipeline PipelineReference
}

type MergeRequest

type MergeRequest struct {
	Id      int64
	Iid     int64
	Project ProjectReference

	CreatedAt *time.Time
	UpdatedAt *time.Time
	MergedAt  *time.Time
	ClosedAt  *time.Time

	Name   string
	Title  string
	Labels []string

	State       string
	MergeStatus string
	MergeError  string

	SourceProjectId int64
	SourceBranch    string
	TargetProjectId int64
	TargetBranch    string

	DiffStats    MergeRequestDiffStats
	DiffRefs     MergeRequestDiffRefs
	Participants MergeRequestParticipants

	Approved  bool
	Conflicts bool
	Draft     bool
	Mergeable bool

	UserNotesCount int64

	Milestone *MilestoneReference
}

type MergeRequestDiffRefs

type MergeRequestDiffRefs struct {
	BaseSha  string
	HeadSha  string
	StartSha string

	MergeCommitSha  string
	RebaseCommitSha string
}

type MergeRequestDiffStats

type MergeRequestDiffStats struct {
	Additions   int64
	Changes     int64
	Deletions   int64
	FileCount   int64
	CommitCount int64
}

type MergeRequestNoteEvent

type MergeRequestNoteEvent struct {
	Id           int64
	MergeRequest MergeRequestReference

	CreatedAt *time.Time
	UpdatedAt *time.Time

	Type     string
	System   bool
	Internal bool

	Author UserReference

	Resolvable bool
	Resolved   bool
	ResolvedAt *time.Time
	Resolver   UserReference
}

type MergeRequestParticipants

type MergeRequestParticipants struct {
	Author    UserReference
	Assignees []UserReference
	Reviewers []UserReference
	Approvers []UserReference
	MergeUser UserReference
}

type MergeRequestReference

type MergeRequestReference struct {
	Id  int64
	Iid int64

	Project ProjectReference
}

type Metric

type Metric struct {
	Id  string
	Iid int64
	Job JobReference

	Name      string
	Labels    map[string]string
	Value     float64
	Timestamp int64
}

type MilestoneReference

type MilestoneReference struct {
	Id      int64
	Iid     int64
	Project ProjectReference
}

type NamespaceReference

type NamespaceReference struct {
	Id       int64
	FullPath string
}

type Pipeline

type Pipeline struct {
	Id  int64
	Iid int64

	Project ProjectReference

	Name          string
	Ref           string
	RefPath       string
	Sha           string
	Source        string
	Status        string
	FailureReason string

	CommittedAt *time.Time
	CreatedAt   *time.Time
	UpdatedAt   *time.Time
	StartedAt   *time.Time
	FinishedAt  *time.Time

	QueuedDuration time.Duration
	Duration       time.Duration
	Coverage       float64

	Warnings   bool
	YamlErrors bool

	Child               bool
	UpstreamPipeline    *PipelineReference
	DownstreamPipelines []*PipelineReference

	MergeRequest *MergeRequestReference

	User UserReference
}

type PipelineReference

type PipelineReference struct {
	Id  int64
	Iid int64

	Project ProjectReference
}

type Project

type Project struct {
	Id       int64
	Namspace NamespaceReference

	Name        string
	FullName    string
	Path        string
	FullPath    string
	Description string

	CreatedAt      *time.Time
	UpdatedAt      *time.Time
	LastActivityAt *time.Time

	Statistics ProjectStatistics

	Archived   bool
	Visibility string

	DefaultBranch string
}

type ProjectReference

type ProjectReference struct {
	Id       int64
	FullPath string
}

type ProjectStatistics

type ProjectStatistics struct {
	JobArtifactsSize      int64
	ContainerRegistrySize int64
	LfsObjectsSize        int64
	PackagesSize          int64
	PipelineArtifactsSize int64
	RepositorySize        int64
	SnippetsSize          int64
	StorageSize           int64
	UploadsSize           int64
	WikiSize              int64

	CommitCount int64
	StarCount   int64
	ForksCount  int64
}

type Runner added in v0.22.0

type Runner struct {
	Id          int64
	ShortSha    string
	Description string

	RunnerType RunnerType
	TagList    []string

	Status RunnerStatus

	Locked bool
	Paused bool

	RunProtected bool
	RunUntagged  bool

	CreatedAt   *time.Time
	ContactedAt *time.Time

	CreatedBy UserReference
}

type RunnerAccessLevel added in v0.22.0

type RunnerAccessLevel string
const (
	RunnerAccessLevelNotProtected RunnerAccessLevel = "NOT_PROTECTED"
	RunnerAccessLevelRefProtected RunnerAccessLevel = "REF_PROTECTED"
	RunnerAccessLevelUnknown      RunnerAccessLevel = "UNKNOWN"
)

type RunnerReference added in v0.22.0

type RunnerReference struct {
	Id       int64
	ShortSha string
}

type RunnerStatus added in v0.22.0

type RunnerStatus string
const (
	// Runner that contacted the instance within the last 2 hours.
	RunnerStatusOnline RunnerStatus = "ONLINE"
	// Runner that has not contacted the instance within the last 2 hours.
	RunnerStatusOffline RunnerStatus = "OFFLINE"
	// Runner that has not contacted the instance within the last 7 days.
	RunnerStatusStale RunnerStatus = "STALE"
	// Runner that has never contacted the instance.
	RunnerStatusNeverContacted RunnerStatus = "NEVER_CONTACTED"
	// Unknown runner status.
	RunnerStatusUnknown RunnerStatus = "UNKNOWN"
)

type RunnerType added in v0.22.0

type RunnerType string
const (
	RunnerTypeInstance RunnerType = "INSTANCE"
	RunnerTypeGroup    RunnerType = "GROUP"
	RunnerTypeProject  RunnerType = "PROJECT"
	RunnerTypeUnknown  RunnerType = "UNKNOWN"
)

type Section

type Section struct {
	Id  int64
	Job JobReference

	Name       string
	StartedAt  *time.Time
	FinishedAt *time.Time
	Duration   time.Duration
}

type TestCase

type TestCase struct {
	Id        string
	TestSuite TestSuiteReference

	Name          string
	Classname     string
	Status        string
	ExecutionTime time.Duration
	File          string
	StackTrace    string
	SystemOutput  string
	AttachmentUrl string

	Properties []TestProperty
}

type TestCaseStatus

type TestCaseStatus string

type TestProperty

type TestProperty struct {
	Name  string
	Value string
}

type TestReport

type TestReport struct {
	Id  string
	Job JobReference

	TotalTime    time.Duration
	TotalCount   int64
	ErrorCount   int64
	FailedCount  int64
	SkippedCount int64
	SuccessCount int64
}

type TestReportReference

type TestReportReference struct {
	Id  string
	Job JobReference
}

type TestSuite

type TestSuite struct {
	Id         string
	TestReport TestReportReference

	Name         string
	TotalTime    time.Duration
	TotalCount   int64
	ErrorCount   int64
	FailedCount  int64
	SkippedCount int64
	SuccessCount int64

	Properties []TestProperty
}

type TestSuiteReference

type TestSuiteReference struct {
	Id         string
	TestReport TestReportReference
}

type UserReference

type UserReference struct {
	Id       int64
	Username string
	Name     string
}

Jump to

Keyboard shortcuts

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