estafette

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 45 Imported by: 0

Documentation

Overview

Package estafette is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoBuildCreated    = errors.New("No build is created")
	ErrNoReleaseCreated  = errors.New("No release is created")
	ErrNoBotCreated      = errors.New("No bot is created")
	ErrReleaseNotAllowed = &ReleaseError{Message: releaseNotAllowed}
)

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(templatesPath string, config *api.APIConfig, encryptedConfig *api.APIConfig, databaseClient database.Client, cloudStorageClient cloudstorage.Client, ciBuilderClient builderapi.Client, buildService Service, warningHelper api.WarningHelper, secretHelper crypt.SecretHelper, gcsMigratorClient migrationpb.ServiceClient) Handler

NewHandler returns a new estafette.Handler

func (*Handler) CancelPipelineBot

func (h *Handler) CancelPipelineBot(c *gin.Context)

func (*Handler) CancelPipelineBuild

func (h *Handler) CancelPipelineBuild(c *gin.Context)

func (*Handler) CancelPipelineRelease

func (h *Handler) CancelPipelineRelease(c *gin.Context)

func (*Handler) Commands

func (h *Handler) Commands(c *gin.Context)

func (*Handler) CreateNotification

func (h *Handler) CreateNotification(c *gin.Context)

func (*Handler) CreatePipelineBot

func (h *Handler) CreatePipelineBot(c *gin.Context)

func (*Handler) CreatePipelineBuild

func (h *Handler) CreatePipelineBuild(c *gin.Context)

func (*Handler) CreatePipelineRelease

func (h *Handler) CreatePipelineRelease(c *gin.Context)

func (*Handler) EncryptSecret

func (h *Handler) EncryptSecret(c *gin.Context)

func (*Handler) GenerateManifest

func (h *Handler) GenerateManifest(c *gin.Context)

func (*Handler) GetAllMigrations

func (h *Handler) GetAllMigrations(c *gin.Context)

func (*Handler) GetAllNotifications

func (h *Handler) GetAllNotifications(c *gin.Context)

func (*Handler) GetAllPipelineBots

func (h *Handler) GetAllPipelineBots(c *gin.Context)

func (*Handler) GetAllPipelineBuilds

func (h *Handler) GetAllPipelineBuilds(c *gin.Context)

func (*Handler) GetAllPipelineReleases

func (h *Handler) GetAllPipelineReleases(c *gin.Context)

func (*Handler) GetAllPipelinesReleaseTargets

func (h *Handler) GetAllPipelinesReleaseTargets(c *gin.Context)

func (*Handler) GetAllReleasesReleaseTargets

func (h *Handler) GetAllReleasesReleaseTargets(c *gin.Context)

func (*Handler) GetCatalogFilterValues

func (h *Handler) GetCatalogFilterValues(c *gin.Context)

func (*Handler) GetCatalogFilters

func (h *Handler) GetCatalogFilters(c *gin.Context)

func (*Handler) GetConfig

func (h *Handler) GetConfig(c *gin.Context)

func (*Handler) GetConfigBuildControl

func (h *Handler) GetConfigBuildControl(c *gin.Context)

func (*Handler) GetConfigCredentials

func (h *Handler) GetConfigCredentials(c *gin.Context)

func (*Handler) GetConfigTrustedImages

func (h *Handler) GetConfigTrustedImages(c *gin.Context)

func (*Handler) GetFrequentLabels

func (h *Handler) GetFrequentLabels(c *gin.Context)

func (*Handler) GetManifestTemplates

func (h *Handler) GetManifestTemplates(c *gin.Context)

func (*Handler) GetMigratedBuild

func (h *Handler) GetMigratedBuild(c *gin.Context)

func (*Handler) GetMigratedRelease

func (h *Handler) GetMigratedRelease(c *gin.Context)

func (*Handler) GetMigrationByFromRepo

func (h *Handler) GetMigrationByFromRepo(c *gin.Context)

func (*Handler) GetMigrationByID

func (h *Handler) GetMigrationByID(c *gin.Context)

func (*Handler) GetPipeline

func (h *Handler) GetPipeline(c *gin.Context)

func (*Handler) GetPipelineBot

func (h *Handler) GetPipelineBot(c *gin.Context)

func (*Handler) GetPipelineBotLogs

func (h *Handler) GetPipelineBotLogs(c *gin.Context)

func (*Handler) GetPipelineBotLogsByID

func (h *Handler) GetPipelineBotLogsByID(c *gin.Context)

func (*Handler) GetPipelineBotLogsPerPage

func (h *Handler) GetPipelineBotLogsPerPage(c *gin.Context)

func (*Handler) GetPipelineBotNames

func (h *Handler) GetPipelineBotNames(c *gin.Context)

func (*Handler) GetPipelineBots

func (h *Handler) GetPipelineBots(c *gin.Context)

func (*Handler) GetPipelineBuild

func (h *Handler) GetPipelineBuild(c *gin.Context)

func (*Handler) GetPipelineBuildBranches

func (h *Handler) GetPipelineBuildBranches(c *gin.Context)

func (*Handler) GetPipelineBuildLogs

func (h *Handler) GetPipelineBuildLogs(c *gin.Context)

func (*Handler) GetPipelineBuildLogsByID

func (h *Handler) GetPipelineBuildLogsByID(c *gin.Context)

func (*Handler) GetPipelineBuildLogsPerPage

func (h *Handler) GetPipelineBuildLogsPerPage(c *gin.Context)

func (*Handler) GetPipelineBuildWarnings

func (h *Handler) GetPipelineBuildWarnings(c *gin.Context)

func (*Handler) GetPipelineBuilds

func (h *Handler) GetPipelineBuilds(c *gin.Context)

func (*Handler) GetPipelineRecentBuilds

func (h *Handler) GetPipelineRecentBuilds(c *gin.Context)

func (*Handler) GetPipelineRelease

func (h *Handler) GetPipelineRelease(c *gin.Context)

func (*Handler) GetPipelineReleaseLogs

func (h *Handler) GetPipelineReleaseLogs(c *gin.Context)

func (*Handler) GetPipelineReleaseLogsByID

func (h *Handler) GetPipelineReleaseLogsByID(c *gin.Context)

func (*Handler) GetPipelineReleaseLogsPerPage

func (h *Handler) GetPipelineReleaseLogsPerPage(c *gin.Context)

func (*Handler) GetPipelineReleases

func (h *Handler) GetPipelineReleases(c *gin.Context)

func (*Handler) GetPipelineStatsBotsCPUUsageMeasurements

func (h *Handler) GetPipelineStatsBotsCPUUsageMeasurements(c *gin.Context)

func (*Handler) GetPipelineStatsBotsDurations

func (h *Handler) GetPipelineStatsBotsDurations(c *gin.Context)

func (*Handler) GetPipelineStatsBotsMemoryUsageMeasurements

func (h *Handler) GetPipelineStatsBotsMemoryUsageMeasurements(c *gin.Context)

func (*Handler) GetPipelineStatsBuildsCPUUsageMeasurements

func (h *Handler) GetPipelineStatsBuildsCPUUsageMeasurements(c *gin.Context)

func (*Handler) GetPipelineStatsBuildsDurations

func (h *Handler) GetPipelineStatsBuildsDurations(c *gin.Context)

func (*Handler) GetPipelineStatsBuildsMemoryUsageMeasurements

func (h *Handler) GetPipelineStatsBuildsMemoryUsageMeasurements(c *gin.Context)

func (*Handler) GetPipelineStatsReleasesCPUUsageMeasurements

func (h *Handler) GetPipelineStatsReleasesCPUUsageMeasurements(c *gin.Context)

func (*Handler) GetPipelineStatsReleasesDurations

func (h *Handler) GetPipelineStatsReleasesDurations(c *gin.Context)

func (*Handler) GetPipelineStatsReleasesMemoryUsageMeasurements

func (h *Handler) GetPipelineStatsReleasesMemoryUsageMeasurements(c *gin.Context)

func (*Handler) GetPipelineWarnings

func (h *Handler) GetPipelineWarnings(c *gin.Context)

func (*Handler) GetPipelines

func (h *Handler) GetPipelines(c *gin.Context)

func (*Handler) GetReleaseTargets

func (h *Handler) GetReleaseTargets(c *gin.Context)

func (*Handler) GetStatsBotsAdoption

func (h *Handler) GetStatsBotsAdoption(c *gin.Context)

func (*Handler) GetStatsBotsCount

func (h *Handler) GetStatsBotsCount(c *gin.Context)

func (*Handler) GetStatsBuildsAdoption

func (h *Handler) GetStatsBuildsAdoption(c *gin.Context)

func (*Handler) GetStatsBuildsCount

func (h *Handler) GetStatsBuildsCount(c *gin.Context)

func (*Handler) GetStatsBuildsDuration

func (h *Handler) GetStatsBuildsDuration(c *gin.Context)

func (*Handler) GetStatsMostBots

func (h *Handler) GetStatsMostBots(c *gin.Context)

func (*Handler) GetStatsMostBuilds

func (h *Handler) GetStatsMostBuilds(c *gin.Context)

func (*Handler) GetStatsMostReleases

func (h *Handler) GetStatsMostReleases(c *gin.Context)

func (*Handler) GetStatsPipelinesCount

func (h *Handler) GetStatsPipelinesCount(c *gin.Context)

func (*Handler) GetStatsReleasesAdoption

func (h *Handler) GetStatsReleasesAdoption(c *gin.Context)

func (*Handler) GetStatsReleasesCount

func (h *Handler) GetStatsReleasesCount(c *gin.Context)

func (*Handler) PollMigrationTasks

func (h *Handler) PollMigrationTasks(stop <-chan struct{}, done func())

func (*Handler) PostPipelineBotLogs

func (h *Handler) PostPipelineBotLogs(c *gin.Context)

func (*Handler) PostPipelineBuildLogs

func (h *Handler) PostPipelineBuildLogs(c *gin.Context)

func (*Handler) PostPipelineReleaseLogs

func (h *Handler) PostPipelineReleaseLogs(c *gin.Context)

func (*Handler) QueueMigration

func (h *Handler) QueueMigration(c *gin.Context)

func (*Handler) RollbackMigration

func (h *Handler) RollbackMigration(c *gin.Context)

func (*Handler) SetPipelineArchival

func (h *Handler) SetPipelineArchival(archived bool) func(c *gin.Context)

func (*Handler) TailPipelineBotLogs

func (h *Handler) TailPipelineBotLogs(c *gin.Context)

func (*Handler) TailPipelineBuildLogs

func (h *Handler) TailPipelineBuildLogs(c *gin.Context)

func (*Handler) TailPipelineReleaseLogs

func (h *Handler) TailPipelineReleaseLogs(c *gin.Context)

func (*Handler) ValidateManifest

func (h *Handler) ValidateManifest(c *gin.Context)

type MockService

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

MockService is a mock of Service interface.

func NewMockService

func NewMockService(ctrl *gomock.Controller) *MockService

NewMockService creates a new mock instance.

func (*MockService) Archive

func (m *MockService) Archive(ctx context.Context, repoSource, repoOwner, repoName string) error

Archive mocks base method.

func (*MockService) CreateBot

func (m *MockService) CreateBot(ctx context.Context, bot contracts.Bot, mft manifest.EstafetteManifest, repoBranch string) (*contracts.Bot, error)

CreateBot mocks base method.

func (*MockService) CreateBuild

func (m *MockService) CreateBuild(ctx context.Context, build contracts.Build) (*contracts.Build, error)

CreateBuild mocks base method.

func (*MockService) CreateRelease

func (m *MockService) CreateRelease(ctx context.Context, release contracts.Release, mft manifest.EstafetteManifest, repoBranch, repoRevision string) (*contracts.Release, error)

CreateRelease mocks base method.

func (*MockService) EXPECT

func (m *MockService) EXPECT() *MockServiceMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockService) FinishBot

func (m *MockService) FinishBot(ctx context.Context, repoSource, repoOwner, repoName, botID string, botStatus contracts.Status) error

FinishBot mocks base method.

func (*MockService) FinishBuild

func (m *MockService) FinishBuild(ctx context.Context, repoSource, repoOwner, repoName, buildID string, buildStatus contracts.Status) error

FinishBuild mocks base method.

func (*MockService) FinishRelease

func (m *MockService) FinishRelease(ctx context.Context, repoSource, repoOwner, repoName, releaseID string, releaseStatus contracts.Status) error

FinishRelease mocks base method.

func (*MockService) FireBitbucketTriggers

func (m *MockService) FireBitbucketTriggers(ctx context.Context, bitbucketEvent manifest.EstafetteBitbucketEvent) error

FireBitbucketTriggers mocks base method.

func (*MockService) FireCronTriggers

func (m *MockService) FireCronTriggers(ctx context.Context, cronEvent manifest.EstafetteCronEvent) error

FireCronTriggers mocks base method.

func (*MockService) FireGitTriggers

func (m *MockService) FireGitTriggers(ctx context.Context, gitEvent manifest.EstafetteGitEvent) error

FireGitTriggers mocks base method.

func (*MockService) FireGithubTriggers

func (m *MockService) FireGithubTriggers(ctx context.Context, githubEvent manifest.EstafetteGithubEvent) error

FireGithubTriggers mocks base method.

func (*MockService) FirePipelineTriggers

func (m *MockService) FirePipelineTriggers(ctx context.Context, build contracts.Build, event string) error

FirePipelineTriggers mocks base method.

func (*MockService) FirePubSubTriggers

func (m *MockService) FirePubSubTriggers(ctx context.Context, pubsubEvent manifest.EstafettePubSubEvent) error

FirePubSubTriggers mocks base method.

func (*MockService) FireReleaseTriggers

func (m *MockService) FireReleaseTriggers(ctx context.Context, release contracts.Release, event string) error

FireReleaseTriggers mocks base method.

func (*MockService) GetEventsForJobEnvvars

func (m *MockService) GetEventsForJobEnvvars(ctx context.Context, triggers []manifest.EstafetteTrigger, events []manifest.EstafetteEvent) ([]manifest.EstafetteEvent, error)

GetEventsForJobEnvvars mocks base method.

func (*MockService) Rename

func (m *MockService) Rename(ctx context.Context, fromRepoSource, fromRepoOwner, fromRepoName, toRepoSource, toRepoOwner, toRepoName string) error

Rename mocks base method.

func (*MockService) Unarchive

func (m *MockService) Unarchive(ctx context.Context, repoSource, repoOwner, repoName string) error

Unarchive mocks base method.

func (*MockService) UpdateBuildStatus

func (m *MockService) UpdateBuildStatus(ctx context.Context, event contracts.EstafetteCiBuilderEvent) error

UpdateBuildStatus mocks base method.

func (*MockService) UpdateJobResources

func (m *MockService) UpdateJobResources(ctx context.Context, event contracts.EstafetteCiBuilderEvent) error

UpdateJobResources mocks base method.

type MockServiceMockRecorder

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

MockServiceMockRecorder is the mock recorder for MockService.

func (*MockServiceMockRecorder) Archive

func (mr *MockServiceMockRecorder) Archive(ctx, repoSource, repoOwner, repoName interface{}) *gomock.Call

Archive indicates an expected call of Archive.

func (*MockServiceMockRecorder) CreateBot

func (mr *MockServiceMockRecorder) CreateBot(ctx, bot, mft, repoBranch interface{}) *gomock.Call

CreateBot indicates an expected call of CreateBot.

func (*MockServiceMockRecorder) CreateBuild

func (mr *MockServiceMockRecorder) CreateBuild(ctx, build interface{}) *gomock.Call

CreateBuild indicates an expected call of CreateBuild.

func (*MockServiceMockRecorder) CreateRelease

func (mr *MockServiceMockRecorder) CreateRelease(ctx, release, mft, repoBranch, repoRevision interface{}) *gomock.Call

CreateRelease indicates an expected call of CreateRelease.

func (*MockServiceMockRecorder) FinishBot

func (mr *MockServiceMockRecorder) FinishBot(ctx, repoSource, repoOwner, repoName, botID, botStatus interface{}) *gomock.Call

FinishBot indicates an expected call of FinishBot.

func (*MockServiceMockRecorder) FinishBuild

func (mr *MockServiceMockRecorder) FinishBuild(ctx, repoSource, repoOwner, repoName, buildID, buildStatus interface{}) *gomock.Call

FinishBuild indicates an expected call of FinishBuild.

func (*MockServiceMockRecorder) FinishRelease

func (mr *MockServiceMockRecorder) FinishRelease(ctx, repoSource, repoOwner, repoName, releaseID, releaseStatus interface{}) *gomock.Call

FinishRelease indicates an expected call of FinishRelease.

func (*MockServiceMockRecorder) FireBitbucketTriggers

func (mr *MockServiceMockRecorder) FireBitbucketTriggers(ctx, bitbucketEvent interface{}) *gomock.Call

FireBitbucketTriggers indicates an expected call of FireBitbucketTriggers.

func (*MockServiceMockRecorder) FireCronTriggers

func (mr *MockServiceMockRecorder) FireCronTriggers(ctx, cronEvent interface{}) *gomock.Call

FireCronTriggers indicates an expected call of FireCronTriggers.

func (*MockServiceMockRecorder) FireGitTriggers

func (mr *MockServiceMockRecorder) FireGitTriggers(ctx, gitEvent interface{}) *gomock.Call

FireGitTriggers indicates an expected call of FireGitTriggers.

func (*MockServiceMockRecorder) FireGithubTriggers

func (mr *MockServiceMockRecorder) FireGithubTriggers(ctx, githubEvent interface{}) *gomock.Call

FireGithubTriggers indicates an expected call of FireGithubTriggers.

func (*MockServiceMockRecorder) FirePipelineTriggers

func (mr *MockServiceMockRecorder) FirePipelineTriggers(ctx, build, event interface{}) *gomock.Call

FirePipelineTriggers indicates an expected call of FirePipelineTriggers.

func (*MockServiceMockRecorder) FirePubSubTriggers

func (mr *MockServiceMockRecorder) FirePubSubTriggers(ctx, pubsubEvent interface{}) *gomock.Call

FirePubSubTriggers indicates an expected call of FirePubSubTriggers.

func (*MockServiceMockRecorder) FireReleaseTriggers

func (mr *MockServiceMockRecorder) FireReleaseTriggers(ctx, release, event interface{}) *gomock.Call

FireReleaseTriggers indicates an expected call of FireReleaseTriggers.

func (*MockServiceMockRecorder) GetEventsForJobEnvvars

func (mr *MockServiceMockRecorder) GetEventsForJobEnvvars(ctx, triggers, events interface{}) *gomock.Call

GetEventsForJobEnvvars indicates an expected call of GetEventsForJobEnvvars.

func (*MockServiceMockRecorder) Rename

func (mr *MockServiceMockRecorder) Rename(ctx, fromRepoSource, fromRepoOwner, fromRepoName, toRepoSource, toRepoOwner, toRepoName interface{}) *gomock.Call

Rename indicates an expected call of Rename.

func (*MockServiceMockRecorder) Unarchive

func (mr *MockServiceMockRecorder) Unarchive(ctx, repoSource, repoOwner, repoName interface{}) *gomock.Call

Unarchive indicates an expected call of Unarchive.

func (*MockServiceMockRecorder) UpdateBuildStatus

func (mr *MockServiceMockRecorder) UpdateBuildStatus(ctx, event interface{}) *gomock.Call

UpdateBuildStatus indicates an expected call of UpdateBuildStatus.

func (*MockServiceMockRecorder) UpdateJobResources

func (mr *MockServiceMockRecorder) UpdateJobResources(ctx, event interface{}) *gomock.Call

UpdateJobResources indicates an expected call of UpdateJobResources.

type ReleaseError

type ReleaseError struct {
	Cluster                  string                        `json:"cluster,omitempty"`
	Message                  string                        `json:"message,omitempty"`
	RepositoryReleaseControl *api.RepositoryReleaseControl `json:"repositoryReleaseControl,omitempty"`
}

func (*ReleaseError) Error

func (r *ReleaseError) Error() string

func (*ReleaseError) Is

func (r *ReleaseError) Is(target error) bool

type Service

type Service interface {
	CreateBuild(ctx context.Context, build contracts.Build) (b *contracts.Build, err error)
	FinishBuild(ctx context.Context, repoSource, repoOwner, repoName string, buildID string, buildStatus contracts.Status) (err error)
	CreateRelease(ctx context.Context, release contracts.Release, mft manifest.EstafetteManifest, repoBranch, repoRevision string) (r *contracts.Release, err error)
	FinishRelease(ctx context.Context, repoSource, repoOwner, repoName string, releaseID string, releaseStatus contracts.Status) (err error)
	CreateBot(ctx context.Context, bot contracts.Bot, mft manifest.EstafetteManifest, repoBranch string) (b *contracts.Bot, err error)
	FinishBot(ctx context.Context, repoSource, repoOwner, repoName string, botID string, botStatus contracts.Status) (err error)
	FireGitTriggers(ctx context.Context, gitEvent manifest.EstafetteGitEvent) (err error)
	FirePipelineTriggers(ctx context.Context, build contracts.Build, event string) (err error)
	FireReleaseTriggers(ctx context.Context, release contracts.Release, event string) (err error)
	FirePubSubTriggers(ctx context.Context, pubsubEvent manifest.EstafettePubSubEvent) (err error)
	FireCronTriggers(ctx context.Context, cronEvent manifest.EstafetteCronEvent) (err error)
	FireGithubTriggers(ctx context.Context, githubEvent manifest.EstafetteGithubEvent) (err error)
	FireBitbucketTriggers(ctx context.Context, bitbucketEvent manifest.EstafetteBitbucketEvent) (err error)
	Rename(ctx context.Context, fromRepoSource, fromRepoOwner, fromRepoName, toRepoSource, toRepoOwner, toRepoName string) (err error)
	Archive(ctx context.Context, repoSource, repoOwner, repoName string) (err error)
	Unarchive(ctx context.Context, repoSource, repoOwner, repoName string) (err error)
	UpdateBuildStatus(ctx context.Context, event contracts.EstafetteCiBuilderEvent) (err error)
	UpdateJobResources(ctx context.Context, event contracts.EstafetteCiBuilderEvent) (err error)
	GetEventsForJobEnvvars(ctx context.Context, triggers []manifest.EstafetteTrigger, events []manifest.EstafetteEvent) (triggersAsEvents []manifest.EstafetteEvent, err error)
}

Service encapsulates build and release creation and re-triggering

func NewLoggingService

func NewLoggingService(s Service) Service

NewLoggingService returns a new instance of a logging Service.

func NewMetricsService

func NewMetricsService(s Service, requestCount metrics.Counter, requestLatency metrics.Histogram) Service

NewMetricsService returns a new instance of a metrics Service.

func NewService

func NewService(config *api.APIConfig, databaseClient database.Client, secretHelper crypt.SecretHelper, prometheusClient prometheus.Client, cloudStorageClient cloudstorage.Client, builderapiClient builderapi.Client, githubJobVarsFunc func(context.Context, string, string, string) (string, error), bitbucketJobVarsFunc func(context.Context, string, string, string) (string, error), cloudsourceJobVarsFunc func(context.Context, string, string, string) (string, error)) Service

NewService returns a new estafette.Service

func NewTracingService

func NewTracingService(s Service) Service

NewTracingService returns a new instance of a tracing Service.

Jump to

Keyboard shortcuts

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