sdk

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 65 Imported by: 469

Documentation

Index

Constants

View Source
const (
	DefaultAction = "Default"
	BuiltinAction = "Builtin"
	PluginAction  = "Plugin"
	JoinedAction  = "Joined"
	AsCodeAction  = "ActionAsCode"
)

Action type

View Source
const (
	ScriptAction              = "Script"
	JUnitAction               = "JUnit"
	CoverageAction            = "Coverage"
	GitCloneAction            = "GitClone"
	GitTagAction              = "GitTag"
	ReleaseVCSAction          = "ReleaseVCS"
	CheckoutApplicationAction = "CheckoutApplication"
	DeployApplicationAction   = "DeployApplication"
	PushBuildInfo             = "PushBuildInfo"
	InstallKeyAction          = "InstallKey"
	ReleaseAction             = "Release"
	PromoteAction             = "Promote"

	DefaultGitCloneParameterTagValue = "{{.git.tag}}"
)

Builtin Action

View Source
const (
	ArtifactUpload   = "Artifact Upload"
	ArtifactDownload = "Artifact Download"

	ArtifactUploadPluginInputPath = "cds.integration.artifact_manager.upload.path"

	ArtifactUploadPluginOutputPathFileName = "name"
	ArtifactUploadPluginOutputPathFilePath = "path"
	ArtifactUploadPluginOutputPathRepoType = "repository_type"
	ArtifactUploadPluginOutputPathRepoName = "repository_name"
	ArtifactUploadPluginOutputPathMD5      = "md5"
	ArtifactUploadPluginOutputPerm         = "perm"
	ArtifactUploadPluginOutputSize         = "size"
	ArtifactUploadPluginOutputFileType     = "file_type"

	ArtifactDownloadPluginInputDestinationPath = "cds.integration.artifact_manager.download.destination.path"
	ArtifactDownloadPluginInputFilePath        = "cds.integration.artifact_manager.download.file.path"
	ArtifactDownloadPluginInputMd5             = "cds.integration.artifact_manager.download.file.md5"
	ArtifactDownloadPluginInputPerm            = "cds.integration.artifact_manager.download.file.perm"

	ArtifactFileTypeCoverage = "coverage"
)

Builtin artifact manipulation actions

View Source
const (
	AuditAdd    = "add"
	AuditUpdate = "update"
	AuditDelete = "delete"
)

Different type of Audit event

View Source
const (
	StatusPending           = "Pending"
	StatusWaiting           = "Waiting"
	StatusChecking          = "Checking" // DEPRECATED, to remove when removing pipelineBuild
	StatusBuilding          = "Building"
	StatusSuccess           = "Success"
	StatusFail              = "Fail"
	StatusDisabled          = "Disabled"
	StatusNeverBuilt        = "Never Built"
	StatusUnknown           = "Unknown"
	StatusSkipped           = "Skipped"
	StatusStopped           = "Stopped"
	StatusWorkerPending     = "Pending"
	StatusWorkerRegistering = "Registering"

	StatusCrafting   = "Crafting"
	StatusScheduling = "Scheduling"
)

Action status in queue

View Source
const (
	EntityTypeWorkerModel = "WorkerModel"
	EntityTypeAction      = "Action"
	EntityTypeWorkflow    = "Workflow"
	EntityTypeJob         = "Job"
	EntityNamePattern     = "^[a-zA-Z0-9._-]{1,}$"
)
View Source
const (
	EventAnalysisStart = "AnalysisStart"
	EventAnalysisDone  = "AnalysisDone"

	EventRunJobEnqueued         = "RunJobEnqueued"
	EventRunJobScheduled        = "RunJobScheduled"
	EventRunJobBuilding         = "RunJobBuilding"
	EventRunJobManualTriggered  = "RunJobManualTriggered"
	EventRunJobRunResultAdded   = "RunJobRunResultAdded"
	EventRunJobRunResultUpdated = "RunJobRunResultUpdated"
	EventRunJobEnded            = "RunJobEnded"

	EventRunCrafted          = "RunCrafted"
	EventRunBuilding         = "RunBuilding"
	EventRunEnded            = "RunEnded"
	EventRunRestartFailedJob = "RunRestartFailedJob"

	EventEntityCreated = "EntityCreated"
	EventEntityUpdated = "EntityUpdated"
	EventEntityDeleted = "EntityDeleted"

	EventVCSCreated = "VCSCreated"
	EventVCSUpdated = "VCSUpdated"
	EventVCSDeleted = "VCSDeleted"

	EventHatcheryCreated    = "HatcheryCreated"
	EventHatcheryUpdated    = "HatcheryUpdated"
	EventHatcheryTokenRegen = "HatcheryTokenRegen"
	EventHatcheryDeleted    = "HatcheryDeleted"

	EventRepositoryCreated = "RepositoryCreated"
	EventRepositoryDeleted = "RepositoryDeleted"

	EventOrganizationCreated = "OrganizationCreated"
	EventOrganizationDeleted = "OrganizationDeleted"

	EventRegionCreated = "RegionCreated"
	EventRegionDeleted = "RegionDeleted"

	EventPermissionCreated = "PermissionCreated"
	EventPermissionUpdated = "PermissionUpdated"
	EventPermissionDeleted = "PermissionDeleted"

	EventUserCreated       = "UserCreated"
	EventUserUpdated       = "UserUpdated"
	EventUserDeleted       = "UserDeleted"
	EventUserGPGKeyCreated = "UserGPGKeyCreated"
	EventUserGPGKeyDeleted = "UserGPGKeyDeleted"

	EventPluginCreated = "PluginCreated"
	EventPluginUpdated = "PluginUpdated"
	EventPluginDeleted = "PluginDeleted"

	EventIntegrationModelCreated = "IntegrationModelCreated"
	EventIntegrationModelUpdated = "IntegrationModelUpdated"
	EventIntegrationModelDeleted = "IntegrationModelDeleted"

	EventIntegrationCreated = "IntegrationCreated"
	EventIntegrationUpdated = "IntegrationUpdated"
	EventIntegrationDeleted = "IntegrationDeleted"

	EventProjectCreated = "ProjectCreated"
	EventProjectUpdated = "ProjectUpdated"
	EventProjectDeleted = "ProjectDeleted"

	EventNotificationCreated = "NotificationCreated"
	EventNotificationUpdated = "NotificationUpdated"
	EventNotificationDeleted = "NotificationDeleted"

	EventVariableSetCreated     = "VariableSetCreated"
	EventVariableSetDeleted     = "VariableSetDeleted"
	EventVariableSetItemCreated = "VariableSetItemCreated"
	EventVariableSetItemUpdated = "VariableSetItemUpdated"
	EventVariableSetItemDeleted = "VariableSetItemDeleted"
)
View Source
const (
	// PermissionRead  read permission on the resource
	PermissionRead = 4
	// PermissionReadExecute  read & execute permission on the resource
	PermissionReadExecute = 5
	// PermissionReadWriteExecute read/execute/write permission on the resource
	PermissionReadWriteExecute = 7
)
View Source
const (
	WebHookModelName              = "WebHook"
	RepositoryWebHookModelName    = "RepositoryWebHook"
	GerritHookModelName           = "GerritHook"
	SchedulerModelName            = "Scheduler"
	GitPollerModelName            = "Git Repository Poller"
	KafkaHookModelName            = "Kafka hook"
	RabbitMQHookModelName         = "RabbitMQ hook"
	WorkflowModelName             = "Workflow"
	HookConfigProject             = "project"
	HookConfigWorkflow            = "workflow"
	HookConfigTargetProject       = "target_project"
	HookConfigTargetWorkflow      = "target_workflow"
	HookConfigTargetHook          = "target_hook"
	HookConfigWorkflowID          = "workflow_id"
	HookConfigWebHookID           = "webHookID"
	HookConfigVCSType             = "vcsType"
	HookConfigVCSServer           = "vcsServer"
	HookConfigEventFilter         = "eventFilter"
	HookConfigRepoFullName        = "repoFullName"
	HookConfigModelType           = "model_type"
	HookConfigModelName           = "model_name"
	HookConfigIcon                = "hookIcon"
	WebHookModelConfigMethod      = "method"
	RepositoryWebHookModelMethod  = "method"
	SchedulerModelCron            = "cron"
	SchedulerModelTimezone        = "timezone"
	Payload                       = "payload"
	HookModelIntegration          = "integration"
	KafkaHookModelConsumerGroup   = "consumer group"
	KafkaHookModelTopic           = "topic"
	RabbitMQHookModelQueue        = "queue"
	RabbitMQHookModelBindingKey   = "binding_key"
	RabbitMQHookModelExchangeType = "exchange_type"
	RabbitMQHookModelExchangeName = "exchange_name"
	RabbitMQHookModelConsumerTag  = "consumer_tag"
	SchedulerUsername             = "cds.scheduler"
	SchedulerFullname             = "CDS Scheduler"
)

These are constants about hooks

View Source
const (
	SignHeaderVCSName   = "X-Cds-Hooks-Vcs-Name"
	SignHeaderRepoName  = "X-Cds-Hooks-Repo-Name"
	SignHeaderVCSType   = "X-Cds-Hooks-Vcs-Type"
	SignHeaderEventName = "X-Cds-Hooks-Event-Name"

	WorkflowHookEventWorkflowUpdate = "workflow-update"
	WorkflowHookEventModelUpdate    = "model-update"
	WorkflowHookEventPush           = "push"
	WorkflowHookManual              = "manual"

	WorkflowHookEventPullRequest             = "pull-request"
	WorkflowHookEventPullRequestTypeOpened   = "opened"
	WorkflowHookEventPullRequestTypeReopened = "reopened"
	WorkflowHookEventPullRequestTypeClosed   = "closed"
	WorkflowHookEventPullRequestTypeEdited   = "edited"

	WorkflowHookEventPullRequestComment            = "pull-request-comment"
	WorkflowHookEventPullRequestCommentTypeCreated = "created"
	WorkflowHookEventPullRequestCommentTypeDeleted = "deleted"
	WorkflowHookEventPullRequestCommentTypeEdited  = "edited"

	RepoEventPush = "push"

	HookEventStatusScheduled     = "Scheduled"
	HookEventStatusAnalysis      = "Analyzing"
	HookEventStatusWorkflowHooks = "WorkflowHooks"
	HookEventStatusSignKey       = "SignKey"
	HookEventStatusWorkflow      = "Workflow"
	HookEventStatusDone          = "Done"
	HookEventStatusError         = "Error"
	HookEventStatusSkipped       = "Skipped"

	HookEventWorkflowStatusScheduler = "Scheduled"
	HookEventWorkflowStatusDone      = "Done"
)
View Source
const (
	KafkaIntegrationModel           = "Kafka"
	RabbitMQIntegrationModel        = "RabbitMQ"
	OpenstackIntegrationModel       = "Openstack"
	AWSIntegrationModel             = "AWS"
	DefaultStorageIntegrationName   = "shared.infra"
	ArtifactoryIntegrationModelName = "Artifactory"

	ArtifactoryConfigPlatform              = "platform"
	ArtifactoryConfigURL                   = "url"
	ArtifactoryConfigDistributionURL       = "distribution.url"
	ArtifactoryConfigTokenName             = "token.name"
	ArtifactoryConfigToken                 = "token"
	ArtifactoryConfigReleaseToken          = "release.token"
	ArtifactoryConfigCdsRepository         = "cds.repository"
	ArtifactoryConfigProjectKey            = "project.key"
	ArtifactoryConfigPromotionLowMaturity  = "promotion.maturity.low"
	ArtifactoryConfigPromotionHighMaturity = "promotion.maturity.high"
	ArtifactoryConfigBuildInfoPrefix       = "build.info.prefix"
	ArtifactoryConfigRepositoryPrefix      = "repo.prefix"
)

This is the buitin integration model

View Source
const (
	IntegrationTypeEvent      = IntegrationType("event")
	IntegrationTypeCompute    = IntegrationType("compute")
	IntegrationTypeHook       = IntegrationType("hook")
	IntegrationTypeStorage    = IntegrationType("storage")
	IntegrationTypeDeployment = IntegrationType("deployment")
)
View Source
const (
	// IntegrationConfigTypeString represents a string configuration value
	IntegrationConfigTypeString = "string"
	// IntegrationConfigTypeText represents a text configuration value
	IntegrationConfigTypeText = "text"
	// IntegrationConfigTypePassword represents a password configuration value
	IntegrationConfigTypePassword = "password"
	// IntegrationConfigTypeBoolean represents a password configuration value
	IntegrationConfigTypeBoolean = "boolean"
	// IntegrationConfigTypeRegion represents a region requirement
	IntegrationConfigTypeRegion = "region"

	IntegrationVariablePrefixDeployment      = "deployment"
	IntegrationVariablePrefixArtifactManager = "artifact_manager"
)
View Source
const (
	MaintenanceAPIKey    string = "cds_maintenance_api"
	MaintenanceQueueName string = "cds_maintenance"
)
View Source
const (
	MetricKeyVulnerability = "Vulnerability"
	MetricKeyUnitTest      = "UnitTest"
)
View Source
const (
	// MigrationStatusTodo is the constant to indicate that the migration is "to do"
	MigrationStatusTodo string = "TODO"
	// MigrationStatusInProgress is the constant to indicate that the migration is "in progress"
	MigrationStatusInProgress string = "IN PROGRESS"
	// MigrationStatusDone is the constant to indicate that the migration is "done"
	MigrationStatusDone string = "DONE"
	// MigrationStatusCanceled is the constant to indicate that the migration is "canceled"
	MigrationStatusCanceled string = "CANCELED"
	// MigrationStatusNotExecuted is the constant to indicate that the migration is "not executed"
	MigrationStatusNotExecuted string = "NOT EXECUTED"
)
View Source
const (
	EmailUserNotification = "email"
	VCSUserNotification   = "vcs"
	EventsNotification    = "event"
)

const

View Source
const (
	UserNotificationAlways = "always"
	UserNotificationNever  = "never"
	UserNotificationChange = "change"
)

const

View Source
const (
	ListParameter    = "list"
	NumberParameter  = "number"
	StringParameter  = "string"
	TextParameter    = "text"
	BooleanParameter = "boolean"
	KeySSHParameter  = "ssh-key"
	KeyPGPParameter  = "pgp-key"
)

Different type of Parameter

View Source
const (
	GRPCPluginDeploymentIntegration = "integration-deploy_application"
	GRPCPluginUploadArtifact        = "integration-upload_artifact"
	GRPCPluginDownloadArtifact      = "integration-download_artifact"
	GRPCPluginBuildInfo             = "integration-build_info"
	GRPCPluginRelease               = "integration-release"
	GRPCPluginPromote               = "integration-promote"
	GRPCPluginAction                = "action"
)

These are type of plugins

View Source
const (
	// ApplicationLastModificationType represent key for last update event about application
	ApplicationLastModificationType = "application"
	// PipelineLastModificationType represent key for last update event about pipeline
	PipelineLastModificationType = "pipeline"
	// WorkflowLastModificationType represent key for last update event about workflow
	WorkflowLastModificationType = "workflow"
	// ProjectLastModificationType represent key for last update event about project
	ProjectLastModificationType = "project"
	// ProjectPipelineLastModificationType represent key for last update event about project.pipeline (rename, delete or add a pipeline)
	ProjectPipelineLastModificationType = "project.pipeline"
	// ProjectApplicationLastModificationType represent key for last update event about project.application (rename, delete or add an application)
	ProjectApplicationLastModificationType = "project.application"
	// ProjectEnvironmentLastModificationType represent key for last update event about project.environment (rename, delete or add an environment)
	ProjectEnvironmentLastModificationType = "project.environment"
	// ProjectWorkflowLastModificationType represent key for last update event about project.workflow (rename, delete or add a workflow)
	ProjectWorkflowLastModificationType = "project.workflow"
	// ProjectVariableLastModificationType represent key for last update event about project.variable (rename, delete or add a variable)
	ProjectVariableLastModificationType = "project.variable"
	// ProjectKeysLastModificationType represent key for last update event about project.keys (add, delete a key)
	ProjectKeysLastModificationType = "project.keys"
	// ProjectIntegrationsLastModificationType represent key for last update event about project.integrations (add, update, delete a integration)
	ProjectIntegrationsLastModificationType = "project.integrations"
)
View Source
const (
	ProjectVariableTypeSecret = "secret"
	ProjectVariableTypeString = "string"

	ProjectVariableSetItemNamePattern = "^[a-zA-Z0-9_-]{1,}$"
)
View Source
const (
	// Global Role
	GlobalRoleManagePermission   = "manage-permission"
	GlobalRoleManageOrganization = "manage-organization"
	GlobalRoleManageRegion       = "manage-region"
	GlobalRoleManageHatchery     = "manage-hatchery"
	GlobalRoleManageUser         = "manage-user"
	GlobalRoleManageGroup        = "manage-group"
	GlobalRoleManagePlugin       = "manage-plugin"
	GlobalRoleProjectCreate      = "create-project"

	// Project Role
	ProjectRoleRead               = "read"
	ProjectRoleManage             = "manage"
	ProjectRoleManageNotification = "manage-notification"
	ProjectRoleManageWorkerModel  = "manage-worker-model"
	ProjectRoleManageAction       = "manage-action"
	ProjectRoleManageWorkflow     = "manage-workflow"

	// Hatchery Role
	HatcheryRoleSpawn = "start-worker"

	// Region Role
	RegionRoleList    = "list"
	RegionRoleExecute = "execute"
	RegionRoleManage  = "manage"
)
View Source
const (
	RepositoryAnalysisStatusInProgress = "InProgress"
	RepositoryAnalysisStatusSucceed    = "Success"
	RepositoryAnalysisStatusError      = "Error"
	RepositoryAnalysisStatusSkipped    = "Skipped"

	GitRefTagPrefix    = "refs/tags/"
	GitRefBranchPrefix = "refs/heads/"
	GitRefTypeBranch   = "branch"
	GitRefTypeTag      = "tag"
)
View Source
const (
	// ResponseWorkflowNameHeader is used as HTTP header
	ResponseWorkflowNameHeader = "X-Api-Workflow-Name"
	// ResponseWorkflowIDHeader is used as HTTP header
	ResponseWorkflowIDHeader = "X-Api-Workflow-Id"
	// WorkflowAsCodeHeader is used as HTTP header
	WorkflowAsCodeHeader = "X-Api-Workflow-As-Code"

	// ResponseTemplateGroupNameHeader is used as HTTP header
	ResponseTemplateGroupNameHeader = "X-Api-Template-Group-Name"
	// ResponseTemplateSlugHeader is used as HTTP header
	ResponseTemplateSlugHeader = "X-Api-Template-Slug"
)
View Source
const (
	//BinaryRequirement refers to the need to a specific binary on host running the action
	BinaryRequirement = "binary"
	// ModelRequirement refers to the need fo a specific model
	ModelRequirement = "model"
	// HostnameRequirement checks the hostname of the worker
	HostnameRequirement = "hostname"
	//PluginRequirement installs & checks plugins of the worker
	PluginRequirement = "plugin"
	//ServiceRequirement links a service to a worker
	ServiceRequirement = "service"
	//MemoryRequirement set memory limit on a container
	MemoryRequirement = "memory"
	// OSArchRequirement checks the 'dist' of a worker eg {GOOS}/{GOARCH}
	OSArchRequirement = "os-architecture"
	// RegionRequirement lets a use to force a job running in a hatchery's region
	RegionRequirement = "region"
	// SecretRequirement is needed to ask for a project's secret when it's not automatically injected (ex: when using SkipProjectSecretsOnRegion)
	SecretRequirement = "secret"
	// FlavorRequirement set flavor for a virtual machine
	FlavorRequirement = "flavor"
)
View Source
const (
	TypeHooks         = "hooks"
	TypeRepositories  = "repositories"
	TypeElasticsearch = "elasticsearch"
	TypeVCS           = "vcs"
	TypeAPI           = "api"
	TypeUI            = "ui"
	TypeCDN           = "cdn"
	TypeHatchery      = "hatchery"
	TypeDBMigrate     = "dbmigrate"
)

Those are constant for services types

View Source
const (
	MonitoringStatusAlert = "AL"
	MonitoringStatusWarn  = "WARN"
	MonitoringStatusOK    = "OK"
)

This constants deals with Monitoring statuses

View Source
const (
	UserRingAdmin      = "ADMIN"
	UserRingMaintainer = "MAINTAINER"
	UserRingUser       = "USER"
)

User rings.

View Source
const (
	EntityActionInputKey = "^[a-zA-Z0-9]*$"
	EntityActionStepID   = "^[a-zA-Z0-9]*$"
)
View Source
const (
	WorkerModelTypeOpenstack = "openstack"
	WorkerModelTypeDocker    = "docker"
	WorkerModelTypeVSphere   = "vsphere"
)
View Source
const (
	WorkflowHookTypeRepository  = "RepositoryWebHook"
	WorkflowHookTypeWorkerModel = "WorkerModelUpdate"
	WorkflowHookTypeWorkflow    = "WorkflowUpdate"
	WorkflowHookTypeManual      = "Manual"
)
View Source
const (
	GitBranchManualPayload = "git.branch"
	GitCommitManualPayload = "git.commit"
	GitTagManualPayload    = "git.tag"
)
View Source
const (
	WorkflowRunInfoLevelInfo    = "info"
	WorkflowRunInfoLevelWarning = "warning"
	WorkflowRunInfoLevelError   = "error"
)
View Source
const (
	V2WorkflowRunResultStatusPending   = "PENDING"
	V2WorkflowRunResultStatusCompleted = "COMPLETED"
	V2WorkflowRunResultStatusPromoted  = "PROMOTED"
	V2WorkflowRunResultStatusReleased  = "RELEASED"
	V2WorkflowRunResultStatusCanceled  = "CANCELED"
)
View Source
const (
	V2WorkflowRunResultTypeCoverage          = "coverage"
	V2WorkflowRunResultTypeTest              = "tests"
	V2WorkflowRunResultTypeRelease           = "release"
	V2WorkflowRunResultTypeGeneric           = "generic"
	V2WorkflowRunResultTypeVariable          = "variable"
	V2WorkflowRunResultTypeDocker            = "docker"
	V2WorkflowRunResultTypeDebian            = "debian"
	V2WorkflowRunResultTypePython            = "python"
	V2WorkflowRunResultTypeArsenalDeployment = "deployment"
	V2WorkflowRunResultTypeHelm              = "helm"
)
View Source
const (
	SecretVariable     = "password"
	TextVariable       = "text"
	StringVariable     = "string"
	KeyVariable        = "key"
	BooleanVariable    = "boolean"
	NumberVariable     = "number"
	RepositoryVariable = "repository"
	SSHKeyVariable     = "ssh"
	PGPKeyVariable     = "pgp"
)

Different type of Variable

View Source
const (
	HeaderXVCSURL           = "X-CDS-VCS-URL"
	HeaderXVCSURLApi        = "X-CDS-VCS-URL-API"
	HeaderXVCSType          = "X-CDS-VCS-TYPE"
	HeaderXVCSToken         = "X-CDS-VCS-TOKEN"
	HeaderXVCSUsername      = "X-CDS-VCS-USERNAME"
	HeaderXVCSSSHUsername   = "X-CDS-VCS-SSH-USERNAME"
	HeaderXVCSSSHPort       = "X-CDS-VCS-SSH-PORT"
	HeaderXVCSSSHPrivateKey = "X-CDS-VCS-SSH-PRIVATE-KEY"

	VCSTypeGitea           = "gitea"
	VCSTypeGerrit          = "gerrit"
	VCSTypeGitlab          = "gitlab"
	VCSTypeBitbucketServer = "bitbucketserver"
	VCSTypeBitbucketCloud  = "bitbucketcloud"
	VCSTypeGithub          = "github"
)

HTTP Headers

View Source
const (
	WarningMissingProjectVariableEnv               = "MISSING_PROJECT_VARIABLE_ENVIRONMENT"
	WarningMissingProjectVariableApplication       = "MISSING_PROJECT_VARIABLE_APPLICATION"
	WarningMissingProjectVariablePipelineParameter = "MISSING_PROJECT_VARIABLE_PIPELINE_PARAMETER"
	WarningMissingProjectVariablePipelineJob       = "MISSING_PROJECT_VARIABLE_PIPELINE_JOB"
	WarningMissingProjectVariableWorkflow          = "MISSING_PROJECT_VARIABLE_WORKFLOW"
	WarningUnusedProjectVariable                   = "UNUSED_PROJECT_VARIABLE"
	WarningMissingProjectPermissionEnv             = "MISSING_PROJECT_PERMISSION_ENV"
	WarningMissingProjectPermissionWorkflow        = "MISSING_PROJECT_PERMISSION_WORKFLOW"
	WarningMissingProjectKeyApplication            = "MISSING_PROJECT_KEY_APPLICATION"
	WarningMissingProjectKeyPipelineParameter      = "MISSING_PROJECT_KEY_PIPELINE_PARAMETER"
	WarningMissingProjectKeyPipelineJob            = "MISSING_PROJECT_KEY_PIPELINE_JOB"
	WarningUnusedProjectKey                        = "UNUSED_PROJECT_KEY"
	WarningMissingProjectVCSServer                 = "MISSING_PROJECT_VCS"
	WarningUnusedProjectVCSServer                  = "UNUSED_PROJECT_VCS"
	WarningMissingVCSConfiguration                 = "MISSING_VCS_CONFIGURATION"
	WarningMissingApplicationVariable              = "MISSING_APPLICATION_VARIABLE"
	WarningUnusedApplicationVariable               = "UNUSED_APPLICATION_VARIABLE"
	WarningMissingApplicationKey                   = "MISSING_APPLICATION_KEY"
	WarningUnusedApplicationKey                    = "UNUSED_APPLICATION_KEY"
	WarningMissingEnvironmentVariable              = "MISSING_ENVIRONMENT_VARIABLE"
	WarningUnusedEnvironmentVariable               = "UNUSED_ENVIRONMENT_VARIABLE"
	WarningMissingEnvironmentKey                   = "MISSING_ENVIRONMENT_KEY"
	WarningUnusedEnvironmentKey                    = "UNUSED_ENVIRONMENT_KEY"
	WarningMissingPipelineParameter                = "MISSING_PIPELINE_PARAMETER"
	WarningUnusedPipelineParameter                 = "UNUSED_PIPELINE_PARAMETER"
)
View Source
const (
	Docker      = "docker"
	HostProcess = "host"
	Openstack   = "openstack"
	VSphere     = "vsphere"
)

Existing worker model type

View Source
const (
	WorkflowConditionsOperatorEquals             = "eq"
	WorkflowConditionsOperatorNotEquals          = "ne"
	WorkflowConditionsOperatorLessThan           = "lt"
	WorkflowConditionsOperatorLessOrEqualThan    = "le"
	WorkflowConditionsOperatorGreaterThan        = "gt"
	WorkflowConditionsOperatorGreaterOrEqualThan = "ge"
	WorkflowConditionsOperatorRegex              = "regex"
)

WorkflowData conditions operator

View Source
const (
	GitlabIcon    = "Gitlab"
	GitHubIcon    = "Github"
	BitbucketIcon = "Bitbucket"
	GerritIcon    = "git"
)

Those are icon for hooks

View Source
const (
	// HookConfigTypeString type string
	HookConfigTypeString = "string"
	// HookConfigTypeIntegration type integration
	HookConfigTypeIntegration = "integration"
	// HookConfigTypeProject type project
	HookConfigTypeProject = "project"
	// HookConfigTypeWorkflow type workflow
	HookConfigTypeWorkflow = "workflow"
	// HookConfigTypeHook type hook
	HookConfigTypeHook = "hook"
	// HookConfigTypeMultiChoice type multiple
	HookConfigTypeMultiChoice = "multiple"
)
View Source
const (
	NodeTypePipeline     = "pipeline"
	NodeTypeJoin         = "join"
	NodeTypeOutGoingHook = "outgoinghook"
	NodeTypeFork         = "fork"
)
View Source
const (
	RunInfoTypInfo     = "Info"
	RunInfoTypeWarning = "Warning"
	RunInfoTypeError   = "Error"
)
View Source
const AuthSigninConsumerTokenDuration time.Duration = time.Minute * 5
View Source
const (
	CDSSessionID = "X-CDS-Session-ID"
)
View Source
const (
	DefaultHistoryLength int64 = 20
)

DefaultHistoryLength is the default history length

View Source
const DefaultWorkflowNodeRunReport = `` /* 833-byte string literal not displayed */
View Source
const IconFormat = "data:image/"

IconFormat is the format prefix accepted for icon

View Source
const MaxIconSize = 120000

MaxIconSize is the maximum size of the icon in octet

View Source
const NamePattern = "^[a-zA-Z0-9._-]{1,}$"

NamePattern Pattern for project/application/pipeline/group name

View Source
const NamePatternSpace = `^[\sa-zA-Z0-9._-]{1,}$`

NamePatternSpace Pattern for stage name

View Source
const (
	// Different types of warning for PipelineBuild
	OptionalStepFailed = "optional_step_failed"
)

This constant deals with pipelines

View Source
const (
	PasswordPlaceholder string = "**********"
)

Value of passwords when leaving the API

View Source
const ProjectKeyPattern = "^[A-Z0-9]{1,}$"

ProjectKeyPattern pattern for project key

View Source
const (
	// SecretMinLength is the minimal size of a secret
	// variable to be considered as a secret
	// a secret variable displayed, with less then 6, will
	// displayed, instead of appears as **cds.app.my-password**
	SecretMinLength = 6
)
View Source
const SharedInfraGroupName = "shared.infra"

SharedInfraGroupName is the name of the builtin group used to share infrastructure between projects

View Source
const URLGithubIssues = "https://github.com/ovh/cds/issues"

URLGithubIssues contains a link to CDS Issues

View Source
const URLGithubReleases = "https://github.com/ovh/cds/releases"

URLGithubReleases contains a link to CDS Official Releases

View Source
const UserContactTypeEmail = "email"
View Source
const WorkflowHookModelBuiltin = "builtin"

WorkflowHookModelBuiltin is a constant for the builtin hook models

Variables

View Source
var (
	StatusTerminated    = True
	StatusNotTerminated = False
)
View Source
var (
	True        = true
	False       = false
	TrueString  = "true"
	FalseString = "false"
)

True of false

View Source
var (
	ErrUnknownError                                  = Error{ID: 1, Status: http.StatusInternalServerError}
	ErrActionAlreadyUpdated                          = Error{ID: 2, Status: http.StatusBadRequest}
	ErrNoAction                                      = Error{ID: 3, Status: http.StatusNotFound}
	ErrActionLoop                                    = Error{ID: 4, Status: http.StatusBadRequest}
	ErrInvalidID                                     = Error{ID: 5, Status: http.StatusBadRequest}
	ErrInvalidProject                                = Error{ID: 6, Status: http.StatusBadRequest}
	ErrInvalidProjectKey                             = Error{ID: 7, Status: http.StatusBadRequest}
	ErrProjectHasPipeline                            = Error{ID: 8, Status: http.StatusForbidden}
	ErrProjectHasApplication                         = Error{ID: 9, Status: http.StatusForbidden}
	ErrUnauthorized                                  = Error{ID: 10, Status: http.StatusUnauthorized}
	ErrForbidden                                     = Error{ID: 11, Status: http.StatusForbidden}
	ErrPipelineNotFound                              = Error{ID: 12, Status: http.StatusBadRequest}
	ErrPipelineNotAttached                           = Error{ID: 13, Status: http.StatusBadRequest}
	ErrNoEnvironmentProvided                         = Error{ID: 14, Status: http.StatusBadRequest}
	ErrEnvironmentProvided                           = Error{ID: 15, Status: http.StatusBadRequest}
	ErrUnknownEnv                                    = Error{ID: 16, Status: http.StatusBadRequest}
	ErrEnvironmentExist                              = Error{ID: 17, Status: http.StatusForbidden}
	ErrNoPipelineBuild                               = Error{ID: 18, Status: http.StatusNotFound}
	ErrInvalidUsername                               = Error{ID: 21, Status: http.StatusBadRequest}
	ErrInvalidEmail                                  = Error{ID: 22, Status: http.StatusBadRequest}
	ErrGroupPresent                                  = Error{ID: 23, Status: http.StatusBadRequest}
	ErrInvalidName                                   = Error{ID: 24, Status: http.StatusBadRequest}
	ErrInvalidUser                                   = Error{ID: 25, Status: http.StatusBadRequest}
	ErrBuildArchived                                 = Error{ID: 26, Status: http.StatusBadRequest}
	ErrNoEnvironment                                 = Error{ID: 27, Status: http.StatusNotFound}
	ErrModelNameExist                                = Error{ID: 28, Status: http.StatusForbidden}
	ErrNoProject                                     = Error{ID: 30, Status: http.StatusNotFound}
	ErrVariableExists                                = Error{ID: 31, Status: http.StatusForbidden}
	ErrInvalidGroupPattern                           = Error{ID: 32, Status: http.StatusBadRequest}
	ErrGroupExists                                   = Error{ID: 33, Status: http.StatusForbidden}
	ErrNotEnoughAdmin                                = Error{ID: 34, Status: http.StatusBadRequest}
	ErrInvalidProjectName                            = Error{ID: 35, Status: http.StatusBadRequest}
	ErrInvalidApplicationPattern                     = Error{ID: 36, Status: http.StatusBadRequest}
	ErrInvalidPipelinePattern                        = Error{ID: 37, Status: http.StatusBadRequest}
	ErrNotFound                                      = Error{ID: 38, Status: http.StatusNotFound}
	ErrNoHook                                        = Error{ID: 40, Status: http.StatusNotFound}
	ErrNoAttachedPipeline                            = Error{ID: 41, Status: http.StatusNotFound}
	ErrNoReposManager                                = Error{ID: 42, Status: http.StatusNotFound}
	ErrNoReposManagerAuth                            = Error{ID: 43, Status: http.StatusUnauthorized}
	ErrNoReposManagerClientAuth                      = Error{ID: 44, Status: http.StatusForbidden}
	ErrRepoNotFound                                  = Error{ID: 45, Status: http.StatusNotFound}
	ErrSecretStoreUnreachable                        = Error{ID: 46, Status: http.StatusMethodNotAllowed}
	ErrSecretKeyFetchFailed                          = Error{ID: 47, Status: http.StatusMethodNotAllowed}
	ErrInvalidGoPath                                 = Error{ID: 48, Status: http.StatusBadRequest}
	ErrCommitsFetchFailed                            = Error{ID: 49, Status: http.StatusNotFound}
	ErrInvalidSecretFormat                           = Error{ID: 50, Status: http.StatusInternalServerError}
	ErrNoPreviousSuccess                             = Error{ID: 52, Status: http.StatusNotFound}
	ErrNoPermExecution                               = Error{ID: 53, Status: http.StatusForbidden}
	ErrInvalidSecretValue                            = Error{ID: 55, Status: http.StatusBadRequest}
	ErrPipelineHasApplication                        = Error{ID: 56, Status: http.StatusBadRequest}
	ErrNoDirectSecretUse                             = Error{ID: 57, Status: http.StatusForbidden}
	ErrNoBranch                                      = Error{ID: 58, Status: http.StatusNotFound}
	ErrLDAPConn                                      = Error{ID: 59, Status: http.StatusInternalServerError}
	ErrServiceUnavailable                            = Error{ID: 60, Status: http.StatusServiceUnavailable}
	ErrParseUserNotification                         = Error{ID: 61, Status: http.StatusBadRequest}
	ErrNotSupportedUserNotification                  = Error{ID: 62, Status: http.StatusBadRequest}
	ErrGroupNeedAdmin                                = Error{ID: 63, Status: http.StatusBadRequest}
	ErrGroupNeedWrite                                = Error{ID: 64, Status: http.StatusBadRequest}
	ErrNoVariable                                    = Error{ID: 65, Status: http.StatusNotFound}
	ErrPluginInvalid                                 = Error{ID: 66, Status: http.StatusBadRequest}
	ErrApplicationExist                              = Error{ID: 69, Status: http.StatusForbidden}
	ErrBranchNameNotProvided                         = Error{ID: 70, Status: http.StatusBadRequest}
	ErrInfiniteTriggerLoop                           = Error{ID: 71, Status: http.StatusBadRequest}
	ErrInvalidResetUser                              = Error{ID: 72, Status: http.StatusBadRequest}
	ErrUserConflict                                  = Error{ID: 73, Status: http.StatusBadRequest}
	ErrWrongRequest                                  = Error{ID: 74, Status: http.StatusBadRequest}
	ErrAlreadyExist                                  = Error{ID: 75, Status: http.StatusForbidden}
	ErrInvalidType                                   = Error{ID: 76, Status: http.StatusBadRequest}
	ErrParentApplicationAndPipelineMandatory         = Error{ID: 77, Status: http.StatusBadRequest}
	ErrNoParentBuildFound                            = Error{ID: 78, Status: http.StatusNotFound}
	ErrParameterExists                               = Error{ID: 79, Status: http.StatusForbidden}
	ErrNoHatchery                                    = Error{ID: 80, Status: http.StatusNotFound}
	ErrInvalidWorkerStatus                           = Error{ID: 81, Status: http.StatusNotFound}
	ErrInvalidToken                                  = Error{ID: 82, Status: http.StatusUnauthorized}
	ErrAppBuildingPipelines                          = Error{ID: 83, Status: http.StatusForbidden}
	ErrInvalidTimezone                               = Error{ID: 84, Status: http.StatusBadRequest}
	ErrEnvironmentCannotBeDeleted                    = Error{ID: 85, Status: http.StatusForbidden}
	ErrInvalidPipeline                               = Error{ID: 86, Status: http.StatusBadRequest}
	ErrKeyNotFound                                   = Error{ID: 87, Status: http.StatusNotFound}
	ErrPipelineAlreadyExists                         = Error{ID: 88, Status: http.StatusForbidden}
	ErrJobAlreadyBooked                              = Error{ID: 89, Status: http.StatusForbidden}
	ErrPipelineBuildNotFound                         = Error{ID: 90, Status: http.StatusNotFound}
	ErrAlreadyTaken                                  = Error{ID: 91, Status: http.StatusGone}
	ErrWorkflowNodeNotFound                          = Error{ID: 93, Status: http.StatusNotFound}
	ErrWorkflowInvalidRoot                           = Error{ID: 94, Status: http.StatusBadRequest}
	ErrWorkflowNodeRef                               = Error{ID: 95, Status: http.StatusBadRequest}
	ErrWorkflowInvalid                               = Error{ID: 96, Status: http.StatusBadRequest}
	ErrWorkflowNodeJoinNotFound                      = Error{ID: 97, Status: http.StatusNotFound}
	ErrInvalidJobRequirement                         = Error{ID: 98, Status: http.StatusBadRequest}
	ErrNotImplemented                                = Error{ID: 99, Status: http.StatusNotImplemented}
	ErrParameterNotExists                            = Error{ID: 100, Status: http.StatusNotFound}
	ErrUnknownKeyType                                = Error{ID: 101, Status: http.StatusBadRequest}
	ErrInvalidKeyPattern                             = Error{ID: 102, Status: http.StatusBadRequest}
	ErrWebhookConfigDoesNotMatch                     = Error{ID: 103, Status: http.StatusBadRequest}
	ErrPipelineUsedByWorkflow                        = Error{ID: 104, Status: http.StatusBadRequest}
	ErrMethodNotAllowed                              = Error{ID: 105, Status: http.StatusMethodNotAllowed}
	ErrInvalidNodeNamePattern                        = Error{ID: 106, Status: http.StatusBadRequest}
	ErrWorkflowNodeParentNotRun                      = Error{ID: 107, Status: http.StatusForbidden}
	ErrHookNotFound                                  = Error{ID: 108, Status: http.StatusNotFound}
	ErrDefaultGroupPermission                        = Error{ID: 109, Status: http.StatusBadRequest}
	ErrLastGroupWithWriteRole                        = Error{ID: 110, Status: http.StatusForbidden}
	ErrInvalidEmailDomain                            = Error{ID: 111, Status: http.StatusForbidden}
	ErrWorkflowNodeRunJobNotFound                    = Error{ID: 112, Status: http.StatusNotFound}
	ErrBuiltinKeyNotFound                            = Error{ID: 113, Status: http.StatusInternalServerError}
	ErrStepNotFound                                  = Error{ID: 114, Status: http.StatusNotFound}
	ErrWorkerModelAlreadyBooked                      = Error{ID: 115, Status: http.StatusForbidden}
	ErrConditionsNotOk                               = Error{ID: 116, Status: http.StatusBadRequest}
	ErrDownloadInvalidOS                             = Error{ID: 117, Status: http.StatusNotFound}
	ErrDownloadInvalidArch                           = Error{ID: 118, Status: http.StatusNotFound}
	ErrDownloadInvalidName                           = Error{ID: 119, Status: http.StatusNotFound}
	ErrDownloadDoesNotExist                          = Error{ID: 120, Status: http.StatusNotFound}
	ErrTokenNotFound                                 = Error{ID: 121, Status: http.StatusNotFound}
	ErrWorkflowNotificationNodeRef                   = Error{ID: 122, Status: http.StatusBadRequest}
	ErrInvalidJobRequirementDuplicateModel           = Error{ID: 123, Status: http.StatusBadRequest}
	ErrInvalidJobRequirementDuplicateHostname        = Error{ID: 124, Status: http.StatusBadRequest}
	ErrInvalidKeyName                                = Error{ID: 125, Status: http.StatusBadRequest}
	ErrRepoOperationTimeout                          = Error{ID: 126, Status: http.StatusRequestTimeout}
	ErrInvalidGitBranch                              = Error{ID: 127, Status: http.StatusBadRequest}
	ErrInvalidFavoriteType                           = Error{ID: 128, Status: http.StatusBadRequest}
	ErrUnsupportedOSArchPlugin                       = Error{ID: 129, Status: http.StatusNotFound}
	ErrInvalidPatternModel                           = Error{ID: 132, Status: http.StatusBadRequest}
	ErrWorkerModelNoAdmin                            = Error{ID: 133, Status: http.StatusForbidden}
	ErrWorkerModelNoPattern                          = Error{ID: 134, Status: http.StatusForbidden}
	ErrJobNotBooked                                  = Error{ID: 135, Status: http.StatusBadRequest}
	ErrUserNotFound                                  = Error{ID: 136, Status: http.StatusNotFound}
	ErrInvalidNumber                                 = Error{ID: 137, Status: http.StatusBadRequest}
	ErrKeyAlreadyExist                               = Error{ID: 138, Status: http.StatusForbidden}
	ErrPipelineNameImport                            = Error{ID: 139, Status: http.StatusBadRequest}
	ErrWorkflowNameImport                            = Error{ID: 140, Status: http.StatusBadRequest}
	ErrIconBadFormat                                 = Error{ID: 141, Status: http.StatusBadRequest}
	ErrIconBadSize                                   = Error{ID: 142, Status: http.StatusBadRequest}
	ErrWorkflowConditionBadOperator                  = Error{ID: 143, Status: http.StatusBadRequest}
	ErrColorBadFormat                                = Error{ID: 144, Status: http.StatusBadRequest}
	ErrInvalidHookConfiguration                      = Error{ID: 145, Status: http.StatusBadRequest}
	ErrWorkerModelDeploymentFailed                   = Error{ID: 146, Status: http.StatusBadRequest}
	ErrJobLocked                                     = Error{ID: 147, Status: http.StatusConflict}
	ErrWorkflowNodeRunLocked                         = Error{ID: 148, Status: http.StatusConflict}
	ErrInvalidData                                   = Error{ID: 149, Status: http.StatusBadRequest}
	ErrInvalidGroupAdmin                             = Error{ID: 150, Status: http.StatusForbidden}
	ErrInvalidGroupMember                            = Error{ID: 151, Status: http.StatusForbidden}
	ErrWorkflowNotGenerated                          = Error{ID: 152, Status: http.StatusForbidden}
	ErrAlreadyLatestTemplate                         = Error{ID: 153, Status: http.StatusForbidden}
	ErrInvalidNodeDefaultPayload                     = Error{ID: 154, Status: http.StatusBadRequest}
	ErrInvalidApplicationRepoStrategy                = Error{ID: 155, Status: http.StatusBadRequest}
	ErrWorkflowNodeRootUpdate                        = Error{ID: 156, Status: http.StatusBadRequest}
	ErrWorkflowAlreadyAsCode                         = Error{ID: 157, Status: http.StatusBadRequest}
	ErrNoDBMigrationID                               = Error{ID: 158, Status: http.StatusNotFound}
	ErrCannotParseTemplate                           = Error{ID: 159, Status: http.StatusBadRequest}
	ErrGroupNotFoundInProject                        = Error{ID: 160, Status: http.StatusBadRequest}
	ErrGroupNotFoundInWorkflow                       = Error{ID: 161, Status: http.StatusBadRequest}
	ErrWorkflowPermInsufficient                      = Error{ID: 162, Status: http.StatusBadRequest}
	ErrApplicationUsedByWorkflow                     = Error{ID: 163, Status: http.StatusBadRequest}
	ErrLocked                                        = Error{ID: 164, Status: http.StatusConflict}
	ErrInvalidJobRequirementWorkerModelPermission    = Error{ID: 165, Status: http.StatusBadRequest}
	ErrInvalidJobRequirementWorkerModelCapabilitites = Error{ID: 166, Status: http.StatusBadRequest}
	ErrMalformattedStep                              = Error{ID: 167, Status: http.StatusBadRequest}
	ErrVCSUsedByApplication                          = Error{ID: 168, Status: http.StatusBadRequest}
	ErrApplicationAsCodeOverride                     = Error{ID: 169, Status: http.StatusForbidden}
	ErrPipelineAsCodeOverride                        = Error{ID: 170, Status: http.StatusForbidden}
	ErrEnvironmentAsCodeOverride                     = Error{ID: 171, Status: http.StatusForbidden}
	ErrWorkflowAsCodeOverride                        = Error{ID: 172, Status: http.StatusForbidden}
	ErrProjectSecretDataUnknown                      = Error{ID: 173, Status: http.StatusBadRequest}
	ErrApplicationMandatoryOnWorkflowAsCode          = Error{ID: 174, Status: http.StatusBadRequest}
	ErrInvalidPassword                               = Error{ID: 175, Status: http.StatusBadRequest}
	ErrInvalidPayloadVariable                        = Error{ID: 176, Status: http.StatusBadRequest}
	ErrRepositoryUsedByHook                          = Error{ID: 177, Status: http.StatusForbidden}
	ErrResourceNotInProject                          = Error{ID: 178, Status: http.StatusForbidden}
	ErrEnvironmentNotFound                           = Error{ID: 179, Status: http.StatusBadRequest}
	ErrIntegrationNotFound                           = Error{ID: 180, Status: http.StatusBadRequest}
	ErrBadBrokerConfiguration                        = Error{ID: 181, Status: http.StatusBadRequest}
	ErrSignupDisabled                                = Error{ID: 182, Status: http.StatusForbidden}
	ErrUsernamePresent                               = Error{ID: 183, Status: http.StatusBadRequest}
	ErrInvalidJobRequirementNetworkAccess            = Error{ID: 184, Status: http.StatusBadRequest}
	ErrInvalidWorkerModelNamePattern                 = Error{ID: 185, Status: http.StatusBadRequest}
	ErrWorkflowAsCodeResync                          = Error{ID: 186, Status: http.StatusForbidden}
	ErrWorkflowNodeNameDuplicate                     = Error{ID: 187, Status: http.StatusBadRequest}
	ErrUnsupportedMediaType                          = Error{ID: 188, Status: http.StatusUnsupportedMediaType}
	ErrNothingToPush                                 = Error{ID: 189, Status: http.StatusBadRequest}
	ErrWorkerErrorCommand                            = Error{ID: 190, Status: http.StatusBadRequest}
	ErrRepoAnalyzeFailed                             = Error{ID: 191, Status: http.StatusInternalServerError}
	ErrConflictData                                  = Error{ID: 192, Status: http.StatusConflict}
	ErrWebsocketUpgrade                              = Error{ID: 193, Status: http.StatusUpgradeRequired}
	ErrMFARequired                                   = Error{ID: 194, Status: http.StatusForbidden}
	ErrHatcheryNoResourceAvailable                   = Error{ID: 195, Status: http.StatusInternalServerError}
	ErrRegionNotAllowed                              = Error{ID: 196, Status: http.StatusInternalServerError}
	ErrInvalidRunIdentifier                          = Error{ID: 197, Status: http.StatusBadRequest}
)

Existing CDS errors Note: the error id is useless except to ensure objects are different in map

View Source
var (
	BuiltinHookModels = []*WorkflowHookModel{
		&WebHookModel,
		&RepositoryWebHookModel,
		&GitPollerModel,
		&SchedulerModel,
		&KafkaHookModel,
		&RabbitMQHookModel,
		&WorkflowModel,
		&GerritHookModel,
	}

	BuiltinOutgoingHookModels = []*WorkflowHookModel{
		&OutgoingWebHookModel,
		&OutgoingWorkflowModel,
	}

	KafkaHookModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/kafka",
		Name:       KafkaHookModelName,
		Icon:       "Linkify",
		DefaultConfig: WorkflowNodeHookConfig{
			HookModelIntegration: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeIntegration,
			},
			KafkaHookModelTopic: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
		},
	}

	RabbitMQHookModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/rabbitmq",
		Name:       RabbitMQHookModelName,
		Icon:       "Linkify",
		DefaultConfig: WorkflowNodeHookConfig{
			HookModelIntegration: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeIntegration,
			},
			RabbitMQHookModelQueue: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
			RabbitMQHookModelExchangeType: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
			RabbitMQHookModelExchangeName: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
			RabbitMQHookModelBindingKey: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
			RabbitMQHookModelConsumerTag: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
		},
	}

	WebHookModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/webhook",
		Name:       WebHookModelName,
		Icon:       "Linkify",
		DefaultConfig: WorkflowNodeHookConfig{
			WebHookModelConfigMethod: {
				Value:        "POST",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
		},
	}

	RepositoryWebHookModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/repositorywebhook",
		Name:       RepositoryWebHookModelName,
		Icon:       "Linkify",
		DefaultConfig: WorkflowNodeHookConfig{
			RepositoryWebHookModelMethod: {
				Value:        "POST",
				Configurable: false,
				Type:         HookConfigTypeString,
			},
			HookConfigEventFilter: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeMultiChoice,
			},
		},
	}

	GitPollerModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/poller",
		Name:       GitPollerModelName,
		Icon:       "git square",
		DefaultConfig: WorkflowNodeHookConfig{
			"payload": {
				Value:        "{}",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
		},
	}

	SchedulerModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/scheduler",
		Name:       SchedulerModelName,
		Icon:       "fa-clock-o",
		DefaultConfig: WorkflowNodeHookConfig{
			SchedulerModelCron: {
				Value:        "0 * * * *",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
			SchedulerModelTimezone: {
				Value:        "UTC",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
			Payload: {
				Value:        "{}",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
		},
	}

	GerritHookModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/gerrit",
		Name:       GerritHookModelName,
		Icon:       "git",
		DefaultConfig: WorkflowNodeHookConfig{
			HookConfigEventFilter: {
				Value:        "",
				Configurable: true,
				Type:         HookConfigTypeMultiChoice,
			},
		},
	}

	WorkflowModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/workflowhook",
		Name:       WorkflowModelName,
		Icon:       "sitemap",
	}

	OutgoingWebHookModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/webhook",
		Name:       WebHookModelName,
		Icon:       "Linkify",
		DefaultConfig: WorkflowNodeHookConfig{
			WebHookModelConfigMethod: {
				Value:        "POST",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
			"URL": {
				Configurable: true,
				Type:         HookConfigTypeString,
			},
			Payload: {
				Value:        "{}",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
		},
	}

	OutgoingWorkflowModel = WorkflowHookModel{
		Author:     "CDS",
		Type:       WorkflowHookModelBuiltin,
		Identifier: "github.com/ovh/cds/hook/builtin/workflowhook",
		Name:       WorkflowModelName,
		Icon:       "sitemap",
		DefaultConfig: WorkflowNodeHookConfig{
			HookConfigTargetProject: {
				Configurable: true,
				Type:         HookConfigTypeProject,
			},
			HookConfigTargetWorkflow: {
				Configurable: true,
				Type:         HookConfigTypeWorkflow,
			},
			HookConfigTargetHook: {
				Configurable: true,
				Type:         HookConfigTypeHook,
			},
			Payload: {
				Value:        "{}",
				Configurable: true,
				Type:         HookConfigTypeString,
			},
		},
	}
)

Here are the default hooks

View Source
var (
	BuiltinIntegrationModels = []*IntegrationModel{
		&KafkaIntegration,
		&RabbitMQIntegration,
		&OpenstackIntegration,
		&AWSIntegration,
		&ArtifactoryIntegration,
	}
	// KafkaIntegration represents a kafka integration
	KafkaIntegration = IntegrationModel{
		Name:       KafkaIntegrationModel,
		Author:     "CDS",
		Identifier: "github.com/ovh/cds/integration/builtin/kafka",
		Icon:       "",
		DefaultConfig: IntegrationConfig{
			"broker url": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"username": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"password": IntegrationConfigValue{
				Type: IntegrationConfigTypePassword,
			},
			"topic": IntegrationConfigValue{
				Type:        IntegrationConfigTypeString,
				Description: "This is mandatory only if you want to use Event Integration",
			},
		},
		Disabled: false,
		Hook:     true,
		Event:    true,
	}
	// RabbitMQIntegration represents a kafka integration
	RabbitMQIntegration = IntegrationModel{
		Name:       RabbitMQIntegrationModel,
		Author:     "CDS",
		Identifier: "github.com/ovh/cds/integration/builtin/rabbitmq",
		Icon:       "",
		DefaultConfig: IntegrationConfig{
			"uri": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"username": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"password": IntegrationConfigValue{
				Type: IntegrationConfigTypePassword,
			},
		},
		Disabled: false,
		Hook:     true,
	}
	// OpenstackIntegration represents an openstack integration
	OpenstackIntegration = IntegrationModel{
		Name:       OpenstackIntegrationModel,
		Author:     "CDS",
		Identifier: "github.com/ovh/cds/integration/builtin/openstack",
		Icon:       "",
		DefaultConfig: IntegrationConfig{
			"address": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"region": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"domain": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"tenant_name": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"username": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"password": IntegrationConfigValue{
				Type: IntegrationConfigTypePassword,
			},
			"storage_container_prefix": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"storage_temporary_url_supported": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
		},
		Storage:  true,
		Disabled: false,
		Hook:     false,
	}
	// ArtifactoryIntegration represent integration with artifactory
	ArtifactoryIntegration = IntegrationModel{
		Name:       ArtifactoryIntegrationModelName,
		Author:     "CDS",
		Identifier: "github.com/ovh/cds/integration/builtin/artifactory",
		Icon:       "",
		DefaultConfig: IntegrationConfig{
			ArtifactoryConfigPlatform: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			ArtifactoryConfigURL: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			ArtifactoryConfigDistributionURL: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			ArtifactoryConfigTokenName: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			ArtifactoryConfigToken: IntegrationConfigValue{
				Type: IntegrationConfigTypePassword,
			},
			ArtifactoryConfigReleaseToken: IntegrationConfigValue{
				Type: IntegrationConfigTypePassword,
			},
			ArtifactoryConfigProjectKey: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			ArtifactoryConfigCdsRepository: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			ArtifactoryConfigPromotionLowMaturity: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			ArtifactoryConfigPromotionHighMaturity: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			ArtifactoryConfigBuildInfoPrefix: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			ArtifactoryConfigRepositoryPrefix: IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
		},
		ArtifactManager: true,
	}
	// AWSIntegration represents an aws integration
	AWSIntegration = IntegrationModel{
		Name:       AWSIntegrationModel,
		Author:     "CDS",
		Identifier: "github.com/ovh/cds/integration/builtin/aws",
		Icon:       "",
		DefaultConfig: IntegrationConfig{
			"region": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"bucket_name": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"prefix": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"access_key_id": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"secret_access_key": IntegrationConfigValue{
				Type: IntegrationConfigTypePassword,
			},
			"endpoint": IntegrationConfigValue{
				Type: IntegrationConfigTypeString,
			},
			"disable_ssl": IntegrationConfigValue{
				Type: IntegrationConfigTypeBoolean,
			},
			"force_path_style": IntegrationConfigValue{
				Type: IntegrationConfigTypeBoolean,
			},
		},
		Storage:  true,
		Disabled: false,
		Hook:     false,
	}
)

Here are the default plateform models

View Source
var (
	FR = lang(language.French)
	EN = lang(language.AmericanEnglish)
)

Supported API language

View Source
var (
	MsgAppCreated                           = &Message{"MsgAppCreated", trad{FR: "L'application %s a été créée avec succès", EN: "Application %s successfully created"}, nil, RunInfoTypInfo}
	MsgAppUpdated                           = &Message{"MsgAppUpdated", trad{FR: "L'application %s a été mise à jour avec succès", EN: "Application %s successfully updated"}, nil, RunInfoTypInfo}
	MsgPipelineCreated                      = &Message{"MsgPipelineCreated", trad{FR: "Le pipeline %s a été créé avec succès", EN: "Pipeline %s successfully created"}, nil, RunInfoTypInfo}
	MsgPipelineCreationAborted              = &Message{"MsgPipelineCreationAborted", trad{FR: "La création du pipeline %s a été abandonnée", EN: "Pipeline %s creation aborted"}, nil, RunInfoTypeError}
	MsgPipelineExists                       = &Message{"MsgPipelineExists", trad{FR: "Le pipeline %s existe déjà", EN: "Pipeline %s already exists"}, nil, RunInfoTypInfo}
	MsgAppVariablesCreated                  = &Message{"MsgAppVariablesCreated", trad{FR: "Les variables ont été ajoutées avec succès sur l'application %s", EN: "Application variables for %s are successfully created"}, nil, RunInfoTypInfo}
	MsgAppKeyCreated                        = &Message{"MsgAppKeyCreated", trad{FR: "La clé %s %s a été créée sur l'application %s", EN: "%s key %s created on application %s"}, nil, RunInfoTypInfo}
	MsgEnvironmentExists                    = &Message{"MsgEnvironmentExists", trad{FR: "L'environnement %s existe déjà", EN: "Environment %s already exists"}, nil, RunInfoTypInfo}
	MsgEnvironmentCreated                   = &Message{"MsgEnvironmentCreated", trad{FR: "L'environnement %s a été créé avec succès", EN: "Environment %s successfully created"}, nil, RunInfoTypInfo}
	MsgEnvironmentVariableUpdated           = &Message{"MsgEnvironmentVariableUpdated", trad{FR: "La variable %s de l'environnement %s a été mise à jour", EN: "Variable %s on environment %s has been updated"}, nil, RunInfoTypInfo}
	MsgEnvironmentVariableCannotBeUpdated   = &Message{"MsgEnvironmentVariableCannotBeUpdated", trad{FR: "La variable %s de l'environnement %s n'a pu être mise à jour : %s", EN: "Variable %s on environment %s cannot be updated: %s"}, nil, RunInfoTypeError}
	MsgEnvironmentVariableCreated           = &Message{"MsgEnvironmentVariableCreated", trad{FR: "La variable %s de l'environnement %s a été ajoutée", EN: "Variable %s on environment %s has been added"}, nil, RunInfoTypInfo}
	MsgEnvironmentVariableCannotBeCreated   = &Message{"MsgEnvironmentVariableCannotBeCreated", trad{FR: "La variable %s de l'environnement %s n'a pu être ajoutée : %s", EN: "Variable %s on environment %s cannot be added: %s"}, nil, RunInfoTypeError}
	MsgEnvironmentGroupUpdated              = &Message{"MsgEnvironmentGroupUpdated", trad{FR: "Le groupe %s de l'environnement %s a été mis à jour", EN: "Group %s on environment %s has been updated"}, nil, RunInfoTypInfo}
	MsgEnvironmentGroupCannotBeUpdated      = &Message{"MsgEnvironmentGroupCannotBeUpdated", trad{FR: "Le groupe %s de l'environnement %s n'a pu être mis à jour : %s", EN: "Group %s on environment %s cannot be updated: %s"}, nil, RunInfoTypeError}
	MsgEnvironmentGroupCreated              = &Message{"MsgEnvironmentGroupCreated", trad{FR: "Le groupe %s de l'environnement %s a été ajouté", EN: "Group %s on environment %s has been added"}, nil, RunInfoTypInfo}
	MsgEnvironmentGroupCannotBeCreated      = &Message{"MsgEnvironmentGroupCannotBeCreated", trad{FR: "Le groupe %s de l'environnement %s n'a pu être ajouté : %s", EN: "Group %s on environment %s cannot be added: %s"}, nil, RunInfoTypeError}
	MsgEnvironmentGroupDeleted              = &Message{"MsgEnvironmentGroupDeleted", trad{FR: "Le groupe %s de l'environnement %s a été supprimé", EN: "Group %s on environment %s has been deleted"}, nil, RunInfoTypInfo}
	MsgEnvironmentGroupCannotBeDeleted      = &Message{"MsgEnvironmentGMsgEnvironmentGroupCannotBeDeletedroupCannotBeCreated", trad{FR: "Le groupe %s de l'environnement %s n'a pu être supprimé : %s", EN: "Group %s on environment %s cannot be deleted: %s"}, nil, RunInfoTypeError}
	MsgEnvironmentKeyCreated                = &Message{"MsgEnvironmentKeyCreated", trad{FR: "La clé %s %s a été créée sur l'environnement %s", EN: "%s key %s created on environment %s"}, nil, RunInfoTypInfo}
	MsgEnvironmentKeyCannotBeCreated        = &Message{"MsgEnvironmentKeyCannotBeCreated", trad{FR: "La clé %s %s n'a pas été créée sur l'environnement %s", EN: "%s key %s cannot be created on environment %s: %v"}, nil, RunInfoTypeError}
	MsgJobNotValidActionNotFound            = &Message{"MsgJobNotValidActionNotFound", trad{FR: "Erreur de validation du Job %s : L'action %s à l'étape %d n'a pas été trouvée", EN: "Job %s validation Failure: Unknown action %s on step #%d"}, nil, RunInfoTypeError}
	MsgJobNotValidInvalidActionParameter    = &Message{"MsgJobNotValidInvalidActionParameter", trad{FR: "Erreur de validation du Job %s : Le paramètre %s de l'étape %d - %s est invalide", EN: "Job %s validation Failure: Invalid parameter %s on step #%d %s"}, nil, RunInfoTypeError}
	MsgPipelineGroupUpdated                 = &Message{"MsgPipelineGroupUpdated", trad{FR: "Les permissions du groupe %s sur le pipeline %s on été mises à jour", EN: "Permission for group %s on pipeline %s has been updated"}, nil, RunInfoTypInfo}
	MsgPipelineGroupAdded                   = &Message{"MsgPipelineGroupAdded", trad{FR: "Les permissions du groupe %s sur le pipeline %s on été ajoutées", EN: "Permission for group %s on pipeline %s has been added"}, nil, RunInfoTypInfo}
	MsgPipelineGroupDeleted                 = &Message{"MsgPipelineGroupDeleted", trad{FR: "Les permissions du groupe %s sur le pipeline %s on été supprimées", EN: "Permission for group %s on pipeline %s has been deleted"}, nil, RunInfoTypInfo}
	MsgPipelineStageUpdated                 = &Message{"MsgPipelineStageUpdated", trad{FR: "Le stage %s a été mis à jour", EN: "Stage %s updated"}, nil, RunInfoTypInfo}
	MsgPipelineStageUpdating                = &Message{"MsgPipelineStageUpdating", trad{FR: "Mise à jour du stage %s en cours...", EN: "Updating stage %s ..."}, nil, RunInfoTypInfo}
	MsgPipelineStageDeletingOldJobs         = &Message{"MsgPipelineStageDeletingOldJobs", trad{FR: "Suppression des anciens jobs du stage %s en cours...", EN: "Deleting old jobs in stage %s ..."}, nil, RunInfoTypInfo}
	MsgPipelineStageInsertingNewJobs        = &Message{"MsgPipelineStageInsertingNewJobs", trad{FR: "Insertion des nouveaux jobs dans le stage %s en cours...", EN: "Inserting new jobs in stage %s ..."}, nil, RunInfoTypInfo}
	MsgPipelineStageAdded                   = &Message{"MsgPipelineStageAdded", trad{FR: "Le stage %s a été ajouté", EN: "Stage %s added"}, nil, RunInfoTypInfo}
	MsgPipelineStageDeleted                 = &Message{"MsgPipelineStageDeleted", trad{FR: "Le stage %s a été supprimé", EN: "Stage %s deleted"}, nil, RunInfoTypInfo}
	MsgPipelineJobUpdated                   = &Message{"MsgPipelineJobUpdated", trad{FR: "Le job %s du stage %s a été mis à jour", EN: "Job %s in stage %s updated"}, nil, RunInfoTypInfo}
	MsgPipelineJobAdded                     = &Message{"MsgPipelineJobAdded", trad{FR: "Le job %s du stage %s a été ajouté", EN: "Job %s in stage %s added"}, nil, RunInfoTypInfo}
	MsgPipelineJobDeleted                   = &Message{"MsgPipelineJobDeleted", trad{FR: "Le job %s du stage %s a été supprimé", EN: "Job %s in stage %s deleted"}, nil, RunInfoTypInfo}
	MsgPipelineDetached                     = &Message{"MsgPipelineDetached", trad{FR: "Le pipeline %s est détaché du repository %s", EN: "The pipeline %s is detached from repository %s"}, nil, RunInfoTypInfo}
	MsgApplicationDetached                  = &Message{"MsgApplicationDetached", trad{FR: "L'application %s est détachée du repository %s", EN: "The application %s is detached from repository %s"}, nil, RunInfoTypInfo}
	MsgEnvironmentDetached                  = &Message{"MsgEnvironmentDetached", trad{FR: "L'environnement %s est détaché du repository %s", EN: "The environment %s is detached from repository %s"}, nil, RunInfoTypInfo}
	MsgWorkflowDetached                     = &Message{"MsgWorkflowDetached", trad{FR: "Le workflow %s est détaché du repository %s", EN: "The workflow %s is detached from repository %s"}, nil, RunInfoTypInfo}
	MsgSpawnInfoHatcheryStarts              = &Message{"MsgSpawnInfoHatcheryStarts", trad{FR: "La Hatchery %s a démarré le lancement du worker %s avec le modèle %s", EN: "Hatchery %s starts spawn worker %s with model %s"}, nil, RunInfoTypInfo}
	MsgSpawnInfoHatcheryErrorSpawn          = &Message{"MsgSpawnInfoHatcheryErrorSpawn", trad{FR: "Une erreur est survenue lorsque la Hatchery %s a démarré un worker avec le modèle %s après %s, err: %s", EN: "Error while Hatchery %s spawns worker with model %s after %s, err: %s"}, nil, RunInfoTypeError}
	MsgSpawnInfoHatcheryStartDockerPull     = &Message{"MsgSpawnInfoHatcheryStartDockerPull", trad{FR: "La Hatchery %s a démarré le docker pull de l'image %s...", EN: "Hatchery %s starts docker pull %s..."}, nil, RunInfoTypInfo}
	MsgSpawnInfoHatcheryEndDockerPull       = &Message{"MsgSpawnInfoHatcheryEndDockerPull", trad{FR: "La Hatchery %s a terminé le docker pull de l'image %s", EN: "Hatchery %s docker pull %s done"}, nil, RunInfoTypInfo}
	MsgSpawnInfoHatcheryEndDockerPullErr    = &Message{"MsgSpawnInfoHatcheryEndDockerPullErr", trad{FR: "⚠ La Hatchery %s a terminé le docker pull de l'image %s en erreur: %s", EN: "⚠ Hatchery %s - docker pull %s done with error: %v"}, nil, RunInfoTypeError}
	MsgSpawnInfoDeprecatedModel             = &Message{"MsgSpawnInfoDeprecatedModel", trad{FR: "⚠ Attention vous utilisez un worker model (%s) déprécié", EN: "⚠ Pay attention you are using a deprecated worker model (%s)"}, nil, RunInfoTypeWarning}
	MsgSpawnInfoWorkerEnd                   = &Message{"MsgSpawnInfoWorkerEnd", trad{FR: "✓ Le worker %s a terminé et a passé %s à travailler sur les étapes", EN: "✓ Worker %s finished working on this job"}, nil, RunInfoTypInfo}
	MsgSpawnInfoJobDisabled                 = &Message{"MsgSpawnInfoJobDisabled", trad{FR: "✓ Le job a désactivé", EN: "✓ Job is disabled"}, nil, RunInfoTypInfo}
	MsgSpawnInfoJobInQueue                  = &Message{"MsgSpawnInfoJobInQueue", trad{FR: "✓ Le job a été mis en file d'attente", EN: "✓ Job has been queued"}, nil, RunInfoTypInfo}
	MsgSpawnInfoJobTaken                    = &Message{"MsgSpawnInfoJobTaken", trad{FR: "Le job %s a été pris par le worker %s", EN: "Job %s has been taken by worker %s"}, nil, RunInfoTypInfo}
	MsgSpawnInfoJobTakenWorkerVersion       = &Message{"MsgSpawnInfoJobTakenWorkerVersion", trad{FR: "Worker %s version:%s os:%s arch:%s", EN: "Worker %s version:%s os:%s arch:%s"}, nil, RunInfoTypInfo}
	MsgSpawnInfoWorkerForJob                = &Message{"MsgSpawnInfoWorkerForJob", trad{FR: "Ce worker %s a été créé pour lancer ce job", EN: "This worker %s was created to take this action"}, nil, RunInfoTypInfo}
	MsgSpawnInfoWorkerForJobError           = &Message{"MsgSpawnInfoWorkerForJobError", trad{FR: "⚠ Ce worker %s a été créé pour lancer ce job, mais ne possède pas tous les pré-requis. Vérifiez que les prérequis suivants: %s", EN: "⚠ This worker %s was created to take this action, but does not have all prerequisites. Please verify the following prerequisites: %s"}, nil, RunInfoTypeError}
	MsgSpawnInfoJobError                    = &Message{"MsgSpawnInfoJobError", trad{FR: "⚠ Impossible de lancer ce job : %s", EN: "⚠ Unable to run this job: %s"}, nil, RunInfoTypInfo}
	MsgWorkflowStarting                     = &Message{"MsgWorkflowStarting", trad{FR: "Le workflow %s#%s a été démarré", EN: "Workflow %s#%s has been started"}, nil, RunInfoTypInfo}
	MsgWorkflowError                        = &Message{"MsgWorkflowError", trad{FR: "⚠ Une erreur est survenue: %v", EN: "⚠ An error has occurred: %v"}, nil, RunInfoTypeError}
	MsgWorkflowConditionError               = &Message{"MsgWorkflowConditionError", trad{FR: "Les conditions de lancement ne sont pas respectées.", EN: "Run conditions aren't ok."}, nil, RunInfoTypInfo}
	MsgWorkflowNodeStop                     = &Message{"MsgWorkflowNodeStop", trad{FR: "Le pipeline a été arrété par %s", EN: "The pipeline has been stopped by %s"}, nil, RunInfoTypInfo}
	MsgWorkflowNodeMutex                    = &Message{"MsgWorkflowNodeMutex", trad{FR: "Le pipeline %s est mis en attente tant qu'il est en cours sur un autre run", EN: "The pipeline %s is waiting while it's running on another run"}, nil, RunInfoTypInfo}
	MsgWorkflowNodeMutexRelease             = &Message{"MsgWorkflowNodeMutexRelease", trad{FR: "Lancement du pipeline %s", EN: "Triggering pipeline %s"}, nil, RunInfoTypInfo}
	MsgWorkflowImportedUpdated              = &Message{"MsgWorkflowImportedUpdated", trad{FR: "Le workflow %s a été mis à jour", EN: "Workflow %s has been updated"}, nil, RunInfoTypInfo}
	MsgWorkflowImportedInserted             = &Message{"MsgWorkflowImportedInserted", trad{FR: "Le workflow %s a été créé", EN: "Workflow %s has been created"}, nil, RunInfoTypInfo}
	MsgSpawnInfoHatcheryCannotStartJob      = &Message{"MsgSpawnInfoHatcheryCannotStart", trad{FR: "Aucune hatchery n'a pu démarrer de worker respectant vos pré-requis de job, merci de les vérifier.", EN: "No hatchery can spawn a worker corresponding your job's requirements. Please check your job's requirements."}, nil, RunInfoTypeWarning}
	MsgWorkflowRunBranchDeleted             = &Message{"MsgWorkflowRunBranchDeleted", trad{FR: "La branche %s  a été supprimée", EN: "Branch %s has been deleted"}, nil, RunInfoTypInfo}
	MsgWorkflowTemplateImportedInserted     = &Message{"MsgWorkflowTemplateImportedInserted", trad{FR: "Le template de workflow %s/%s a été créé", EN: "Workflow template %s/%s has been created"}, nil, RunInfoTypInfo}
	MsgWorkflowTemplateImportedUpdated      = &Message{"MsgWorkflowTemplateImportedUpdated", trad{FR: "Le template de workflow %s/%s a été mis à jour", EN: "Workflow template %s/%s has been updated"}, nil, RunInfoTypInfo}
	MsgWorkflowErrorBadPipelineName         = &Message{"MsgWorkflowErrorBadPipelineName", trad{FR: "Le pipeline %s indiqué dans votre fichier yaml de workflow n'existe pas", EN: "The pipeline %s mentioned in your workflow's yaml file doesn't exist"}, nil, RunInfoTypeError}
	MsgWorkflowErrorBadApplicationName      = &Message{"MsgWorkflowErrorBadApplicationName", trad{FR: "L'application %s indiquée dans votre fichier yaml de workflow n'existe pas ou ne correspond pas aux normes ^[a-zA-Z0-9._-]{1,}$", EN: "The application %s mentioned in your workflow's yaml file doesn't exist or is incorrect with ^[a-zA-Z0-9._-]{1,}$"}, nil, RunInfoTypeError}
	MsgWorkflowErrorBadEnvironmentName      = &Message{"MsgWorkflowErrorBadEnvironmentName", trad{FR: "L'environnement %s indiqué dans votre fichier yaml de workflow n'existe pas", EN: "The environment %s mentioned in your workflow's yaml file doesn't exist"}, nil, RunInfoTypeError}
	MsgWorkflowErrorBadIntegrationName      = &Message{"MsgWorkflowErrorBadIntegrationName", trad{FR: "L'intégration %s indiquée dans votre fichier yaml n'existe pas", EN: "The integration %s mentioned in your yaml file doesn't exist"}, nil, RunInfoTypeError}
	MsgWorkflowErrorBadCdsDir               = &Message{"MsgWorkflowErrorBadCdsDir", trad{FR: "Un problème est survenu avec votre répertoire .cds", EN: "A problem occurred about your .cds directory"}, nil, RunInfoTypeError}
	MsgWorkflowErrorUnknownKey              = &Message{"MsgWorkflowErrorUnknownKey", trad{FR: "La clé '%s' est incorrecte ou n'existe pas", EN: "The key '%s' is incorrect or doesn't exist"}, nil, RunInfoTypeError}
	MsgWorkflowErrorBadVCSStrategy          = &Message{"MsgWorkflowErrorBadVCSStrategy", trad{FR: "Vos informations vcs_* sont incorrectes", EN: "Your vcs_* fields are incorrects"}, nil, RunInfoTypeError}
	MsgWorkflowDeprecatedVersion            = &Message{"MsgWorkflowDeprecatedVersion", trad{FR: "La configuration yaml de votre workflow est dans un format déprécié. Exportez le avec la CLI `cdsctl workflow export %s %s`", EN: "The yaml workflow configuration format is deprecated. Export your workflow with CLI `cdsctl workflow export %s %s`"}, nil, RunInfoTypeWarning}
	MsgWorkflowGeneratedFromTemplateVersion = &Message{"MsgWorkflowGeneratedFromTemplateVersion", trad{FR: "Le workflow a été généré à partir du modèle de workflow: %s", EN: "The workflow was generated from the template: %s"}, nil, RunInfoTypInfo}
	MsgTooMuchWorkflowRun                   = &Message{"MsgTooMuchWorkflowRun", trad{FR: "L'exécution de ce workflow est suspendu. Vous dépassez le nombre maximum d'éxécution autorisé (%.f). Merci de revoir la politique de retention de ce workflow", EN: "Workflow run is delayed. The maximum number of runs for this workflow has been reached ( %.f ). Please update your workflow retention policy"}, nil, RunInfoTypeWarning}
	MsgSpawnErrorHatcheryRetryAttempt       = &Message{"MsgSpawnErrorHatcheryRetryAttempt", trad{EN: "Job execution failed by hatchery %s. Reason: %s"}, nil, RunInfoTypeError}
	MsgWorkflowV3Preview                    = &Message{"MsgWorkflowV3Preview", trad{FR: "Le workflow a été généré en version 3 à partir d'une ancienne version", EN: "The workflow was generated in version 3 from an old version"}, nil, RunInfoTypeWarning}
	MsgSpawnInfoDisableSecretInjection      = &Message{"MsgSpawnInfoDisableSecretInjection", trad{EN: "⚠ Project's secrets were not automatically injected for this job because of a region prerequisite: %s"}, nil, RunInfoTypInfo}
	MsgSpawnInfoManualSecretInjection       = &Message{"MsgSpawnInfoManualSecretInjection", trad{EN: "Prerequisites of type secret matched %s secret(s)"}, nil, RunInfoTypInfo}
	MsgSpawnInfoWorkerHookSetup             = &Message{"MsgSpawnInfoWorkerHookSetup", trad{EN: "Setting up worker hook %q"}, nil, RunInfoTypInfo}
	MsgSpawnInfoWorkerHookRun               = &Message{"MsgSpawnInfoWorkerHookRun", trad{EN: "Running worker hook %q"}, nil, RunInfoTypInfo}
	MsgSpawnInfoWorkerHookRunTeardown       = &Message{"MsgSpawnInfoWorkerHookRunTeardown", trad{EN: "Running worker hook %q teardown"}, nil, RunInfoTypInfo}
	MsgSpawnInfoWorkerDisabledByHatchery    = &Message{"MsgSpawnInfoWorkerDisabledByHatchery", trad{EN: "The worker (not responding) %s was disabled by hatchery"}, nil, RunInfoTypeWarning}
	MsgSpawnInfoWorkerDisabledByAdmin       = &Message{"MsgSpawnInfoWorkerDisabledByAdmin", trad{EN: "The worker %s was disabled by an administrator"}, nil, RunInfoTypeWarning}
	MsgSpawnInfoJobFailedCauseByWorkerLost  = &Message{"MsgSpawnInfoJobFailedCauseByWorkerLost", trad{EN: "The job %s was set to failed due to lost connection with the worker"}, nil, RunInfoTypeWarning}
)

Message list

View Source
var (
	UserNotificationTemplateEmail = UserNotificationTemplate{
		Subject: "{{.cds.project}}/{{.cds.workflow}}#{{.cds.version}} {{.cds.status}}",
		Body: `Project : {{.cds.project}}
Workflow : {{.cds.workflow}}#{{.cds.version}}
Pipeline : {{.cds.node}}
Status : {{.cds.status}}
Details : {{.cds.buildURL}}
Triggered by : {{.cds.triggered_by.username}}
Branch : {{.git.branch | default "n/a"}}`,
	}

	UserNotificationTemplateMap = map[string]UserNotificationTemplate{
		EmailUserNotification: UserNotificationTemplateEmail,
		VCSUserNotification: {
			Body: DefaultWorkflowNodeRunReport,
		},
	}
)

Default template values

View Source
var (
	WorkflowRoleTrigger = "trigger"
	WorkflowRoles       = []string{WorkflowRoleTrigger}
)
View Source
var (
	// AvailableRequirementsType List of all requirements
	AvailableRequirementsType = []string{
		BinaryRequirement,
		HostnameRequirement,
		MemoryRequirement,
		ModelRequirement,
		OSArchRequirement,
		PluginRequirement,
		RegionRequirement,
		ServiceRequirement,
		SecretRequirement,
		FlavorRequirement,
	}

	// OSArchRequirementValues comes from go tool dist list
	OSArchRequirementValues = RequirementList{
		{Name: "linux/amd64", Type: OSArchRequirement, Value: "linux/amd64"},
		{Name: "linux/386", Type: OSArchRequirement, Value: "linux/386"},

		{Name: "darwin/amd64", Type: OSArchRequirement, Value: "darwin/amd64"},

		{Name: "freebsd/386", Type: OSArchRequirement, Value: "freebsd/386"},
		{Name: "freebsd/amd64", Type: OSArchRequirement, Value: "freebsd/amd64"},

		{Name: "linux/arm64", Type: OSArchRequirement, Value: "linux/arm64"},

		{Name: "netbsd/386", Type: OSArchRequirement, Value: "netbsd/386"},
		{Name: "netbsd/amd64", Type: OSArchRequirement, Value: "netbsd/amd64"},

		{Name: "openbsd/386", Type: OSArchRequirement, Value: "openbsd/386"},
		{Name: "openbsd/amd64", Type: OSArchRequirement, Value: "openbsd/amd64"},

		{Name: "windows/amd64", Type: OSArchRequirement, Value: "windows/amd64"},
	}
)
View Source
var (
	// AvailableVariableType list all existing variable type in CDS
	AvailableVariableType = []string{
		SecretVariable,
		TextVariable,
		StringVariable,
		BooleanVariable,
		NumberVariable,
	}

	BasicVariableNames = []string{
		"cds.version",
		"cds.application",
		"cds.environment",
		"cds.job",
		"cds.manual",
		"cds.pipeline",
		"cds.project",
		"cds.run",
		"cds.run.number",
		"cds.run.subnumber",
		"cds.stage",
		"cds.triggered_by.email",
		"cds.triggered_by.fullname",
		"cds.triggered_by.username",
		"cds.ui.pipeline.run",
		"cds.worker",
		"cds.workflow",
		"cds.workspace",
		"payload",
	}

	BasicGitVariableNames = []string{
		"git.repository",
		"git.branch",
		"git.message",
		"git.author",
		"git.hash",
		"git.hash.short",
		"git.url",
		"git.http_url",
		"git.server",
	}
)
View Source
var (
	BitbucketEvents = []string{
		"repo:refs_changed",
		"repo:comment:added",
		"repo:comment:deleted",
		"repo:comment:edited",
		"repo:forked",
		"repo:modified",
		"pr:comment:added",
		"pr:comment:deleted",
		"pr:comment:edited",
		"pr:declined",
		"pr:deleted",
		"pr:from_ref_updated",
		"pr:merged",
		"pr:modified",
		"pr:opened",
		"pr:reviewer:approved",
		"pr:reviewer:needs_work",
		"pr:reviewer:unapproved",
		"pr:reviewer:updated",
	}

	BitbucketEventsDefault = []string{
		"repo:refs_changed",
	}

	BitbucketCloudEvents = []string{
		"repo:push",
		"repo:commit_comment_created",
		"repo:commit_status_created",
		"repo:commit_status_updated",
		"repo:created",
		"repo:deleted",
		"repo:fork",
		"repo:imported",
		"repo:transfer",
		"repo:updated",
		"issue:comment_created",
		"issue:created",
		"issue:updated",
		"project:updated",
		"pullrequest:approved",
		"pullrequest:comment_created",
		"pullrequest:comment_deleted",
		"pullrequest:comment_updated",
		"pullrequest:created",
		"pullrequest:fulfilled",
		"pullrequest:rejected",
		"pullrequest:unapproved",
		"pullrequest:updated",
	}

	BitbucketCloudEventsDefault = []string{
		"repo:push",
	}

	GitHubEvents = []string{
		"push",
		"pull_request_review_comment",
		"pull_request_review",
		"pull_request",
		"check_run",
		"check_suite",
		"commit_comment",
		"create",
		"delete",
		"deployment_status",
		"deployment",
		"fork",
		"github_app_authorization",
		"gollum",
		"installation_repositories",
		"installation",
		"issue_comment",
		"issues",
		"label",
		"marketplace_purchase",
		"member",
		"membership",
		"milestone",
		"org_block",
		"organization",
		"page_build",
		"project_card",
		"project_column",
		"project",
		"public",
		"release",
		"repository_import",
		"repository_vulnerability_alert",
		"repository",
		"security_advisory",
		"status",
		"team_add",
		"team",
		"watch",
	}

	GitHubEventsDefault = []string{
		"push",
	}

	GitlabEventsDefault = []string{
		"Push Hook",
		"Tag Push Hook",
	}

	GerritEvents = []string{
		GerritEventTypePatchsetCreated,
		GerritEventTypeAssignedChanged,
		GerritEventTypeChangeAbandoned,
		GerritEventTypeChangeDeleted,
		GerritEventTypeChangeMerged,
		GerritEventTypeChangeRestored,
		GerritEventTypeCommentAdded,
		GerritEventTypeDrafPublished,
		GerritEventTypeDroppedOutput,
		GerritEventTypeHashTagsChanged,
		GerritEventTypeProjectCreated,
		GerritEventTypeRefUpdated,
		GerritEventTypeReviewerAdded,
		GerritEventTypeReviewerDelete,
		GerritEventTypeTopicChanged,
		GerritEventTypeWIPStateChanged,
		GerritEventTypePrivateStateChanged,
		GerritEventTypeVoteDeleted,
	}

	GerritEventTypeAssignedChanged     = "assignee-changed"
	GerritEventTypeChangeAbandoned     = "change-abandoned"
	GerritEventTypeChangeDeleted       = "change-deleted"
	GerritEventTypeChangeMerged        = "change-merged"
	GerritEventTypeChangeRestored      = "change-restored"
	GerritEventTypeCommentAdded        = "comment-added"
	GerritEventTypeDrafPublished       = "draft-published"
	GerritEventTypeDroppedOutput       = "dropped-output"
	GerritEventTypeHashTagsChanged     = "hashtags-changed"
	GerritEventTypeProjectCreated      = "project-created"
	GerritEventTypePatchsetCreated     = "patchset-created"
	GerritEventTypeRefUpdated          = "ref-updated"
	GerritEventTypeReviewerAdded       = "reviewer-added"
	GerritEventTypeReviewerDelete      = "reviewer-deleted"
	GerritEventTypeTopicChanged        = "topic-changed"
	GerritEventTypeWIPStateChanged     = "wip-state-changed"
	GerritEventTypePrivateStateChanged = "private-state-changed"
	GerritEventTypeVoteDeleted         = "vote-deleted"

	GerritEventsDefault = []string{
		GerritEventTypePatchsetCreated,
	}
)
View Source
var (
	//VERSION is set with -ldflags "-X github.com/ovh/cds/sdk.VERSION=$(VERSION)"
	VERSION = "snapshot"

	//GOOS is set with -ldflags "-X github.com/ovh/cds/sdk.GOOS=$(GOOS)"
	GOOS = ""

	//GOARCH is set with -ldflags "-X github.com/ovh/cds/sdk.GOARCH=$(GOARCH)"
	GOARCH = ""

	//GITHASH is set with -ldflags "-X github.com/ovh/cds/sdk.GITHASH=$(GITHASH)"
	GITHASH = ""

	//BUILDTIME is set with -ldflags "-X github.com/ovh/cds/sdk.BUILDTIME=$(BUILDTIME)"
	BUILDTIME = ""

	//BINARY is set with -ldflags "-X github.com/ovh/cds/sdk.BINARY=$(BINARY)"
	BINARY = ""

	//DBMIGRATE is set with -ldflags "-X github.com/ovh/cds/sdk.DBMIGRATE=$(DBMIGRATE)"
	// this flag contains the number of sql files to migrate for this version
	DBMIGRATE = ""
)
View Source
var (
	WorkflowRunHeader = "X-Workflow-Run"
	WorkflowHeader    = "X-Workflow"
	ProjectKeyHeader  = "X-Project-Key"
)

AuthConsumerScopes list.

View Source
var (
	// AvailableParameterType list all existing parameters type in CDS
	AvailableParameterType = []string{
		StringParameter,
		NumberParameter,
		TextParameter,
		BooleanParameter,
		ListParameter,
		KeySSHParameter,
		KeyPGPParameter,
	}
)
View Source
var (
	// AvailableWorkerModelType List of all worker model type
	AvailableWorkerModelType = []string{
		string(Docker),
		string(HostProcess),
		string(Openstack),
		string(VSphere),
	}
)
View Source
var ColorRegexp = regexp.MustCompile(`^#\w{3,8}$`)

ColorRegexp represent the regexp for a format to hexadecimal color

View Source
var (
	DefaultFuncs = map[string]ActionFunc{
		"contains":   contains,
		"startsWith": startsWith,
		"endsWith":   endsWith,
		"format":     format,
		"join":       join,
		"toJSON":     toJSON,
		"fromJSON":   fromJSON,
		"hashFiles":  hashFiles,
		"success":    success,
		"always":     always,
		"cancelled":  cancelled,
		"failure":    failure,
	}
)
View Source
var ErrExecutableNotFound = errors.New("executable file not found in $PATH")

ErrExecutableNotFound is the error resulting if a path search failed to find an executable file.

View Source
var (
	HatcheryRoles = StringSlice{HatcheryRoleSpawn}
)
View Source
var MapMergeOptions = struct {
	// Function to exclude git parameters
	ExcludeGitParams CheckFunc
}{
	ExcludeGitParams: excludeGitParams,
}

MapMergeOptions options for mapMerge functions

View Source
var MessageAmericanEnglish = map[string]string{
	WarningMissingProjectVariableEnv:               `Variable {{index . "VarName"}} is used by environment {{index . "EnvironmentName"}} but does not exist on project {{index . "ProjectKey"}}`,
	WarningMissingProjectVariableApplication:       `Variable {{index . "VarName"}} is used by application {{index . "ApplicationName"}} but does not exist on project {{index . "ProjectKey"}}`,
	WarningMissingProjectVariablePipelineParameter: `Variable {{index . "VarName"}} is used by parameter in pipeline {{index . "PipelineName"}} but does not exist on project {{index . "ProjectKey"}}`,
	WarningMissingProjectVariablePipelineJob:       `Variable {{index . "VarName"}} is used in pipeline {{index . "PipelineName"}}, in stage {{index . "StageName"}} by job {{index . "JobName"}} but does not exist on project {{index . "ProjectKey"}}`,
	WarningMissingProjectVariableWorkflow:          `Variable {{index . "VarName"}} is used by the workflow {{index . "WorkflowName"}} in Pipeline {{index . "NodeName"}} but does not exist on project {{index . "ProjectKey"}}`,
	WarningUnusedProjectVariable:                   `Unused variable {{index . "VarName"}} on project {{index . "ProjectKey"}}.`,
	WarningMissingProjectPermissionEnv:             `Group {{index . "GroupName"}} is not on project {{index . "ProjectKey"}} but is used on Environment {{index . "EnvironmentName"}}.`,
	WarningMissingProjectPermissionWorkflow:        `Group {{index . "GroupName"}} is not on project {{index . "ProjectKey"}} but is used on Workflow {{index . "WorkflowName"}}.`,
	WarningMissingProjectKeyApplication:            `Key {{index . "KeyName"}} is used by application {{index . "ApplicationName"}} but does not exist on project {{index . "ProjectKey"}}`,
	WarningMissingProjectKeyPipelineParameter:      `Key {{index . "KeyName"}} is used by a parameter in pipeline {{index . "PipelineName"}}  but does not exist on project {{index . "ProjectKey"}}`,
	WarningMissingProjectKeyPipelineJob:            `Key {{index . "KeyName"}} is used by pipeline {{index . "PipelineName"}} in stage {{index . "StageName"}} in job {{index . "JobName"}}  but does not exist on project {{index . "ProjectKey"}}`,
	WarningUnusedProjectKey:                        `Unused key {{index . "KeyName"}} on project {{index . "ProjectKey"}}.`,
	WarningMissingProjectVCSServer:                 `Repository manager {{index . "VCSName"}} is used by Application: "{{index . "ApplicationName"}}" but does not exist on project {{index . "ProjectKey"}}`,
	WarningUnusedProjectVCSServer:                  `Unused repository manager {{index . "VCSName"}} on project {{index . "ProjectKey"}}.`,
	WarningMissingVCSConfiguration:                 `CDS variables .git.* are used but there is no repository manager on project {{index . "ProjectKey"}}`,
	WarningMissingApplicationVariable:              `Variable {{index . "VarName"}} is used but does not exist on project/application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}`,
	WarningUnusedApplicationVariable:               `Unused variable {{index . "VarName"}} on project/application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}.`,
	WarningMissingApplicationKey:                   `Key {{index . "KeyName"}} is used but does not exist on project/application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}`,
	WarningUnusedApplicationKey:                    `Unused key {{index . "KeyName"}} on project/application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}.`,
	WarningMissingEnvironmentVariable:              `Variable {{index . "VarName"}} is used but does not exist on project/environment {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}`,
	WarningUnusedEnvironmentVariable:               `Unused variable {{index . "VarName"}} on project/environment {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}.`,
	WarningMissingEnvironmentKey:                   `Key {{index . "KeyName"}} is used but does not exist on project/environment {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}`,
	WarningUnusedEnvironmentKey:                    `Unused key {{index . "KeyName"}} on project/environment {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}.`,
	WarningMissingPipelineParameter:                `Parameter {{index . "ParamName"}} is used but does not exist on project/pipeline {{index . "ProjectKey"}}/{{index . "PipelineName"}}`,
	WarningUnusedPipelineParameter:                 `Unused parameter {{index . "ParamName"}} on project/pipeline {{index . "ProjectKey"}}/{{index . "PipelineName"}}.`,
}
View Source
var MessageFrench = map[string]string{
	WarningMissingProjectVariableEnv:               `La variable {{index . "VarName"}} est utilisée par l'environment {{index . "EnvironmentName"}} mais n'existe pas dans le projet {{index . "ProjectKey"}}`,
	WarningMissingProjectVariableApplication:       `La variable {{index . "VarName"}} est utilisée par l'application {{index . "ApplicationName"}} mais n'existe pas dans le projet {{index . "ProjectKey"}}`,
	WarningMissingProjectVariablePipelineParameter: `La variable {{index . "VarName"}} est utilisée par les paramètre du pipeline {{index . "PipelineName"}} mais n'existe pas dans le projet {{index . "ProjectKey"}}`,
	WarningMissingProjectVariablePipelineJob:       `La variable {{index . "VarName"}} est utilisée par le pipeline {{index . "PipelineName"}}, dans le stage {{index . "StageName"}} dans le job {{index . "JobName"}} mais n'existe pas dans le projet {{index . "ProjectKey"}}`,
	WarningMissingProjectVariableWorkflow:          `La variable {{index . "VarName"}} est utilisée par le workflow {{index . "WorkflowName"}} par le pipeline {{index . "NodeName"}} mais n'existe pas dans le projet {{index . "ProjectKey"}}`,
	WarningUnusedProjectVariable:                   `La variable {{index . "VarName"}} est inutilisée dans le projet {{index . "ProjectKey"}}.`,
	WarningMissingProjectPermissionEnv:             `Le groupe {{index . "GroupName"}} n'a pas accès au projet {{index . "ProjectKey"}} mais est positionné sur l'environment {{index . "EnvironmentName"}}.`,
	WarningMissingProjectPermissionWorkflow:        `Le groupe {{index . "GroupName"}} n'a pas accès au projet {{index . "ProjectKey"}} mais est positionné sur le workflow {{index . "WorkflowName"}}.`,
	WarningMissingProjectKeyApplication:            `La clé {{index . "KeyName"}} est utilisée dans l'application {{index . "ApplicationName"}} mais n'existe pas dans le projet {{index . "ProjectKey"}}`,
	WarningMissingProjectKeyPipelineParameter:      `La clé {{index . "KeyName"}} est utilisée dans le pipeline {{index . "PipelineName"}}  mais n'existe pas dans le projet {{index . "ProjectKey"}}`,
	WarningMissingProjectKeyPipelineJob:            `La clé {{index . "KeyName"}} est utilisée dans le pipeline {{index . "PipelineName"}} dans le stage {{index . "StageName"}} dans le job {{index . "JobName"}}  but does not exist on project {{index . "ProjectKey"}}`,
	WarningUnusedProjectKey:                        `La clé {{index . "KeyName"}} est inutilisé dans le projet {{index . "ProjectKey"}}.`,
	WarningMissingProjectVCSServer:                 `Le gestionnaire de dépôt {{index . "VCSName"}} est utilisés par l'application' : "{{index . "ApplicationName"}}" mais n'existe pas sur le projet {{index . "ProjectKey"}}`,
	WarningUnusedProjectVCSServer:                  `Le gestionnaire de dépôt {{index . "VCSName"}} est inutilisé dans le project {{index . "ProjectKey"}}`,
	WarningMissingVCSConfiguration:                 `Les variables CDS git.* sont utilisées mais aucun repository manager n'est lié au projet {{index . "ProjectKey"}}`,
	WarningMissingApplicationVariable:              `La variable {{index . "VarName"}} est utilisée mais n'existe pas dans l'application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}`,
	WarningUnusedApplicationVariable:               `La variable {{index . "VarName"}} est inutilisée dans l'application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}.`,
	WarningMissingApplicationKey:                   `La clé {{index . "KeyName"}} est utilisée mais n'existe pas dans l'application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}`,
	WarningUnusedApplicationKey:                    `La clé {{index . "KeyName"}} est inutilisée dans l'application {{index . "ProjectKey"}}/{{index . "ApplicationName"}}.`,
	WarningMissingEnvironmentVariable:              `La variable {{index . "VarName"}} est utilisée mais n'existe pas dans l'environnement {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}`,
	WarningUnusedEnvironmentVariable:               `La variable {{index . "VarName"}} est inutilisée dans l'environnement {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}.`,
	WarningMissingEnvironmentKey:                   `La clé {{index . "KeyName"}} est utilisée mais n'existe pas dans l'environnement {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}`,
	WarningUnusedEnvironmentKey:                    `La clé {{index . "KeyName"}} est inutilisée dans l'environnement {{index . "ProjectKey"}}/{{index . "EnvironmentName"}}.`,
	WarningMissingPipelineParameter:                `Le paramètre {{index . "ParamName"}} est utilisé mais n'existe pas dans le pipeline {{index . "ProjectKey"}}/{{index . "PipelineName"}}`,
	WarningUnusedPipelineParameter:                 `Le paramètre {{index . "ParamName"}} est inutilisé dans le pipeline {{index . "ProjectKey"}}/{{index . "PipelineName"}}.`,
}
View Source
var Messages = map[string]*Message{
	MsgAppCreated.ID:                           MsgAppCreated,
	MsgAppUpdated.ID:                           MsgAppUpdated,
	MsgPipelineCreated.ID:                      MsgPipelineCreated,
	MsgPipelineCreationAborted.ID:              MsgPipelineCreationAborted,
	MsgPipelineExists.ID:                       MsgPipelineExists,
	MsgAppVariablesCreated.ID:                  MsgAppVariablesCreated,
	MsgAppKeyCreated.ID:                        MsgAppKeyCreated,
	MsgEnvironmentExists.ID:                    MsgEnvironmentExists,
	MsgEnvironmentCreated.ID:                   MsgEnvironmentCreated,
	MsgEnvironmentVariableUpdated.ID:           MsgEnvironmentVariableUpdated,
	MsgEnvironmentVariableCannotBeUpdated.ID:   MsgEnvironmentVariableCannotBeUpdated,
	MsgEnvironmentVariableCreated.ID:           MsgEnvironmentVariableCreated,
	MsgEnvironmentVariableCannotBeCreated.ID:   MsgEnvironmentVariableCannotBeCreated,
	MsgEnvironmentGroupUpdated.ID:              MsgEnvironmentGroupUpdated,
	MsgEnvironmentGroupCannotBeUpdated.ID:      MsgEnvironmentGroupCannotBeUpdated,
	MsgEnvironmentGroupCreated.ID:              MsgEnvironmentGroupCreated,
	MsgEnvironmentGroupCannotBeCreated.ID:      MsgEnvironmentGroupCannotBeCreated,
	MsgEnvironmentGroupDeleted.ID:              MsgEnvironmentGroupDeleted,
	MsgEnvironmentGroupCannotBeDeleted.ID:      MsgEnvironmentGroupCannotBeDeleted,
	MsgEnvironmentKeyCreated.ID:                MsgEnvironmentKeyCreated,
	MsgEnvironmentKeyCannotBeCreated.ID:        MsgEnvironmentKeyCannotBeCreated,
	MsgJobNotValidActionNotFound.ID:            MsgJobNotValidActionNotFound,
	MsgJobNotValidInvalidActionParameter.ID:    MsgJobNotValidInvalidActionParameter,
	MsgPipelineGroupUpdated.ID:                 MsgPipelineGroupUpdated,
	MsgPipelineGroupAdded.ID:                   MsgPipelineGroupAdded,
	MsgPipelineGroupDeleted.ID:                 MsgPipelineGroupDeleted,
	MsgPipelineStageUpdated.ID:                 MsgPipelineStageUpdated,
	MsgPipelineStageUpdating.ID:                MsgPipelineStageUpdating,
	MsgPipelineStageDeletingOldJobs.ID:         MsgPipelineStageDeletingOldJobs,
	MsgPipelineStageInsertingNewJobs.ID:        MsgPipelineStageInsertingNewJobs,
	MsgPipelineStageAdded.ID:                   MsgPipelineStageAdded,
	MsgPipelineStageDeleted.ID:                 MsgPipelineStageDeleted,
	MsgPipelineJobUpdated.ID:                   MsgPipelineJobUpdated,
	MsgPipelineJobAdded.ID:                     MsgPipelineJobAdded,
	MsgPipelineJobDeleted.ID:                   MsgPipelineJobDeleted,
	MsgPipelineDetached.ID:                     MsgPipelineDetached,
	MsgApplicationDetached.ID:                  MsgApplicationDetached,
	MsgEnvironmentDetached.ID:                  MsgEnvironmentDetached,
	MsgWorkflowDetached.ID:                     MsgWorkflowDetached,
	MsgSpawnInfoHatcheryStarts.ID:              MsgSpawnInfoHatcheryStarts,
	MsgSpawnInfoHatcheryErrorSpawn.ID:          MsgSpawnInfoHatcheryErrorSpawn,
	MsgSpawnInfoHatcheryStartDockerPull.ID:     MsgSpawnInfoHatcheryStartDockerPull,
	MsgSpawnInfoHatcheryEndDockerPull.ID:       MsgSpawnInfoHatcheryEndDockerPull,
	MsgSpawnInfoHatcheryEndDockerPullErr.ID:    MsgSpawnInfoHatcheryEndDockerPullErr,
	MsgSpawnInfoDeprecatedModel.ID:             MsgSpawnInfoDeprecatedModel,
	MsgSpawnInfoWorkerEnd.ID:                   MsgSpawnInfoWorkerEnd,
	MsgSpawnInfoJobDisabled.ID:                 MsgSpawnInfoJobDisabled,
	MsgSpawnInfoJobInQueue.ID:                  MsgSpawnInfoJobInQueue,
	MsgSpawnInfoJobTaken.ID:                    MsgSpawnInfoJobTaken,
	MsgSpawnInfoJobTakenWorkerVersion.ID:       MsgSpawnInfoJobTakenWorkerVersion,
	MsgSpawnInfoWorkerForJob.ID:                MsgSpawnInfoWorkerForJob,
	MsgSpawnInfoWorkerForJobError.ID:           MsgSpawnInfoWorkerForJobError,
	MsgSpawnInfoJobError.ID:                    MsgSpawnInfoJobError,
	MsgWorkflowStarting.ID:                     MsgWorkflowStarting,
	MsgWorkflowError.ID:                        MsgWorkflowError,
	MsgWorkflowConditionError.ID:               MsgWorkflowConditionError,
	MsgWorkflowNodeStop.ID:                     MsgWorkflowNodeStop,
	MsgWorkflowNodeMutex.ID:                    MsgWorkflowNodeMutex,
	MsgWorkflowNodeMutexRelease.ID:             MsgWorkflowNodeMutexRelease,
	MsgWorkflowImportedUpdated.ID:              MsgWorkflowImportedUpdated,
	MsgWorkflowImportedInserted.ID:             MsgWorkflowImportedInserted,
	MsgSpawnInfoHatcheryCannotStartJob.ID:      MsgSpawnInfoHatcheryCannotStartJob,
	MsgWorkflowRunBranchDeleted.ID:             MsgWorkflowRunBranchDeleted,
	MsgWorkflowTemplateImportedInserted.ID:     MsgWorkflowTemplateImportedInserted,
	MsgWorkflowTemplateImportedUpdated.ID:      MsgWorkflowTemplateImportedUpdated,
	MsgWorkflowErrorBadPipelineName.ID:         MsgWorkflowErrorBadPipelineName,
	MsgWorkflowErrorBadApplicationName.ID:      MsgWorkflowErrorBadApplicationName,
	MsgWorkflowErrorBadEnvironmentName.ID:      MsgWorkflowErrorBadEnvironmentName,
	MsgWorkflowErrorBadIntegrationName.ID:      MsgWorkflowErrorBadIntegrationName,
	MsgWorkflowErrorBadCdsDir.ID:               MsgWorkflowErrorBadCdsDir,
	MsgWorkflowErrorUnknownKey.ID:              MsgWorkflowErrorUnknownKey,
	MsgWorkflowErrorBadVCSStrategy.ID:          MsgWorkflowErrorBadVCSStrategy,
	MsgWorkflowDeprecatedVersion.ID:            MsgWorkflowDeprecatedVersion,
	MsgWorkflowGeneratedFromTemplateVersion.ID: MsgWorkflowGeneratedFromTemplateVersion,
	MsgTooMuchWorkflowRun.ID:                   MsgTooMuchWorkflowRun,
	MsgSpawnErrorHatcheryRetryAttempt.ID:       MsgSpawnErrorHatcheryRetryAttempt,
	MsgWorkflowV3Preview.ID:                    MsgWorkflowV3Preview,
	MsgSpawnInfoDisableSecretInjection.ID:      MsgSpawnInfoDisableSecretInjection,
	MsgSpawnInfoManualSecretInjection.ID:       MsgSpawnInfoManualSecretInjection,
	MsgSpawnInfoWorkerHookSetup.ID:             MsgSpawnInfoWorkerHookSetup,
	MsgSpawnInfoWorkerHookRun.ID:               MsgSpawnInfoWorkerHookRun,
	MsgSpawnInfoWorkerHookRunTeardown.ID:       MsgSpawnInfoWorkerHookRunTeardown,
	MsgSpawnInfoWorkerDisabledByHatchery.ID:    MsgSpawnInfoWorkerDisabledByHatchery,
	MsgSpawnInfoWorkerDisabledByAdmin.ID:       MsgSpawnInfoWorkerDisabledByAdmin,
	MsgSpawnInfoJobFailedCauseByWorkerLost.ID:  MsgSpawnInfoJobFailedCauseByWorkerLost,
}

Messages contains all sdk Messages

View Source
var NamePatternRegex = regexp.MustCompile(NamePattern)

NamePatternRegex Pattern regexp

View Source
var NamePatternSpaceRegex = regexp.MustCompile(NamePatternSpace)

NamePatternSpaceRegex Pattern regexp

View Source
var SIGINFO = unix.SIGUSR1
View Source
var (
	SupportedLanguages = []language.Tag{
		language.AmericanEnglish,
		language.French,
	}
)

SupportedLanguages on API errors

WorkflowData conditions operator

Functions

func ActionInfoMarkdown

func ActionInfoMarkdown(a Action, filename string) string

ActionInfoMarkdown returns string formatted with markdown.

func ActionsToGroupIDs

func ActionsToGroupIDs(as []*Action) []int64

ActionsToGroupIDs returns group ids for given actions list.

func ActionsToIDs

func ActionsToIDs(as []*Action) []int64

ActionsToIDs returns ids for given actions list.

func AddParameter

func AddParameter(array *[]Parameter, name string, parameterType string, value string)

AddParameter append a parameter in a parameter array

func AddRequirement

func AddRequirement(array *RequirementList, id int64, name string, requirementType string, value string)

AddRequirement append a requirement in a requirement array

func AllowIntegrationInVariable

func AllowIntegrationInVariable(model IntegrationModel) bool

func AuthConsumersToAuthentifiedUserIDs

func AuthConsumersToAuthentifiedUserIDs(cs []*AuthUserConsumer) []string

AuthConsumersToAuthentifiedUserIDs returns ids of given auth consumers.

func AuthConsumersToIDs

func AuthConsumersToIDs(cs []AuthUserConsumer) []string

AuthConsumersToIDs returns ids of given auth consumers.

func AuthentifiedUsersToIDs

func AuthentifiedUsersToIDs(users []*AuthentifiedUser) []string

AuthentifiedUsersToIDs returns ids for given authentified user list.

func BinaryFilename

func BinaryFilename(name, os, arch, variant string) string

BinaryFilename returns artifact name cds-name-os-arch-variant this name is used on Github Releases

func Cause

func Cause(err error) error

Cause returns recursively the root error from given error.

func CheckContentTypeBinary

func CheckContentTypeBinary(resp *http.Response) error

CheckContentTypeBinary returns an error if Content-Type is not application/octet-stream

func CleanPath added in v0.52.0

func CleanPath(path string) string

func ComputeWorkerModelPath

func ComputeWorkerModelPath(groupName, modelName string) string

ComputeWorkerModelPath returns path for a worker model with given group name and model name.

func ContextWithStacktrace

func ContextWithStacktrace(ctx context.Context, err error) context.Context

func CreateTarFromPaths

func CreateTarFromPaths(fs afero.Fs, cwd string, paths []string, w io.Writer, opts *TarOptions) error

CreateTarFromPaths returns a tar formatted reader of a tar made of several path

func DecodeError

func DecodeError(data []byte) error

DecodeError return an Error struct from json

func DefaultIfEmptyStorage

func DefaultIfEmptyStorage(integrationName string) string

DefaultIfEmptyStorage return sdk.DefaultStorageIntegrationName if integrationName is empty

func DeleteEmptyValueFromArray

func DeleteEmptyValueFromArray(array []string) []string

DeleteEmptyValueFromArray deletes empty value from an array of string

func DeleteFromArray

func DeleteFromArray(array []string, el string) []string

DeleteFromArray deletes value from an array of string

func DeleteFromInt64Array

func DeleteFromInt64Array(array []int64, el int64) []int64

DeleteFromArray deletes value from an array of int64

func DirectoryExists

func DirectoryExists(path string) (bool, error)

DirectoryExists checks if the directory exists

func DownloadFromGitHub

func DownloadFromGitHub(ctx context.Context, directory, filename string, version string) error

func DownloadURLFromGithub

func DownloadURLFromGithub(filename string, version string) (string, error)

func EnvVartoENV

func EnvVartoENV(p Parameter) []string

func ErrorIs

func ErrorIs(err error, target Error) bool

ErrorIs returns true if error match the target error.

func ErrorIsUnknown

func ErrorIsUnknown(err error) bool

ErrorIsUnknown returns true the error is unknown (sdk.ErrUnknownError or lib error).

func ErrorWithFallback

func ErrorWithFallback(err error, httpError Error, from string, args ...interface{}) error

ErrorWithFallback returns the current error if it's not a ErrUnknownError else it returns a new ErrorWithStack

func Errorf added in v0.52.0

func Errorf(format string, args ...interface{}) error

func Exit

func Exit(format string, args ...interface{})

Exit func display an error message on stderr and exit 1

func FileMd5sum

func FileMd5sum(filePath string) (string, error)

FileMd5sum returns the md5sum of a file

func FileSHA512sum

func FileSHA512sum(filePath string) (string, error)

FileSHA512sum returns the sha512sum of a file

func FormatDateRFC5322

func FormatDateRFC5322(date time.Time) string

FormatDateRFC5322 format an RFC 5322 date string.

func FromGitToHumanError added in v0.53.1

func FromGitToHumanError(targetError, err error) error

func GenerateHash

func GenerateHash() (string, error)

func GenerateHookSecret added in v0.52.0

func GenerateHookSecret() (string, error)

func GenerateProjectDefaultKeyName

func GenerateProjectDefaultKeyName(projectKey string, t KeyType) string

func GenerateRepositoryWebHookSecret added in v0.53.1

func GenerateRepositoryWebHookSecret(hookSecretKey, vcsName, repoName string) string

func GetActionJsonSchema added in v0.53.0

func GetActionJsonSchema(publicActionNames []string) *jsonschema.Schema

func GetContentType

func GetContentType(resp *http.Response) string

GetContentType returns the content-type header from a http.Response

func GetFuncName added in v0.52.0

func GetFuncName(i interface{}) string

func GetIntegrationVariablePrefix

func GetIntegrationVariablePrefix(model IntegrationModel) string

func GetJobJsonSchema added in v0.53.0

func GetJobJsonSchema(publicActionNames []string, regionNames []string, workerModels []string) *jsonschema.Schema

func GetJobStepName added in v0.53.0

func GetJobStepName(stepID string, stepIndex int) string

func GetManageRoleByEntity added in v0.53.0

func GetManageRoleByEntity(entityType string) (string, error)

func GetWorkerModelJsonSchema added in v0.52.0

func GetWorkerModelJsonSchema() *jsonschema.Schema

func GetWorkflowJsonSchema added in v0.53.0

func GetWorkflowJsonSchema(publicActionNames, regionNames, workerModelNames []string) *jsonschema.Schema

func GoroutineID

func GoroutineID() uint64

func GroupPointersToIDs

func GroupPointersToIDs(gs []*Group) []int64

GroupPointersToIDs returns ids of given groups.

func Hash512 added in v0.52.0

func Hash512(in string) string

func IPinRange

func IPinRange(ctx context.Context, IPrange string) ([]string, error)

IPinRange returns a slice of all IP in given IP range i.e 10.35.11.240/28

func IPinRanges

func IPinRanges(ctx context.Context, IPranges string) ([]string, error)

IPinRanges returns a slice of all IP in all given IP ranges i.e 72.44.1.240/28,72.42.1.23/27

func ImportGPGKey added in v0.52.0

func ImportGPGKey(dir string, keyName string, publicKey string) (string, []byte, error)

func InitSupportedOSArch

func InitSupportedOSArch(supportedOSArchConf []string) error

func IntMapToSlice

func IntMapToSlice(m map[int64]struct{}) []int64

IntMapToSlice converts a map struct to a slice for int64 keys

func InterfaceSlice

func InterfaceSlice(slice interface{}) []interface{}

InterfaceSlice cast a untyped slice into a slice of untypes things. It will panic if the parameter is not a slice

func IsDefaultHooks added in v0.53.1

func IsDefaultHooks(on *WorkflowOn) []string

func IsDownloadedBinary

func IsDownloadedBinary(directoriesDownload, filename string) bool

IsDownloadedBinary returns true if the binary is already downloaded, false otherwise

func IsErrorWithStack

func IsErrorWithStack(err error) bool

IsErrorWithStack returns true if given error is an errorWithStack.

func IsGz

func IsGz(buf []byte) bool

IsGz returns true if the content is gzipped

func IsInArray

func IsInArray(elt string, array []string) bool

IsInArray checks if the element is in the array

func IsInInt64Array

func IsInInt64Array(elt int64, array []int64) bool

IsInInt64Array checks if the element is in the array (int64)

func IsJobIDForRegister added in v0.53.0

func IsJobIDForRegister(jobID string) bool

func IsTar

func IsTar(buf []byte) bool

IsTar returns true if the content is a tar

func IsURL

func IsURL(path string) bool

IsURL returns if given path is a url according to the URL regex.

func IsValidEmail

func IsValidEmail(email string) bool

IsValidEmail Check if user email address is ok

func IsValidHookPath added in v0.53.1

func IsValidHookPath(ctx context.Context, configuredPaths []string, paths []string) bool

func IsValidHookRefs added in v0.53.1

func IsValidHookRefs(ctx context.Context, configuredRefs []string, currentEventRef string) bool

func IsValidPermissionValue

func IsValidPermissionValue(v int) bool

IsValidPermissionValue checks that given permission int value match an exiting level.

func IsValidUUID

func IsValidUUID(uu string) bool

func IsValidUsername

func IsValidUsername(username string) error

func JSONUnmarshal

func JSONUnmarshal(btes []byte, i interface{}) error

func JSONWithoutHTMLEncode

func JSONWithoutHTMLEncode(t interface{}) ([]byte, error)

JSONWithoutHTMLEncode return byte array of a struct into json without HTML encode

func ListGoroutines

func ListGoroutines() ([]*stack.Goroutine, error)

func LookPath

func LookPath(fs afero.Fs, file string) (string, error)

LookPath searches for an executable named file in the directories named by the PATH environment variable. If file contains a slash, it is tried directly and the PATH is not consulted. The result may be an absolute path or a path relative to the current directory.

func MapHasKeys added in v0.53.0

func MapHasKeys(i interface{}, expectedKeys ...interface{}) bool

func MessagesToError

func MessagesToError(messages []Message) error

MessagesToError returns a translated slices of messages as an error

func ModelsToGroupIDs

func ModelsToGroupIDs(ms []*Model) []int64

ModelsToGroupIDs returns group ids of given worker models.

func NeedPlaceholder

func NeedPlaceholder(t string) bool

NeedPlaceholder returns true if variable type is either secret or key

func NewArtifactoryClient

func NewArtifactoryClient(url string, token string) (artifactory.ArtifactoryServicesManager, error)

func NewError

func NewError(httpError Error, err error) error

NewError returns a merge of given err with new http error.

func NewErrorFrom

func NewErrorFrom(err error, from string, args ...interface{}) error

NewErrorFrom returns the given error with given from details.

func NewErrorWithStack

func NewErrorWithStack(root error, err error) error

NewErrorWithStack wraps given root error and override its http error with given error.

func NoPath added in v0.52.0

func NoPath(path string) string

func OneLineValue added in v0.52.0

func OneLineValue(v string) string

func ParameterAddOrSetValue

func ParameterAddOrSetValue(vars *[]Parameter, name string, parameterType string, value string)

ParameterAddOrSetValue add a new parameter or update a value

func ParameterValue

func ParameterValue(vars []Parameter, s string) string

ParameterValue return a parameter value given its name if it exists in array, else it returns empty string

func ParametersFromApplicationKeys

func ParametersFromApplicationKeys(app Application) map[string]string

ParametersFromApplicationVariables returns a map from application key

func ParametersFromApplicationVariables

func ParametersFromApplicationVariables(app Application) map[string]string

ParametersFromApplicationVariables returns a map from a slice of parameters

func ParametersFromEnvironmentKeys

func ParametersFromEnvironmentKeys(env Environment) map[string]string

ParametersFromEnvironmentKeys returns a map from environment key

func ParametersFromEnvironmentVariables

func ParametersFromEnvironmentVariables(env Environment) map[string]string

ParametersFromEnvironmentVariables returns a map from a slice of parameters

func ParametersFromIntegration

func ParametersFromIntegration(prefix string, ppf IntegrationConfig) map[string]string

ParametersFromIntegration returns a map of variables from a ProjectIntegration

func ParametersFromPipelineParameters

func ParametersFromPipelineParameters(pipParams []Parameter) map[string]string

ParametersFromPipelineParameters returns a map from a slice of parameters

func ParametersFromProjectVariables

func ParametersFromProjectVariables(proj Project) map[string]string

ParametersFromProjectVariables returns a map from a slice of parameters

func ParametersMapMerge

func ParametersMapMerge(params map[string]string, otherParams map[string]string, checkFuncs ...func(string) bool) map[string]string

ParametersMapMerge merges two maps of parameters

func ParametersToMap

func ParametersToMap(params []Parameter) map[string]string

ParametersToMap returns a map from a slice of parameters

func ParseDateRFC5322

func ParseDateRFC5322(date string) (time.Time, error)

ParseDateRFC5322 parses an RFC 5322 date string.

func PathIsAbs

func PathIsAbs(s string) bool

func ProjectsToIDs

func ProjectsToIDs(ps []Project) []int64

ProjectsToIDs returns ids of given projects.

func RandomString

func RandomString(strlen int) string

RandomString generate random string containing a-zA-Z0-9

func ReflectFieldByTag

func ReflectFieldByTag(i interface{}, tagKey, tagValues string) interface{}

ReflectFieldByTag returns a pointer to a value corresponding to a tag For instance:

		sdk.ReflectFieldByTag(&Configuration{}, "toml", "api.database.name")

		Search for a field tagged 'toml:api' that is a struct.
		is this value, there is a field tagged 'toml:database' that is a struct.
     finally in this value, there a field tagged 'toml:name'. We return a pointer to this field.

func RemoveNotPrintableChar

func RemoveNotPrintableChar(in string) string

func Round

func Round(d, r time.Duration) time.Duration

Round rounds a duration, see original source here: https://play.golang.org/p/WjfKwhhjL5 round("1h23m45.6789s", time.Second} will returns want: "1h23m46s"

func SHA512sum

func SHA512sum(s string) (string, error)

func StatusIsTerminated

func StatusIsTerminated(status string) bool

StatusIsTerminated returns if status is terminated (nothing related to building or waiting, ...)

func StatusValidate

func StatusValidate(status ...string) bool

StatusValidate returns if given strings are valid status.

func StringFirstN

func StringFirstN(s string, i int) string

func StringIsAscii

func StringIsAscii(s string) bool

func TimeSafe added in v0.53.1

func TimeSafe(t *time.Time) time.Time

func UUID

func UUID() string

UUID returns a UUID v4

func Untar

func Untar(fs afero.Fs, dst string, r io.Reader) error

Untar takes a destination path and a reader; a tar reader loops over the tarfile creating the file structure at 'dst' along the way, and writing any files

func UntarGz

func UntarGz(fs afero.Fs, dst string, r io.Reader) error

UntarGz takes a destination path and a reader; a tar.gz reader loops over the tarfile creating the file structure at 'dst' along the way, and writing any files

func VCSCommitStatusContextV1 added in v0.53.1

func VCSCommitStatusContextV1(projKey, workflowName string, evt EventRunWorkflowNode) string

VCSCommitStatusContextV1 return a node formated status Context for workflow V1

func VCSIsSameCommit added in v0.53.1

func VCSIsSameCommit(sha1, sha1b string) bool

func ValidAndNotEmpty

func ValidAndNotEmpty(v reflect.Value) bool

func ValueFromInterface

func ValueFromInterface(i interface{}) reflect.Value

func VersionString

func VersionString() string

VersionString returns a string contains all about current version

func WithData

func WithData(err error, data interface{}) error

WithData returns an error with data from given error.

func WithStack

func WithStack(err error) error

WithStack returns an error with stack from given error.

func WorkerModelValidate

func WorkerModelValidate(modelType string) bool

WorkerModelValidate returns if given strings are valid worker model type.

func WorkflowCheckConditions

func WorkflowCheckConditions(conditions []WorkflowNodeCondition, params []Parameter) (bool, error)

WorkflowCheckConditions checks conditions given a list of parameters

func WorkflowJobParents added in v0.53.1

func WorkflowJobParents(w V2Workflow, jobID string) []string

func WorkflowTemplateInstancesToIDs

func WorkflowTemplateInstancesToIDs(wtis []*WorkflowTemplateInstance) []int64

WorkflowTemplateInstancesToIDs returns ids of given workflow template instances.

func WorkflowTemplateInstancesToWorkflowIDs

func WorkflowTemplateInstancesToWorkflowIDs(wtis []*WorkflowTemplateInstance) []int64

WorkflowTemplateInstancesToWorkflowIDs returns workflow ids of given workflow template instances.

func WorkflowTemplateInstancesToWorkflowTemplateIDs

func WorkflowTemplateInstancesToWorkflowTemplateIDs(wtis []*WorkflowTemplateInstance) []int64

WorkflowTemplateInstancesToWorkflowTemplateIDs returns workflow template ids of given workflow template instances.

func WorkflowTemplatesToGroupIDs

func WorkflowTemplatesToGroupIDs(wts []*WorkflowTemplate) []int64

WorkflowTemplatesToGroupIDs returns group ids of given workflow templates.

func WorkflowTemplatesToIDs

func WorkflowTemplatesToIDs(wts []*WorkflowTemplate) []int64

WorkflowTemplatesToIDs returns ids of given workflow templates.

func WorkflowToIDs

func WorkflowToIDs(ws []*Workflow) []int64

WorkflowToIDs returns ids of given workflows.

func WrapError

func WrapError(err error, format string, args ...interface{}) error

WrapError returns an error with stack and message.

Types

type APIConfig

type APIConfig struct {
	DefaultRunRetentionPolicy    string `json:"default_run_retention_policy"`
	ProjectCreationDisabled      bool   `json:"project_creation_disabled"`
	ProjectInfoCreationDisabled  string `json:"project_info_creation_disabled,omitempty"`
	ProjectVCSManagementDisabled bool   `json:"project_vcs_management_disabled,omitempty"`
}

type Action

type Action struct {
	ID          int64  `json:"id" yaml:"-" db:"id"`
	GroupID     *int64 `json:"group_id,omitempty" yaml:"-" db:"group_id"`
	Name        string `json:"name" db:"name"`
	Type        string `json:"type" yaml:"-" db:"type"`
	Description string `json:"description" yaml:"desc,omitempty" db:"description"`
	Enabled     bool   `json:"enabled" yaml:"-" db:"enabled"`
	Deprecated  bool   `json:"deprecated" yaml:"-" db:"deprecated"`
	// aggregates from action_edge
	StepName       string `json:"step_name,omitempty" yaml:"step_name,omitempty" db:"-"`
	Optional       bool   `json:"optional" yaml:"-" db:"-"`
	AlwaysExecuted bool   `json:"always_executed" yaml:"-" db:"-"`
	// aggregates
	Requirements RequirementList `json:"requirements" db:"-"`
	Parameters   []Parameter     `json:"parameters" db:"-"`
	Actions      []Action        `json:"actions,omitempty" yaml:"actions,omitempty" db:"-"`
	Group        *Group          `json:"group,omitempty" db:"-"`
	FirstAudit   *AuditAction    `json:"first_audit,omitempty" db:"-"`
	LastAudit    *AuditAction    `json:"last_audit,omitempty" db:"-"`
	Editable     bool            `json:"editable,omitempty" db:"-"`
}

Action is the base element of CDS pipeline

func ActionsFilterNotTypes

func ActionsFilterNotTypes(as []*Action, ts ...string) []*Action

ActionsFilterNotTypes returns a list of actions filtered by types.

func NewAction

func NewAction(name string) *Action

NewAction instantiate a new Action

func (*Action) Add

func (a *Action) Add(child Action) *Action

Add takes an action that will be executed when current action is executed

func (*Action) FlattenRequirements

func (a *Action) FlattenRequirements() RequirementList

FlattenRequirements returns all requirements for an action and its children.

func (Action) IsValid

func (a Action) IsValid() error

IsValid returns error if the action is not valid.

func (Action) IsValidDefault

func (a Action) IsValidDefault() error

IsValidDefault returns default action validity.

func (*Action) Parameter

func (a *Action) Parameter(p Parameter) *Action

Parameter add given parameter to Action

func (*Action) Requirement

func (a *Action) Requirement(name string, t string, value string) *Action

Requirement add given requirement to Action

func (*Action) Scan

func (a *Action) Scan(src interface{}) error

Scan action.

func (Action) ToSummary

func (a Action) ToSummary() ActionSummary

ToSummary returns an ActionSummary from an Action

func (Action) ToUniqueChildrenIDs

func (a Action) ToUniqueChildrenIDs() []int64

ToUniqueChildrenIDs returns distinct children ids for given action.

func (Action) Value

func (a Action) Value() (driver.Value, error)

Value returns driver.Value from action.

type ActionContext added in v0.53.0

type ActionContext struct {
	Inputs map[string]interface{} `json:"inputs,omitempty"`
}

type ActionFunc added in v0.53.0

type ActionFunc func(ctx context.Context, a *ActionParser, inputs ...interface{}) (interface{}, error)

type ActionInput added in v0.53.0

type ActionInput struct {
	Description string `json:"description,omitempty" jsonschema_extras:"order=2"`
	Default     string `` /* 142-byte string literal not displayed */
}

type ActionOutput added in v0.53.0

type ActionOutput struct {
	Description string `json:"description,omitempty" jsonschema_extras:"order=2"`
	Value       string `json:"value" jsonschema_extras:"order=1"`
}

type ActionParser added in v0.53.0

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

func NewActionParser added in v0.53.0

func NewActionParser(contexts map[string]interface{}, funcs map[string]ActionFunc) *ActionParser

func (*ActionParser) Interpolate added in v0.53.0

func (a *ActionParser) Interpolate(ctx context.Context, input string) (interface{}, error)

func (*ActionParser) InterpolateToBool added in v0.53.1

func (a *ActionParser) InterpolateToBool(ctx context.Context, input string) (bool, error)

func (*ActionParser) InterpolateToString added in v0.53.1

func (a *ActionParser) InterpolateToString(ctx context.Context, input string) (string, error)

func (*ActionParser) Validate added in v0.53.0

func (a *ActionParser) Validate(ctx context.Context, input string) error

type ActionRuns added in v0.53.0

type ActionRuns struct {
	Steps []ActionStep `json:"steps" jsonschema_description:"List of sequential steps executed by the action"`
}

type ActionStep added in v0.53.0

type ActionStep struct {
	ID              string            `json:"id,omitempty" jsonschema_extras:"order=2" jsonschema_description:"Identifier of the step"`
	Uses            string            `` /* 162-byte string literal not displayed */
	Run             string            `` /* 133-byte string literal not displayed */
	With            map[string]string `` /* 137-byte string literal not displayed */
	If              string            `json:"if,omitempty" jsonschema_extras:"order=1,textarea=true" jsonschema_description:"Condition to execute/skip the step"`
	ContinueOnError bool              `` /* 133-byte string literal not displayed */
	Env             map[string]string `` /* 126-byte string literal not displayed */
}

type ActionStepUsesWith added in v0.53.0

type ActionStepUsesWith map[string]string

type ActionSummary

type ActionSummary struct {
	Name     string `json:"name"`
	StepName string `json:"step_name"`
}

ActionSummary is the light representation of an action for CDS event

type ActionUsages

type ActionUsages struct {
	Pipelines []UsagePipeline `json:"pipelines"`
	Actions   []UsageAction   `json:"actions"`
}

ActionUsages for action.

type AnalysisEvent added in v0.53.1

type AnalysisEvent struct {
	ProjectEventV2
	VCSName    string `json:"vcs_name"`
	Repository string `json:"repository"`
	Status     string `json:"status"`
	UserID     string `json:"user_id,omitempty"`
	Username   string `json:"username,omitempty"`
}

type AnalysisRequest added in v0.52.0

type AnalysisRequest struct {
	ProjectKey    string `json:"projectKey"`
	VcsName       string `json:"vcsName"`
	RepoName      string `json:"repoName"`
	Ref           string `json:"ref"`
	Commit        string `json:"commit"`
	HookEventUUID string `json:"hook_event_uuid"`
	UserID        string `json:"user_id"`
}

type AnalysisResponse added in v0.52.0

type AnalysisResponse struct {
	AnalysisID string `json:"analysis_id" cli:"analysis_id"`
	Status     string `json:"status" cli:"status"`
}

type Application

type Application struct {
	ID                   int64                        `json:"id" db:"id"`
	Name                 string                       `json:"name" db:"name" cli:"name,key"`
	Description          string                       `json:"description" db:"description"`
	Icon                 string                       `json:"icon" db:"icon"`
	ProjectID            int64                        `json:"-" db:"project_id"`
	ProjectKey           string                       `json:"project_key" db:"-" cli:"project_key"`
	Variables            []ApplicationVariable        `json:"variables,omitempty" db:"-"`
	Notifications        []UserNotification           `json:"notifications,omitempty" db:"-"`
	LastModified         time.Time                    `json:"last_modified" db:"last_modified" mapstructure:"-"`
	VCSServer            string                       `json:"vcs_server,omitempty" db:"vcs_server"`
	RepositoryFullname   string                       `json:"repository_fullname,omitempty" db:"repo_fullname" cli:"repository_fullname"`
	RepositoryStrategy   RepositoryStrategy           `json:"vcs_strategy,omitempty" db:"cipher_vcs_strategy" gorpmapping:"encrypted,ProjectID,Name"`
	Metadata             Metadata                     `json:"metadata" yaml:"metadata" db:"metadata"`
	Keys                 []ApplicationKey             `json:"keys" yaml:"keys" db:"-"`
	Usage                *Usage                       `json:"usage,omitempty" db:"-" cli:"-"`
	DeploymentStrategies map[string]IntegrationConfig `json:"deployment_strategies,omitempty" db:"-" cli:"-"`
	FromRepository       string                       `json:"from_repository,omitempty" db:"from_repository" cli:"-"`
	// aggregate
	WorkflowAscodeHolder *Workflow `json:"workflow_ascode_holder,omitempty" cli:"-" db:"-"`
}

Application represent an application in a project

func (Application) GetKey

func (app Application) GetKey(kname string) *ApplicationKey

GetKey return a key by name

func (Application) GetSSHKey

func (app Application) GetSSHKey(kname string) *ApplicationKey

GetSSHKey return a key by name

func (Application) IsValid

func (app Application) IsValid() error

IsValid returns error if the application is not valid.

func (Application) PGPKeys

func (app Application) PGPKeys() []ApplicationKey

PGPKeys returns the slice of pgp key for an application

func (Application) SSHKeys

func (app Application) SSHKeys() []ApplicationKey

SSHKeys returns the slice of ssh key for an application

type ApplicationKey

type ApplicationKey struct {
	ID            int64   `json:"id" db:"id" cli:"-"`
	Name          string  `json:"name" db:"name" cli:"name"`
	Public        string  `json:"public" db:"public" cli:"publickey"`
	Private       string  `json:"private" db:"private" cli:"-" gorpmapping:"encrypted,ID,Name"`
	KeyID         string  `json:"key_id" db:"key_id" cli:"-"`
	Type          KeyType `json:"type" db:"type" cli:"type"`
	ApplicationID int64   `json:"application_id" db:"application_id"`
}

ApplicationKey represent a key attach to an application

type ApplicationOverview

type ApplicationOverview struct {
	Graphs  []ApplicationOverviewGraph      `json:"graphs,omitempty"`
	GitURL  string                          `json:"git_url,omitempty"`
	History map[string][]WorkflowRunSummary `json:"history,omitempty"`
}

ApplicationOverview represents the overview of an application

type ApplicationOverviewGraph

type ApplicationOverviewGraph struct {
	Type  string            `json:"type"`
	Datas []json.RawMessage `json:"datas"`
}

ApplicationOverviewGraph represents data pushed by CDS for metrics

type ApplicationTemplate

type ApplicationTemplate struct {
	Value string `json:"value"`
}

ApplicationTemplate struct.

func (*ApplicationTemplate) IsValid

func (a *ApplicationTemplate) IsValid() error

IsValid returns application template validity.

type ApplicationTemplates

type ApplicationTemplates []ApplicationTemplate

ApplicationTemplates struct.

func (*ApplicationTemplates) Scan

func (a *ApplicationTemplates) Scan(src interface{}) error

Scan application templates.

func (ApplicationTemplates) Value

func (a ApplicationTemplates) Value() (driver.Value, error)

Value returns driver.Value from workflow template applications.

type ApplicationVariable

type ApplicationVariable struct {
	ID            int64  `json:"id,omitempty" cli:"-"`
	Name          string `json:"name" cli:"name,key"`
	Value         string `json:"value" cli:"value"`
	Type          string `json:"type" cli:"type"`
	ApplicationID int64  `json:"application_id" cli:"-"`
}

type ApplicationVariableAudit

type ApplicationVariableAudit struct {
	ID             int64                `json:"id" yaml:"-" db:"id"`
	ApplicationID  int64                `json:"application_id" yaml:"-" db:"application_id"`
	VariableID     int64                `json:"variable_id" yaml:"-" db:"variable_id"`
	Type           string               `json:"type" yaml:"-" db:"type"`
	VariableBefore *ApplicationVariable `json:"variable_before,omitempty" yaml:"-" db:"-"`
	VariableAfter  ApplicationVariable  `json:"variable_after,omitempty" yaml:"-" db:"-"`
	Versionned     time.Time            `json:"versionned" yaml:"-" db:"versionned"`
	Author         string               `json:"author" yaml:"-" db:"author"`
}

ApplicationVariableAudit represents an audit on an application variable

type ArsenalDeploymentDetailAlternative added in v0.53.1

type ArsenalDeploymentDetailAlternative struct {
	Name    string                 `json:"name" mapstructure:"name"`
	From    string                 `json:"from,omitempty" mapstructure:"from"`
	Config  map[string]interface{} `json:"config" mapstructure:"config"`
	Options map[string]interface{} `json:"options,omitempty" mapstructure:"options"`
}

type ArtifactResult added in v0.53.0

type ArtifactResult struct {
	Repo         string         `json:"repo"`
	Path         string         `json:"path"`
	Name         string         `json:"name"`
	Created      time.Time      `json:"created"`
	Properties   []ItemProperty `json:"properties,omitempty"`
	Size         int64          `json:"size,omitempty"`
	Stats        []ItemStat     `json:"stats,omitempty"`
	VirtualRepos []string       `json:"virtual_repos,omitempty"`
	ActualMD5    string         `json:"actual_md5"`
}

func (*ArtifactResult) String added in v0.53.0

func (i *ArtifactResult) String() string

type ArtifactResults added in v0.53.0

type ArtifactResults []ArtifactResult

type ArtifactResultsSearchPage added in v0.53.0

type ArtifactResultsSearchPage struct {
	Results []ArtifactResult `json:"results"`
	Range   struct {
		StartPos int `json:"start_pos"`
		EndPos   int `json:"end_pos"`
		Total    int `json:"total"`
	} `json:"range"`
}

type ArtifactsStore

type ArtifactsStore struct {
	Name                  string `json:"name"`
	TemporaryURLSupported bool   `json:"temporary_url_supported"`
}

ArtifactsStore represents

type AsCodeEvent

type AsCodeEvent struct {
	ID             int64           `json:"id" db:"id"`
	WorkflowID     int64           `json:"workflow_id" db:"workflow_id"`
	PullRequestID  int64           `json:"pullrequest_id" db:"pullrequest_id"`
	PullRequestURL string          `json:"pullrequest_url" db:"pullrequest_url"`
	Username       string          `json:"username" db:"username"`
	CreateDate     time.Time       `json:"creation_date" db:"creation_date"`
	FromRepo       string          `json:"from_repository" db:"from_repository"`
	Migrate        bool            `json:"migrate" db:"migrate"`
	Data           AsCodeEventData `json:"data" db:"data"`
}

type AsCodeEventData

type AsCodeEventData struct {
	Workflows    AsCodeEventDataValue `json:"workflows"`
	Pipelines    AsCodeEventDataValue `json:"pipelines"`
	Applications AsCodeEventDataValue `json:"applications"`
	Environments AsCodeEventDataValue `json:"environments"`
}

func (*AsCodeEventData) Scan

func (d *AsCodeEventData) Scan(src interface{}) error

Scan consumer data.

func (AsCodeEventData) Value

func (d AsCodeEventData) Value() (driver.Value, error)

Value returns driver.Value from consumer data.

type AsCodeEventDataValue

type AsCodeEventDataValue map[int64]string

type Audit

type Audit interface {
	Compute(ctx context.Context, db gorp.SqlExecutor, e Event) error
}

Audit represents audit interface.

type AuditAction

type AuditAction struct {
	AuditCommon
	ActionID   int64  `json:"action_id" db:"action_id"`
	DataType   string `json:"data_type" db:"data_type"`
	DataBefore string `json:"data_before" db:"data_before"`
	DataAfter  string `json:"data_after" db:"data_after"`
}

AuditAction represents an audit data on a action.

type AuditCommon

type AuditCommon struct {
	ID          int64     `json:"id" db:"id"`
	TriggeredBy string    `json:"triggered_by" db:"triggered_by"`
	Created     time.Time `json:"created" db:"created" mapstructure:"-"`
	EventType   string    `json:"event_type" db:"event_type"`
}

AuditCommon contains basic stuff for audits.

type AuditWorkflow

type AuditWorkflow struct {
	AuditCommon
	ProjectKey string `json:"project_key" db:"project_key"`
	WorkflowID int64  `json:"workflow_id" db:"workflow_id"`
	DataType   string `json:"data_type" db:"data_type"`
	DataBefore string `json:"data_before" db:"data_before"`
	DataAfter  string `json:"data_after" db:"data_after"`
}

AuditWorkflow represents an audit data on a workflow.

type AuditWorkflowTemplate

type AuditWorkflowTemplate struct {
	AuditCommon
	WorkflowTemplateID int64            `json:"workflow_template_id" db:"workflow_template_id"`
	ChangeMessage      string           `json:"change_message,omitempty" db:"change_message"`
	DataBefore         WorkflowTemplate `json:"data_before" db:"data_before"`
	DataAfter          WorkflowTemplate `json:"data_after" db:"data_after"`
}

AuditWorkflowTemplate represents an audit data on a workflow template.

type AuditWorkflowTemplateInstance

type AuditWorkflowTemplateInstance struct {
	AuditCommon
	WorkflowTemplateInstanceID int64  `json:"workflow_template_instance_id" db:"workflow_template_instance_id"`
	DataType                   string `json:"data_type" db:"data_type"`
	DataBefore                 string `json:"data_before" db:"data_before"`
	DataAfter                  string `json:"data_after" db:"data_after"`
}

AuditWorkflowTemplateInstance represents an audit data on a workflow template instance.

type AuthConsumer

type AuthConsumer struct {
	ID                 string                      `json:"id" cli:"id,key" db:"id"`
	Name               string                      `json:"name" cli:"name" db:"name"`
	Type               AuthConsumerType            `json:"type" cli:"type" db:"type"`
	Description        string                      `json:"description" cli:"description" db:"description"`
	ParentID           *string                     `json:"parent_id,omitempty" db:"parent_id"`
	Created            time.Time                   `json:"created" cli:"created" db:"created"`
	DeprecatedIssuedAt time.Time                   `json:"issued_at" cli:"issued_at" db:"issued_at"`
	Disabled           bool                        `json:"disabled" cli:"disabled" db:"disabled"`
	Warnings           AuthConsumerWarnings        `json:"warnings,omitempty" db:"warnings"`
	LastAuthentication *time.Time                  `json:"last_authentication,omitempty" db:"last_authentication"`
	ValidityPeriods    AuthConsumerValidityPeriods `json:"validity_periods,omitempty" db:"validity_periods"`
}

type AuthConsumerCreateResponse

type AuthConsumerCreateResponse struct {
	Token    string            `json:"token"` // sign in token
	Consumer *AuthUserConsumer `json:"consumer"`
}

AuthConsumerCreateResponse response for a auth consumer creation.

type AuthConsumerData

type AuthConsumerData map[string]string

AuthConsumerData contains specific information from the auth driver.

func (*AuthConsumerData) Scan

func (d *AuthConsumerData) Scan(src interface{}) error

Scan consumer data.

func (AuthConsumerData) Value

func (d AuthConsumerData) Value() (driver.Value, error)

Value returns driver.Value from consumer data.

type AuthConsumerHatcheryData added in v0.53.0

type AuthConsumerHatcheryData struct {
	ID             string `json:"id" cli:"id,key" db:"id"`
	AuthConsumerID string `json:"auth_consumer_id" cli:"auth_consumer_id,key" db:"auth_consumer_id"`
	HatcheryID     string `json:"hatchery_id" cli:"hatchery_id" db:"hatchery_id"`
}

type AuthConsumerHatcherySigninRequest added in v0.53.0

type AuthConsumerHatcherySigninRequest struct {
	Token        string        `json:"token"`
	Name         string        `json:"name"`
	HatcheryType string        `json:"type"`
	HTTPURL      string        `json:"http_url"`
	Config       ServiceConfig `json:"config" db:"config" cli:"-" mapstructure:"config"`
	PublicKey    []byte        `json:"public_key"`
	Version      string        `json:"version"`
}

type AuthConsumerHatcherySigninResponse added in v0.53.0

type AuthConsumerHatcherySigninResponse struct {
	Uptodate bool     `json:"up_to_date"`
	APIURL   string   `json:"api_url"`
	Token    string   `json:"token"`
	Hatchery Hatchery `json:"hatchery"`
	Region   string   `json:"region"`
}

type AuthConsumerRegenRequest

type AuthConsumerRegenRequest struct {
	RevokeSessions  bool   `json:"revoke_sessions"`
	OverlapDuration string `json:"overlap_duration"`
	NewDuration     int64  `json:"new_duration"`
}

AuthConsumerRegenRequest struct.

type AuthConsumerScope

type AuthConsumerScope string

AuthConsumerScope alias type for string.

const (
	AuthConsumerScopeUser         AuthConsumerScope = "User"
	AuthConsumerScopeAccessToken  AuthConsumerScope = "AccessToken"
	AuthConsumerScopeAction       AuthConsumerScope = "Action"
	AuthConsumerScopeAdmin        AuthConsumerScope = "Admin"
	AuthConsumerScopeGroup        AuthConsumerScope = "Group"
	AuthConsumerScopeTemplate     AuthConsumerScope = "Template"
	AuthConsumerScopeProject      AuthConsumerScope = "Project"
	AuthConsumerScopeRun          AuthConsumerScope = "Run"
	AuthConsumerScopeRunExecution AuthConsumerScope = "RunExecution"
	AuthConsumerScopeHooks        AuthConsumerScope = "Hooks"
	AuthConsumerScopeWorkerModel  AuthConsumerScope = "WorkerModel"
	AuthConsumerScopeHatchery     AuthConsumerScope = "Hatchery"
	AuthConsumerScopeService      AuthConsumerScope = "Service"
)

Available auth consumer scopes.

func (AuthConsumerScope) IsValid

func (s AuthConsumerScope) IsValid() bool

IsValid returns validity for scope.

type AuthConsumerScopeDetail

type AuthConsumerScopeDetail struct {
	Scope     AuthConsumerScope          `json:"scope"`
	Endpoints AuthConsumerScopeEndpoints `json:"endpoints,omitempty"`
}

AuthConsumerScopeDetail contains all endpoints for a scope.

type AuthConsumerScopeDetails

type AuthConsumerScopeDetails []AuthConsumerScopeDetail

AuthConsumerScopeDetails type used for database json storage.

func NewAuthConsumerScopeDetails

func NewAuthConsumerScopeDetails(scopes ...AuthConsumerScope) AuthConsumerScopeDetails

func (AuthConsumerScopeDetails) IsValid

func (s AuthConsumerScopeDetails) IsValid() error

IsValid returns an error if current details are invalids.

func (*AuthConsumerScopeDetails) Scan

func (s *AuthConsumerScopeDetails) Scan(src interface{}) error

Scan scope detail slice.

func (AuthConsumerScopeDetails) ToEndpointsMap

func (AuthConsumerScopeDetails) Value

Value returns driver.Value from scope detail slice.

type AuthConsumerScopeEndpoint

type AuthConsumerScopeEndpoint struct {
	Route   string      `json:"route"`
	Methods StringSlice `json:"methods,omitempty"`
}

type AuthConsumerScopeEndpoints

type AuthConsumerScopeEndpoints []AuthConsumerScopeEndpoint

func (AuthConsumerScopeEndpoints) FindEndpoint

type AuthConsumerScopeSlice

type AuthConsumerScopeSlice []AuthConsumerScope

AuthConsumerScopeSlice type used for database json storage.

func (*AuthConsumerScopeSlice) Scan

func (s *AuthConsumerScopeSlice) Scan(src interface{}) error

Scan scope slice.

func (AuthConsumerScopeSlice) Value

Value returns driver.Value from scope slice.

type AuthConsumerSigninRequest

type AuthConsumerSigninRequest map[string]interface{}

AuthConsumerSigninRequest struct for auth consumer signin request.

func (AuthConsumerSigninRequest) String added in v0.52.0

func (req AuthConsumerSigninRequest) String(s string) string

func (AuthConsumerSigninRequest) StringE added in v0.52.0

func (req AuthConsumerSigninRequest) StringE(s string) (string, error)

type AuthConsumerSigninResponse

type AuthConsumerSigninResponse struct {
	APIURL  string            `json:"api_url,omitempty"`
	Token   string            `json:"token"` // session token
	User    *AuthentifiedUser `json:"user"`
	Service *Service          `json:"service,omitempty"`
}

AuthConsumerSigninResponse response for a auth consumer signin.

type AuthConsumerType

type AuthConsumerType string

AuthConsumerType constant to identify what is the driver used to create a consumer.

const (
	ConsumerBuiltin      AuthConsumerType = "builtin"
	ConsumerLocal        AuthConsumerType = "local"
	ConsumerLDAP         AuthConsumerType = "ldap"
	ConsumerCorporateSSO AuthConsumerType = "corporate-sso"
	ConsumerGithub       AuthConsumerType = "github"
	ConsumerGitlab       AuthConsumerType = "gitlab"
	ConsumerOIDC         AuthConsumerType = "openid-connect"
	ConsumerHatchery     AuthConsumerType = "hatchery"
	ConsumerTest         AuthConsumerType = "futurama"
	ConsumerTest2        AuthConsumerType = "planet-express"
)

Consumer types.

func (AuthConsumerType) IsValid

func (t AuthConsumerType) IsValid() bool

IsValid returns validity of given auth consumer type.

func (AuthConsumerType) IsValidExternal

func (t AuthConsumerType) IsValidExternal() bool

IsValidExternal returns validity of given auth consumer type.

type AuthConsumerValidityPeriod

type AuthConsumerValidityPeriod struct {
	IssuedAt time.Time     `json:"issued_at" cli:"issued_at" `
	Duration time.Duration `json:"duration" cli:"duration"`
}

type AuthConsumerValidityPeriods

type AuthConsumerValidityPeriods []AuthConsumerValidityPeriod

func NewAuthConsumerValidityPeriod

func NewAuthConsumerValidityPeriod(iat time.Time, duration time.Duration) AuthConsumerValidityPeriods

func (AuthConsumerValidityPeriods) Latest

func (*AuthConsumerValidityPeriods) Scan

func (p *AuthConsumerValidityPeriods) Scan(src interface{}) error

func (*AuthConsumerValidityPeriods) Sort

func (p *AuthConsumerValidityPeriods) Sort()

func (AuthConsumerValidityPeriods) Value

type AuthConsumerWarning

type AuthConsumerWarning struct {
	Type      AuthConsumerWarningType `json:"type"`
	GroupID   int64                   `json:"group_id,omitempty"`
	GroupName string                  `json:"group_name,omitempty"`
}

AuthConsumerWarning contains info about a warning.

func NewConsumerWarningGroupInvalid

func NewConsumerWarningGroupInvalid(groupID int64, groupName string) AuthConsumerWarning

NewConsumerWarningGroupInvalid returns a new warning for given group info.

func NewConsumerWarningGroupRemoved

func NewConsumerWarningGroupRemoved(groupID int64, groupName string) AuthConsumerWarning

NewConsumerWarningGroupRemoved returns a new warning for given group info.

func NewConsumerWarningLastGroupRemoved

func NewConsumerWarningLastGroupRemoved() AuthConsumerWarning

NewConsumerWarningLastGroupRemoved returns a new warning.

type AuthConsumerWarningType

type AuthConsumerWarningType string

AuthConsumerWarningType constant for consumer warnings.

const (
	WarningGroupInvalid     AuthConsumerWarningType = "group-invalid"
	WarningGroupRemoved     AuthConsumerWarningType = "group-removed"
	WarningLastGroupRemoved AuthConsumerWarningType = "last-group-removed"
)

Consumer warning types.

type AuthConsumerWarnings

type AuthConsumerWarnings []AuthConsumerWarning

AuthConsumerWarnings contains specific information from the auth driver.

func (*AuthConsumerWarnings) Scan

func (w *AuthConsumerWarnings) Scan(src interface{}) error

Scan consumer data.

func (AuthConsumerWarnings) Value

func (w AuthConsumerWarnings) Value() (driver.Value, error)

Value returns driver.Value from consumer warnings.

type AuthCurrentConsumerResponse

type AuthCurrentConsumerResponse struct {
	User           AuthentifiedUser   `json:"user"`
	Consumer       AuthUserConsumer   `json:"consumer"`
	Session        AuthSession        `json:"session"`
	DriverManifest AuthDriverManifest `json:"driver_manifest"`
}

AuthCurrentConsumerResponse describe the current consumer and the current session

type AuthDriver

type AuthDriver interface {
	GetManifest() AuthDriverManifest
	GetSessionDuration() time.Duration
	GetUserInfo(context.Context, AuthConsumerSigninRequest) (AuthDriverUserInfo, error)
	GetDriver() Driver
}

AuthDriver interface.

type AuthDriverManifest

type AuthDriverManifest struct {
	Type           AuthConsumerType `json:"type"`
	SignupDisabled bool             `json:"signup_disabled"`
	SupportMFA     bool             `json:"support_mfa"`
}

AuthDriverManifest struct describe a auth driver.

type AuthDriverManifests

type AuthDriverManifests []AuthDriverManifest

AuthDriverManifests gives functions on driver manifest slice.

func (AuthDriverManifests) ExistsConsumerType

func (a AuthDriverManifests) ExistsConsumerType(consumerType AuthConsumerType) bool

ExistsConsumerType returns if a driver exists for given consumer type.

func (AuthDriverManifests) FindByConsumerType

func (a AuthDriverManifests) FindByConsumerType(consumerType AuthConsumerType) (AuthDriverManifest, bool)

FindByConsumerType returns a manifest for given consumer type if exists.

type AuthDriverResponse

type AuthDriverResponse struct {
	IsFirstConnection bool                `json:"is_first_connection"`
	Drivers           AuthDriverManifests `json:"manifests"`
}

AuthDriverResponse struct contains drivers manifest and some info about auth config.

type AuthDriverSigningRedirect

type AuthDriverSigningRedirect struct {
	Method      string            `json:"method"`
	URL         string            `json:"url"`
	Body        map[string]string `json:"body"`
	ContentType string            `json:"content_type"`
}

type AuthDriverUserInfo

type AuthDriverUserInfo struct {
	ExternalID      string
	Username        string
	Fullname        string
	Email           string
	MFA             bool
	ExternalTokenID string
	Organization    string
}

AuthDriverUserInfo struct discribed a user returns by a auth driver.

type AuthHatcheryConsumer added in v0.53.0

type AuthHatcheryConsumer struct {
	AuthConsumer
	AuthConsumerHatchery AuthConsumerHatcheryData `json:"auth_consumer_hatchery,omitempty" db:"-"`
}

AuthHatcheryConsumer issues session linked to an authentified user.

type AuthSession

type AuthSession struct {
	ID         string    `json:"id" cli:"id,key" db:"id"`
	ConsumerID string    `json:"consumer_id" cli:"consumer_id" db:"consumer_id"`
	ExpireAt   time.Time `json:"expire_at,omitempty" cli:"expire_at" db:"expire_at"`
	Created    time.Time `json:"created" cli:"created" db:"created"`
	MFA        bool      `json:"mfa" cli:"mfa" db:"mfa"`
	// aggregates
	Consumer     *AuthUserConsumer `json:"consumer,omitempty" db:"-"`
	Groups       []Group           `json:"groups,omitempty" db:"-"`
	Current      bool              `json:"current,omitempty" cli:"current" db:"-"`
	LastActivity *time.Time        `json:"last_activity,omitempty" cli:"last_activity,omitempty" db:"-"`
}

AuthSession struct.

type AuthSessionJWTClaims

type AuthSessionJWTClaims struct {
	ID      string
	TokenID string
	jwt.StandardClaims
}

AuthSessionJWTClaims is the specific claims format for JWT session.

type AuthSessions

type AuthSessions []AuthSession

AuthSessions gives functions for auth session slice.

type AuthSigninConsumerToken

type AuthSigninConsumerToken struct {
	IssuedAt          int64  `json:"issued_at"`
	Origin            string `json:"origin,omitempty"`
	RedirectURI       string `json:"redirect_uri,omitempty"`
	RequireMFA        bool   `json:"require_mfa,omitempty"`
	IsFirstConnection bool   `json:"is_first_connection,omitempty"`
	LinkUser          bool   `json:"link_user,omitempty"`
}

AuthSigninConsumerToken discribes the payload for a signin state token.

type AuthUserConsumer added in v0.53.0

type AuthUserConsumer struct {
	AuthConsumer
	AuthConsumerUser AuthUserConsumerData `json:"auth_consumer_user,omitempty" db:"-"`
}

AuthUserConsumer issues session linked to an authentified user.

func (AuthUserConsumer) Admin added in v0.53.0

func (c AuthUserConsumer) Admin() bool

func (AuthUserConsumer) GetEmail added in v0.53.0

func (c AuthUserConsumer) GetEmail() string

func (AuthUserConsumer) GetFullname added in v0.53.0

func (c AuthUserConsumer) GetFullname() string

func (AuthUserConsumer) GetGroupIDs added in v0.53.0

func (c AuthUserConsumer) GetGroupIDs() []int64

GetGroupIDs returns group ids for auth consumer, if empty in consumer returns group ids from authentified user.

func (AuthUserConsumer) GetUsername added in v0.53.0

func (c AuthUserConsumer) GetUsername() string

func (AuthUserConsumer) IsValid added in v0.53.0

func (c AuthUserConsumer) IsValid(scopeDetails AuthConsumerScopeDetails) error

IsValid returns validity for auth consumer.

func (AuthUserConsumer) Maintainer added in v0.53.0

func (c AuthUserConsumer) Maintainer() bool

type AuthUserConsumerData added in v0.53.0

type AuthUserConsumerData struct {
	ID                           string                   `json:"id" cli:"id,key" db:"id"`
	AuthConsumerID               string                   `json:"auth_consumer_id" cli:"auth_consumer_id,key" db:"auth_consumer_id"`
	AuthentifiedUserID           string                   `json:"user_id,omitempty" db:"user_id"`
	Data                         AuthConsumerData         `json:"-" db:"data"` // NEVER returns auth consumer data in json, TODO this fields should be visible only in auth package
	GroupIDs                     Int64Slice               `json:"group_ids,omitempty" cli:"group_ids" db:"group_ids"`
	InvalidGroupIDs              Int64Slice               `json:"invalid_group_ids,omitempty" db:"invalid_group_ids"`
	ScopeDetails                 AuthConsumerScopeDetails `json:"scope_details,omitempty" cli:"scope_details" db:"scope_details"`
	ServiceName                  *string                  `json:"service_name,omitempty" db:"service_name"`
	ServiceType                  *string                  `json:"service_type,omitempty" db:"service_type"`
	ServiceRegion                *string                  `json:"service_region,omitempty" db:"service_region"`
	ServiceIgnoreJobWithNoRegion *bool                    `json:"service_ignore_job_with_no_region,omitempty" db:"service_ignore_job_with_no_region"`
	// aggregates
	AuthentifiedUser *AuthentifiedUser `json:"user,omitempty" db:"-"`
	Groups           Groups            `json:"groups,omitempty" db:"-"`
	// aggregates by router auth middleware
	Service *Service `json:"-" db:"-"`
	Worker  *Worker  `json:"-" db:"-"`
}

AuthUserConsumerData issues session linked to an authentified user.

type AuthUserConsumers added in v0.53.0

type AuthUserConsumers []AuthUserConsumer

AuthUserConsumers gives functions for auth consumer slice.

type AuthentifiedUser

type AuthentifiedUser struct {
	ID       string    `json:"id" yaml:"id" cli:"id" db:"id"`
	Created  time.Time `json:"created" yaml:"created" cli:"created" db:"created"`
	Username string    `json:"username" yaml:"username" cli:"username,key" db:"username"`
	Fullname string    `json:"fullname" yaml:"fullname,omitempty" cli:"fullname" db:"fullname"`
	Ring     string    `json:"ring" yaml:"ring,omitempty" cli:"ring" db:"ring"`
	// aggregates
	Contacts     UserContacts `json:"-" yaml:"-" db:"-"`
	Favorites    []Favorite   `json:"favorites" yaml:"favorites" db:"-"`
	Groups       Groups       `json:"groups" yaml:"groups" db:"-"`
	Organization string       `json:"organization,omitempty" yaml:"organization,omitempty" cli:"organization" db:"-"`
}

AuthentifiedUser struct contains all information about a cds user.

func (AuthentifiedUser) GetEmail

func (u AuthentifiedUser) GetEmail() string

GetEmail return the primary email for the authentified user (should exists).

func (AuthentifiedUser) GetFullname

func (u AuthentifiedUser) GetFullname() string

func (AuthentifiedUser) GetGroupIDs

func (u AuthentifiedUser) GetGroupIDs() []int64

GetGroupIDs returns groups ids for user

func (AuthentifiedUser) GetUsername

func (u AuthentifiedUser) GetUsername() string

func (AuthentifiedUser) IsValid

func (u AuthentifiedUser) IsValid() error

IsValid returns an error if given user's infos are not valid.

func (*AuthentifiedUser) Scan

func (u *AuthentifiedUser) Scan(src interface{}) error

Scan workflow template request.

func (AuthentifiedUser) Value

func (u AuthentifiedUser) Value() (driver.Value, error)

Value returns driver.Value from workflow template request.

type AuthentifiedUsers

type AuthentifiedUsers []AuthentifiedUser

AuthentifiedUsers provides func for authentified user list.

func (AuthentifiedUsers) IDs

func (a AuthentifiedUsers) IDs() []string

func (AuthentifiedUsers) ToMapByID

func (a AuthentifiedUsers) ToMapByID() map[string]AuthentifiedUser

ToMapByID returns a map of authentified users indexed by ids.

type Author

type Author struct {
	Username string `json:"username" cli:"-"`
	Fullname string `json:"fullname" cli:"-"`
	Email    string `json:"email" cli:"-"`
}

Author struct contains info about model author.

func (*Author) Scan

func (a *Author) Scan(src interface{}) error

Scan author.

func (Author) Value

func (a Author) Value() (driver.Value, error)

Value returns driver.Value from author.

type BitbucketServerActor

type BitbucketServerActor struct {
	Name         string `json:"name"`
	EmailAddress string `json:"emailAddress"`
	ID           int    `json:"id"`
	DisplayName  string `json:"displayName"`
	Active       bool   `json:"active"`
	Slug         string `json:"slug"`
	Type         string `json:"type"`
}

type BitbucketServerAuthor

type BitbucketServerAuthor struct {
	User     BitbucketServerActor `json:"user"`
	Role     string               `json:"role"`
	Approved bool                 `json:"approved"`
	Status   string               `json:"status"`
}

type BitbucketServerChange

type BitbucketServerChange struct {
	Ref      BitbucketServerRef `json:"ref"`
	RefID    string             `json:"refId"`
	FromHash string             `json:"fromHash"`
	ToHash   string             `json:"toHash"`
	Type     string             `json:"type"`
}

type BitbucketServerComment

type BitbucketServerComment struct {
	Properties  BitbucketServerProperties `json:"properties"`
	ID          int64                     `json:"id"`
	Version     int64                     `json:"version"`
	Text        string                    `json:"text"`
	Author      BitbucketServerActor      `json:"author"`
	CreatedDate int64                     `json:"createdDate"`
	UpdatedDate int64                     `json:"updatedDate"`
	Comments    []string                  `json:"comments"`
	Tasks       []string                  `json:"tasks"`
}

type BitbucketServerParticipant

type BitbucketServerParticipant struct {
	User               BitbucketServerActor `json:"user"`
	LastReviewedCommit string               `json:"lastReviewedCommit"`
	Role               string               `json:"role"`
	Approved           bool                 `json:"approved"`
	Status             string               `json:"status"`
}

type BitbucketServerPreviousTarget

type BitbucketServerPreviousTarget struct {
	ID              string `json:"id"`
	DisplayID       string `json:"displayId"`
	Type            string `json:"type"`
	LatestCommit    string `json:"latestCommit"`
	LatestChangeset string `json:"latestChangeset"`
}

type BitbucketServerProject

type BitbucketServerProject struct {
	Key    string `json:"key"`
	ID     int64  `json:"id"`
	Name   string `json:"name"`
	Public bool   `json:"public"`
	Type   string `json:"type"`
}

type BitbucketServerProperties

type BitbucketServerProperties struct {
	RepositoryID int64 `json:"repositoryId"`
}

type BitbucketServerPullRequest

type BitbucketServerPullRequest struct {
	ID          int                    `json:"id"`
	Version     int                    `json:"version"`
	Title       string                 `json:"title"`
	Description string                 `json:"description"`
	State       string                 `json:"state"`
	Open        bool                   `json:"open"`
	Closed      bool                   `json:"closed"`
	CreatedDate int                    `json:"createdDate"`
	UpdatedDate int                    `json:"updatedDate"`
	FromRef     BitbucketServerRef     `json:"fromRef"`
	ToRef       BitbucketServerRef     `json:"toRef"`
	Locked      bool                   `json:"locked"`
	Author      *BitbucketServerAuthor `json:"author,omitempty"`
	Reviewers   []struct {
		User               BitbucketServerActor `json:"user"`
		LastReviewedCommit string               `json:"lastReviewedCommit"`
		Role               string               `json:"role"`
		Approved           bool                 `json:"approved"`
		Status             string               `json:"status"`
	} `json:"reviewers,omitempty"`
	Participants []BitbucketServerParticipant `json:"participants,omitempty"`
	Properties   PullRequestProperties        `json:"properties,omitempty"`
	Links        struct {
		Self []struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"links"`
}

type BitbucketServerRef

type BitbucketServerRef struct {
	ID           string                    `json:"id"`
	DisplayID    string                    `json:"displayId"`
	LatestCommit string                    `json:"latestCommit"`
	Repository   BitbucketServerRepository `json:"repository"`
	Type         string                    `json:"type"`
}

type BitbucketServerRepository

type BitbucketServerRepository struct {
	ID            int64                  `json:"id"`
	Slug          string                 `json:"slug"`
	Name          interface{}            `json:"name"`
	ScmID         string                 `json:"scmId"`
	State         string                 `json:"state"`
	StatusMessage string                 `json:"statusMessage"`
	Forkable      bool                   `json:"forkable"`
	Project       BitbucketServerProject `json:"project"`
	Public        bool                   `json:"public"`
}

type BitbucketServerWebhookEvent

type BitbucketServerWebhookEvent struct {
	EventKey string                `json:"eventKey"`
	Date     string                `json:"date"`
	Actor    *BitbucketServerActor `json:"actor"`

	// PR event data
	PullRequest         *BitbucketServerPullRequest    `json:"pullRequest"`
	PreviousTitle       string                         `json:"previousTitle"`
	PreviousDescription interface{}                    `json:"previousDescription"`
	PreviousTarget      *BitbucketServerPreviousTarget `json:"previousTarget"`

	// Review event data
	Participant    *BitbucketServerParticipant `json:"participant"`
	PreviousStatus string                      `json:"previousStatus"`

	// Reviewer edited data
	AddedReviewers   []BitbucketServerActor `json:"addedReviewers"`
	RemovedReviewers []BitbucketServerActor `json:"removedReviewers"`

	// PR Comment event data
	Comment         *BitbucketServerComment `json:"comment"`
	PreviousComment string                  `json:"previousComment"`

	// PushEvent data
	Repository *BitbucketServerRepository `json:"repository"`
	Changes    []BitbucketServerChange    `json:"changes"`
}

type Blur added in v0.52.0

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

func NewBlur added in v0.52.0

func NewBlur(secrets []string) (*Blur, error)

func (*Blur) Interface added in v0.52.0

func (b *Blur) Interface(i interface{}) error

func (*Blur) String added in v0.52.0

func (b *Blur) String(s string) string

type BookedBy

type BookedBy struct {
	Name string `json:"name,omitempty"`
	ID   int64  `json:"id,omitempty"`
}

type Bookmark

type Bookmark struct {
	Icon        string `json:"icon" db:"icon"`
	Description string `json:"description" db:"description"`
	NavbarProjectData
}

Bookmark represents the type for a bookmark with his icon and description

type BuildNumberAndHash

type BuildNumberAndHash struct {
	BuildNumber int64
	Hash        string
	Branch      string
	Tag         string
	Remote      string
	RemoteURL   string
}

BuildNumberAndHash represents BuildNumber, Commit Hash and Branch for a Pipeline Build or Node Run

type CDNApiRef

type CDNApiRef interface {
	ToHash() (string, error)
	ToFilename() string
}

func NewCDNApiRef

func NewCDNApiRef(t CDNItemType, signature cdn.Signature) (CDNApiRef, error)

func NewCDNLogApiRef

func NewCDNLogApiRef(signature cdn.Signature) CDNApiRef

func NewCDNLogApiRefV2 added in v0.53.0

func NewCDNLogApiRefV2(signature cdn.Signature) CDNApiRef

func NewCDNRunResultApiRef

func NewCDNRunResultApiRef(signature cdn.Signature) CDNApiRef

func NewCDNRunResultApiRefV2 added in v0.53.1

func NewCDNRunResultApiRefV2(signature cdn.Signature) CDNApiRef

func NewCDNWorkerCacheApiRef

func NewCDNWorkerCacheApiRef(signature cdn.Signature) CDNApiRef

type CDNConfig

type CDNConfig struct {
	TCPURL          string `json:"tcp_url"`
	TCPURLEnableTLS bool   `json:"tcp_url_enable_tls"`
	HTTPURL         string `json:"http_url"`
}

type CDNDuplicateItemRequest added in v0.53.1

type CDNDuplicateItemRequest struct {
	FromJob string `json:"from_job"`
	ToJob   string `json:"to_job"`
}

type CDNItem

type CDNItem struct {
	ID           string          `json:"id" db:"id"`
	Created      time.Time       `json:"created" db:"created"`
	LastModified time.Time       `json:"last_modified" db:"last_modified"`
	Hash         string          `json:"hash" db:"cipher_hash" gorpmapping:"encrypted,ID,APIRefHash,Type"`
	APIRefRaw    json.RawMessage `json:"api_ref" db:"-"`
	APIRef       CDNApiRef       `json:"-" db:"-"`
	APIRefHash   string          `json:"api_ref_hash" db:"api_ref_hash"`
	Status       string          `json:"status" db:"status"`
	Type         CDNItemType     `json:"type" db:"type"`
	Size         int64           `json:"size" db:"size"`
	MD5          string          `json:"md5" db:"md5"`
	ToDelete     bool            `json:"to_delete" db:"to_delete"`
}

func (CDNItem) GetCDNLogApiRef

func (c CDNItem) GetCDNLogApiRef() (*CDNLogAPIRef, bool)

func (CDNItem) GetCDNLogApiRefV2 added in v0.53.0

func (c CDNItem) GetCDNLogApiRefV2() (*CDNLogAPIRefV2, bool)

func (CDNItem) GetCDNRunResultApiRef

func (c CDNItem) GetCDNRunResultApiRef() (*CDNRunResultAPIRef, bool)

func (CDNItem) GetCDNRunResultApiRefV2 added in v0.53.1

func (c CDNItem) GetCDNRunResultApiRefV2() (*CDNRunResultAPIRefV2, bool)

func (CDNItem) GetCDNWorkerCacheApiRef

func (c CDNItem) GetCDNWorkerCacheApiRef() (*CDNWorkerCacheAPIRef, bool)

func (CDNItem) MarshalJSON

func (c CDNItem) MarshalJSON() ([]byte, error)

func (*CDNItem) UnmarshalJSON

func (c *CDNItem) UnmarshalJSON(data []byte) error
type CDNItemLink struct {
	CDNHttpURL string  `json:"cdn_http_url"`
	Item       CDNItem `json:"item"`
}
type CDNItemLinks struct {
	CDNHttpURL string    `json:"cdn_http_url"`
	Items      []CDNItem `json:"items"`
}

type CDNItemResume

type CDNItemResume struct {
	CDNItem  CDNItem                `json:"item"` // Here we can't use nested struct because of the custom CDNItem marshaller
	Location map[string]CDNItemUnit `json:"item_units"`
}

type CDNItemType

type CDNItemType string
const (
	CDNTypeItemStepLog      CDNItemType = "step-log"
	CDNTypeItemJobStepLog   CDNItemType = "job-step-log" // v2
	CDNTypeItemServiceLog   CDNItemType = "service-log"
	CDNTypeItemServiceLogV2 CDNItemType = "service-log-v2"
	CDNTypeItemRunResult    CDNItemType = "run-result"
	CDNTypeItemRunResultV2  CDNItemType = "run-result-v2"
	CDNTypeItemWorkerCache  CDNItemType = "worker-cache"
	CDNStatusItemIncoming               = "Incoming"
	CDNStatusItemCompleted              = "Completed"
)

func (CDNItemType) IsLog

func (t CDNItemType) IsLog() bool

func (CDNItemType) Validate

func (t CDNItemType) Validate() error

type CDNItemUnit

type CDNItemUnit struct {
	ID           string      `json:"id" db:"id"`
	Type         CDNItemType `json:"type" db:"type"`
	ItemID       string      `json:"item_id" db:"item_id"`
	UnitID       string      `json:"unit_id" db:"unit_id"`
	LastModified time.Time   `json:"last_modified" db:"last_modified"`
	Locator      string      `json:"locator" db:"cipher_locator" gorpmapping:"encrypted,UnitID,ItemID"`
	HashLocator  string      `json:"hash_locator" db:"hash_locator"`
	Item         *CDNItem    `json:"-" db:"-"`
	ToDelete     bool        `json:"to_delete" db:"to_delete"`
}

type CDNLogAPIRef

type CDNLogAPIRef struct {
	ProjectKey     string `json:"project_key"`
	WorkflowName   string `json:"workflow_name"`
	WorkflowID     int64  `json:"workflow_id"`
	RunID          int64  `json:"run_id"`
	NodeRunID      int64  `json:"node_run_id"`
	NodeRunName    string `json:"node_run_name"`
	NodeRunJobID   int64  `json:"node_run_job_id"`
	NodeRunJobName string `json:"node_run_job_name"`

	// for workers
	StepOrder int64  `json:"step_order"`
	StepName  string `json:"step_name,omitempty"`

	// for hatcheries
	RequirementServiceID   int64  `json:"service_id,omitempty"`
	RequirementServiceName string `json:"service_name,omitempty"`
}

func (*CDNLogAPIRef) Scan

func (a *CDNLogAPIRef) Scan(src interface{}) error

Scan CDNLogAPIRef.

func (*CDNLogAPIRef) ToFilename

func (a *CDNLogAPIRef) ToFilename() string

func (*CDNLogAPIRef) ToHash

func (a *CDNLogAPIRef) ToHash() (string, error)

func (CDNLogAPIRef) Value

func (a CDNLogAPIRef) Value() (driver.Value, error)

Value returns driver.Value from CDNLogAPIRef.

type CDNLogAPIRefV2 added in v0.53.0

type CDNLogAPIRefV2 struct {
	ProjectKey   string      `json:"project_key"`
	WorkflowName string      `json:"workflow_name"`
	RunID        string      `json:"run_id"`
	RunJobID     string      `json:"run_job_id"`
	RunJobName   string      `json:"run_job_name"`
	RunNumber    int64       `json:"run_number"`
	RunAttempt   int64       `json:"run_attempt"`
	ItemType     CDNItemType `json:"item_type"`

	// for workers
	StepOrder int64  `json:"step_order"`
	StepName  string `json:"step_name,omitempty"`

	// for hatcheries
	ServiceName string `json:"service_name,omitempty"`
}

func (*CDNLogAPIRefV2) ToFilename added in v0.53.0

func (a *CDNLogAPIRefV2) ToFilename() string

func (*CDNLogAPIRefV2) ToHash added in v0.53.0

func (a *CDNLogAPIRefV2) ToHash() (string, error)
type CDNLogLink struct {
	ItemType CDNItemType `json:"item_type"`
	APIRef   string      `json:"api_ref"`
}

type CDNLogLinkData

type CDNLogLinkData struct {
	APIRef      string      `json:"api_ref"`
	StepOrder   int64       `json:"step_order"`
	StepName    string      `json:"step_name"`
	ServiceName string      `json:"service_name"`
	ItemType    CDNItemType `json:"item_type"`
}
type CDNLogLinks struct {
	CDNURL   string           `json:"cdn_url,omitempty"`
	ItemType CDNItemType      `json:"item_type,omitempty"` // workflow v2: it's empty
	Data     []CDNLogLinkData `json:"datas"`
}

type CDNLogsLines

type CDNLogsLines struct {
	APIRef     string `json:"api_ref"`
	LinesCount int64  `json:"lines_count"`
}

type CDNMarkDelete

type CDNMarkDelete struct {
	RunID int64 `json:"run_id,omitempty"`
}

type CDNReaderFormat

type CDNReaderFormat string
const (
	CDNReaderFormatJSON CDNReaderFormat = "json"
	CDNReaderFormatText CDNReaderFormat = "text"
)

type CDNRunResultAPIRef

type CDNRunResultAPIRef struct {
	ProjectKey    string                `json:"project_key"`
	WorkflowName  string                `json:"workflow_name"`
	WorkflowID    int64                 `json:"workflow_id"`
	RunID         int64                 `json:"run_id"`
	RunJobID      int64                 `json:"run_job_id"`
	RunJobName    string                `json:"run_job_name"`
	RunNodeID     int64                 `json:"run_node_id"`
	ArtifactName  string                `json:"artifact_name"`
	Perm          uint32                `json:"perm"`
	RunResultType WorkflowRunResultType `json:"type"`
}

func (*CDNRunResultAPIRef) ToFilename

func (a *CDNRunResultAPIRef) ToFilename() string

func (*CDNRunResultAPIRef) ToHash

func (a *CDNRunResultAPIRef) ToHash() (string, error)

type CDNRunResultAPIRefV2 added in v0.53.1

type CDNRunResultAPIRefV2 struct {
	ProjectKey    string `json:"project_key"`
	WorkflowName  string `json:"workflow_name"`
	RunID         string `json:"run_id"`
	RunJobRegion  string `json:"run_job_region"`
	RunJobID      string `json:"run_job_id"`
	RunJobName    string `json:"run_job_name"`
	RunNumber     int64  `json:"run_number"`
	RunAttempt    int64  `json:"run_attempt"`
	RunResultID   string `json:"run_result_id"`
	RunResultName string `json:"run_result_name"`
	RunResultType string `json:"run_result_type"`
}

func (*CDNRunResultAPIRefV2) ToFilename added in v0.53.1

func (a *CDNRunResultAPIRefV2) ToFilename() string

func (*CDNRunResultAPIRefV2) ToHash added in v0.53.1

func (a *CDNRunResultAPIRefV2) ToHash() (string, error)

type CDNStreamFilter

type CDNStreamFilter struct {
	JobRunID string `json:"job_run_id"`
}

func (CDNStreamFilter) Validate

func (f CDNStreamFilter) Validate() error

type CDNUnit

type CDNUnit struct {
	ID      string        `json:"id" db:"id"`
	Created time.Time     `json:"created" db:"created"`
	Name    string        `json:"name" db:"name"`
	Config  ServiceConfig `json:"config" db:"config"`
}

type CDNUnitHandlerRequest

type CDNUnitHandlerRequest struct {
	ID      string `json:"id" cli:"id"`
	Name    string `json:"name" cli:"name"`
	NbItems int64  `json:"nb_items" cli:"nb_items"`
}

type CDNWSEvent

type CDNWSEvent struct {
	ItemType   CDNItemType `json:"item_type"`
	JobRunID   string      `json:"job_run_id"`
	ItemUnitID string      `json:"new_item_unit_id"`
}

type CDNWorkerCacheAPIRef

type CDNWorkerCacheAPIRef struct {
	ProjectKey string    `json:"project_key"`
	CacheTag   string    `json:"cache_tag"`
	ExpireAt   time.Time `json:"expire_at"`
}

func (*CDNWorkerCacheAPIRef) ToFilename

func (a *CDNWorkerCacheAPIRef) ToFilename() string

func (*CDNWorkerCacheAPIRef) ToHash

func (a *CDNWorkerCacheAPIRef) ToHash() (string, error)

type CDSContext added in v0.53.0

type CDSContext struct {
	// Workflow
	EventName          string                 `json:"event_name,omitempty"`
	Event              map[string]interface{} `json:"event,omitempty"`
	ProjectKey         string                 `json:"project_key,omitempty"`
	RunID              string                 `json:"run_id,omitempty"`
	RunNumber          int64                  `json:"run_number,omitempty"`
	RunAttempt         int64                  `json:"run_attempt,omitempty"`
	Workflow           string                 `json:"workflow,omitempty"`
	WorkflowRef        string                 `json:"workflow_ref,omitempty"`
	WorkflowSha        string                 `json:"workflow_sha,omitempty"`
	WorkflowVCSServer  string                 `json:"workflow_vcs_server,omitempty"`
	WorkflowRepository string                 `json:"workflow_repository,omitempty"`
	TriggeringActor    string                 `json:"triggering_actor,omitempty"`

	// Job
	Job   string `json:"job,omitempty"`
	Stage string `json:"stage,omitempty"`

	// Worker
	Workspace string `json:"workspace,omitempty"`

	// TODO
	WorkflowIntegrations map[string]interface{} `json:"integrations,omitempty"` // actual key: artifact_manager
}

type Cache

type Cache struct {
	ID              int64  `json:"id" cli:"id"`
	Project         string `json:"project"`
	Name            string `json:"name" cli:"name"`
	Tag             string `json:"tag"`
	TmpURL          string `json:"tmp_url"`
	SecretKey       string `json:"secret_key"`
	IntegrationName string `json:"integration_name"`

	Files            []string `json:"files"`
	WorkingDirectory string   `json:"working_directory"`
}

Cache define a file needed to be save for cache

func (*Cache) GetName

func (c *Cache) GetName() string

GetName returns the name the artifact

func (*Cache) GetPath

func (c *Cache) GetPath() string

GetPath returns the path of the artifact

type CanonicalFormUsage

type CanonicalFormUsage struct {
	Signer string `json:"signer" db:"signer"`
	Number int64  `json:"number" db:"number"`
	Latest bool   `json:"latest"`
}

type CanonicalFormUsageResume

type CanonicalFormUsageResume map[string][]CanonicalFormUsage

type CanonicalService

type CanonicalService struct {
	ID                    int64         `json:"id" db:"id" mapstructure:"id"`
	Name                  string        `json:"name" db:"name" cli:"name,key" mapstructure:"name"`
	ConsumerID            *string       `json:"-" db:"auth_consumer_id" mapstructure:"-"`
	Type                  string        `json:"type" db:"type" cli:"type" mapstructure:"type"`
	HTTPURL               string        `json:"http_url" db:"http_url" cli:"url" mapstructure:"http_url"`
	Config                ServiceConfig `json:"config" db:"config" cli:"-" mapstructure:"config"`
	PublicKey             []byte        `json:"public_key" db:"public_key" mapstructure:"public_key"`
	Region                *string       `json:"region" db:"region" mapstructure:"region"`
	IgnoreJobWithNoRegion *bool         `json:"ignore_job_with_no_region" db:"ignore_job_with_no_region" mapstructure:"ignore_job_with_no_region"`
}

type CheckFunc

type CheckFunc func(string) bool

CheckFunc is a function to check key of a map for map merge

type CheckProjectAccess added in v0.53.0

type CheckProjectAccess struct {
	ProjectKey string `json:"project_key"`
	Role       string `json:"role"`
	SessionID  string `json:"session_id"`
}

type CommitStatus added in v0.53.1

type CommitStatus struct {
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
}

type ConfigUser

type ConfigUser struct {
	URLUI  string `json:"url.ui"`
	URLAPI string `json:"url.api"`
}

ConfigUser struct.

type DatabaseMigrationStatus

type DatabaseMigrationStatus struct {
	ID        string     `json:"id" db:"id" cli:"id,key"`
	Migrated  bool       `json:"migrated" db:"-" cli:"migrated"`
	AppliedAt *time.Time `json:"applied_at" db:"applied_at" cli:"applied_at"`
	// aggregates
	Database string `json:"database" db:"-" cli:"database"`
}

DatabaseMigrationStatus represents on migration script status

type DefaultValues

type DefaultValues struct {
	DefaultGroupName string
}

DefaultValues contains default user values for init DB

type DownloadableResource

type DownloadableResource struct {
	Name      string `json:"name"`
	OS        string `json:"os"`
	Arch      string `json:"arch"`
	Variant   string `json:"variant,omitempty"`
	Filename  string `json:"filename,omitempty"`
	Available *bool  `json:"available,omitempty"`
}

func AllDownloadableResources

func AllDownloadableResources() []DownloadableResource

func AllDownloadableResourcesWithAvailability

func AllDownloadableResourcesWithAvailability(directoriesDownload string) []DownloadableResource

AllDownloadableResourcesWithAvailability set flag Available on downloads list

type Driver added in v0.53.0

type Driver interface {
	GetUserInfoFromDriver(ctx context.Context, req AuthConsumerSigninRequest) (AuthDriverUserInfo, error)
}

type DriverWithRedirect added in v0.53.0

type DriverWithRedirect interface {
	DriverWithSignInRequest
	GetSigninURI(AuthSigninConsumerToken) (AuthDriverSigningRedirect, error)
}

type DriverWithSignInRequest added in v0.53.0

type DriverWithSignInRequest interface {
	Driver
	CheckSigninRequest(req AuthConsumerSigninRequest) error
}

type DriverWithSigninStateToken added in v0.53.0

type DriverWithSigninStateToken interface {
	DriverWithSignInRequest
	CheckSigninStateToken(AuthConsumerSigninRequest) error
}

type EncryptFunc

type EncryptFunc func(context.Context, gorp.SqlExecutor, int64, string, string) (string, error)

EncryptFunc is a common type

type EntitiesPermissions

type EntitiesPermissions map[string]Permissions

func (EntitiesPermissions) Level

func (e EntitiesPermissions) Level(s string) int

func (EntitiesPermissions) Permissions

func (e EntitiesPermissions) Permissions(s string) Permissions

type Entity added in v0.52.0

type Entity struct {
	ID                  string    `json:"id" db:"id"`
	ProjectKey          string    `json:"project_key" db:"project_key"`
	ProjectRepositoryID string    `json:"project_repository_id" db:"project_repository_id"`
	Type                string    `json:"type" db:"type"`
	FilePath            string    `json:"file_path" db:"file_path"`
	Name                string    `json:"name" db:"name"`
	Commit              string    `json:"commit" db:"commit"`
	Ref                 string    `json:"ref" db:"ref"`
	LastUpdate          time.Time `json:"last_update" db:"last_update"`
	Data                string    `json:"data" db:"data"`
}

type EntityCheckResponse added in v0.53.0

type EntityCheckResponse struct {
	Messages []string `json:"messages"`
}

type EntityEvent added in v0.53.1

type EntityEvent struct {
	ProjectEventV2
	VCSName    string `json:"vcs_name"`
	Repository string `json:"repository"`
	Entity     string `json:"entity"`
	UserID     string `json:"user_id,omitempty"`
	Username   string `json:"username,omitempty"`
}

type EntityFullName added in v0.53.0

type EntityFullName struct {
	Name       string `json:"name" db:"name"`
	Ref        string `json:"ref" db:"ref"`
	VCSName    string `json:"vcs_name" db:"vcs_name"`
	RepoName   string `json:"repo_name" db:"repo_name"`
	ProjectKey string `json:"project_key" db:"project_key"`
}

type EntityWithObject added in v0.53.1

type EntityWithObject struct {
	Entity
	Workflow V2Workflow
	Action   V2Action
	Model    V2WorkerModel
}

type Environment

type Environment struct {
	ID                   int64                 `json:"id" yaml:"-" db:"id"`
	Name                 string                `json:"name" yaml:"name" cli:"name,key" db:"name"`
	Variables            []EnvironmentVariable `json:"variables,omitempty" yaml:"variables"`
	ProjectID            int64                 `json:"-" yaml:"-" db:"project_id"`
	ProjectKey           string                `json:"project_key" yaml:"-"`
	Created              time.Time             `json:"created" db:"created"`
	LastModified         time.Time             `json:"last_modified" db:"last_modified"`
	Keys                 []EnvironmentKey      `json:"keys"`
	Usage                *Usage                `json:"usage,omitempty"`
	FromRepository       string                `json:"from_repository,omitempty" db:"from_repository"`
	WorkflowAscodeHolder *Workflow             `json:"workflow_ascode_holder,omitempty" cli:"-"`
}

Environment represent a deployment environment

func NewEnvironment

func NewEnvironment(name string) *Environment

NewEnvironment instantiate a new Environment

func (Environment) GetKey

func (e Environment) GetKey(kname string) *EnvironmentKey

GetKey return a key by name

func (Environment) GetSSHKey

func (e Environment) GetSSHKey(kname string) *EnvironmentKey

GetSSHKey return a key by name

func (Environment) PGPKeys

func (e Environment) PGPKeys() []EnvironmentKey

PGPKeys returns the slice of pgp key for an environment

func (Environment) SSHKeys

func (e Environment) SSHKeys() []EnvironmentKey

SSHKeys returns the slice of ssh key for an environment

func (*Environment) UnmarshalJSON

func (e *Environment) UnmarshalJSON(data []byte) error

UnmarshalJSON custom for last modified.

type EnvironmentKey

type EnvironmentKey struct {
	ID            int64   `json:"id" db:"id" cli:"-"`
	Name          string  `json:"name" db:"name" cli:"name"`
	Public        string  `json:"public" db:"public" cli:"publickey"`
	Private       string  `json:"private" db:"private" cli:"-" gorpmapping:"encrypted,ID,Name"`
	KeyID         string  `json:"key_id" db:"key_id" cli:"-"`
	Type          KeyType `json:"type" db:"type" cli:"type"`
	EnvironmentID int64   `json:"environment_id" db:"environment_id"`
}

EnvironmentKey represent a key attach to an environment

type EnvironmentTemplate

type EnvironmentTemplate struct {
	Value string `json:"value"`
}

EnvironmentTemplate struct.

func (*EnvironmentTemplate) IsValid

func (e *EnvironmentTemplate) IsValid() error

IsValid returns environment template validity.

type EnvironmentTemplates

type EnvironmentTemplates []EnvironmentTemplate

EnvironmentTemplates struct.

func (*EnvironmentTemplates) Scan

func (e *EnvironmentTemplates) Scan(src interface{}) error

Scan environment templates.

func (EnvironmentTemplates) Value

func (e EnvironmentTemplates) Value() (driver.Value, error)

Value returns driver.Value from workflow template applications.

type EnvironmentVariable

type EnvironmentVariable struct {
	ID            int64  `json:"id,omitempty" cli:"-"`
	Name          string `json:"name" cli:"name,key"`
	Value         string `json:"value" cli:"value"`
	Type          string `json:"type" cli:"type"`
	EnvironmentID int64  `json:"environment_id" cli:"-"`
}

type EnvironmentVariableAudit

type EnvironmentVariableAudit struct {
	ID             int64                `json:"id" yaml:"-" db:"id"`
	EnvironmentID  int64                `json:"environment_id" yaml:"-" db:"environment_id"`
	VariableID     int64                `json:"variable_id" yaml:"-" db:"variable_id"`
	Type           string               `json:"type" yaml:"-" db:"type"`
	VariableBefore *EnvironmentVariable `json:"variable_before,omitempty" yaml:"-" db:"-"`
	VariableAfter  EnvironmentVariable  `json:"variable_after,omitempty" yaml:"-" db:"-"`
	Versionned     time.Time            `json:"versionned" yaml:"-" db:"versionned"`
	Author         string               `json:"author" yaml:"-" db:"author"`
}

EnvironmentVariableAudit represents an audit on an environment variable

type Error

type Error struct {
	ID         int         `json:"id"`
	Status     int         `json:"-"`
	Message    string      `json:"message"`
	Data       interface{} `json:"data,omitempty"`
	RequestID  string      `json:"request_id,omitempty"`
	StackTrace string      `json:"stack_trace,omitempty"`
	From       string      `json:"from,omitempty"`
}

Error type.

func ExtractHTTPError

func ExtractHTTPError(source error) Error

ExtractHTTPError tries to recognize given error and return http error with message in a language matching Accepted-Language.

func (Error) Error

func (e Error) Error() string

func (Error) Translate

func (e Error) Translate() string

type Event

type Event struct {
	Timestamp           time.Time        `json:"timestamp"`
	Hostname            string           `json:"hostname"`
	CDSName             string           `json:"cdsname"`
	EventType           string           `json:"type_event"` // go type of payload
	Payload             json.RawMessage  `json:"payload"`
	Attempts            int              `json:"attempt"`
	Username            string           `json:"username,omitempty"`
	UserMail            string           `json:"user_mail,omitempty"`
	ProjectKey          string           `json:"project_key,omitempty"`
	ApplicationName     string           `json:"application_name,omitempty"`
	PipelineName        string           `json:"pipeline_name,omitempty"`
	EnvironmentName     string           `json:"environment_name,omitempty"`
	WorkflowName        string           `json:"workflow_name,omitempty"`
	WorkflowRunNum      int64            `json:"workflow_run_num,omitempty"`
	WorkflowRunNumSub   int64            `json:"workflow_run_num_sub,omitempty"`
	WorkflowNodeRunID   int64            `json:"workflow_node_run_id,omitempty"`
	OperationUUID       string           `json:"operation_uuid,omitempty"`
	Status              string           `json:"status,omitempty"`
	Tags                []WorkflowRunTag `json:"tag,omitempty"`
	EventIntegrationsID []int64          `json:"event_integrations_id"`
	Region              string           `json:"region,omitempty"`
	ModelType           string           `json:"model_type,omitempty"`
}

Event represents a event from API Event is "create", "update", "delete" Status is "Waiting" "Building" "Success" "Fail" "Unknown", optional DateEvent is a date (timestamp format)

type EventActionAdd

type EventActionAdd struct {
	Action Action
}

EventActionAdd represents the event when adding an action.

type EventActionUpdate

type EventActionUpdate struct {
	OldAction Action
	NewAction Action
}

EventActionUpdate represents the event when updating an action.

type EventApplicationAdd

type EventApplicationAdd struct {
	Application
}

EventApplicationAdd represents the event when adding an application

type EventApplicationDelete

type EventApplicationDelete struct {
}

EventApplicationDelete represents the event when deleting an application

type EventApplicationKeyAdd

type EventApplicationKeyAdd struct {
	Key ApplicationKey `json:"key"`
}

EventApplicationKeyAdd represents the event when adding an application key

type EventApplicationKeyDelete

type EventApplicationKeyDelete struct {
	Key ApplicationKey `json:"key"`
}

EventApplicationKeyDelete represents the event when deleting an application key

type EventApplicationPermissionAdd

type EventApplicationPermissionAdd struct {
	Permission GroupPermission `json:"group_permission"`
}

EventApplicationPermissionAdd represents the event when adding an application permission

type EventApplicationPermissionDelete

type EventApplicationPermissionDelete struct {
	Permission GroupPermission `json:"group_permission"`
}

EventApplicationPermissionDelete represents the event when deleting an application permission

type EventApplicationPermissionUpdate

type EventApplicationPermissionUpdate struct {
	OldPermission GroupPermission `json:"old_group_permission"`
	NewPermission GroupPermission `json:"new_group_permission"`
}

EventApplicationPermissionUpdate represents the event when updating an application permission

type EventApplicationRepositoryAdd

type EventApplicationRepositoryAdd struct {
	VCSServer  string `json:"vcs_server"`
	Repository string `json:"repository"`
}

EventApplicationRepositoryAdd represents the event when adding a repository to an application

type EventApplicationRepositoryDelete

type EventApplicationRepositoryDelete struct {
	VCSServer  string `json:"vcs_server"`
	Repository string `json:"repository"`
}

EventApplicationRepositoryDelete represents the event when deleting a repository to an application

type EventApplicationUpdate

type EventApplicationUpdate struct {
	OldName               string             `json:"old_name"`
	NewName               string             `json:"new_name"`
	OldMetadata           Metadata           `json:"old_metadata"`
	NewMetadata           Metadata           `json:"new_metadata"`
	OldRepositoryStrategy RepositoryStrategy `json:"old_vcs_strategy"`
	NewRepositoryStrategy RepositoryStrategy `json:"new_vcs_strategy"`
}

EventApplicationUpdate represents the event when updating an application

type EventApplicationVariableAdd

type EventApplicationVariableAdd struct {
	Variable ApplicationVariable `json:"variable"`
}

EventApplicationVariableAdd represents the event when adding an application variable

type EventApplicationVariableDelete

type EventApplicationVariableDelete struct {
	Variable ApplicationVariable `json:"variable"`
}

EventApplicationVariableDelete represents the event when deleting an application variable

type EventApplicationVariableUpdate

type EventApplicationVariableUpdate struct {
	OldVariable ApplicationVariable `json:"old_variable"`
	NewVariable ApplicationVariable `json:"new_variable"`
}

EventApplicationVariableUpdate represents the event when updating an application variable

type EventAsCodeEvent

type EventAsCodeEvent struct {
	Event AsCodeEvent `json:"as_code_event"`
}

EventAsCodeEvent represents the event when add/update a workflow event

type EventEngine

type EventEngine struct {
	Message string `json:"message"`
}

EventEngine contains event data for engine

type EventEnvironmentAdd

type EventEnvironmentAdd struct {
	Environment
}

EventEnvironmentAdd represents the event when adding an environment

type EventEnvironmentDelete

type EventEnvironmentDelete struct {
}

EventEnvironmentDelete represents the event when deleting an environment

type EventEnvironmentKeyAdd

type EventEnvironmentKeyAdd struct {
	Key EnvironmentKey `json:"key"`
}

EventEnvironmentKeyAdd represents the event when adding an environment key

type EventEnvironmentKeyDelete

type EventEnvironmentKeyDelete struct {
	Key EnvironmentKey `json:"key"`
}

EventEnvironmentKeyDelete represents the event when deleting an environment key

type EventEnvironmentPermissionAdd

type EventEnvironmentPermissionAdd struct {
	Permission GroupPermission `json:"group_permission"`
}

EventEnvironmentPermissionAdd represents the event when adding an environment permission

type EventEnvironmentPermissionDelete

type EventEnvironmentPermissionDelete struct {
	Permission GroupPermission `json:"group_permission"`
}

EventEnvironmentPermissionDelete represents the event when deleting an environment permission

type EventEnvironmentPermissionUpdate

type EventEnvironmentPermissionUpdate struct {
	OldPermission GroupPermission `json:"old_group_permission"`
	NewPermission GroupPermission `json:"new_group_permission"`
}

EventEnvironmentPermissionUpdate represents the event when updating an environment permission

type EventEnvironmentUpdate

type EventEnvironmentUpdate struct {
	OldName string `json:"old_name"`
	NewName string `json:"new_name"`
}

EventEnvironmentUpdate represents the event when updating an environment

type EventEnvironmentVariableAdd

type EventEnvironmentVariableAdd struct {
	Variable EnvironmentVariable `json:"variable"`
}

EventEnvironmentVariableAdd represents the event when adding an environment variable

type EventEnvironmentVariableDelete

type EventEnvironmentVariableDelete struct {
	Variable EnvironmentVariable `json:"variable"`
}

EventEnvironmentVariableDelete represents the event when deleting an environment variable

type EventEnvironmentVariableUpdate

type EventEnvironmentVariableUpdate struct {
	OldVariable EnvironmentVariable `json:"old_variable"`
	NewVariable EnvironmentVariable `json:"new_variable"`
}

EventEnvironmentVariableUpdate represents the event when updating an environment variable

type EventFake

type EventFake struct {
	Data int64 `json:"data"`
}

EventFake is used for test purpose

type EventFilter

type EventFilter struct {
	CurrentItem int            `json:"current_item"`
	Filter      TimelineFilter `json:"filter"`
}

EventFilter represents filters when getting events

type EventJobSummary added in v0.52.0

type EventJobSummary struct {
	ID                   int64      `json:"id"`
	ProjectKey           string     `json:"project_key"`
	Workflow             string     `json:"workflow"`
	Pipeline             string     `json:"pipeline"`
	PipelineName         string     `json:"pipeline_name"`
	Job                  string     `json:"job"`
	WorkflowRunVersion   string     `json:"workflow_run_version"`
	WorkflowRunNumber    int        `json:"workflow_run_number"`
	WorkflowRunSubNumber int        `json:"workflow_run_sub_number"`
	FinalStatus          string     `json:"final_status"`
	Created              *time.Time `json:"created"`
	Started              *time.Time `json:"started"`
	Ended                *time.Time `json:"ended"`
	InQueueDuration      int        `json:"in_queue_duration"`
	BuildDuration        int        `json:"build_duration"`
	TotalDuration        int        `json:"total_duration"`
	CreatedHour          int        `json:"created_hour"`
	WorkerModel          string     `json:"worker_model"`
	WorkerModelType      string     `json:"worker_model_type"`
	Worker               string     `json:"worker"`
	Hatchery             string     `json:"hatchery"`
	Region               string     `json:"region"`
	Hook                 string     `json:"hook"`
	GitVCS               string     `json:"git_vcs"`
	GitRepo              string     `json:"git_repo"`
	GitBranch            string     `json:"git_branch"`
	GitTag               string     `json:"git_tag"`
	GitCommit            string     `json:"git_commit"`
}

type EventMaintenance

type EventMaintenance struct {
	Enable bool `json:"enable"`
}

EventMaintenance contains event data for maintenance event

type EventNotif

type EventNotif struct {
	Recipients []string `json:"recipients"`
	Subject    string   `json:"subject,omitempty"`
	Body       string   `json:"body,omitempty"`
}

EventNotif contains event data for a job

type EventOperation

type EventOperation struct {
	Operation
}

type EventPipelineAdd

type EventPipelineAdd struct {
	Pipeline
}

EventPipelineAdd represents the event when adding a pipeline

type EventPipelineDelete

type EventPipelineDelete struct {
}

EventPipelineDelete represents the event when deleting a pipeline

type EventPipelineJobAdd

type EventPipelineJobAdd struct {
	StageID         int64  `json:"stage_id"`
	StageName       string `json:"stage_name"`
	StageBuildOrder int    `json:"stage_build_order"`
	Job             Job    `json:"job"`
}

EventPipelineJobAdd represents the event when adding a job

type EventPipelineJobDelete

type EventPipelineJobDelete struct {
	StageID         int64  `json:"stage_id"`
	StageName       string `json:"stage_name"`
	StageBuildOrder int    `json:"stage_build_order"`
	JobName         string `json:"job_name"`
}

EventPipelineJobDelete represents the event when deleting a job

type EventPipelineJobUpdate

type EventPipelineJobUpdate struct {
	StageID         int64  `json:"stage_id"`
	StageName       string `json:"stage_name"`
	StageBuildOrder int    `json:"stage_build_order"`
	OldJob          Job    `json:"old_job"`
	NewJob          Job    `json:"new_job"`
}

EventPipelineJobUpdate represents the event when updating a job

type EventPipelineParameterAdd

type EventPipelineParameterAdd struct {
	Parameter Parameter `json:"parameter"`
}

EventPipelineParameterAdd represents the event when adding a pipeline parameter

type EventPipelineParameterDelete

type EventPipelineParameterDelete struct {
	Parameter Parameter `json:"parameter"`
}

EventPipelineParameterDelete represents the event when deleting a pipeline parameter

type EventPipelineParameterUpdate

type EventPipelineParameterUpdate struct {
	OldParameter Parameter `json:"old_parameter"`
	NewParameter Parameter `json:"new_parameter"`
}

EventPipelineParameterUpdate represents the event when updating a pipeline parameter

type EventPipelinePermissionAdd

type EventPipelinePermissionAdd struct {
	Permission GroupPermission `json:"group_permission"`
}

EventPipelinePermissionAdd represents the event when adding a pipeline permission

type EventPipelinePermissionDelete

type EventPipelinePermissionDelete struct {
	Permission GroupPermission `json:"group_permission"`
}

EventPipelinePermissionDelete represents the event when deleting a pipeline permission

type EventPipelinePermissionUpdate

type EventPipelinePermissionUpdate struct {
	OldPermission GroupPermission `json:"old_group_permission"`
	NewPermission GroupPermission `json:"new_group_permission"`
}

EventPipelinePermissionUpdate represents the event when updating a pipeline permission

type EventPipelineStageAdd

type EventPipelineStageAdd struct {
	Name         string         `json:"name"`
	BuildOrder   int            `json:"build_order"`
	Enabled      bool           `json:"enabled"`
	Prerequisite []Prerequisite `json:"prerequisite"`
}

EventPipelineStageAdd represents the event when adding a stage

type EventPipelineStageDelete

type EventPipelineStageDelete struct {
	ID         int64  `json:"id"`
	Name       string `json:"name"`
	BuildOrder int    `json:"build_order"`
}

EventPipelineStageDelete represents the event when deleting a stage

type EventPipelineStageMove

type EventPipelineStageMove struct {
	StageName          string `json:"stage_name"`
	StageID            int64  `json:"stage_id"`
	OldStageBuildOrder int    `json:"old_build_order"`
	NewStageBuildOrder int    `json:"new_build_order"`
}

EventPipelineStageMove represent the event when moving a stage

type EventPipelineStageUpdate

type EventPipelineStageUpdate struct {
	NewName         string         `json:"name"`
	NewBuildOrder   int            `json:"build_order"`
	NewPrerequisite []Prerequisite `json:"prerequisite"`
	OldName         string         `json:"old_name"`
	OldBuildOrder   int            `json:"old_build_order"`
	OldPrerequisite []Prerequisite `json:"old_prerequisite"`
	NewEnabled      bool           `json:"enabled"`
	OldEnabled      bool           `json:"old_enabled"`
}

EventPipelineStageUpdate represents the event when updating a stage

type EventPipelineUpdate

type EventPipelineUpdate struct {
	OldName string `json:"old_name"`
	NewName string `json:"new_name"`
}

EventPipelineUpdate represents the event when updating a pipeline

type EventProjectAdd

type EventProjectAdd struct {
	Variables   []ProjectVariable `json:"variables"`
	Permissions []GroupPermission `json:"groups_permission"`
	Keys        []ProjectKey      `json:"keys"`
	Metadata    Metadata          `json:"metadata"`
}

EventProjectAdd represents the event when adding a project

type EventProjectDelete

type EventProjectDelete struct {
}

EventProjectDelete represents the event when deleting a project

type EventProjectIntegrationAdd

type EventProjectIntegrationAdd struct {
	Integration ProjectIntegration `json:"integration"`
}

EventProjectIntegrationAdd represents the event when adding a project integration

type EventProjectIntegrationDelete

type EventProjectIntegrationDelete struct {
	Integration ProjectIntegration `json:"integration"`
}

EventProjectIntegrationDelete represents the event when deleting a project integration

type EventProjectIntegrationUpdate

type EventProjectIntegrationUpdate struct {
	OldIntegration  ProjectIntegration `json:"old_integration"`
	NewsIntegration ProjectIntegration `json:"new_integration"`
}

EventProjectIntegrationUpdate represents the event when updating a project integration

type EventProjectKeyAdd

type EventProjectKeyAdd struct {
	Key ProjectKey `json:"key"`
}

EventProjectKeyAdd represents the event when adding a project key

type EventProjectKeyDelete

type EventProjectKeyDelete struct {
	Key ProjectKey `json:"key"`
}

EventProjectKeyDelete represents the event when deleting a project key

type EventProjectKeyDisable added in v0.53.0

type EventProjectKeyDisable struct {
	Key ProjectKey `json:"key"`
}

type EventProjectKeyEnable added in v0.53.0

type EventProjectKeyEnable struct {
	Key ProjectKey `json:"key"`
}

type EventProjectPermissionAdd

type EventProjectPermissionAdd struct {
	Permission GroupPermission `json:"group_permission"`
}

EventProjectPermissionAdd represents the event when adding a project permission

type EventProjectPermissionDelete

type EventProjectPermissionDelete struct {
	Permission GroupPermission `json:"group_permission"`
}

EventProjectPermissionDelete represents the event when deleting a project permission

type EventProjectPermissionUpdate

type EventProjectPermissionUpdate struct {
	OldPermission GroupPermission `json:"old_group_permission"`
	NewPermission GroupPermission `json:"new_group_permission"`
}

EventProjectPermissionUpdate represents the event when updating a project permission

type EventProjectRepositoryAdd added in v0.53.0

type EventProjectRepositoryAdd struct {
	Repository ProjectRepository `json:"repository"`
	VCS        VCSProject        `json:"vcs"`
}

type EventProjectRepositoryAnalyze added in v0.53.0

type EventProjectRepositoryAnalyze struct {
	RepositoryID string `json:"repository_id"`
	VCSID        string `json:"vcs_id"`
	AnalysisID   string `json:"analysis_id"`
	Status       string `json:"status"`
}

type EventProjectRepositoryDelete added in v0.53.0

type EventProjectRepositoryDelete struct {
	Repository ProjectRepository `json:"repository"`
	VCS        VCSProject        `json:"vcs"`
}

type EventProjectUpdate

type EventProjectUpdate struct {
	OldName     string   `json:"old_name"`
	NewName     string   `json:"new_name"`
	OldMetadata Metadata `json:"old_metadata"`
	NewMetadata Metadata `json:"new_metadata"`
}

EventProjectUpdate represents the event when updating a project

type EventProjectVCSServerAdd

type EventProjectVCSServerAdd struct {
	VCSServerName string `json:"vcs_server"`
}

EventProjectVCSServerAdd represents the event when adding a project vcs server

type EventProjectVCSServerDelete

type EventProjectVCSServerDelete struct {
	VCSServerName string `json:"vcs_server"`
}

EventProjectVCSServerDelete represents the event when deleting a project vcs server

type EventProjectVariableAdd

type EventProjectVariableAdd struct {
	Variable ProjectVariable `json:"variable"`
}

EventProjectVariableAdd represents the event when adding a project variable

type EventProjectVariableDelete

type EventProjectVariableDelete struct {
	Variable ProjectVariable `json:"variable"`
}

EventProjectVariableDelete represents the event when deleting a project variable

type EventProjectVariableUpdate

type EventProjectVariableUpdate struct {
	OldVariable ProjectVariable `json:"old_variable"`
	NewVariable ProjectVariable `json:"new_variable"`
}

EventProjectVariableUpdate represents the event when updating a project variable

type EventRetentionWorkflowDryRun

type EventRetentionWorkflowDryRun struct {
	Runs         []WorkflowRunToKeep `json:"runs"`
	Status       string              `json:"status"`
	Error        string              `json:"error"`
	Warnings     []string            `json:"warnings"`
	RunsAnalyzed int64               `json:"nb_runs_analyzed"`
}

EventRetentionWorkflowDryRun represents the vent when execution dry run on workflow retention

type EventRunWorkflow

type EventRunWorkflow struct {
	ID               int64            `json:"id"`
	Number           int64            `json:"num"`
	Status           string           `json:"status"`
	Start            int64            `json:"start"`
	LastExecution    int64            `json:"last_execution"`
	LastModified     int64            `json:"last_modified"`
	LastModifiedNano int64            `json:"last_modified_nano"`
	Tags             []WorkflowRunTag `json:"tags"`
	ToDelete         bool             `json:"to_delete"`
}

EventRunWorkflow contains event data for a workflow run

type EventRunWorkflowJob

type EventRunWorkflowJob struct {
	ID     int64  `json:"id,omitempty"`
	Status string `json:"status,omitempty"`
	Start  int64  `json:"start,omitempty"`
	Done   int64  `json:"done,omitempty"`
}

EventRunWorkflowJob contains event data for a workflow job node run

type EventRunWorkflowNode

type EventRunWorkflowNode struct {
	ID                    int64                     `json:"id,omitempty"`
	NodeID                int64                     `json:"node_id,omitempty"`
	RunID                 int64                     `json:"run_id,omitempty"`
	Number                int64                     `json:"num,omitempty"`
	SubNumber             int64                     `json:"subnum,omitempty"`
	Status                string                    `json:"status,omitempty"`
	Start                 int64                     `json:"start,omitempty"`
	Done                  int64                     `json:"done,omitempty"`
	Payload               interface{}               `json:"payload,omitempty"`
	HookEvent             *WorkflowNodeRunHookEvent `json:"hook_event"`
	Manual                *WorkflowNodeRunManual    `json:"manual"`
	SourceNodeRuns        []int64                   `json:"source_node_runs"`
	WorkflowRunID         int64                     `json:"workflow_run_id"`
	RepositoryManagerName string                    `json:"repository_manager_name"`
	RepositoryFullName    string                    `json:"repository_full_name"`
	Hash                  string                    `json:"hash"`
	Tag                   string                    `json:"tag"`
	BranchName            string                    `json:"branch_name"`
	NodeName              string                    `json:"node_name"`
	StagesSummary         []StageSummary            `json:"stages_summary"`
	HookUUID              string                    `json:"hook_uuid"`
	HookLog               string                    `json:"log,omitempty"`
	NodeType              string                    `json:"node_type,omitempty"`
	GerritChange          *GerritChangeEvent        `json:"gerrit_change,omitempty"`
	EventIntegrations     []int64                   `json:"event_integrations_id,omitempty"`
}

EventRunWorkflowNode contains event data for a workflow node run

type EventRunWorkflowOutgoingHook

type EventRunWorkflowOutgoingHook struct {
	HookID            int64  `json:"hook_id"`
	ID                string `json:"id"`
	Status            string `json:"status,omitempty"`
	Start             int64  `json:"start,omitempty"`
	Done              int64  `json:"done,omitempty"`
	Log               string `json:"log,omitempty"`
	WorkflowRunID     int64  `json:"workflow_run_id"`
	WorkflowRunNumber *int64 `json:"workflow_run_number,omitempty"`
}

EventRunWorkflowOutgoingHook contains event data for a workflow outgoing hook run

type EventSubscription

type EventSubscription struct {
	UUID         string `json:"uuid"`
	ProjectKey   string `json:"key"`
	WorkflowName string `json:"workflow_name"`
	WorkflowNum  int64  `json:"num"`
	WorkflowRuns bool   `json:"runs"`
	Overwrite    bool   `json:"overwrite"`
}

EventSubscription data send to api to subscribe to an event

type EventWarningAdd

type EventWarningAdd struct {
	Warning
}

EventWarningAdd represents the event when adding a warning

type EventWarningDelete

type EventWarningDelete struct {
	Type    string
	Element string
}

EventWarningDelete represents the event when deleting a warning

type EventWarningUpdate

type EventWarningUpdate struct {
	Warning
}

EventWarningUpdate represents the event when updating a warning

type EventWorkflowAdd

type EventWorkflowAdd struct {
	Workflow Workflow `json:"workflow"`
}

EventWorkflowAdd represents the event when adding a workflow

type EventWorkflowDelete

type EventWorkflowDelete struct {
	Workflow Workflow `json:"workflow"`
}

EventWorkflowDelete represents the event when deleting a workflow

type EventWorkflowPermissionAdd

type EventWorkflowPermissionAdd struct {
	WorkflowID int64           `json:"workflow_id"`
	Permission GroupPermission `json:"group_permission"`
}

EventWorkflowPermissionAdd represents the event when adding a workflow permission

type EventWorkflowPermissionDelete

type EventWorkflowPermissionDelete struct {
	WorkflowID int64           `json:"workflow_id"`
	Permission GroupPermission `json:"group_permission"`
}

EventWorkflowPermissionDelete represents the event when deleting a workflow permission

type EventWorkflowPermissionUpdate

type EventWorkflowPermissionUpdate struct {
	WorkflowID    int64           `json:"workflow_id"`
	OldPermission GroupPermission `json:"old_group_permission"`
	NewPermission GroupPermission `json:"new_group_permission"`
}

EventWorkflowPermissionUpdate represents the event when updating a workflow permission

type EventWorkflowTemplateAdd

type EventWorkflowTemplateAdd struct {
	WorkflowTemplate WorkflowTemplate `json:"workflow_template"`
}

EventWorkflowTemplateAdd represents the event when adding a workflow template.

type EventWorkflowTemplateInstanceAdd

type EventWorkflowTemplateInstanceAdd struct {
	WorkflowTemplateInstance WorkflowTemplateInstance `json:"workflow_template_instance"`
}

EventWorkflowTemplateInstanceAdd represents the event when adding a workflow template instance.

type EventWorkflowTemplateInstanceUpdate

type EventWorkflowTemplateInstanceUpdate struct {
	OldWorkflowTemplateInstance WorkflowTemplateInstance `json:"old_workflow_template_instance"`
	NewWorkflowTemplateInstance WorkflowTemplateInstance `json:"new_workflow_template_instance"`
}

EventWorkflowTemplateInstanceUpdate represents the event when updating a workflow template instance.

type EventWorkflowTemplateUpdate

type EventWorkflowTemplateUpdate struct {
	OldWorkflowTemplate WorkflowTemplate `json:"old_workflow_template"`
	NewWorkflowTemplate WorkflowTemplate `json:"new_workflow_template"`
	ChangeMessage       string           `json:"change_message"`
}

EventWorkflowTemplateUpdate represents the event when updating a workflow template.

type EventWorkflowUpdate

type EventWorkflowUpdate struct {
	NewWorkflow Workflow `json:"new_workflow"`
	OldWorkflow Workflow `json:"old_workflow"`
}

EventWorkflowUpdate represents the event when updating a workflow

type ExecutedJob

type ExecutedJob struct {
	Job
	StepStatus []StepStatus `json:"step_status" db:"-"`
	Reason     string       `json:"reason" db:"-"`
	WorkerName string       `json:"worker_name" db:"-"`
	WorkerID   string       `json:"worker_id" db:"-"`
}

ExecutedJob represents a running job

func (ExecutedJob) ToSummary

func (j ExecutedJob) ToSummary() ExecutedJobSummary

ToSummary transforms an ExecutedJob to an ExecutedJobSummary

type ExecutedJobSummary

type ExecutedJobSummary struct {
	StepStatusSummary []StepStatusSummary `json:"step_status"`
	Reason            string              `json:"reason"`
	WorkerName        string              `json:"worker_name"`
	WorkerID          string              `json:"worker_id"`
	JobName           string              `json:"job_name"`
	PipelineActionID  int64               `json:"pipeline_action_id"`
	PipelineStageID   int64               `json:"pipeline_stage_id"`
	Steps             []ActionSummary     `json:"steps"`
}

ExecutedJobSummary is a light representation of ExecutedJob for CDS event

type Expiration

type Expiration int

Expiration defines how worker key should expire

type Favorite

type Favorite struct {
	ProjectIDs  []int64 `json:"project_ids" yaml:"project_ids"`
	WorkflowIDs []int64 `json:"workflow_ids" yaml:"workflow_ids"`
}

Favorite represent the favorites workflow or project of the user

type FavoriteParams

type FavoriteParams struct {
	Type         string `json:"type"`
	ProjectKey   string `json:"project_key"`
	WorkflowName string `json:"workflow_name,omitempty"`
}

FavoriteParams represents a project or workflow user's bookmark

type Feature

type Feature struct {
	ID   int64       `json:"id" db:"id" cli:"-" yaml:"-"`
	Name FeatureName `json:"name" db:"name" cli:"name" yaml:"name"`
	Rule string      `json:"rule" db:"rule" cli:"-" yaml:"rule"`
}

type FeatureEnabledResponse

type FeatureEnabledResponse struct {
	Name    FeatureName `json:"name"`
	Enabled bool        `json:"enabled"`
	Exists  bool        `json:"exists"`
}

type FeatureName

type FeatureName string
const (
	FeatureMFARequired  FeatureName = "mfa_required"
	FeaturePurgeName    FeatureName = "workflow-retention-policy"
	FeaturePurgeMaxRuns FeatureName = "workflow-retention-maxruns"
	FeatureTracing      FeatureName = "tracing"
	FeatureWorkflowV3   FeatureName = "workflow-v3"
	FeatureRegion       FeatureName = "region"
	FeatureCDSAsCode    FeatureName = "all-as-code"
)

type FileChildren added in v0.52.0

type FileChildren struct {
	Uri    string `json:"uri"`
	Folder bool   `json:"folder"`
}

type FileInfo

type FileInfo struct {
	Checksums         *FileInfoChecksum `json:"checksums,omitempty"`
	Created           time.Time         `json:"created"`
	CreatedBy         string            `json:"createdBy"`
	DownloadURI       string            `json:"downloadUri"`
	LastModified      time.Time         `json:"lastModified"`
	LastUpdated       time.Time         `json:"lastUpdated"`
	MimeType          string            `json:"mimeType"`
	ModifiedBy        string            `json:"modifiedBy"`
	OriginalChecksums *FileInfoChecksum `json:"originalChecksums,omitempty"`
	Path              string            `json:"path"`
	RemoteURL         string            `json:"remoteUrl"`
	Repo              string            `json:"repo"`
	SizeString        string            `json:"size"`
	Size              int64
	URI               string `json:"uri"`
}

type FileInfoChecksum added in v0.52.0

type FileInfoChecksum struct {
	Md5    string `json:"md5"`
	Sha1   string `json:"sha1"`
	Sha256 string `json:"sha256"`
}

type FullEventV2 added in v0.53.1

type FullEventV2 struct {
	ID               string          `json:"id"`
	Type             string          `json:"type"`
	Payload          json.RawMessage `json:"payload"`
	ProjectKey       string          `json:"project_key,omitempty"`
	VCSName          string          `json:"vcs_name,omitempty"`
	Repository       string          `json:"repository,omitempty"`
	Workflow         string          `json:"workflow,omitempty"`
	WorkflowRunID    string          `json:"workflow_run_id,omitempty"`
	RunJobID         string          `json:"run_job_id,omitempty"`
	RunNumber        int64           `json:"run_number,omitempty"`
	RunAttempt       int64           `json:"run_attempt,omitempty"`
	Region           string          `json:"region,omitempty"`
	Hatchery         string          `json:"hatchery,omitempty"`
	ModelType        string          `json:"model_type,omitempty"`
	JobID            string          `json:"job_id,omitempty"`
	Status           string          `json:"status,omitempty"`
	UserID           string          `json:"user_id,omitempty"`
	Username         string          `json:"username,omitempty"`
	RunResult        string          `json:"run_result,omitempty"`
	Entity           string          `json:"entity,omitempty"`
	Organization     string          `json:"organization,omitempty"`
	Permission       string          `json:"permission,omitempty"`
	Plugin           string          `json:"plugin,omitempty"`
	GPGKey           string          `json:"gpg_key,omitempty"`
	IntegrationModel string          `json:"integration_model,omitempty"`
	Integration      string          `json:"integration,omitempty"`
	KeyName          string          `json:"key_name,omitempty"`
	KeyType          string          `json:"key_type,omitempty"`
	Variable         string          `json:"variable,omitempty"`
	Notification     string          `json:"notification,omitempty"`
	VariableSet      string          `json:"variable_set,omitempty"`
	Item             string          `json:"item,omitempty"`
}

FullEventV2 uses to process event

type GRPCPlugin

type GRPCPlugin struct {
	ID                 int64              `json:"id" yaml:"id" cli:"id" db:"id"`
	Name               string             `json:"name" yaml:"name" cli:"name,key" db:"name"`
	Type               string             `json:"type" yaml:"type" cli:"type" db:"type"`
	Author             string             `json:"author" yaml:"author" cli:"author" db:"author"`
	Description        string             `json:"description" yaml:"description" cli:"description" db:"description"`
	Inputs             PluginInputs       `json:"inputs,omitempty" yaml:"inputs,omitempty" cli:"inputs" db:"inputs"`
	Binaries           GRPCPluginBinaries `json:"binaries" yaml:"binaries" cli:"-" db:"binaries"`
	IntegrationModelID *int64             `json:"-" db:"integration_model_id" yaml:"-" cli:"-"`
	Integration        string             `json:"integration" db:"-" yaml:"integration" cli:"integration"`
}

GRPCPlugin is the type representing a plugin over GRPC

func (GRPCPlugin) GetBinary

func (p GRPCPlugin) GetBinary(os, arch string) *GRPCPluginBinary

GetBinary returns the binary for a specific os and arch

func (*GRPCPlugin) Validate

func (p *GRPCPlugin) Validate() error

type GRPCPluginBinaries

type GRPCPluginBinaries []GRPCPluginBinary

func (*GRPCPluginBinaries) Scan

func (b *GRPCPluginBinaries) Scan(src interface{}) error

Scan plugin binaries.

func (GRPCPluginBinaries) Value

func (b GRPCPluginBinaries) Value() (driver.Value, error)

Value returns driver.Value from plugin binary slice.

type GRPCPluginBinary

type GRPCPluginBinary struct {
	OS               string          `json:"os,omitempty" yaml:"os"`
	Arch             string          `json:"arch,omitempty" yaml:"arch"`
	Name             string          `json:"name,omitempty" yaml:"-"`
	ObjectPath       string          `json:"object_path,omitempty" yaml:"-"`
	Size             int64           `json:"size,omitempty" yaml:"-"`
	Perm             uint32          `json:"perm,omitempty" yaml:"-"`
	MD5sum           string          `json:"md5sum,omitempty" yaml:"-"`
	SHA512sum        string          `json:"sha512sum,omitempty" yaml:"-"`
	TempURL          string          `json:"temp_url,omitempty" yaml:"-"`
	TempURLSecretKey string          `json:"-" yaml:"-"`
	Entrypoints      []string        `json:"entrypoints,omitempty" yaml:"entrypoints"`
	Cmd              string          `json:"cmd,omitempty" yaml:"cmd"`
	Args             []string        `json:"args,omitempty" yaml:"args"`
	Requirements     RequirementList `json:"requirements,omitempty" yaml:"requirements"`
	FileContent      []byte          `json:"file_content,omitempty" yaml:"-"` //only used for upload
	PluginName       string          `json:"plugin_name,omitempty" yaml:"-"`
}

GRPCPluginBinary represents a binary file (for a specific os and arch) serving a GRPCPlugin

func (GRPCPluginBinary) GetName

func (b GRPCPluginBinary) GetName() string

GetName is a part of the objectstore.Object interface implementation

func (GRPCPluginBinary) GetPath

func (b GRPCPluginBinary) GetPath() string

GetPath is a part of the objectstore.Object interface implementation

type GateInputs added in v0.53.1

type GateInputs map[string]interface{}

func (*GateInputs) Scan added in v0.53.1

func (gi *GateInputs) Scan(src interface{}) error

func (GateInputs) Value added in v0.53.1

func (gi GateInputs) Value() (driver.Value, error)

type GenerateRepositoryWebhook added in v0.53.1

type GenerateRepositoryWebhook struct {
	Key string `json:"key"`
}

type GerritChangeEvent

type GerritChangeEvent struct {
	ID         string `json:"id,omitempty"`
	Project    string `json:"project,omitempty"`
	DestBranch string `json:"dest_branch,omitempty"`
	Revision   string `json:"revision,omitempty"`
	Report     string `json:"report,omitempty"`
	URL        string `json:"url,omitempty"`
}

GerritChangeEvent Gerrit information that are needed on event

type GerritEventExecution

type GerritEventExecution struct {
	Message []byte `json:"message"`
}

GerritEventExecution contains specific data for a gerrit event execution

type GitContext added in v0.53.0

type GitContext struct {
	Server        string `json:"server,omitempty"`
	Repository    string `json:"repository,omitempty"`
	RepositoryURL string `json:"repositoryUrl,omitempty"`
	Ref           string `json:"ref,omitempty"`
	RefName       string `json:"ref_name,omitempty"`
	Sha           string `json:"sha,omitempty"`
	RefType       string `json:"ref_type,omitempty"`
	Connection    string `json:"connection,omitempty"`
	SSHKey        string `json:"ssh_key,omitempty"`
	SSHPrivate    string `json:"ssh_private,omitempty"`
	Username      string `json:"username,omitempty"`
	Token         string `json:"token,omitempty"`
	SemverCurrent string `json:"semver_current,omitempty"`
	SemverNext    string `json:"semver_next,omitempty"`
}

type GlobalEventV2 added in v0.53.1

type GlobalEventV2 struct {
	ID      string          `json:"id"`
	Type    string          `json:"type"`
	Payload json.RawMessage `json:"payload"`
}

type GoRoutine

type GoRoutine struct {
	Name    string
	Func    func(ctx context.Context)
	Restart bool
	Active  bool
	// contains filtered or unexported fields
}

type GoRoutines

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

GoRoutines contains list of routines that have to stay up

func NewGoRoutines

func NewGoRoutines(ctx context.Context) *GoRoutines

NewGoRoutines instanciates a new GoRoutineManager

func (*GoRoutines) Exec

func (m *GoRoutines) Exec(c context.Context, name string, fn func(ctx context.Context))

Exec runs the function within a goroutine with a panic recovery

func (*GoRoutines) GetStatus

func (m *GoRoutines) GetStatus() []MonitoringStatusLine

GetStatus returns the monitoring status of goroutines that should be running

func (*GoRoutines) GoRoutine

func (m *GoRoutines) GoRoutine(name string) *GoRoutine

func (*GoRoutines) Run

func (m *GoRoutines) Run(c context.Context, name string, fn func(ctx context.Context))

Run runs the function within a goroutine with a panic recovery, and keep GoRoutine status.

func (*GoRoutines) RunWithRestart

func (m *GoRoutines) RunWithRestart(c context.Context, name string, fn func(ctx context.Context))

RunWithRestart runs the function within a goroutine with a panic recovery, and keep GoRoutine status. if the goroutine is stopped, it will ne restarted

func (*GoRoutines) Stop added in v0.53.1

func (m *GoRoutines) Stop(name string)

type Group

type Group struct {
	ID   int64  `json:"id" yaml:"-" db:"id"`
	Name string `json:"name" yaml:"name" cli:"name,key" db:"name"`
	// aggregate
	Members      GroupMembers `json:"members,omitempty" yaml:"members,omitempty" db:"-"`
	Admin        bool         `json:"admin,omitempty" yaml:"admin,omitempty" db:"-"`
	Organization string       `json:"organization,omitempty" yaml:"organization,omitempty" cli:"organization" db:"-"`
}

Group represent a group of user.

func (Group) IsAdmin

func (g Group) IsAdmin(u AuthentifiedUser) bool

IsAdmin checks if given authentified user is admin for current group, group should have members aggregated.

func (Group) IsMember

func (g Group) IsMember(groupIDs []int64) bool

IsMember checks if given group member is part of current group.

func (Group) IsValid

func (g Group) IsValid() error

IsValid returns an error if given group is not valid.

type GroupMember

type GroupMember struct {
	ID           string `json:"id" yaml:"id" cli:"id,key"`
	Username     string `json:"username" yaml:"username" cli:"username"`
	Fullname     string `json:"fullname" yaml:"fullname,omitempty" cli:"fullname"`
	Admin        bool   `json:"admin,omitempty" yaml:"admin,omitempty" cli:"admin"`
	Organization string `json:"organization,omitempty" yaml:"organization,omitempty" cli:"organization"`
}

GroupMember struct.

type GroupMembers

type GroupMembers []GroupMember

func (GroupMembers) CheckAdminExists

func (m GroupMembers) CheckAdminExists() error

func (GroupMembers) ComputeOrganization

func (m GroupMembers) ComputeOrganization() (string, error)

func (GroupMembers) DiffUserIDs

func (m GroupMembers) DiffUserIDs(o GroupMembers) []string

func (GroupMembers) IsValid

func (m GroupMembers) IsValid() error

func (GroupMembers) UserIDs

func (m GroupMembers) UserIDs() []string

type GroupPermission

type GroupPermission struct {
	Group      Group `json:"group"`
	Permission int   `json:"permission"`
}

GroupPermission represent a group and his role in the project

func (GroupPermission) IsValid

func (g GroupPermission) IsValid() error

IsValid returns an error if group permission is not valid.

type GroupPermissions

type GroupPermissions []GroupPermission

func (GroupPermissions) ComputeOrganization

func (g GroupPermissions) ComputeOrganization() (string, error)

func (GroupPermissions) GetByGroupID added in v0.52.0

func (g GroupPermissions) GetByGroupID(groupID int64) *GroupPermission

type Groups

type Groups []Group

Groups type provides useful func on group list.

func (Groups) HasOneOf

func (g Groups) HasOneOf(groupIDs ...int64) bool

HasOneOf returns true if one of the given ids is in groups list.

func (Groups) ToIDs

func (g Groups) ToIDs() []int64

ToIDs returns ids for groups.

func (Groups) ToMap

func (g Groups) ToMap() map[int64]Group

ToMap returns a map of groups by ids.

type Hatchery added in v0.53.0

type Hatchery struct {
	ID            string        `json:"id" db:"id" cli:"id,key"`
	Name          string        `json:"name" db:"name" cli:"name"`
	ModelType     string        `json:"model_type" db:"model_type" cli:"model_type"`
	Config        ServiceConfig `json:"config" db:"config"`
	LastHeartbeat time.Time     `json:"last_heartbeat,omitempty" db:"last_heartbeat" cli:"last_heartbeat"`
	PublicKey     []byte        `json:"public_key" db:"public_key"`
	HTTPURL       string        `json:"http_url" db:"http_url"`
}

type HatcheryConfig added in v0.53.0

type HatcheryConfig map[string]interface{}

func (*HatcheryConfig) Scan added in v0.53.0

func (hc *HatcheryConfig) Scan(src interface{}) error

func (HatcheryConfig) Value added in v0.53.0

func (hc HatcheryConfig) Value() (driver.Value, error)

type HatcheryEvent added in v0.53.1

type HatcheryEvent struct {
	GlobalEventV2
	Hatchery string `json:"hatchery"`
	UserID   string `json:"user_id,omitempty"`
	Username string `json:"username,omitempty"`
}

type HatcheryGetResponse added in v0.53.1

type HatcheryGetResponse struct {
	Hatchery
	ConsumerExpiration string `json:"consumer_expiration,omitempty" db:"-" cli:"consumer_expiration,omitempty"`
	Token              string `json:"token,omitempty" db:"-" cli:"token,omitempty"`
}

type HatcheryMetrics added in v0.53.1

type HatcheryMetrics struct {
	Jobs                          *stats.Int64Measure
	JobsWebsocket                 *stats.Int64Measure
	JobsProcessed                 *stats.Int64Measure
	SpawningWorkers               *stats.Int64Measure
	SpawnedWorkers                *stats.Int64Measure
	SpawningWorkersErrors         *stats.Int64Measure
	JobReceivedInQueuePollingWSv1 *stats.Int64Measure
	JobReceivedInQueuePollingWSv2 *stats.Int64Measure
	ChanV1JobAdd                  *stats.Int64Measure
	ChanV2JobAdd                  *stats.Int64Measure
	ChanWorkerStarterPop          *stats.Int64Measure
	PendingWorkers                *stats.Int64Measure
	RegisteringWorkers            *stats.Int64Measure
	CheckingWorkers               *stats.Int64Measure
	WaitingWorkers                *stats.Int64Measure
	BuildingWorkers               *stats.Int64Measure
	DisabledWorkers               *stats.Int64Measure
}

type HatcheryPendingWorkerCreation added in v0.53.1

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

func (*HatcheryPendingWorkerCreation) Init added in v0.53.1

func (*HatcheryPendingWorkerCreation) IsJobAlreadyPendingWorkerCreation added in v0.53.1

func (c *HatcheryPendingWorkerCreation) IsJobAlreadyPendingWorkerCreation(id string) bool

func (*HatcheryPendingWorkerCreation) NbJobInPendingWorkerCreation added in v0.53.1

func (c *HatcheryPendingWorkerCreation) NbJobInPendingWorkerCreation() int

func (*HatcheryPendingWorkerCreation) RemoveJobFromPendingWorkerCreation added in v0.53.1

func (c *HatcheryPendingWorkerCreation) RemoveJobFromPendingWorkerCreation(id string)

func (*HatcheryPendingWorkerCreation) SetJobInPendingWorkerCreation added in v0.53.1

func (c *HatcheryPendingWorkerCreation) SetJobInPendingWorkerCreation(id string) int

type HatcheryStatus added in v0.53.0

type HatcheryStatus struct {
	ID         int64            `json:"id" db:"id" cli:"id,key"`
	HatcheryID string           `json:"hatchery_id" db:"hatchery_id" cli:"hatchery_id"`
	SessionID  string           `json:"session_id" db:"session_id" cli:"session_id"`
	Status     MonitoringStatus `json:"monitoring_status" db:"monitoring_status"`
}

type Hook added in v0.52.0

type Hook struct {
	UUID          string            `json:"uuid"`
	HookType      string            `json:"hook_type"`
	Configuration HookConfiguration `json:"configuration"`
	HookSignKey   string            `json:"hook_sign_key,omitempty"`
}

type HookAccessData added in v0.52.0

type HookAccessData struct {
	URL         string `json:"url" cli:"url"`
	HookSignKey string `json:"hook_sign_key" cli:"hook_sign_key"`
}

type HookAnalysisCallback added in v0.53.1

type HookAnalysisCallback struct {
	AnalysisID     string           `json:"analysis_id"`
	AnalysisStatus string           `json:"analysis_status"`
	Error          string           `json:"error"`
	Models         []EntityFullName `json:"models"`
	Workflows      []EntityFullName `json:"workflows"`
}

type HookConfigValue added in v0.52.0

type HookConfigValue struct {
	Value              string   `json:"value"`
	Configurable       bool     `json:"configurable"`
	Type               string   `json:"type"`
	MultipleChoiceList []string `json:"multiple_choice_list"`
}

HookConfigValue represents the value of a node hook config

type HookConfiguration added in v0.52.0

type HookConfiguration map[string]WorkflowNodeHookConfigValue

func (*HookConfiguration) Scan added in v0.52.0

func (hc *HookConfiguration) Scan(src interface{}) error

func (HookConfiguration) Value added in v0.52.0

func (hc HookConfiguration) Value() (driver.Value, error)

type HookEventCallback added in v0.53.1

type HookEventCallback struct {
	AnalysisCallback   *HookAnalysisCallback  `json:"analysis_callback"`
	SigningKeyCallback *HookSigninKeyCallback `json:"signing_key_callback"`
	HookEventUUID      string                 `json:"hook_event_uuid"`
	VCSServerType      string                 `json:"vcs_server_type"`
	VCSServerName      string                 `json:"vcs_server_name"`
	RepositoryName     string                 `json:"repository_name"`
}

type HookListWorkflowRequest added in v0.53.1

type HookListWorkflowRequest struct {
	HookEventUUID       string           `json:"hook_event_uuid"`
	VCSName             string           `json:"vcs_name"`
	RepositoryName      string           `json:"repository_name"`
	Ref                 string           `json:"ref"`
	Sha                 string           `json:"sha"`
	Paths               []string         `json:"paths"`
	RepositoryEventName string           `json:"repository_event"`
	RepositoryEventType string           `json:"repository_event_type"`
	AnayzedProjectKeys  StringSlice      `json:"project_keys"`
	Models              []EntityFullName `json:"models"`
	Workflows           []EntityFullName `json:"workflows"`
}

type HookManualWorkflowRun added in v0.53.1

type HookManualWorkflowRun struct {
	UserRequest V2WorkflowRunManualRequest
	Project     string
	VCSType     string
	VCSServer   string
	Repository  string
	Ref         string
	Commit      string
	Workflow    string
	UserID      string
	Username    string
}

type HookRepository added in v0.53.1

type HookRepository struct {
	VCSServerType  string `json:"vcs_server_type"`
	VCSServerName  string `json:"vcs_server_name" cli:"vcs_server_name"`
	RepositoryName string `json:"repository_name" cli:"repository_name"`
	Stopped        bool   `json:"stopped" cli:"stopped"`
}

type HookRepositoryEvent added in v0.53.1

type HookRepositoryEvent struct {
	UUID                      string                         `json:"uuid"`
	Created                   int64                          `json:"created"`
	EventName                 string                         `json:"event_name"` // WorkflowHookEventPush, sdk.WorkflowHookEventPullRequest
	EventType                 string                         `json:"event_type"` // created, deleted, edited, opened
	VCSServerType             string                         `json:"vcs_server_type"`
	VCSServerName             string                         `json:"vcs_server_name"`
	RepositoryName            string                         `json:"repository_name"`
	Body                      []byte                         `json:"body"`
	ExtractData               HookRepositoryEventExtractData `json:"extracted_data"`
	Status                    string                         `json:"status"`
	ProcessingTimestamp       int64                          `json:"processing_timestamp"`
	LastUpdate                int64                          `json:"last_update"`
	LastError                 string                         `json:"last_error"`
	NbErrors                  int64                          `json:"nb_errors"`
	Analyses                  []HookRepositoryEventAnalysis  `json:"analyses"`
	ModelUpdated              []EntityFullName               `json:"model_updated"`
	WorkflowUpdated           []EntityFullName               `json:"workflow_updated"`
	WorkflowHooks             []HookRepositoryEventWorkflow  `json:"workflows"`
	UserID                    string                         `json:"user_id"`
	Username                  string                         `json:"username"`
	SignKey                   string                         `json:"sign_key"`
	SigningKeyOperation       string                         `json:"signing_key_operation"`
	SigningKeyOperationStatus OperationStatus                `json:"signing_key_operation_status"`
	SemverCurrent             string                         `json:"semver_current"`
	SemverNext                string                         `json:"semver_next"`
}

func (*HookRepositoryEvent) GetFullName added in v0.53.1

func (h *HookRepositoryEvent) GetFullName() string

type HookRepositoryEventAnalysis added in v0.53.1

type HookRepositoryEventAnalysis struct {
	AnalyzeID  string `json:"analyze_id"`
	Status     string `json:"status"`
	ProjectKey string `json:"project_key"`
	Error      string `json:"error"`
}

type HookRepositoryEventExtractData added in v0.53.1

type HookRepositoryEventExtractData struct {
	CDSEventName   string   `json:"cds_event_name"`
	CDSEventType   string   `json:"cds_event_type"`
	Commit         string   `json:"commit"`
	Paths          []string `json:"paths"`
	Ref            string   `json:"ref"`
	ProjectManual  string   `json:"manual_project"`
	WorkflowManual string   `json:"manual_workflow"`
}

type HookRepositoryEventWorkflow added in v0.53.1

type HookRepositoryEventWorkflow struct {
	ProjectKey           string `json:"project_key"`
	VCSIdentifier        string `json:"vcs_identifier"`
	RepositoryIdentifier string `json:"repository_identifier"`
	WorkflowName         string `json:"workflow_name"`
	EntityID             string `json:"entity_id"`
	Ref                  string `json:"ref"`
	Type                 string `json:"type"`
	Status               string `json:"status"`
	TargetBranch         string `json:"target_branch,omitempty"`
	TargetCommit         string `json:"target_commit,omitempty"`
	ModelFullName        string `json:"model,omitempty"`
	RunID                string `json:"run_id,omitempty"`
	RunNumber            int64  `json:"run_number,omitempty"`
}

type HookRetrieveSignKeyRequest added in v0.53.1

type HookRetrieveSignKeyRequest struct {
	ProjectKey     string `json:"projectKey"`
	VCSServerType  string `json:"vcs_server_type"`
	VCSServerName  string `json:"vcs_server_name"`
	RepositoryName string `json:"repository_name"`
	Commit         string `json:"commit"`
	Ref            string `json:"ref"`
	HookEventUUID  string `json:"hook_event_uuid"`
}

type HookRetrieveUserRequest added in v0.53.1

type HookRetrieveUserRequest struct {
	ProjectKey     string `json:"projectKey"`
	VCSServerType  string `json:"vcs_server_type"`
	VCSServerName  string `json:"vcs_server_name"`
	RepositoryName string `json:"repository_name"`
	Commit         string `json:"commit"`
	SignKey        string `json:"sign_key"`
	HookEventUUID  string `json:"hook_event_uuid"`
}

type HookRetrieveUserResponse added in v0.53.1

type HookRetrieveUserResponse struct {
	UserID   string `json:"user_id"`
	Username string `json:"username"`
}

type HookSigninKeyCallback added in v0.53.1

type HookSigninKeyCallback struct {
	Status        OperationStatus `json:"status"`
	SignKey       string          `json:"sign_key"`
	SemverCurrent string          `json:"semver_current"`
	SemverNext    string          `json:"semver_next"`
	Error         string          `json:"error"`
}

type IDName

type IDName struct {
	ID          int64   `json:"id" db:"id"`
	Name        string  `json:"name" db:"name"`
	Description string  `json:"description,omitempty" db:"description"`
	Icon        string  `json:"icon,omitempty" db:"icon"`
	Labels      []Label `json:"labels,omitempty" db:"-"`
}

IDName is generally used when you want to get basic informations from db

type IDNames

type IDNames []IDName

func (IDNames) IDs

func (idNames IDNames) IDs() []int64

func (IDNames) Names

func (idNames IDNames) Names() []string

type Identifiable

type Identifiable interface {
	GetUsername() string
	GetEmail() string
	GetFullname() string
}

type Int64Slice

type Int64Slice []int64

Int64Slice type used for database json storage.

func (*Int64Slice) Contains

func (s *Int64Slice) Contains(v int64) bool

Contains return true if given value is in the slice.

func (*Int64Slice) Remove

func (s *Int64Slice) Remove(v int64)

Remove all occurrences of given value from the slice.

func (*Int64Slice) Scan

func (s *Int64Slice) Scan(src interface{}) error

Scan int64 slice.

func (*Int64Slice) Unique

func (s *Int64Slice) Unique()

Remove duplicated value from slice.

func (Int64Slice) Value

func (s Int64Slice) Value() (driver.Value, error)

Value returns driver.Value from int64 slice.

type IntegrationConfig

type IntegrationConfig map[string]IntegrationConfigValue

IntegrationConfig represent the configuration of an integration

func (IntegrationConfig) Blur

func (config IntegrationConfig) Blur()

func (IntegrationConfig) Clone

func (config IntegrationConfig) Clone() IntegrationConfig

Clone return a copy of the config (with a copy of the underlying data structure)

func (IntegrationConfig) DecryptSecrets

func (config IntegrationConfig) DecryptSecrets(decryptFunc func(string) (string, error)) error

DecryptSecrets decrypt secrets given a cypher func

func (IntegrationConfig) EncryptSecrets

func (config IntegrationConfig) EncryptSecrets(encryptFunc func(string) (string, error)) error

EncryptSecrets encrypt secrets given a cypher func

func (*IntegrationConfig) HideSecrets

func (config *IntegrationConfig) HideSecrets()

HideSecrets replaces password with a placeholder

func (IntegrationConfig) MergeWith

func (config IntegrationConfig) MergeWith(cfg IntegrationConfig)

MergeWith set new values from new config and update existing values if not default.

func (*IntegrationConfig) Scan

func (config *IntegrationConfig) Scan(src interface{}) error

Scan IntegrationConfig.

func (IntegrationConfig) SetValue

func (config IntegrationConfig) SetValue(name string, value string)

Set value

func (IntegrationConfig) Value

func (config IntegrationConfig) Value() (driver.Value, error)

Value returns driver.Value from IntegrationConfig.

type IntegrationConfigMap

type IntegrationConfigMap map[string]IntegrationConfig

func (IntegrationConfigMap) Blur

func (config IntegrationConfigMap) Blur()

func (IntegrationConfigMap) Clone

func (*IntegrationConfigMap) Scan

func (config *IntegrationConfigMap) Scan(src interface{}) error

Scan IntegrationConfig.

func (IntegrationConfigMap) Value

func (config IntegrationConfigMap) Value() (driver.Value, error)

Value returns driver.Value from IntegrationConfig.

type IntegrationConfigValue

type IntegrationConfigValue struct {
	Value       string `json:"value" yaml:"value"`
	Type        string `json:"type" yaml:"type"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	Static      bool   `json:"static,omitempty" yaml:"static,omitempty"`
}

IntegrationConfigValue represent a configuration value for a integration

type IntegrationModel

type IntegrationModel struct {
	ID                      int64                `json:"id" db:"id" yaml:"-" cli:"-"`
	Name                    string               `json:"name" db:"name" yaml:"name" cli:"name,key"`
	Author                  string               `json:"author" db:"author" yaml:"author" cli:"author"`
	Identifier              string               `json:"identifier" db:"identifier" yaml:"identifier,omitempty"`
	Icon                    string               `json:"icon" db:"icon" yaml:"icon"`
	DefaultConfig           IntegrationConfig    `json:"default_config" db:"default_config" yaml:"default_config"`
	AdditionalDefaultConfig IntegrationConfig    `json:"additional_default_config" db:"additional_default_config" yaml:"additional_default_config"`
	PublicConfigurations    IntegrationConfigMap `json:"public_configurations,omitempty" db:"cipher_public_configurations" yaml:"public_configurations"`
	Disabled                bool                 `json:"disabled" db:"disabled" yaml:"disabled"`
	Hook                    bool                 `json:"hook" db:"hook" yaml:"hook" cli:"hooks_supported"`
	Storage                 bool                 `json:"storage" db:"storage" yaml:"storage" cli:"storage supported"`
	Deployment              bool                 `json:"deployment" db:"deployment" yaml:"deployment" cli:"deployment_supported"`
	Compute                 bool                 `json:"compute" db:"compute" yaml:"compute" cli:"compute_supported"`
	Event                   bool                 `json:"event" db:"event" yaml:"event" cli:"event_supported"`
	ArtifactManager         bool                 `json:"artifact_manager" db:"artifact_manager" yaml:"artifact_manager" cli:"artifact_manager_supported"`
	Public                  bool                 `json:"public,omitempty" db:"public" yaml:"public,omitempty"`
}

IntegrationModel represent a integration model with its default configuration

func (*IntegrationModel) Blur

func (p *IntegrationModel) Blur()

func (IntegrationModel) IsBuiltin

func (p IntegrationModel) IsBuiltin() bool

IsBuiltin checks is the model is builtin or not

type IntegrationModelEvent added in v0.53.1

type IntegrationModelEvent struct {
	GlobalEventV2
	IntegrationModel string `json:"integration_model"`
	UserID           string `json:"user_id"`
	Username         string `json:"username"`
}

type IntegrationType

type IntegrationType string

IntegrationType represents all different type of integrations

type ItemProperty added in v0.53.0

type ItemProperty struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type ItemStat added in v0.53.0

type ItemStat struct {
	URI                  string `json:"uri"`
	DownloadCount        int    `json:"downloadCount"`
	LastDownloaded       int64  `json:"lastDownloaded"`
	LastDownloadedBy     string `json:"lastDownloadedBy"`
	RemoteDownloadCount  int    `json:"remoteDownloadCount"`
	RemoteLastDownloaded int    `json:"remoteLastDownloaded"`
}

type JUnitInnerResult added in v0.52.0

type JUnitInnerResult struct {
	Value string `xml:",cdata" json:"value,omitempty" mapstructure:"value"`
}

type JUnitTestCase added in v0.52.0

type JUnitTestCase struct {
	XMLName   xml.Name           `xml:"testcase" json:"-"`
	Classname string             `xml:"classname,attr,omitempty" json:"classname,omitempty" mapstructure:"classname"`
	Errors    []JUnitTestFailure `xml:"error,omitempty" json:"errors,omitempty" mapstructure:"errors"`
	Failures  []JUnitTestFailure `xml:"failure,omitempty" json:"failures,omitempty" mapstructure:"failures"`
	Name      string             `xml:"name,attr" json:"name,omitempty" mapstructure:"name"`
	Skipped   []JUnitTestSkipped `xml:"skipped,omitempty" json:"skipped,omitempty" mapstructure:"skipped"`
	Status    string             `xml:"status,attr,omitempty" json:"status,omitempty" mapstructure:"status"`
	Systemerr JUnitInnerResult   `xml:"system-err,omitempty" json:"systemerr,omitempty" mapstructure:"systemerr"`
	Systemout JUnitInnerResult   `xml:"system-out,omitempty" json:"systemout,omitempty" mapstructure:"systemout"`
	Time      string             `xml:"time,attr,omitempty" json:"time,omitempty" mapstructure:"time"`
}

type JUnitTestFailure added in v0.52.0

type JUnitTestFailure struct {
	Message string `xml:"message,attr,omitempty" json:"message,omitempty" mapstructure:"message"`
	Type    string `xml:"type,attr,omitempty" json:"type,omitempty" mapstructure:"type"`
	Value   string `xml:",cdata" json:"value,omitempty" mapstructure:"value"`
}

type JUnitTestSkipped added in v0.52.0

type JUnitTestSkipped struct {
	Message string `xml:"message,attr,omitempty" json:"message,omitempty" mapstructure:"message"`
	Value   string `xml:",cdata" json:"value,omitempty" mapstructure:"value"`
}

type JUnitTestSuite added in v0.52.0

type JUnitTestSuite struct {
	XMLName   xml.Name        `xml:"testsuite" json:"-"`
	Disabled  int             `xml:"disabled,attr,omitempty" json:"disabled,omitempty" mapstructure:"disabled"`
	Errors    int             `xml:"errors,attr,omitempty" json:"errors,omitempty" mapstructure:"errors"`
	Failures  int             `xml:"failures,attr,omitempty" json:"failures,omitempty" mapstructure:"failures"`
	ID        string          `xml:"id,attr" json:"id,omitempty" mapstructure:"id"`
	Name      string          `xml:"name,attr" json:"name,omitempty" mapstructure:"name"`
	Package   string          `xml:"package,attr,omitempty" json:"package,omitempty" mapstructure:"package"`
	Skipped   int             `xml:"skipped,attr,omitempty" json:"skipped,omitempty" mapstructure:"skipped"`
	TestCases []JUnitTestCase `xml:"testcase" json:"tests,omitempty" mapstructure:"tests"`
	Time      string          `xml:"time,attr,omitempty" json:"time,omitempty" mapstructure:"time"`
	Timestamp string          `xml:"timestamp,attr,omitempty" json:"timestamp,omitempty" mapstructure:"timestamp"`
	Total     int             `xml:"tests,attr" json:"total,omitempty" mapstructure:"total"`
}

type JUnitTestsSuites added in v0.52.0

type JUnitTestsSuites struct {
	XMLName    xml.Name         `xml:"testsuites" json:"-"`
	TestSuites []JUnitTestSuite `xml:"testsuite" json:"test_suites" mapstructure:"test_suites"`
}

func (JUnitTestsSuites) ComputeStats added in v0.52.0

func (s JUnitTestsSuites) ComputeStats() TestsStats

func (JUnitTestsSuites) EnsureData added in v0.52.0

func (s JUnitTestsSuites) EnsureData() JUnitTestsSuites

EnsureData add missing names on test cases and suites also compute test suites total values from test cases data.

type Job

type Job struct {
	PipelineActionID int64                  `json:"pipeline_action_id"`
	PipelineStageID  int64                  `json:"pipeline_stage_id"`
	Enabled          bool                   `json:"enabled"`
	LastModified     int64                  `json:"last_modified"`
	Action           Action                 `json:"action"`
	Warnings         []PipelineBuildWarning `json:"warnings"`
}

Job is the element of a stage

func (Job) IsValid

func (j Job) IsValid() error

IsValid returns job's validity.

type JobContext added in v0.53.0

type JobContext struct {
	// Update by worker
	Status string `json:"status"`

	// Set by hatchery
	Services map[string]JobContextService `json:"services"`
}

type JobContextService added in v0.53.0

type JobContextService struct {
	ID   string            `json:"id"`
	Port map[string]string `json:"ports"`
}

type JobIntegrationsContext added in v0.53.1

type JobIntegrationsContext struct {
	ArtifactManager string `json:"artifact_manager,omitempty"`
	Deployment      string `json:"deployment,omitempty"`
}

func (JobIntegrationsContext) All added in v0.53.1

func (c JobIntegrationsContext) All() []string

type JobMatrix added in v0.53.1

type JobMatrix map[string]string

func (*JobMatrix) Scan added in v0.53.1

func (jm *JobMatrix) Scan(src interface{}) error

func (JobMatrix) Value added in v0.53.1

func (jm JobMatrix) Value() (driver.Value, error)

type JobResultContext added in v0.53.0

type JobResultContext struct {
	Result  V2WorkflowRunJobStatus `json:"result"`
	Outputs JobResultOutput        `json:"outputs"`
}

type JobResultOutput added in v0.53.0

type JobResultOutput map[string]string

func (*JobResultOutput) Scan added in v0.53.0

func (jro *JobResultOutput) Scan(src interface{}) error

func (JobResultOutput) Value added in v0.53.0

func (jro JobResultOutput) Value() (driver.Value, error)

type JobRunContext added in v0.53.0

type JobRunContext struct {
	NodeRunContext
	Job     JobContext        `json:"job,omitempty"`
	Secrets map[string]string `json:"secrets,omitempty"`
}

func (*JobRunContext) Scan added in v0.53.0

func (m *JobRunContext) Scan(src interface{}) error

func (JobRunContext) Value added in v0.53.0

func (m JobRunContext) Value() (driver.Value, error)

type JobStepStatus added in v0.53.1

type JobStepStatus struct {
	Conclusion V2WorkflowRunJobStatus `json:"conclusion"` // result of a step after 'continue-on-error'
	Outcome    V2WorkflowRunJobStatus `json:"outcome"`    // result of a step before 'continue-on-error'
	Outputs    JobResultOutput        `json:"outputs"`
	Started    time.Time              `json:"started"`
	Ended      time.Time              `json:"ended"`
}

type JobStepsStatus added in v0.53.1

type JobStepsStatus map[string]JobStepStatus

func (*JobStepsStatus) Scan added in v0.53.1

func (sc *JobStepsStatus) Scan(src interface{}) error

func (JobStepsStatus) ToStepContext added in v0.53.1

func (s JobStepsStatus) ToStepContext() StepsContext

func (JobStepsStatus) Value added in v0.53.1

func (sc JobStepsStatus) Value() (driver.Value, error)

type JobsResultContext added in v0.53.0

type JobsResultContext map[string]JobResultContext

type KafkaTaskExecution

type KafkaTaskExecution struct {
	Message []byte `json:"message"`
}

KafkaTaskExecution contains specific data for a kafka hook

type Key

type Key struct {
	ID      int64   `json:"id" db:"id" cli:"-"`
	Name    string  `json:"name" db:"name" cli:"name"`
	Public  string  `json:"public" db:"public" cli:"publickey"`
	Private string  `json:"private" db:"private" cli:"-"`
	KeyID   string  `json:"keyID" db:"key_id" cli:"-"`
	Type    KeyType `json:"type" db:"type" cli:"type"`
}

Key represent a key of type SSH or GPG.

type KeyEvent added in v0.53.1

type KeyEvent struct {
	ProjectEventV2
	KeyName  string `json:"key_name"`
	KeyType  string `json:"key_type"`
	UserID   string `json:"user_id"`
	Username string `json:"username"`
}

type KeyType

type KeyType string
const (
	KeyTypeSSH KeyType = "ssh"
	KeyTypePGP KeyType = "pgp"
)

Those are types if key managed in CDS

func (KeyType) String

func (k KeyType) String() string

type KeyValues

type KeyValues struct {
	Key    string
	Values []string
}

type Label

type Label struct {
	ID         int64  `json:"id" db:"id"`
	Name       string `json:"name" db:"name" cli:"label,key"`
	Color      string `json:"color" db:"color"`
	ProjectID  int64  `json:"project_id" db:"project_id"`
	WorkflowID int64  `json:"workflow_id,omitempty" db:"-"`
}

Label represent a label linked to a workflow

func (*Label) IsValid

func (label *Label) IsValid() error

IsValid return an error or update label if it is not valid.

type Labels

type Labels []Label

Labels slice.

func (Labels) IsValid

func (l Labels) IsValid() error

IsValid returns an error if a label is not valid.

type LastModification

type LastModification struct {
	Key          string `json:"key,omitempty"`
	Name         string `json:"name"`
	Username     string `json:"username"`
	LastModified int64  `json:"last_modified"`
	Type         string `json:"type,omitempty"`
}

LastModification is stored in cache and used for ProjectLastUpdates computing

type Lintable added in v0.52.0

type Lintable interface {
	Lint() []error
	GetName() string
}

type MergeCommitProperty

type MergeCommitProperty struct {
	ID        string `json:"id"`
	DisplayID string `json:"displayId"`
}

type Message

type Message struct {
	ID     string
	Format trad
	Args   []interface{}
	Type   string
}

Message represent a struc format translated messages

func ErrorToMessage

func ErrorToMessage(err error) (Message, bool)

ErrorToMessage returns message from an error if possible

func NewMessage

func NewMessage(m *Message, args ...interface{}) Message

NewMessage instanciantes a new message

func (*Message) String

func (m *Message) String() string

String returns formated string for the specified language

func (Message) ToSpawnMsg

func (m Message) ToSpawnMsg() SpawnMsg

type Metadata

type Metadata map[string]string

Metadata represents metadata

func (*Metadata) Scan

func (a *Metadata) Scan(src interface{}) error

Scan Metadata.

func (Metadata) Value

func (a Metadata) Value() (driver.Value, error)

Value returns driver.Value from Metadata.

type Metric

type Metric struct {
	ProjectKey    string             `json:"project_key"`
	ApplicationID int64              `json:"application_id"`
	WorkflowID    int64              `json:"workflow_id"`
	Key           string             `json:"key"`
	Value         map[string]float64 `json:"value"`
	Date          time.Time          `json:"timestamp"`
	Num           int64              `json:"run"`
}

Metric represent a CDS metric

type MetricRequest

type MetricRequest struct {
	ProjectKey    string `json:"project_key"`
	ApplicationID int64  `json:"application_id"`
	WorkflowID    int64  `json:"workflow_id"`
	Key           string `json:"key"`
}

MetricRequest represents the request to retrieve metrics

type Migration

type Migration struct {
	ID        int64     `json:"id" db:"id" cli:"id"`
	Name      string    `json:"name" db:"name" cli:"name"`
	Status    string    `json:"status" db:"status" cli:"status"`
	Progress  string    `json:"progress" db:"progress" cli:"progress"`
	Error     string    `json:"error" db:"error" cli:"error"`
	Automatic bool      `json:"automatic" db:"mandatory" cli:"automatic"`
	Created   time.Time `json:"created" db:"created" cli:"created"`
	Done      time.Time `json:"done" db:"done" cli:"done"`
	Release   string    `json:"release" db:"release" cli:"release"`
	Major     uint64    `json:"major" db:"major" cli:"major"`
	Minor     uint64    `json:"minor" db:"minor" cli:"minor"`
	Patch     uint64    `json:"patch" db:"patch" cli:"patch"`
	Blocker   bool      `json:"-" db:"-" cli:"-"`

	ExecFunc func(ctx context.Context) error `json:"-" db:"-" cli:"-" yaml:"-"`
}

Migration represent a CDS migration

type Model

type Model struct {
	ID                  int64               `json:"id" db:"id" cli:"-"`
	Name                string              `json:"name" db:"name" cli:"name,key"`
	Description         string              `json:"description" db:"description" cli:"description"`
	Type                string              `json:"type" db:"type" cli:"type"`
	Disabled            bool                `json:"disabled" db:"disabled" cli:"disabled"`
	Restricted          bool                `json:"restricted" db:"restricted" cli:"restricted"`
	RegisteredOS        *string             `json:"registered_os" db:"registered_os" cli:"-"`
	RegisteredArch      *string             `json:"registered_arch" db:"registered_arch" cli:"-"`
	NeedRegistration    bool                `json:"need_registration" db:"need_registration" cli:"-"`
	LastRegistration    time.Time           `json:"last_registration" db:"last_registration" cli:"-"`
	CheckRegistration   bool                `json:"check_registration" db:"check_registration" cli:"-"`
	UserLastModified    time.Time           `json:"user_last_modified" db:"user_last_modified" cli:"-"`
	Author              Author              `json:"created_by" db:"created_by" cli:"-"`
	GroupID             int64               `json:"group_id" db:"group_id" cli:"-"`
	NbSpawnErr          int64               `json:"nb_spawn_err" db:"nb_spawn_err" cli:"nb_spawn_err"`
	LastSpawnErr        *string             `json:"last_spawn_err" db:"last_spawn_err" cli:"-"`
	LastSpawnErrLogs    *string             `json:"last_spawn_err_log" db:"last_spawn_err_log" cli:"-"`
	DateLastSpawnErr    *time.Time          `json:"date_last_spawn_err" db:"date_last_spawn_err" cli:"-"`
	IsDeprecated        bool                `json:"is_deprecated" db:"is_deprecated" cli:"deprecated"`
	ModelVirtualMachine ModelVirtualMachine `json:"model_virtual_machine,omitempty" db:"model_virtual_machine" cli:"-"`
	ModelDocker         ModelDocker         `json:"model_docker,omitempty" db:"model_docker" cli:"-"`
	// aggregates
	Editable               bool          `json:"editable,omitempty" db:"-"`
	Group                  *Group        `json:"group" db:"-" cli:"-"`
	RegisteredCapabilities []Requirement `json:"registered_capabilities" db:"-" cli:"-"`
	IsOfficial             bool          `json:"is_official" db:"-" cli:"official"`
	PatternName            string        `json:"pattern_name,omitempty" db:"-" cli:"-"`
}

Model represents a worker model (ex: Go 1.5.1 Docker Images) with specified capabilities (ex: go, golint and go2xunit binaries)

func (Model) IsValid

func (m Model) IsValid() error

IsValid returns error if the model is not valid.

func (Model) IsValidType

func (m Model) IsValidType() error

func (Model) Path

func (m Model) Path() string

Path returns full path of the model that contains group and model names.

func (*Model) Update

func (m *Model) Update(data Model)

Update workflow template field from new data.

type ModelCmds

type ModelCmds struct {
	Envs    map[string]string `json:"envs,omitempty"`
	Shell   string            `json:"shell,omitempty"`
	PreCmd  string            `json:"pre_cmd,omitempty"`
	Cmd     string            `json:"cmd,omitempty"`
	PostCmd string            `json:"post_cmd,omitempty"`
}

ModelCmds is the struct to represent a pattern

func (*ModelCmds) Scan

func (m *ModelCmds) Scan(src interface{}) error

Scan model cmds.

func (ModelCmds) Value

func (m ModelCmds) Value() (driver.Value, error)

Value returns driver.Value from model cmds.

type ModelDocker

type ModelDocker struct {
	Image    string            `json:"image,omitempty"`
	Private  bool              `json:"private,omitempty"`
	Registry string            `json:"registry,omitempty"`
	Username string            `json:"username,omitempty"`
	Password string            `json:"password,omitempty"`
	Memory   int64             `json:"memory,omitempty"`
	Envs     map[string]string `json:"envs,omitempty"`
	Shell    string            `json:"shell,omitempty"`
	Cmd      string            `json:"cmd,omitempty"`
}

ModelDocker for swarm and kubernetes.

func (*ModelDocker) Scan

func (m *ModelDocker) Scan(src interface{}) error

Scan model docker.

func (ModelDocker) Value

func (m ModelDocker) Value() (driver.Value, error)

Value returns driver.Value from model docker.

type ModelPattern

type ModelPattern struct {
	ID    int64     `json:"id" db:"id"`
	Name  string    `json:"name" db:"name"`
	Type  string    `json:"type" db:"type"`
	Model ModelCmds `json:"model" db:"model"`
}

ModelPattern represent patterns for users and admin when creating a worker model

type ModelVirtualMachine

type ModelVirtualMachine struct {
	Image    string `json:"image,omitempty"`
	Flavor   string `json:"flavor,omitempty"`
	PreCmd   string `json:"pre_cmd,omitempty"`
	Cmd      string `json:"cmd,omitempty"`
	PostCmd  string `json:"post_cmd,omitempty"`
	User     string `json:"user,omitempty"`
	Password string `json:"password,omitempty"`
}

ModelVirtualMachine for openstack or vsphere.

func (*ModelVirtualMachine) Scan

func (m *ModelVirtualMachine) Scan(src interface{}) error

Scan model virtual machine.

func (ModelVirtualMachine) Value

func (m ModelVirtualMachine) Value() (driver.Value, error)

Value returns driver.Value from model virtual machine.

type Models

type Models []Model

type MonDBMigrate

type MonDBMigrate struct {
	ID        string    `db:"id" cli:"id"`
	AppliedAt time.Time `db:"applied_at" cli:"applied_at"`
}

MonDBMigrate is used by /mon/db/migrate

type MonitoringStatus

type MonitoringStatus struct {
	Now   time.Time              `json:"now"`
	Lines []MonitoringStatusLine `json:"lines"`

	ServiceType     string `json:"-"`
	ServiceName     string `json:"-"`
	ServiceHostname string `json:"-"`
}

MonitoringStatus contains status of CDS Component

func (*MonitoringStatus) AddLine

func (m *MonitoringStatus) AddLine(lines ...MonitoringStatusLine)

AddLine adds line to MonitoringStatus, including the Type of component

func (MonitoringStatus) HTTPStatusCode

func (m MonitoringStatus) HTTPStatusCode() int

HTTPStatusCode returns the http status code

func (*MonitoringStatus) Scan

func (m *MonitoringStatus) Scan(src interface{}) error

Scan workflow template request.

func (MonitoringStatus) Value

func (m MonitoringStatus) Value() (driver.Value, error)

Value returns driver.Value from workflow template request.

type MonitoringStatusLine

type MonitoringStatusLine struct {
	Status     string `json:"status" cli:"status"`
	Component  string `json:"component" cli:"component"`
	Value      string `json:"value" cli:"value"`
	Type       string `json:"type" cli:"type"`
	Service    string `json:"service" cli:"service"`
	Hostname   string `json:"hostname" cli:"hostname"`
	SessionID  string `json:"session,omitempty" cli:"session"`
	ConsumerID string `json:"consumer,omitempty" cli:"consumer"`
}

MonitoringStatusLine represents a CDS Component Status

func (MonitoringStatusLine) String

func (l MonitoringStatusLine) String() string

type MultiError

type MultiError []error

MultiError is just an array of error

func (*MultiError) Append

func (e *MultiError) Append(err error)

Append appends an error to a MultiError

func (*MultiError) Error

func (e *MultiError) Error() string

func (*MultiError) IsEmpty

func (e *MultiError) IsEmpty() bool

IsEmpty return true if MultiError is empty, false otherwise

func (*MultiError) Join

func (e *MultiError) Join(j MultiError)

Join joins errors from MultiError to another errors MultiError

type NavbarProjectData struct {
	Key             string `json:"key" db:"key"`
	Name            string `json:"name" db:"project_name"`
	Description     string `json:"description" db:"description"`
	ApplicationName string `json:"application_name,omitempty" db:"application_name"`
	WorkflowName    string `json:"workflow_name,omitempty" db:"workflow_name"`
	Type            string `json:"type,omitempty" db:"type"`
	Favorite        bool   `json:"favorite" db:"favorite"`
}

NavbarProjectData is the sub struct returned by getNavbarHandler

type NeedContext added in v0.53.1

type NeedContext struct {
	Result  V2WorkflowRunJobStatus `json:"result"`
	Outputs JobResultOutput        `json:"outputs"`
}

type NeedsContext added in v0.53.1

type NeedsContext map[string]NeedContext

type Node

type Node struct {
	ID                  int64             `json:"id" db:"id"`
	WorkflowID          int64             `json:"workflow_id" db:"workflow_id"`
	Name                string            `json:"name" db:"name"`
	Ref                 string            `json:"ref" db:"ref"`
	Type                string            `json:"type" db:"type"`
	Triggers            []NodeTrigger     `json:"triggers" db:"-"`
	TriggerID           int64             `json:"-" db:"-"`
	Context             *NodeContext      `json:"context" db:"-"`
	OutGoingHookContext *NodeOutGoingHook `json:"outgoing_hook" db:"-"`
	JoinContext         []NodeJoin        `json:"parents" db:"-"`
	Hooks               []NodeHook        `json:"hooks" db:"-"`
	Groups              GroupPermissions  `json:"groups,omitempty" db:"-"`
}

Node represents a node in a workflow

func (*Node) AddTrigger

func (n *Node) AddTrigger(name string, dest Node)

AddTrigger adds a trigger to the destination node from the node found by its name

func (*Node) Ancestors

func (n *Node) Ancestors(w WorkflowData) []int64

func (*Node) CheckApplicationDeploymentStrategies

func (n *Node) CheckApplicationDeploymentStrategies(proj Project, w *Workflow) error

CheckApplicationDeploymentStrategies checks application deployment strategies

func (*Node) FilterHooksConfig

func (n *Node) FilterHooksConfig(s ...string)

FilterHooksConfig filter all hooks configuration and remove somme configuration key

func (Node) GetHook

func (n Node) GetHook(UUID string) *NodeHook

func (*Node) IsLinkedToRepo

func (n *Node) IsLinkedToRepo(w *Workflow) bool

IsLinkedToRepo returns boolean to know if the node is linked to an application which is also linked to a repository

func (*Node) Sort

func (n *Node) Sort()

Sort sorts the workflow node

func (*Node) VisitNode

func (n *Node) VisitNode(w *Workflow, visitor func(node *Node, w *Workflow))

VisitNode all the workflow and apply the visitor func on the current node and the children

type NodeContext

type NodeContext struct {
	ID                        int64                  `json:"id" db:"id"`
	NodeID                    int64                  `json:"node_id" db:"node_id"`
	PipelineID                int64                  `json:"pipeline_id" db:"pipeline_id"`
	PipelineName              string                 `json:"pipeline_name" db:"-"`
	ApplicationID             int64                  `json:"application_id" db:"application_id"`
	ApplicationName           string                 `json:"application_name" db:"-"`
	EnvironmentID             int64                  `json:"environment_id" db:"environment_id"`
	EnvironmentName           string                 `json:"environment_name" db:"-"`
	ProjectIntegrationID      int64                  `json:"project_integration_id" db:"project_integration_id"`
	ProjectIntegrationName    string                 `json:"project_integration_name" db:"-"`
	DefaultPayload            interface{}            `json:"default_payload,omitempty" db:"-"`
	DefaultPipelineParameters []Parameter            `json:"default_pipeline_parameters" db:"-"`
	Conditions                WorkflowNodeConditions `json:"conditions" db:"-"`
	Mutex                     bool                   `json:"mutex" db:"mutex"`
}

NodeContext represents a node linked to a pipeline

func (*NodeContext) DefaultPayloadToMap

func (c *NodeContext) DefaultPayloadToMap() (map[string]string, error)

func (*NodeContext) HasDefaultPayload

func (c *NodeContext) HasDefaultPayload() bool

type NodeHook

type NodeHook struct {
	ID            int64                  `json:"id" db:"id"`
	UUID          string                 `json:"uuid" db:"uuid"`
	NodeID        int64                  `json:"node_id" db:"node_id"`
	HookModelID   int64                  `json:"hook_model_id" db:"hook_model_id"`
	HookModelName string                 `json:"hook_model_name" db:"-"`
	Config        WorkflowNodeHookConfig `json:"config" db:"config"`
	Conditions    WorkflowNodeConditions `json:"conditions" db:"conditions"`
}

NodeHook represents a hook which cann trigger the workflow from a given node

func (NodeHook) ConfigValueContainsEventsDefault

func (h NodeHook) ConfigValueContainsEventsDefault() bool

func (NodeHook) Equals

func (h NodeHook) Equals(h1 NodeHook) bool

Equals checks functional equality between two hooks

func (NodeHook) GetConfigValue

func (h NodeHook) GetConfigValue(k string) (string, bool)

func (NodeHook) IsRepositoryWebHook

func (h NodeHook) IsRepositoryWebHook() bool

func (NodeHook) Ref

func (h NodeHook) Ref() string

type NodeJoin

type NodeJoin struct {
	ID         int64  `json:"id" db:"id"`
	NodeID     int64  `json:"node_id" db:"node_id"`
	ParentName string `json:"parent_name,omitempty" db:"-"`
	ParentID   int64  `json:"parent_id,omitempty" db:"parent_id"`
}

NodeJoin represents a join type node

type NodeOutGoingHook

type NodeOutGoingHook struct {
	ID            int64                  `json:"id" db:"id"`
	NodeID        int64                  `json:"node_id" db:"node_id"`
	HookModelID   int64                  `json:"hook_model_id" db:"hook_model_id"`
	HookModelName string                 `json:"-" db:"-"`
	Config        WorkflowNodeHookConfig `json:"config" db:"-"`
}

NodeOutGoingHook represents the link between a node a its outgoings hooks

type NodeRunContext added in v0.53.0

type NodeRunContext struct {
	Git  GitContext        `json:"git,omitempty"`
	Vars map[string]string `json:"vars,omitempty"`
	Jobs JobsResultContext `json:"jobs,omitempty"`
}

DEPRECATED - Only use on old workflow

func (*NodeRunContext) Scan added in v0.53.0

func (m *NodeRunContext) Scan(src interface{}) error

func (NodeRunContext) Value added in v0.53.0

func (m NodeRunContext) Value() (driver.Value, error)

type NodeTrigger

type NodeTrigger struct {
	ID             int64  `json:"id" db:"id"`
	ParentNodeID   int64  `json:"parent_node_id" db:"parent_node_id"`
	ChildNodeID    int64  `json:"child_node_id" db:"child_node_id"`
	ParentNodeName string `json:"parent_node_name" db:"-"`
	ChildNode      Node   `json:"child_node" db:"-"`
}

NodeTrigger represents the link between 2 nodes

type NotificationEvent added in v0.53.1

type NotificationEvent struct {
	ProjectEventV2
	Notification string `json:"notification"`
	UserID       string `json:"user_id"`
	Username     string `json:"username"`
}

type Operation

type Operation struct {
	UUID               string                   `json:"uuid"`
	VCSServer          string                   `json:"vcs_server,omitempty"`
	RepoFullName       string                   `json:"repo_fullname,omitempty"`
	URL                string                   `json:"url"`
	RepositoryStrategy RepositoryStrategy       `json:"strategy,omitempty"`
	Setup              OperationSetup           `json:"setup,omitempty"`
	LoadFiles          OperationLoadFiles       `json:"load_files,omitempty"`
	Status             OperationStatus          `json:"status"`
	Error              *OperationError          `json:"error_details,omitempty"`
	DeprecatedError    string                   `json:"error,omitempty"`
	RepositoryInfo     *OperationRepositoryInfo `json:"repository_info,omitempty"`
	Date               *time.Time               `json:"date,omitempty"`
	User               struct {
		Username string `json:"username,omitempty"  db:"-" cli:"-"`
		Fullname string `json:"fullname,omitempty"  db:"-" cli:"-"`
		Email    string `json:"email,omitempty"  db:"-" cli:"-"`
	} `json:"user,omitempty"`
	RequestID string `json:"request_id,omitempty"`
	NbRetries int    `json:"nb_retries,omitempty"`
}

Operation is the main business object use in repositories service

type OperationCheckout

type OperationCheckout struct {
	Tag            string `json:"tag,omitempty"`
	Branch         string `json:"branch,omitempty"`
	Commit         string `json:"commit,omitempty"`
	CheckSignature bool   `json:"check_signature,omitempty"`
	ProcessSemver  bool   `json:"process_semver,omitempty"`
	Result         struct {
		SignKeyID      string `json:"sign_key_id"`
		CommitVerified bool   `json:"verified"`
		Msg            string `json:"msg"`
		Semver         struct {
			Current string `json:"current"`
			Next    string `json:"next"`
		} `json:"semver"`
	} `json:"result"`
}

OperationCheckout represents a smart git checkout

type OperationError

type OperationError struct {
	ID         int    `json:"id"`
	Status     int    `json:"status,omitempty"`
	Message    string `json:"message"`
	StackTrace string `json:"stack_trace,omitempty"`
	From       string `json:"from,omitempty"`
}

func ToOperationError

func ToOperationError(err error) *OperationError

func (*OperationError) ToError

func (opError *OperationError) ToError() error

type OperationLoadFiles

type OperationLoadFiles struct {
	Pattern string            `json:"pattern,omitempty"`
	Results map[string][]byte `json:"results,omitempty"`
}

OperationLoadFiles represents files loading from a globbing pattern

type OperationPush

type OperationPush struct {
	FromBranch string `json:"from_branch,omitempty"`
	ToBranch   string `json:"to_branch,omitempty"`
	Message    string `json:"message,omitempty"`
	PRLink     string `json:"pr_link,omitempty"`
	Update     bool   `json:"update,omitempty"`
}

OperationPush represents information about push operation

type OperationRepo

type OperationRepo struct {
	Basedir            string
	URL                string
	RepositoryStrategy RepositoryStrategy
}

OperationRepo is an operation

func (OperationRepo) ID

func (r OperationRepo) ID() string

ID returns a generated ID for a Operation

type OperationRepositoryInfo

type OperationRepositoryInfo struct {
	Name          string `json:"name,omitempty"`
	FetchURL      string `json:"fetch_url,omitempty"`
	DefaultBranch string `json:"default_branch,omitempty"`
}

OperationRepositoryInfo represents global information about the repository

type OperationSetup

type OperationSetup struct {
	Checkout OperationCheckout `json:"checkout,omitempty"`
	Push     OperationPush     `json:"push,omitempty"`
}

OperationSetup is the setup for an operation basically its a checkout

type OperationStatus

type OperationStatus int

OperationStatus is the status of an operation

const (
	OperationStatusPending OperationStatus = iota
	OperationStatusProcessing
	OperationStatusDone
	OperationStatusError
)

There are the different OperationStatus values

type Organization added in v0.52.0

type Organization struct {
	ID   string `json:"id" db:"id" cli:"id"`
	Name string `json:"name" db:"name" cli:"name"`
}

type OrganizationEvent added in v0.53.1

type OrganizationEvent struct {
	GlobalEventV2
	Organization string `json:"organization"`
	UserID       string `json:"user_id"`
	Username     string `json:"username"`
}

type Parameter

type Parameter struct {
	ID          int64  `json:"id" yaml:"-"`
	Name        string `json:"name"`
	Type        string `json:"type"`
	Value       string `json:"value"`
	Description string `json:"description,omitempty" yaml:"desc,omitempty"`
	Advanced    bool   `json:"advanced,omitempty" yaml:"advanced,omitempty"`
}

Parameter can be a String/Date/Script/URL...

func ApplicationVariablesToParameters

func ApplicationVariablesToParameters(prefix string, variables []ApplicationVariable) []Parameter

func EnvironmentVariablesToParameters

func EnvironmentVariablesToParameters(prefix string, variables []EnvironmentVariable) []Parameter

func NewStringParameter

func NewStringParameter(s string) (Parameter, error)

NewStringParameter creates a Parameter from a string with <name>=<value> format

func ParameterFind

func ParameterFind(vars []Parameter, s string) *Parameter

ParameterFind return a parameter given its name if it exists in array

func ParametersFromMap

func ParametersFromMap(m map[string]string) []Parameter

ParametersFromMap returns an array of parameters from a map

func ParametersMerge

func ParametersMerge(src []Parameter, overwritter []Parameter) []Parameter

ParametersMerge merges two slices of parameters

func ProjectVariablesToParameters

func ProjectVariablesToParameters(prefix string, variables []ProjectVariable) []Parameter

func VariablesToParameters

func VariablesToParameters(prefix string, variables []Variable) []Parameter

func (Parameter) IsValid

func (p Parameter) IsValid() error

IsValid returns error if the parameter is not valid.

type ParserErrorListener added in v0.53.0

type ParserErrorListener struct {
	*antlr.DiagnosticErrorListener
	Errors []string
}

func NewParserErrorListener added in v0.53.0

func NewParserErrorListener() *ParserErrorListener

func (*ParserErrorListener) SyntaxError added in v0.53.0

func (c *ParserErrorListener) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, msg string, e antlr.RecognitionException)

type PermissionEvent added in v0.53.1

type PermissionEvent struct {
	GlobalEventV2
	Permission string `json:"permission"`
	UserID     string `json:"user_id"`
	Username   string `json:"username"`
}

type Permissions

type Permissions struct {
	Readable   bool `json:"readable"`
	Writable   bool `json:"writable"`
	Executable bool `json:"executable"`
}

func (Permissions) IsMaxLevel

func (p Permissions) IsMaxLevel() bool

IsMaxLevel returns true if permissions has level 7 (writable + readable + executable)

func (Permissions) Level

func (p Permissions) Level() int

type Pipeline

type Pipeline struct {
	ID             int64         `json:"id" yaml:"-" db:"id"`
	Name           string        `json:"name" cli:"name,key" db:"name"`
	Description    string        `json:"description" cli:"description" db:"description"`
	ProjectKey     string        `json:"projectKey" db:"projectKey"`
	ProjectID      int64         `json:"-" db:"project_id"`
	Stages         []Stage       `json:"stages"`
	Parameter      []Parameter   `json:"parameters,omitempty"`
	Usage          *Usage        `json:"usage,omitempty"`
	LastModified   int64         `json:"last_modified" cli:"modified"`
	FromRepository string        `json:"from_repository" cli:"from_repository" db:"from_repository"`
	AsCodeEvents   []AsCodeEvent `json:"ascode_events" cli:"-" db:"-"`
	// aggregate
	WorkflowAscodeHolder *Workflow `json:"workflow_ascode_holder,omitempty" cli:"-" db:"-"`
}

Pipeline represents the complete behavior of CDS for each projects

func (Pipeline) IsValid added in v0.52.0

func (p Pipeline) IsValid() error

type PipelineAction

type PipelineAction struct {
	ActionName      string      `json:"actionName"`
	Args            []Parameter `json:"args"`
	PipelineStageID int64       `json:"pipeline_stage_id"`
}

PipelineAction represents an action in a pipeline

type PipelineAudit

type PipelineAudit struct {
	ID         int64     `json:"id" db:"id"`
	PipelineID int64     `json:"pipeline_id" db:"pipeline_id"`
	UserName   string    `json:"username" db:"username"`
	Versionned time.Time `json:"versionned" db:"versionned"`
	Pipeline   *Pipeline `json:"pipeline" db:"-"`
	Action     string    `json:"action" db:"action"`
}

PipelineAudit represents pipeline audit

type PipelineBuildWarning

type PipelineBuildWarning struct {
	Type   string `json:"type"`
	Action Action `json:"action"`
}

PipelineBuildWarning Struct for display warnings about build

type PipelineTemplate

type PipelineTemplate struct {
	Value string `json:"value"`
}

PipelineTemplate struct.

func (*PipelineTemplate) IsValid

func (p *PipelineTemplate) IsValid() error

IsValid returns pipeline template validity.

type PipelineTemplates

type PipelineTemplates []PipelineTemplate

PipelineTemplates struct.

func (*PipelineTemplates) Scan

func (p *PipelineTemplates) Scan(src interface{}) error

Scan pipeline templates.

func (PipelineTemplates) Value

func (p PipelineTemplates) Value() (driver.Value, error)

Value returns driver.Value from workflow template pipelines.

type PluginEvent added in v0.53.1

type PluginEvent struct {
	GlobalEventV2
	Plugin   string `json:"plugin"`
	UserID   string `json:"user_id"`
	Username string `json:"username"`
}

type PluginInput added in v0.53.0

type PluginInput struct {
	Type        string `json:"type"`
	Description string `json:"description,omitempty"`
	Advanced    bool   `json:"advanced,omitempty"`
	Default     string `json:"default"`
}

type PluginInputs added in v0.53.0

type PluginInputs map[string]PluginInput

func (*PluginInputs) Scan added in v0.53.0

func (p *PluginInputs) Scan(src interface{}) error

Scan plugin inputs.

func (PluginInputs) Value added in v0.53.0

func (p PluginInputs) Value() (driver.Value, error)

Value returns driver.Value from plugin inputs.

type Prerequisite

type Prerequisite struct {
	Parameter     string `json:"parameter"`
	ExpectedValue string `json:"expected_value"`
}

Prerequisite defines a expected value to one triggering pipeline parameter

type Project

type Project struct {
	ID           int64     `json:"-" yaml:"-" db:"id" cli:"-"`
	Key          string    `json:"key" yaml:"key" db:"projectkey" cli:"key,key"`
	Name         string    `json:"name" yaml:"name" db:"name" cli:"name"`
	Description  string    `json:"description" yaml:"description" db:"description" cli:"description"`
	Icon         string    `json:"icon" yaml:"icon" db:"icon" cli:"-"`
	Created      time.Time `json:"created" yaml:"created" db:"created" `
	LastModified time.Time `json:"last_modified" yaml:"last_modified" db:"last_modified"`
	// aggregates
	Workflows        []Workflow           `json:"workflows,omitempty" yaml:"workflows,omitempty" db:"-" cli:"-"`
	WorkflowNames    IDNames              `json:"workflow_names,omitempty" yaml:"workflow_names,omitempty" db:"-" cli:"-"`
	Pipelines        []Pipeline           `json:"pipelines,omitempty" yaml:"pipelines,omitempty" db:"-"  cli:"-"`
	PipelineNames    IDNames              `json:"pipeline_names,omitempty" yaml:"pipeline_names,omitempty" db:"-"  cli:"-"`
	Applications     []Application        `json:"applications,omitempty" yaml:"applications,omitempty" db:"-"  cli:"-"`
	ApplicationNames IDNames              `json:"application_names,omitempty" yaml:"application_names,omitempty" db:"-"  cli:"-"`
	ProjectGroups    GroupPermissions     `json:"groups,omitempty" yaml:"permissions,omitempty" db:"-"  cli:"-"`
	Variables        []ProjectVariable    `json:"variables,omitempty" yaml:"variables,omitempty" db:"-"  cli:"-"`
	Environments     []Environment        `json:"environments,omitempty" yaml:"environments,omitempty" db:"-"  cli:"-"`
	EnvironmentNames IDNames              `json:"environment_names,omitempty" yaml:"environment_names,omitempty" db:"-"  cli:"-"`
	Labels           []Label              `json:"labels,omitempty" yaml:"labels,omitempty" db:"-"  cli:"-"`
	Permissions      Permissions          `json:"permissions" yaml:"-" db:"-"  cli:"-"`
	Metadata         Metadata             `json:"metadata" yaml:"metadata" db:"metadata" cli:"-"`
	Keys             []ProjectKey         `json:"keys,omitempty" yaml:"keys" db:"-" cli:"-"`
	VCSServers       []VCSProject         `json:"vcs_servers" yaml:"vcs_servers" db:"-" cli:"-"`
	Integrations     []ProjectIntegration `json:"integrations" yaml:"integrations" db:"-" cli:"-"`
	Features         map[string]bool      `json:"features" yaml:"features" db:"-" cli:"-"`
	Favorite         bool                 `json:"favorite,omitempty" yaml:"favorite" db:"-" cli:"favorite"`
	URLs             URL                  `json:"urls" yaml:"-" db:"-" cli:"-"`
	Organization     string               `json:"organization" yaml:"-" db:"-" cli:"-"`
}

Project represent a team with group of users and pipelines

func (Project) GetIntegration

func (proj Project) GetIntegration(pfName string) (ProjectIntegration, bool)

GetIntegration returns the ProjectIntegration given a name

func (Project) GetIntegrationByID

func (proj Project) GetIntegrationByID(id int64) *ProjectIntegration

GetIntegrationByID returns the ProjectIntegration given a name

func (Project) GetSSHKey

func (proj Project) GetSSHKey(name string) *ProjectKey

GetSSHKey returns a ssh key given his name

func (Project) IsValid

func (proj Project) IsValid() error

IsValid returns error if the project is not valid.

func (Project) PGPKeys

func (proj Project) PGPKeys() []ProjectKey

PGPKeys returns the slice of pgp key for a project

func (Project) SSHKeys

func (proj Project) SSHKeys() []ProjectKey

SSHKeys returns the slice of ssh key for an application

func (*Project) SetApplication

func (proj *Project) SetApplication(app Application)

SetApplication data on project

func (*Project) SetEnvironment

func (proj *Project) SetEnvironment(env Environment)

SetEnvironment data on project

func (*Project) SetPipeline

func (proj *Project) SetPipeline(pip Pipeline)

SetPipeline data on project

type ProjectEvent added in v0.53.1

type ProjectEvent struct {
	ProjectEventV2
	UserID   string `json:"user_id"`
	Username string `json:"username"`
}

type ProjectEventV2 added in v0.53.1

type ProjectEventV2 struct {
	ID         string          `json:"id"`
	Type       string          `json:"type"`
	ProjectKey string          `json:"project_key"`
	Payload    json.RawMessage `json:"payload"`
}

type ProjectFilter

type ProjectFilter struct {
	Key           string   `json:"key"`
	WorkflowNames []string `json:"workflow_names"`
}

ProjectFilter represents filter on a project

type ProjectGroup

type ProjectGroup struct {
	Project    Project `json:"project"`
	Permission int     `json:"permission"`
}

ProjectGroup represent a link with a project

type ProjectIdentifiers added in v0.52.0

type ProjectIdentifiers struct {
	ID  int64  `json:"-" yaml:"-" db:"id"`
	Key string `json:"-" yaml:"-" db:"projectkey"`
}

type ProjectIntegration

type ProjectIntegration struct {
	ID                 int64             `json:"id" db:"id" yaml:"-"`
	ProjectID          int64             `json:"project_id" db:"project_id" yaml:"-"`
	Name               string            `json:"name" db:"name" cli:"name,key" yaml:"name"`
	IntegrationModelID int64             `json:"integration_model_id" db:"integration_model_id" yaml:"-"`
	Model              IntegrationModel  `json:"model" db:"-" yaml:"model"`
	Config             IntegrationConfig `json:"config" db:"cipher_config" yaml:"config" gorpmapping:"encrypted,ProjectID,IntegrationModelID"`
	// GRPCPlugin field is used to get all plugins associatied to an integration
	// when we GET /project/{permProjectKey}/integrations/{integrationName}
	GRPCPlugins []GRPCPlugin `json:"integration_plugins,omitempty" db:"-" yaml:"-"`
}

ProjectIntegration is an instanciation of a integration model

func (*ProjectIntegration) Blur

func (pf *ProjectIntegration) Blur()

Blur replaces password with a placeholder

type ProjectIntegrationEvent added in v0.53.1

type ProjectIntegrationEvent struct {
	ProjectEventV2
	Integration      string `json:"integration"`
	IntegrationModel string `json:"integration_model"`
	UserID           string `json:"user_id"`
	Username         string `json:"username"`
}

type ProjectKey

type ProjectKey struct {
	ID        int64   `json:"id" db:"id" cli:"-"`
	Name      string  `json:"name" db:"name" cli:"name"`
	Public    string  `json:"public" db:"public" cli:"publickey"`
	Private   string  `json:"private" db:"private" cli:"-" gorpmapping:"encrypted,ID,Name"`
	KeyID     string  `json:"key_id" db:"key_id" cli:"-"`
	Type      KeyType `json:"type" db:"type" cli:"type"`
	ProjectID int64   `json:"project_id" db:"project_id" cli:"-"`
	Builtin   bool    `json:"-" db:"builtin" cli:"-"`
	Disabled  bool    `json:"disabled" db:"disabled" cli:"disabled"`
}

ProjectKey represent a key attach to a project

type ProjectLastUpdates

type ProjectLastUpdates struct {
	LastModification
	Applications []LastModification `json:"applications"`
	Pipelines    []LastModification `json:"pipelines"`
	Environments []LastModification `json:"environments"`
	Workflows    []LastModification `json:"workflows"`
}

ProjectLastUpdates update times of project, application and pipelines Deprecated

type ProjectNotification added in v0.53.1

type ProjectNotification struct {
	ID           string                     `json:"id" db:"id"`
	ProjectKey   string                     `json:"project_key" db:"project_key"`
	Name         string                     `json:"name" db:"name" cli:"name"`
	LastModified time.Time                  `json:"last_modified" db:"last_modified" cli:"last_modified"`
	WebHookURL   string                     `json:"webhook_url" db:"webhook_url" cli:"webhook_url"`
	Filters      ProjectNotificationFilters `json:"filters" db:"filters" cli:"filters"`
	Auth         ProjectNotificationAuth    `json:"auth" db:"auth" gorpmapping:"encrypted,ID,ProjectKey"`
}

type ProjectNotificationAuth added in v0.53.1

type ProjectNotificationAuth struct {
	Headers map[string]string `json:"headers"`
}

type ProjectNotificationFilter added in v0.53.1

type ProjectNotificationFilter struct {
	Events []string `json:"event"`
}

type ProjectNotificationFilters added in v0.53.1

type ProjectNotificationFilters map[string]ProjectNotificationFilter

func (*ProjectNotificationFilters) Scan added in v0.53.1

func (s *ProjectNotificationFilters) Scan(src interface{}) error

func (ProjectNotificationFilters) Value added in v0.53.1

type ProjectRepository added in v0.52.0

type ProjectRepository struct {
	ID           string    `json:"id" db:"id"`
	ProjectKey   string    `json:"project_key" db:"project_key"`
	Name         string    `json:"name" db:"name" cli:"name,key"`
	Created      time.Time `json:"created" db:"created"`
	CreatedBy    string    `json:"created_by" db:"created_by"`
	VCSProjectID string    `json:"-" db:"vcs_project_id"`
	CloneURL     string    `json:"clone_url" db:"clone_url"`
}

type ProjectRepositoryAnalysis added in v0.52.0

type ProjectRepositoryAnalysis struct {
	ID                  string                `json:"id" db:"id" cli:"id"`
	Created             time.Time             `json:"created" db:"created" cli:"created"`
	LastModified        time.Time             `json:"last_modified" db:"last_modified"`
	ProjectRepositoryID string                `json:"project_repository_id" db:"project_repository_id"`
	VCSProjectID        string                `json:"vcs_project_id" db:"vcs_project_id"`
	ProjectKey          string                `json:"project_key" db:"project_key"`
	Status              string                `json:"status" db:"status" cli:"status"`
	Ref                 string                `json:"ref" db:"ref" cli:"ref"`
	Commit              string                `json:"commit" db:"commit" cli:"commit"`
	Data                ProjectRepositoryData `json:"data" db:"data"`
}

type ProjectRepositoryData added in v0.52.0

type ProjectRepositoryData struct {
	HookEventUUID string                        `json:"hook_event_uuid"`
	OperationUUID string                        `json:"operation_uuid"`
	CommitCheck   bool                          `json:"commit_check"`
	SignKeyID     string                        `json:"sign_key_id"`
	CDSUserName   string                        `json:"cds_username"`
	CDSUserID     string                        `json:"cds_username_id"`
	Error         string                        `json:"error"`
	Entities      []ProjectRepositoryDataEntity `json:"entities"`
}

func (*ProjectRepositoryData) Scan added in v0.52.0

func (prd *ProjectRepositoryData) Scan(src interface{}) error

func (ProjectRepositoryData) Value added in v0.52.0

func (prd ProjectRepositoryData) Value() (driver.Value, error)

type ProjectRepositoryDataEntity added in v0.52.0

type ProjectRepositoryDataEntity struct {
	FileName string `json:"file_name"`
	Path     string `json:"path"`
	Status   string `json:"status"`
}

type ProjectVariable

type ProjectVariable struct {
	ID        int64  `json:"id,omitempty" cli:"-"`
	Name      string `json:"name" cli:"name,key"`
	Value     string `json:"value" cli:"value"`
	Type      string `json:"type" cli:"type"`
	ProjectID int64  `json:"project_id" cli:"-"`
}

type ProjectVariableAudit

type ProjectVariableAudit struct {
	ID             int64            `json:"id" yaml:"-" db:"id"`
	ProjectID      int64            `json:"project_id" yaml:"-" db:"project_id"`
	VariableID     int64            `json:"variable_id" yaml:"-" db:"variable_id"`
	Type           string           `json:"type" yaml:"-" db:"type"`
	VariableBefore *ProjectVariable `json:"variable_before,omitempty" yaml:"-" db:"-"`
	VariableAfter  ProjectVariable  `json:"variable_after,omitempty" yaml:"-" db:"-"`
	Versionned     time.Time        `json:"versionned" yaml:"-" db:"versionned"`
	Author         string           `json:"author" yaml:"-" db:"author"`
}

ProjectVariableAudit represents an audit on a project variable

type ProjectVariableSet added in v0.53.1

type ProjectVariableSet struct {
	ID         string                   `json:"id" db:"id"`
	ProjectKey string                   `json:"project_key" db:"project_key"`
	Name       string                   `json:"name" db:"name" cli:"name"`
	Created    time.Time                `json:"created" db:"created" cli:"created"`
	Items      []ProjectVariableSetItem `json:"items" db:"-"`
}

type ProjectVariableSetEvent added in v0.53.1

type ProjectVariableSetEvent struct {
	ProjectEventV2
	VariableSet string `json:"variable_set"`
	UserID      string `json:"user_id"`
	Username    string `json:"username"`
}

type ProjectVariableSetItem added in v0.53.1

type ProjectVariableSetItem struct {
	ID                   string    `json:"id" db:"id"`
	ProjectVariableSetID string    `json:"project_variable_set_id"`
	LastModified         time.Time `json:"last_modified" cli:"last_modified"`
	Name                 string    `json:"name" cli:"name"`
	Type                 string    `json:"type" cli:"type"`
	Value                string    `json:"value" cli:"value"`
}

type ProjectVariableSetItemEvent added in v0.53.1

type ProjectVariableSetItemEvent struct {
	ProjectEventV2
	VariableSet string `json:"variable_set"`
	Item        string `json:"item"`
	UserID      string `json:"user_id"`
	Username    string `json:"username"`
}

type Projects

type Projects []Project

func (Projects) Keys

func (projects Projects) Keys() []string

type PullRequestProperties

type PullRequestProperties struct {
	MergeCommit MergeCommitProperty `json:"mergeCommit"`
}

type PurgeDryRunRequest

type PurgeDryRunRequest struct {
	RetentionPolicy string `json:"retention_policy"`
}

type PurgeDryRunResponse

type PurgeDryRunResponse struct {
	NbRunsToAnalize int64 `json:"nb_runs_to_analyze"`
}

type PurgeTags

type PurgeTags []string

func (*PurgeTags) Scan

func (a *PurgeTags) Scan(src interface{}) error

Scan PurgeTags.

func (PurgeTags) Value

func (a PurgeTags) Value() (driver.Value, error)

Value returns driver.Value from PurgeTags.

type RBAC added in v0.52.0

type RBAC struct {
	ID           string         `json:"id" db:"id"`
	Name         string         `json:"name" db:"name" cli:"name"`
	Created      time.Time      `json:"created" db:"created"`
	LastModified time.Time      `json:"last_modified" db:"last_modified" cli:"last_modified"`
	Global       []RBACGlobal   `json:"global,omitempty" db:"-"`
	Projects     []RBACProject  `json:"projects,omitempty" db:"-"`
	Regions      []RBACRegion   `json:"regions,omitempty" db:"-"`
	Hatcheries   []RBACHatchery `json:"hatcheries,omitempty" db:"-"`
	Workflows    []RBACWorkflow `json:"workflows,omitempty" db:"-"`
}

func (*RBAC) IsEmpty added in v0.53.0

func (rbac *RBAC) IsEmpty() bool

type RBACGlobal added in v0.52.0

type RBACGlobal struct {
	Role           string   `json:"role" db:"role"`
	RBACUsersName  []string `json:"users,omitempty" db:"-"`
	RBACGroupsName []string `json:"groups,omitempty" db:"-"`
	RBACUsersIDs   []string `json:"-" db:"-"`
	RBACGroupsIDs  []int64  `json:"-" db:"-"`
}

type RBACHatchery added in v0.53.0

type RBACHatchery struct {
	Role       string `json:"role" db:"role"`
	HatcheryID string `json:"hatchery_id" db:"hatchery_id"`
	RegionID   string `json:"region_id" db:"region_id"`

	RegionName   string `json:"region" db:"-"`
	HatcheryName string `json:"hatchery" db:"-"`
}

type RBACProject added in v0.52.0

type RBACProject struct {
	AllUsers        bool     `json:"all_users" db:"all_users"`
	Role            string   `json:"role" db:"role"`
	RBACProjectKeys []string `json:"projects,omitempty" db:"-"`
	RBACUsersName   []string `json:"users,omitempty" db:"-"`
	RBACGroupsName  []string `json:"groups,omitempty" db:"-"`

	RBACUsersIDs  []string `json:"-" db:"-"`
	RBACGroupsIDs []int64  `json:"-" db:"-"`
}

type RBACRegion added in v0.53.0

type RBACRegion struct {
	ID                int64    `json:"-" db:"id"`
	RbacID            string   `json:"-"  db:"rbac_id"`
	Role              string   `json:"role" db:"role"`
	RegionID          string   `json:"region_id" db:"region_id"`
	AllUsers          bool     `json:"all_users,omitempty" db:"all_users"`
	RBACOrganizations []string `json:"organizations,omitempty" db:"-"`
	RBACUsersName     []string `json:"users,omitempty" db:"-"`
	RBACGroupsName    []string `json:"groups,omitempty" db:"-"`
	RegionName        string   `json:"region" db:"-"`

	RBACUsersIDs        []string `json:"-" db:"-"`
	RBACGroupsIDs       []int64  `json:"-" db:"-"`
	RBACOrganizationIDs []string `json:"-" db:"-"`
}

type RBACWorkflow added in v0.53.0

type RBACWorkflow struct {
	AllUsers           bool              `json:"all_users" db:"all_users"`
	Role               string            `json:"role" db:"role"`
	ProjectKey         string            `json:"project" db:"project_key"`
	RBACUsersName      []string          `json:"users,omitempty" db:"-"`
	RBACGroupsName     []string          `json:"groups,omitempty" db:"-"`
	RBACWorkflowsNames RBACWorkflowNames `json:"workflows,omitempty" db:"workflows"`
	AllWorkflows       bool              `json:"all_workflows" db:"all_workflows"`

	RBACUsersIDs  []string `json:"-" db:"-"`
	RBACGroupsIDs []int64  `json:"-" db:"-"`
}

type RBACWorkflowNames added in v0.53.0

type RBACWorkflowNames []string

func (*RBACWorkflowNames) Scan added in v0.53.0

func (rwn *RBACWorkflowNames) Scan(src interface{}) error

Scan action.

func (RBACWorkflowNames) Value added in v0.53.0

func (rwn RBACWorkflowNames) Value() (driver.Value, error)

type RabbitMQTaskExecution

type RabbitMQTaskExecution struct {
	Message []byte `json:"message"`
}

RabbitMQTaskExecution contains specific data for a kafka hook

type Region added in v0.52.0

type Region struct {
	ID   string `json:"id" db:"id" cli:"id"`
	Name string `json:"name" db:"name" cli:"name"`
}

type RegionEvent added in v0.53.1

type RegionEvent struct {
	GlobalEventV2
	Region   string `json:"region"`
	UserID   string `json:"user_id"`
	Username string `json:"username"`
}

type ReleaseAsset

type ReleaseAsset struct {
	ID                 *int       `json:"id,omitempty"`
	URL                *string    `json:"url,omitempty"`
	Name               *string    `json:"name,omitempty"`
	Label              *string    `json:"label,omitempty"`
	State              *string    `json:"state,omitempty"`
	ContentType        *string    `json:"content_type,omitempty"`
	Size               *int       `json:"size,omitempty"`
	DownloadCount      *int       `json:"download_count,omitempty"`
	CreatedAt          *Timestamp `json:"created_at,omitempty"`
	UpdatedAt          *Timestamp `json:"updated_at,omitempty"`
	BrowserDownloadURL *string    `json:"browser_download_url,omitempty"`
}

ReleaseAsset represents a GitHub release asset in a repository.

type Repository

type Repository struct {
	URL  string
	Hook bool
}

Repository structs contains all needed information about a single repository

type RepositoryEvent added in v0.53.1

type RepositoryEvent struct {
	ProjectEventV2
	VCSName    string `json:"vcs_name"`
	Repository string `json:"repository"`
	UserID     string `json:"user_id"`
	Username   string `json:"username"`
}

type RepositoryEvents

type RepositoryEvents struct {
	PushEvents        []VCSPushEvent        `json:"push_events" db:"-"`
	CreateEvents      []VCSCreateEvent      `json:"create_events" db:"-"`
	DeleteEvents      []VCSDeleteEvent      `json:"delete_events" db:"-"`
	PullRequestEvents []VCSPullRequestEvent `json:"pullrequest_events" db:"-"`
}

RepositoryEvents group all repository events

type RepositoryPollerExecution

type RepositoryPollerExecution struct {
	ID                    int64            `json:"id" db:"id"`
	ApplicationID         int64            `json:"-" db:"application_id"`
	PipelineID            int64            `json:"-" db:"pipeline_id"`
	ExecutionPlannedDate  time.Time        `json:"execution_planned_date,omitempty" db:"execution_planned_date"`
	ExecutionDate         *time.Time       `json:"execution_date" db:"execution_date"`
	Executed              bool             `json:"executed" db:"executed"`
	PipelineBuildVersions map[string]int64 `json:"pipeline_build_version" db:"-"`
	Error                 string           `json:"error" db:"error"`
	RepositoryEvents
}

RepositoryPollerExecution is a polling execution

type RepositoryRelease

type RepositoryRelease struct {
	ID              *int           `json:"id,omitempty"`
	TagName         *string        `json:"tag_name,omitempty"`
	TargetCommitish *string        `json:"target_commitish,omitempty"`
	Name            *string        `json:"name,omitempty"`
	Body            *string        `json:"body,omitempty"`
	Draft           *bool          `json:"draft,omitempty"`
	Prerelease      *bool          `json:"prerelease,omitempty"`
	CreatedAt       *Timestamp     `json:"created_at,omitempty"`
	PublishedAt     *Timestamp     `json:"published_at,omitempty"`
	URL             *string        `json:"url,omitempty"`
	HTMLURL         *string        `json:"html_url,omitempty"`
	AssetsURL       *string        `json:"assets_url,omitempty"`
	Assets          []ReleaseAsset `json:"assets,omitempty"`
	UploadURL       *string        `json:"upload_url,omitempty"`
	ZipballURL      *string        `json:"zipball_url,omitempty"`
	TarballURL      *string        `json:"tarball_url,omitempty"`
}

RepositoryRelease represents a GitHub release in a repository.

type RepositoryStrategy

type RepositoryStrategy struct {
	ConnectionType string `json:"connection_type"`
	SSHKey         string `json:"ssh_key"`
	SSHKeyContent  string `json:"ssh_key_content,omitempty"`
	User           string `json:"user"`
	Password       string `json:"password"`
	Branch         string `json:"branch,omitempty"`
	DefaultBranch  string `json:"default_branch,omitempty"`
	PGPKey         string `json:"pgp_key"`
}

RepositoryStrategy represents the way to use the repository

type ReqHostMatcher added in v0.53.1

type ReqHostMatcher struct {
	Host string
}

func (ReqHostMatcher) Matches added in v0.53.1

func (m ReqHostMatcher) Matches(x interface{}) bool

func (ReqHostMatcher) String added in v0.53.1

func (m ReqHostMatcher) String() string

type ReqMatcher added in v0.53.1

type ReqMatcher struct {
	Method  string
	URLPath string
}

func (ReqMatcher) Matches added in v0.53.1

func (m ReqMatcher) Matches(x interface{}) bool

func (ReqMatcher) String added in v0.53.1

func (m ReqMatcher) String() string

type ReqNotHostMatcher added in v0.53.1

type ReqNotHostMatcher struct {
	NotHost string
}

func (ReqNotHostMatcher) Matches added in v0.53.1

func (m ReqNotHostMatcher) Matches(x interface{}) bool

func (ReqNotHostMatcher) String added in v0.53.1

func (m ReqNotHostMatcher) String() string

type Requirement

type Requirement struct {
	ID       int64  `json:"id" db:"id"`
	ActionID int64  `json:"action_id" db:"action_id"`
	Name     string `json:"name" yaml:"name" db:"name"`
	Type     string `json:"type" yaml:"type" db:"type"`
	Value    string `json:"value" yaml:"value" db:"value"`
}

Requirement can be : - a binary "which /usr/bin/docker"

type RequirementList

type RequirementList []Requirement

RequirementList is a list of requirement

func RequirementListDeduplicate

func RequirementListDeduplicate(l RequirementList) RequirementList

RequirementListDeduplicate returns requirements list without duplicate values.

func (RequirementList) FilterByType added in v0.52.0

func (l RequirementList) FilterByType(requirementType string) RequirementList

FilterByType returns all requirements that match given type.

func (RequirementList) IsValid

func (l RequirementList) IsValid() error

IsValid returns requirement list validity.

func (RequirementList) Values

func (l RequirementList) Values() []string

Values returns all Requirement.Value

type Result

type Result struct {
	ID           int64      `json:"id,omitempty"`
	BuildID      int64      `json:"buildID,omitempty"`
	Status       string     `json:"status,omitempty"`
	Version      int64      `json:"version,omitempty"`
	Reason       string     `json:"reason,omitempty"`
	RemoteTime   time.Time  `json:"remoteTime,omitempty"`
	Duration     string     `json:"duration,omitempty"`
	NewVariables []Variable `json:"new_variables,omitempty"`
}

type ScheduledTaskExecution

type ScheduledTaskExecution struct {
	DateScheduledExecution string `json:"date_scheduled_execution"`
}

ScheduledTaskExecution contains specific data for a scheduled task execution

type Schema added in v0.53.1

type Schema []byte

Schema is the string representation of the JSON schema

type SchemaResponse

type SchemaResponse struct {
	Workflow    string `json:"workflow"`
	Application string `json:"application"`
	Pipeline    string `json:"pipeline"`
	Environment string `json:"environment"`
}

SchemaResponse contains all json schema for a user.

type Secret

type Secret struct {
	ProjectID int64  `json:"project_id" db:"project_id" cli:"-"`
	Name      string `json:"name" db:"content_name" cli:"name,key"`
	Token     string `json:"token" db:"token" cli:"token"`
	Status    string `json:"status" db:"-" cli:"status"`
}

type Service

type Service struct {
	CanonicalService
	LastHeartbeat    time.Time        `json:"last_heartbeat" db:"last_heartbeat" cli:"heartbeat" mapstructure:"-"`
	MonitoringStatus MonitoringStatus `json:"monitoring_status" db:"-" cli:"-" mapstructure:"-"`
	Version          string           `json:"version" db:"-" cli:"version" mapstructure:"version"`
	Uptodate         bool             `json:"up_to_date" db:"-" mapstructure:"up_to_date"`
}

Service is a µService registered on CDS API.

func (*Service) Update

func (s *Service) Update(data Service)

Update service field from new data.

type ServiceConfig

type ServiceConfig map[string]interface{}

func (*ServiceConfig) Scan

func (c *ServiceConfig) Scan(src interface{}) error

Scan workflow template request.

func (ServiceConfig) Value

func (c ServiceConfig) Value() (driver.Value, error)

Value returns driver.Value from workflow template request.

type ServiceConfiguration

type ServiceConfiguration struct {
	Name       string `toml:"name" json:"name"`
	URL        string `toml:"url" json:"url"`
	Port       string `toml:"port" json:"port"`
	Path       string `toml:"path" json:"path"`
	HealthURL  string `toml:"healthUrl" json:"health_url"`
	HealthPort string `toml:"healthPort" json:"health_port"`
	HealthPath string `toml:"healthPath" json:"health_path"`
	Type       string `toml:"type" json:"type"`
	PublicKey  string `json:"publicKey"`
	ID         int64  `json:"id"`
}

ServiceConfiguration is the configuration of service

type ServiceStatus

type ServiceStatus struct {
	ID               int64            `json:"-" db:"id"`
	MonitoringStatus MonitoringStatus `json:"monitoring_status" db:"monitoring_status" cli:"-"`
	ServiceID        int64            `json:"-" db:"service_id"`
	SessionID        *string          `json:"-" db:"auth_session_id"`
}

ServiceStatus contains the status for a service. The status can be attached to a sesion_id : all services except api or a serviceId for API instance.

type ShortEntity added in v0.53.0

type ShortEntity struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
	Ref  string `json:"ref"`
}

type SpawnErrorForm

type SpawnErrorForm struct {
	Error string
	Logs  []byte
}

SpawnErrorForm represents the arguments needed to add error registration on worker model

type SpawnInfo

type SpawnInfo struct {
	APITime    time.Time `json:"api_time,omitempty" db:"-" mapstructure:"-"`
	RemoteTime time.Time `json:"remote_time,omitempty" db:"-" mapstructure:"-"`
	Message    SpawnMsg  `json:"message,omitempty" db:"-"`
	// UserMessage contains msg translated for end user
	UserMessage string `json:"user_message,omitempty" db:"-"`
}

SpawnInfo contains an information about spawning

type SpawnMsg

type SpawnMsg struct {
	ID   string        `json:"id,omitempty" db:"-"`
	Args []interface{} `json:"args,omitempty" db:"-"`
	Type string        `json:"type,omitempty" db:"-"`
}

SpawnMsg represents a msg for spawnInfo

func SpawnMsgNew

func SpawnMsgNew(msg Message, args ...interface{}) SpawnMsg

func (SpawnMsg) DefaultUserMessage

func (s SpawnMsg) DefaultUserMessage() string

type Stage

type Stage struct {
	ID            int64                  `json:"id" yaml:"pipeline_stage_id"`
	Name          string                 `json:"name"`
	PipelineID    int64                  `json:"-" yaml:"-"`
	BuildOrder    int                    `json:"build_order"`
	Enabled       bool                   `json:"enabled"`
	RunJobs       []WorkflowNodeJobRun   `json:"run_jobs"`
	Prerequisites []Prerequisite         `json:"prerequisites"` //TODO: to delete
	Conditions    WorkflowNodeConditions `json:"conditions"`
	LastModified  time.Time              `json:"last_modified"`
	Jobs          []Job                  `json:"jobs"`
	Status        string                 `json:"status"`
	Warnings      []PipelineBuildWarning `json:"warnings"`
}

Stage Pipeline step that parallelize actions by order

func NewStage

func NewStage(name string) *Stage

NewStage instantiate a new Stage

func (*Stage) PlainConditions

func (s *Stage) PlainConditions() []WorkflowNodeCondition

Conditions returns stage prerequisites as a set of WorkflowTriggerCondition regex

func (Stage) ToSummary

func (s Stage) ToSummary() StageSummary

ToSummary transforms a Stage into a StageSummary

func (*Stage) UnmarshalJSON

func (s *Stage) UnmarshalJSON(data []byte) error

type StageSummary

type StageSummary struct {
	ID             int64                       `json:"id"`
	Name           string                      `json:"name"`
	BuildOrder     int                         `json:"build_order"`
	Enabled        bool                        `json:"enabled"`
	Status         string                      `json:"status"`
	Jobs           []Job                       `json:"jobs"`
	RunJobsSummary []WorkflowNodeJobRunSummary `json:"run_jobs_summary"`
}

StageSummary is a light representation of stage for CDS event

type StepContext added in v0.53.0

type StepContext struct {
	Conclusion V2WorkflowRunJobStatus `json:"conclusion"` // result of a step after 'continue-on-error'
	Outcome    V2WorkflowRunJobStatus `json:"outcome"`    // result of a step before 'continue-on-error'
	Outputs    JobResultOutput        `json:"outputs"`
}

type StepStatus

type StepStatus struct {
	StepOrder int       `json:"step_order" db:"-"`
	Status    string    `json:"status" db:"-"`
	Start     time.Time `json:"start" db:"-"`
	Done      time.Time `json:"done" db:"-"`
}

StepStatus Represent a step and his status

func (StepStatus) ToSummary

func (ss StepStatus) ToSummary() StepStatusSummary

ToSummary transform a StepStatus into a StepStatusSummary

type StepStatusSummary

type StepStatusSummary struct {
	StepOrder int    `json:"step_order" db:"-"`
	Status    string `json:"status" db:"-"`
	Start     int64  `json:"start" db:"-"`
	Done      int64  `json:"done" db:"-"`
}

StepStatusSummary Represent a step and his status for CDS event

type StepsContext added in v0.53.0

type StepsContext map[string]StepContext

func (*StepsContext) Scan added in v0.53.0

func (sc *StepsContext) Scan(src interface{}) error

func (StepsContext) Value added in v0.53.0

func (sc StepsContext) Value() (driver.Value, error)

type StringSlice

type StringSlice []string

StringSlice type used for database json storage.

func (StringSlice) Contains

func (s StringSlice) Contains(value string) bool

func (*StringSlice) Scan

func (s *StringSlice) Scan(src interface{}) error

Scan string slice.

func (*StringSlice) Unique added in v0.53.0

func (s *StringSlice) Unique()

Remove duplicated value from slice.

func (StringSlice) Value

func (s StringSlice) Value() (driver.Value, error)

Value returns driver.Value from string slice.

type TCPServer

type TCPServer struct {
	Addr               string `toml:"addr" default:"" comment:"Listen address without port, example: 127.0.0.1" json:"addr"`
	Port               int    `toml:"port" default:"8090" json:"port"`
	GlobalTCPRateLimit int64  `toml:"globalTCPRateLimit" default:"2097152" comment:"Rate limit (B/s) for incoming logs" json:"globalTCPRateLimit"`
}

type TarOptions

type TarOptions struct {
	TrimDirName string
}

TarOptions useful to indicate some options when we want to tar directory or files

type Task

type Task struct {
	UUID              string                 `json:"uuid" cli:"UUID,key"`
	Type              string                 `json:"type" cli:"Type"`
	Conditions        WorkflowNodeConditions `json:"conditions" cli:"Conditions"`
	Stopped           bool                   `json:"stopped" cli:"Stopped"`
	Executions        []TaskExecution        `json:"executions"`
	NbExecutionsTotal int                    `json:"nb_executions_total" cli:"nb_executions_total"`
	NbExecutionsTodo  int                    `json:"nb_executions_todo" cli:"nb_executions_todo"`
	Configuration     HookConfiguration      `json:"configuration" cli:"configuration"`
	// DEPRECATED
	Config WorkflowNodeHookConfig `json:"config" cli:"Config"`
}

Task is a generic hook tasks such as webhook, scheduler,... which will be started and wait for execution

type TaskExecution

type TaskExecution struct {
	UUID                string                  `json:"uuid" cli:"uuid,key"`
	Type                string                  `json:"type" cli:"type"`
	Timestamp           int64                   `json:"timestamp" cli:"timestamp"`
	NbErrors            int64                   `json:"nb_errors" cli:"nb_errors"`
	LastError           string                  `json:"last_error,omitempty" cli:"last_error"`
	ProcessingTimestamp int64                   `json:"processing_timestamp" cli:"processing_timestamp"`
	WorkflowRun         int64                   `json:"workflow_run" cli:"workflow_run"`
	WebHook             *WebHookExecution       `json:"webhook,omitempty" cli:"-"`
	Kafka               *KafkaTaskExecution     `json:"kafka,omitempty" cli:"-"`
	RabbitMQ            *RabbitMQTaskExecution  `json:"rabbitmq,omitempty" cli:"-"`
	ScheduledTask       *ScheduledTaskExecution `json:"scheduled_task,omitempty" cli:"-"`
	GerritEvent         *GerritEventExecution   `json:"gerrit,omitempty" cli:"-"`
	Status              string                  `json:"status" cli:"status"`
	Configuration       HookConfiguration       `json:"configuration" cli:"-"`
	// DEPRECATED
	Config WorkflowNodeHookConfig `json:"config" cli:"-"`
}

TaskExecution represents an execution instance of a task. It the task is a webhook; this represents the call of the webhook

type TemplateParameterType

type TemplateParameterType string

TemplateParameterType used for template parameter.

const (
	ParameterTypeString     TemplateParameterType = "string"
	ParameterTypeBoolean    TemplateParameterType = "boolean"
	ParameterTypeRepository TemplateParameterType = "repository"
	ParameterTypeSSHKey     TemplateParameterType = "ssh-key"
	ParameterTypePGPKey     TemplateParameterType = "pgp-key"
	ParameterTypeJSON       TemplateParameterType = "json"
)

Parameter types.

func (TemplateParameterType) IsValid

func (t TemplateParameterType) IsValid() bool

IsValid returns parameter type validity.

type TestsResults added in v0.52.0

type TestsResults struct {
	JUnitTestsSuites
	TestsStats
}

type TestsStats added in v0.52.0

type TestsStats struct {
	Total        int `json:"total,omitempty" mapstructure:"total"`
	TotalOK      int `json:"ok,omitempty" mapstructure:"ok"`
	TotalKO      int `json:"ko,omitempty" mapstructure:"ko"`
	TotalSkipped int `json:"skipped,omitempty" mapstructure:"skipped"`
}

type TimelineFilter

type TimelineFilter struct {
	Projects []ProjectFilter `json:"projects"`
}

TimelineFilter represents a user filter for the cds timeline

type Timestamp

type Timestamp struct {
	time.Time
}

Timestamp represents a time that can be unmarshalled from a JSON string formatted as either an RFC3339 or Unix timestamp. This is necessary for some fields since the GitHub API is inconsistent in how it represents times. All exported methods of time.Time can be called on Timestamp.

func (Timestamp) Equal

func (t Timestamp) Equal(u Timestamp) bool

Equal reports whether t and u are equal based on time.Equal

func (Timestamp) String

func (t Timestamp) String() string

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements the json.Unmarshaler interface. Time is expected in RFC3339 or Unix format.

type Token

type Token struct {
	ID          int64      `json:"id" cli:"id,key"`
	GroupID     int64      `json:"group_id"`
	GroupName   string     `json:"group_name" cli:"group_name"`
	Token       string     `json:"token" cli:"token"`
	Description string     `json:"description" cli:"description"`
	Creator     string     `json:"creator" cli:"creator"`
	Expiration  Expiration `json:"expiration" cli:"expiration"`
	Created     time.Time  `json:"created" cli:"created"`
}

Token describes tokens used by worker to access the API on behalf of a group.

type URL

type URL struct {
	APIURL string `json:"api_url,omitempty"`
	UIURL  string `json:"ui_url,omitempty"`
}

type UpdateMaxRunRequest

type UpdateMaxRunRequest struct {
	MaxRuns int64 `json:"max_runs"`
}

type Usage

type Usage struct {
	Workflows    []WorkflowName `json:"workflows,omitempty"`
	Environments []Environment  `json:"environments,omitempty"`
	Pipelines    []Pipeline     `json:"pipelines,omitempty"`
	Applications []Application  `json:"applications,omitempty"`
}

Usage is type to represent usage of each type

type UsageAction

type UsageAction struct {
	GroupID          int64  `json:"group_id"`
	GroupName        string `json:"group_name"`
	ParentActionID   int64  `json:"parent_action_id"`
	ParentActionName string `json:"parent_action_name"`
	ActionID         int64  `json:"action_id"`
	ActionName       string `json:"action_name"`
	Warning          bool   `json:"warning"`
}

UsageAction represent a action using an action.

type UsagePipeline

type UsagePipeline struct {
	ProjectID    int64  `json:"project_id"`
	ProjectKey   string `json:"project_key"`
	ProjectName  string `json:"project_name"`
	PipelineID   int64  `json:"pipeline_id"`
	PipelineName string `json:"pipeline_name"`
	StageID      int64  `json:"stage_id"`
	StageName    string `json:"stage_name"`
	JobID        int64  `json:"job_id"`
	JobName      string `json:"job_name"`
	ActionID     int64  `json:"action_id"`
	ActionName   string `json:"action_name"`
	Warning      bool   `json:"warning"`
}

UsagePipeline represent a pipeline using an action.

type UserContact

type UserContact struct {
	ID       int64     `json:"id" cli:"id,key" db:"id"`
	Created  time.Time `json:"created" cli:"created" db:"created"`
	UserID   string    `json:"user_id" db:"user_id"`
	Type     string    `json:"type" cli:"type" db:"type"`
	Value    string    `json:"value" cli:"value" db:"value"`
	Primary  bool      `json:"primary" cli:"primary" db:"primary_contact"`
	Verified bool      `json:"verified" cli:"verified" db:"verified"`
}

UserContact struct

type UserContacts

type UserContacts []UserContact

func (UserContacts) Filter

func (u UserContacts) Filter(t string) UserContacts

func (UserContacts) Find

func (u UserContacts) Find(contactType, contactValue string) *UserContact

func (UserContacts) Primary

func (u UserContacts) Primary() *UserContact

type UserEvent added in v0.53.1

type UserEvent struct {
	GlobalEventV2
	UserID   string `json:"user_id"`
	Username string `json:"username"`
}

type UserGPGEvent added in v0.53.1

type UserGPGEvent struct {
	GlobalEventV2
	UserID   string `json:"user_id"`
	Username string `json:"username"`
	GPGKey   string `json:"gpg_key"`
}

type UserGPGKey added in v0.52.0

type UserGPGKey struct {
	ID                 string    `json:"id" db:"id"`
	AuthentifiedUserID string    `json:"authentified_user_id" db:"authentified_user_id"`
	KeyID              string    `json:"key_id" db:"key_id" cli:"key_id"`
	PublicKey          string    `json:"public_key" db:"public_key"`
	Created            time.Time `json:"created" db:"created"`
}
type UserLink struct {
	ID                 string    `json:"id" db:"id"`
	AuthentifiedUserID string    `json:"authentified_user_id" db:"authentified_user_id"`
	Type               string    `json:"type" db:"type"`
	ExternalID         string    `json:"external_id" db:"external_id"`
	Username           string    `json:"username" db:"username"`
	Created            time.Time `json:"created" db:"created"`
}

type UserLoginRequest

type UserLoginRequest struct {
	RequestToken string `json:"request_token"`
	Username     string `json:"username"`
	Password     string `json:"password"`
}

UserLoginRequest login request

type UserNotification

type UserNotification struct {
	ApplicationPipelineID int64                               `json:"application_pipeline_id"`
	Pipeline              Pipeline                            `json:"pipeline"`
	Environment           Environment                         `json:"environment"`
	Notifications         map[string]UserNotificationSettings `json:"notifications"`
}

UserNotification is a settings on application_pipeline/env to trigger notification on pipeline event

type UserNotificationSettings

type UserNotificationSettings struct {
	OnSuccess    string                    `json:"on_success,omitempty" yaml:"on_success,omitempty"`         // default is "onChange", empty means onChange
	OnFailure    string                    `json:"on_failure,omitempty" yaml:"on_failure,omitempty"`         // default is "always", empty means always
	OnStart      *bool                     `json:"on_start,omitempty" yaml:"on_start,omitempty"`             // default is false, nil is false
	SendToGroups *bool                     `json:"send_to_groups,omitempty" yaml:"send_to_groups,omitempty"` // default is false, nil is false
	SendToAuthor *bool                     `json:"send_to_author,omitempty" yaml:"send_to_author,omitempty"` // default is true, nil is true
	Recipients   []string                  `json:"recipients,omitempty" yaml:"recipients,omitempty"`
	Template     *UserNotificationTemplate `json:"template,omitempty" yaml:"template,omitempty"`
	Conditions   WorkflowNodeConditions    `json:"conditions,omitempty" yaml:"conditions,omitempty"`
}

UserNotificationSettings --> email settings

func (*UserNotificationSettings) Scan

func (a *UserNotificationSettings) Scan(src interface{}) error

Scan UserNotificationSettings.

func (UserNotificationSettings) Value

Value returns driver.Value from Metadata.

type UserNotificationTemplate

type UserNotificationTemplate struct {
	Subject string `json:"subject,omitempty" yaml:"subject,omitempty"`
	Body    string `json:"body,omitempty" yaml:"body,omitempty"`

	// For VCS
	DisableComment *bool `json:"disable_comment,omitempty" yaml:"disable_comment,omitempty"`
	DisableStatus  *bool `json:"disable_status,omitempty" yaml:"disable_status,omitempty"`
}

UserNotificationTemplate is the notification content

type UserRegistration

type UserRegistration struct {
	ID       string    `json:"id" db:"id"`
	Created  time.Time `json:"created" db:"created"`
	Username string    `json:"username"  db:"username"`
	Fullname string    `json:"fullname"  db:"fullname"`
	Email    string    `json:"email"  db:"email"`
	Hash     string    `json:"-"  db:"hash"` // do no return hash in json
}

type UserResetRequest

type UserResetRequest struct {
	Email       string `json:"email"`
	Username    string `json:"username"`
	VerifyToken string `json:"verify_token"`
	Callback    string `json:"callback"`
}

type UserResponse

type UserResponse struct {
	AuthentifiedUser
	VerifyToken string `json:"verify_token"`
}

type UserTimelineFilter

type UserTimelineFilter struct {
	AuthenticatedUserID string         `json:"-" db:"authentified_user_id"`
	Filter              TimelineFilter `json:"filter" db:"-"`
}

UserTimelineFilter represents user_timeline table

type V2Action added in v0.53.0

type V2Action struct {
	Name        string                  `json:"name" jsonschema_extras:"order=1" jsonschema_description:"Name of the action"`
	Description string                  `json:"description,omitempty" jsonschema_extras:"order=2"`
	Inputs      map[string]ActionInput  `json:"inputs,omitempty" jsonschema_extras:"order=3,mode=edit" jsonschema_description:"Inputs of the action"`
	Outputs     map[string]ActionOutput `json:"outputs,omitempty" jsonschema_extras:"order=4,mode=edit" jsonschema_description:"Outputs compute by the action"`
	Runs        ActionRuns              `json:"runs" jsonschema_extras:"order=5"`
}

func (V2Action) GetName added in v0.53.0

func (a V2Action) GetName() string

func (V2Action) Lint added in v0.53.0

func (a V2Action) Lint() []error

type V2Job added in v0.53.0

type V2Job struct {
	Name            string                  `json:"name,omitempty" jsonschema_extras:"order=1" jsonschema_description:"Name of the job"`
	If              string                  `json:"if,omitempty" jsonschema_extras:"order=5,textarea=true" jsonschema_description:"Condition to execute the job"`
	Gate            string                  `json:"gate,omitempty" jsonschema_extras:"order=5" jsonschema_description:"Gate allows to trigger manually a job"`
	Inputs          map[string]string       `json:"inputs,omitempty" jsonschema_extras:"order=8,mode=edit" jsonschema_description:"Input of thejob"`
	Steps           []ActionStep            `json:"steps,omitempty" jsonschema_extras:"order=11" jsonschema_description:"List of steps"`
	Needs           []string                `json:"needs,omitempty" jsonschema_extras:"order=6,mode=tags" jsonschema_description:"Job dependencies"`
	Stage           string                  `json:"stage,omitempty" jsonschema_extras:"order=2"`
	Region          string                  `json:"region,omitempty" jsonschema_extras:"order=3"`
	ContinueOnError bool                    `json:"continue-on-error,omitempty" jsonschema_extras:"order=4"`
	RunsOnRaw       json.RawMessage         `json:"runs-on,omitempty" jsonschema_extras:"required,order=5,mode=split"`
	RunsOn          V2JobRunsOn             `json:"-"`
	Strategy        *V2JobStrategy          `json:"strategy,omitempty" jsonschema_extras:"order=7"`
	Integrations    []string                `json:"integrations,omitempty" jsonschema_extras:"required,order=9" jsonschema_description:"Job integrations"`
	VariableSets    []string                `json:"vars,omitempty" jsonschema_extras:"required,order=10" jsonschema_description:"VariableSet linked to the job"`
	Env             map[string]string       `` /* 127-byte string literal not displayed */
	Services        map[string]V2JobService `json:"services,omitempty"`

	// TODO
	Concurrency V2JobConcurrency `json:"-"`
}

func (V2Job) MarshalJSON added in v0.53.1

func (job V2Job) MarshalJSON() ([]byte, error)

func (*V2Job) Scan added in v0.53.0

func (w *V2Job) Scan(src interface{}) error

func (*V2Job) UnmarshalJSON added in v0.53.1

func (job *V2Job) UnmarshalJSON(data []byte) error

func (V2Job) Value added in v0.53.0

func (job V2Job) Value() (driver.Value, error)

type V2JobConcurrency added in v0.53.0

type V2JobConcurrency struct {
}

type V2JobGate added in v0.53.1

type V2JobGate struct {
	If        string                    `json:"if,omitempty" jsonschema_extras:"order=1,textarea=true" jsonschema_description:"Condition to execute the gate"`
	Inputs    map[string]V2JobGateInput `` /* 128-byte string literal not displayed */
	Reviewers V2JobGateReviewers        `json:"reviewers,omitempty" jsonschema_extras:"order=3" jsonschema_description:"Restrict the gate to a list of reviewers"`
}

type V2JobGateInput added in v0.53.1

type V2JobGateInput struct {
	Type    string      `json:"type"`
	Default interface{} `json:"default,omitempty"`
	Values  []string    `json:"values,omitempty"`
}

type V2JobGateReviewers added in v0.53.1

type V2JobGateReviewers struct {
	Groups []string `json:"groups,omitempty"`
	Users  []string `json:"users,omitempty"`
}

type V2JobRunsOn added in v0.53.1

type V2JobRunsOn struct {
	Model  string `json:"model"`
	Memory int64  `json:"memory"`
	Flavor string `json:"flavor"`
}

type V2JobService added in v0.53.1

type V2JobService struct {
	Image     string                `json:"image" jsonschema_extras:"order=1,required" jsonschema_description:"Docker Image"`
	Env       map[string]string     `json:"env,omitempty" jsonschema_extras:"order=2" jsonschema_description:"Environment variables"`
	Readiness V2JobServiceReadiness `json:"readiness,omitempty" jsonschema_extras:"order=3" jsonschema_description:"Service readiness"`
}

type V2JobServiceReadiness added in v0.53.1

type V2JobServiceReadiness struct {
	Command  string `` /* 126-byte string literal not displayed */
	Interval string `json:"interval" jsonschema_extras:"order=2,required" jsonschema_description:"Internal, example: 10s"`
	Retries  int    `json:"retries" jsonschema_extras:"order=4,required" jsonschema_description:"Nb of retries, example: 5"`
	Timeout  string `json:"timeout" jsonschema_extras:"order=3,required" jsonschema_description:"Timeout, example: 3s"`
}

type V2JobStrategy added in v0.53.0

type V2JobStrategy struct {
	Matrix map[string][]string `json:"matrix"`
}

type V2QueueJobInfo added in v0.53.1

type V2QueueJobInfo struct {
	RunJob V2WorkflowRunJob `json:"runjob"`
	Model  V2WorkerModel    `json:"model"`
}

type V2SendJobRunInfo added in v0.53.0

type V2SendJobRunInfo struct {
	Level   string    `json:"level" db:"level"`
	Message string    `json:"message" db:"message"`
	Time    time.Time `json:"time" db:"time"`
}

type V2TakeJobResponse added in v0.53.0

type V2TakeJobResponse struct {
	RunJob         V2WorkflowRunJob       `json:"run_job"`
	AsCodeActions  map[string]V2Action    `json:"actions"`
	SigningKey     string                 `json:"signing_key"`
	Contexts       WorkflowRunJobsContext `json:"contexts"`
	SensitiveDatas []string               `json:"sensitive_datas"`
}

type V2Worker added in v0.53.0

type V2Worker struct {
	ID           string    `json:"id" cli:"-" db:"id"`
	Name         string    `json:"name" cli:"name,key" db:"name"`
	LastBeat     time.Time `json:"last_beat" cli:"last_beat" db:"last_beat"`
	ModelName    string    `json:"model_name" cli:"-" db:"model_name"`
	JobRunID     string    `json:"run_job_id" cli:"-" db:"run_job_id"`
	Status       string    `json:"status" cli:"status" db:"status"` // Waiting, Building, Disabled, Unknown
	HatcheryID   string    `json:"hatchery_id,omitempty" cli:"-" db:"hatchery_id"`
	HatcheryName string    `json:"hatchery_name" cli:"-" db:"hatchery_name"` // If the hatchery service was deleted we will keep its name in the worker
	ConsumerID   string    `json:"-" cli:"-" db:"auth_consumer_id"`
	Version      string    `json:"version" cli:"version" db:"version"`
	OS           string    `json:"os" cli:"os" db:"os"`
	Arch         string    `json:"arch" cli:"arch" db:"arch"`
	PrivateKey   []byte    `json:"cypher_private_key,omitempty" cli:"-" db:"cypher_private_key" gorpmapping:"encrypted,ID,JobRunID,HatcheryID,ConsumerID"`
}

V2Worker represents instances of CDS workers living to serve.

type V2WorkerModel added in v0.52.0

type V2WorkerModel struct {
	Name        string          `json:"name" cli:"name" jsonschema:"minLength=1" jsonschema_extras:"order=1" jsonschema_description:"Name of the worker model"`
	Description string          `json:"description,omitempty" jsonschema_extras:"order=2" jsonschema_description:"Description of the worker model"`
	OSArch      string          `json:"osarch" jsonschema_extras:"order=3" jsonschema_description:"OS/Arch of the worker model"`
	Type        string          `` /* 177-byte string literal not displayed */
	Spec        json.RawMessage `` /* 262-byte string literal not displayed */
}

func (V2WorkerModel) GetName added in v0.52.0

func (wm V2WorkerModel) GetName() string

func (V2WorkerModel) Lint added in v0.52.0

func (wm V2WorkerModel) Lint() []error

type V2WorkerModelDockerSpec added in v0.52.0

type V2WorkerModelDockerSpec struct {
	Image    string            `json:"image" jsonschema:"minLength=1" jsonschema_extras:"order=1" jsonschema_description:"Docker image name"`
	Username string            `json:"username,omitempty" jsonschema_extras:"order=2" jsonschema_description:"Username to login to the registry"`
	Password string            `json:"password,omitempty" jsonschema_extras:"order=3" jsonschema_description:"User password to login to the registry"`
	Envs     map[string]string `` /* 133-byte string literal not displayed */
}

type V2WorkerModelOpenstackSpec added in v0.52.0

type V2WorkerModelOpenstackSpec struct {
	Image string `json:"image" jsonschema_description:"Name of the openstack image"`
}

type V2WorkerModelVSphereSpec added in v0.52.0

type V2WorkerModelVSphereSpec struct {
	Image    string `json:"image" jsonschema_description:"Name of the vsphere template"`
	Username string `json:"username,omitempty" jsonschema_description:"Username to connect to the VM"`
	Password string `json:"password,omitempty" jsonschema_description:"Username password to connect to the VM"`
}

type V2Workflow added in v0.53.0

type V2Workflow struct {
	Name         string                   `json:"name"`
	Repository   *WorkflowRepository      `json:"repository,omitempty"`
	OnRaw        json.RawMessage          `json:"on,omitempty"`
	CommitStatus *CommitStatus            `json:"commit-status,omitempty"`
	On           *WorkflowOn              `json:"-" yaml:"-"`
	Stages       map[string]WorkflowStage `json:"stages,omitempty"`
	Gates        map[string]V2JobGate     `json:"gates,omitempty"`
	Jobs         map[string]V2Job         `json:"jobs"`
	Env          map[string]string        `json:"env,omitempty"`
	Integrations []string                 `json:"integrations,omitempty"`
	VariableSets []string                 `json:"vars,omitempty"`
}

func (V2Workflow) CheckGates added in v0.53.1

func (w V2Workflow) CheckGates() []error

func (V2Workflow) CheckStageAndJobNeeds added in v0.53.0

func (w V2Workflow) CheckStageAndJobNeeds() []error

func (V2Workflow) GetName added in v0.53.0

func (w V2Workflow) GetName() string

func (V2Workflow) Lint added in v0.53.0

func (w V2Workflow) Lint() []error

func (V2Workflow) MarshalJSON added in v0.53.1

func (w V2Workflow) MarshalJSON() ([]byte, error)

func (*V2Workflow) UnmarshalJSON added in v0.53.1

func (w *V2Workflow) UnmarshalJSON(data []byte) error

type V2WorkflowHook added in v0.53.1

type V2WorkflowHook struct {
	ID             string             `json:"id" db:"id"`
	ProjectKey     string             `json:"project_key" db:"project_key"`
	VCSName        string             `json:"vcs_name" db:"vcs_name"`
	RepositoryName string             `json:"repository_name" db:"repository_name"`
	EntityID       string             `json:"entity_id" db:"entity_id"`
	WorkflowName   string             `json:"workflow_name" db:"workflow_name"`
	Ref            string             `json:"ref" db:"ref"`
	Commit         string             `json:"commit" db:"commit"`
	Type           string             `json:"type" db:"type"`
	Data           V2WorkflowHookData `json:"data" db:"data"`
}

type V2WorkflowHookData added in v0.53.1

type V2WorkflowHookData struct {
	VCSServer       string   `json:"vcs_server,omitempty"`
	RepositoryName  string   `json:"repository_name,omitempty"`
	RepositoryEvent string   `json:"repository_event,omitempty"`
	Model           string   `json:"model,omitempty"`
	BranchFilter    []string `json:"branch_filter,omitempty"`
	TagFilter       []string `json:"tag_filter,omitempty"`
	PathFilter      []string `json:"path_filter,omitempty"`
	TypesFilter     []string `json:"types_filter,omitempty"`
	TargetBranch    string   `json:"target_branch,omitempty"`
}

func (*V2WorkflowHookData) Scan added in v0.53.1

func (w *V2WorkflowHookData) Scan(src interface{}) error

func (V2WorkflowHookData) Value added in v0.53.1

func (w V2WorkflowHookData) Value() (driver.Value, error)

type V2WorkflowRun added in v0.53.0

type V2WorkflowRun struct {
	ID           string                 `json:"id" db:"id" cli:"id"`
	ProjectKey   string                 `json:"project_key" db:"project_key"`
	VCSServerID  string                 `json:"vcs_server_id" db:"vcs_server_id"`
	VCSServer    string                 `json:"vcs_server" db:"vcs_server"`
	RepositoryID string                 `json:"repository_id" db:"repository_id"`
	Repository   string                 `json:"repository" db:"repository"`
	WorkflowName string                 `json:"workflow_name" db:"workflow_name" cli:"workflow_name"`
	WorkflowSha  string                 `json:"workflow_sha" db:"workflow_sha"`
	WorkflowRef  string                 `json:"workflow_ref" db:"workflow_ref"`
	Status       V2WorkflowRunStatus    `json:"status" db:"status" cli:"status"`
	RunNumber    int64                  `json:"run_number" db:"run_number" cli:"run_number"`
	RunAttempt   int64                  `json:"run_attempt" db:"run_attempt"`
	Started      time.Time              `json:"started" db:"started" cli:"started"`
	LastModified time.Time              `json:"last_modified" db:"last_modified" cli:"last_modified"`
	ToDelete     bool                   `json:"to_delete" db:"to_delete"`
	WorkflowData V2WorkflowRunData      `json:"workflow_data" db:"workflow_data"`
	UserID       string                 `json:"user_id" db:"user_id"`
	Username     string                 `json:"username" db:"username" cli:"username"`
	Contexts     WorkflowRunContext     `json:"contexts" db:"contexts"`
	RunEvent     V2WorkflowRunEvent     `json:"event" db:"event"`
	RunJobEvent  V2WorkflowRunJobEvents `json:"job_events" db:"job_event"`
}

func (V2WorkflowRun) GetStages added in v0.53.1

func (w V2WorkflowRun) GetStages() WorkflowRunStages

type V2WorkflowRunData added in v0.53.0

type V2WorkflowRunData struct {
	Workflow     V2Workflow               `json:"workflow"`
	WorkerModels map[string]V2WorkerModel `json:"worker_models"`
	Actions      map[string]V2Action      `json:"actions"`
}

func (*V2WorkflowRunData) Scan added in v0.53.0

func (w *V2WorkflowRunData) Scan(src interface{}) error

func (V2WorkflowRunData) Value added in v0.53.0

func (w V2WorkflowRunData) Value() (driver.Value, error)

type V2WorkflowRunEnqueue added in v0.53.0

type V2WorkflowRunEnqueue struct {
	RunID  string                   `json:"run_id"`
	UserID string                   `json:"user_id"`
	Gate   V2WorkflowRunEnqueueGate `json:"gate"`
}

type V2WorkflowRunEnqueueGate added in v0.53.1

type V2WorkflowRunEnqueueGate struct {
	JobID  string                 `json:"job_id"`
	Inputs map[string]interface{} `json:"inputs"`
}

type V2WorkflowRunEvent added in v0.53.0

type V2WorkflowRunEvent struct {
	HookType      string                 `json:"hook_type"`
	EventName     string                 `json:"event_name"`
	Ref           string                 `json:"ref"`
	Sha           string                 `json:"sha"`
	SemverCurrent string                 `json:"semver_current"`
	SemverNext    string                 `json:"semver_next"`
	Payload       map[string]interface{} `json:"payload,omitempty"`
	EntityUpdated string                 `json:"entity_updated,omitempty"`
	Cron          string                 `json:"cron,omitempty"`
}

func (*V2WorkflowRunEvent) Scan added in v0.53.0

func (w *V2WorkflowRunEvent) Scan(src interface{}) error

func (V2WorkflowRunEvent) Value added in v0.53.0

func (w V2WorkflowRunEvent) Value() (driver.Value, error)

type V2WorkflowRunHookRequest added in v0.53.1

type V2WorkflowRunHookRequest struct {
	HookEventID   string                 `json:"hook_event_id"`
	UserID        string                 `json:"user_id"`
	EventName     string                 `json:"event_name"`
	Ref           string                 `json:"ref,omitempty"`
	Sha           string                 `json:"sha,omitempty"`
	Payload       map[string]interface{} `json:"payload"`
	HookType      string                 `json:"hook_type"`
	EntityUpdated string                 `json:"entity_updated"`
	SemverCurrent string                 `json:"semver_current"`
	SemverNext    string                 `json:"semver_next"`
}

type V2WorkflowRunInfo added in v0.53.0

type V2WorkflowRunInfo struct {
	ID            string    `json:"id" db:"id"`
	WorkflowRunID string    `json:"workflow_run_id" db:"workflow_run_id"`
	IssuedAt      time.Time `json:"issued_at" db:"issued_at" cli:"issue_at"`
	Level         string    `json:"level" db:"level" cli:"level"`
	Message       string    `json:"message" db:"message" cli:"message"`
}

type V2WorkflowRunJob added in v0.53.0

type V2WorkflowRunJob struct {
	ID            string                 `json:"id" db:"id"`
	JobID         string                 `json:"job_id" db:"job_id" cli:"job_id"`
	WorkflowRunID string                 `json:"workflow_run_id" db:"workflow_run_id"`
	ProjectKey    string                 `json:"project_key" db:"project_key"`
	WorkflowName  string                 `json:"workflow_name" db:"workflow_name"`
	RunNumber     int64                  `json:"run_number" db:"run_number"`
	RunAttempt    int64                  `json:"run_attempt" db:"run_attempt"`
	Status        V2WorkflowRunJobStatus `json:"status" db:"status" cli:"status"`
	Queued        time.Time              `json:"queued" db:"queued"`
	Scheduled     *time.Time             `json:"scheduled,omitempty" db:"scheduled"`
	Started       *time.Time             `json:"started,omitempty" db:"started"`
	Ended         *time.Time             `json:"ended,omitempty" db:"ended"`
	Job           V2Job                  `json:"job" db:"job"`
	WorkerID      string                 `json:"worker_id,omitempty" db:"worker_id"`
	WorkerName    string                 `json:"worker_name" db:"worker_name"`
	HatcheryName  string                 `json:"hatchery_name" db:"hatchery_name"`
	StepsStatus   JobStepsStatus         `json:"steps_status" db:"steps_status"`
	UserID        string                 `json:"user_id" db:"user_id"`
	Username      string                 `json:"username" db:"username"`
	Region        string                 `json:"region,omitempty" db:"region"`
	ModelType     string                 `json:"model_type,omitempty" db:"model_type"`
	Matrix        JobMatrix              `json:"matrix,omitempty" db:"matrix"`
	GateInputs    GateInputs             `json:"gate_inputs,omitempty" db:"gate_inputs"`
}

type V2WorkflowRunJobEvent added in v0.53.1

type V2WorkflowRunJobEvent struct {
	UserID     string                 `json:"user_id"`
	Username   string                 `json:"username"`
	JobID      string                 `json:"job_id"`
	Inputs     map[string]interface{} `json:"inputs"`
	RunAttempt int64                  `json:"run_attempt"`
}

type V2WorkflowRunJobEvents added in v0.53.1

type V2WorkflowRunJobEvents []V2WorkflowRunJobEvent

func (*V2WorkflowRunJobEvents) Scan added in v0.53.1

func (w *V2WorkflowRunJobEvents) Scan(src interface{}) error

func (V2WorkflowRunJobEvents) Value added in v0.53.1

type V2WorkflowRunJobInfo added in v0.53.0

type V2WorkflowRunJobInfo struct {
	ID               string    `json:"id" db:"id"`
	WorkflowRunID    string    `json:"workflow_run_id" db:"workflow_run_id"`
	WorkflowRunJobID string    `json:"workflow_run_job_id" db:"workflow_run_job_id"`
	IssuedAt         time.Time `json:"issued_at" db:"issued_at" cli:"date"`
	Level            string    `json:"level" db:"level" cli:"level"`
	Message          string    `json:"message" db:"message" cli:"message"`
}

type V2WorkflowRunJobResult added in v0.53.0

type V2WorkflowRunJobResult struct {
	Status V2WorkflowRunJobStatus `json:"status"`
	Error  string                 `json:"error,omitempty"`
	Time   time.Time              `json:"time"`
}

type V2WorkflowRunJobStatus added in v0.53.1

type V2WorkflowRunJobStatus string
const (
	V2WorkflowRunJobStatusUnknown    V2WorkflowRunJobStatus = ""
	V2WorkflowRunJobStatusWaiting    V2WorkflowRunJobStatus = "Waiting"
	V2WorkflowRunJobStatusBuilding   V2WorkflowRunJobStatus = "Building"
	V2WorkflowRunJobStatusFail       V2WorkflowRunJobStatus = "Fail"
	V2WorkflowRunJobStatusStopped    V2WorkflowRunJobStatus = "Stopped"
	V2WorkflowRunJobStatusSuccess    V2WorkflowRunJobStatus = "Success"
	V2WorkflowRunJobStatusScheduling V2WorkflowRunJobStatus = "Scheduling"
	V2WorkflowRunJobStatusSkipped    V2WorkflowRunJobStatus = "Skipped"
)

func NewV2WorkflowRunJobStatusFromString added in v0.53.1

func NewV2WorkflowRunJobStatusFromString(s string) (V2WorkflowRunJobStatus, error)

func (V2WorkflowRunJobStatus) IsTerminated added in v0.53.1

func (s V2WorkflowRunJobStatus) IsTerminated() bool

type V2WorkflowRunManualRequest added in v0.53.1

type V2WorkflowRunManualRequest struct {
	Branch         string `json:"branch,omitempty"`
	Tag            string `json:"tag,omitempty"`
	Sha            string `json:"sha,omitempty"`
	WorkflowBranch string `json:"workflow_branch,omitempty"`
	WorkflowTag    string `json:"workflow_tag,omitempty"`
}

type V2WorkflowRunResult added in v0.53.1

type V2WorkflowRunResult struct {
	ID                             string                                      `json:"id" db:"id"`
	WorkflowRunID                  string                                      `json:"workflow_run_id" db:"workflow_run_id"`
	WorkflowRunJobID               string                                      `json:"workflow_run_job_id" db:"workflow_run_job_id"`
	RunAttempt                     int64                                       `json:"run_attempt" db:"run_attempt"`
	IssuedAt                       time.Time                                   `json:"issued_at" db:"issued_at"`
	Type                           V2WorkflowRunResultType                     `json:"type" db:"type"`
	ArtifactManagerIntegrationName *string                                     `json:"artifact_manager_integration_name" db:"artifact_manager_integration_name"`
	ArtifactManagerMetadata        *V2WorkflowRunResultArtifactManagerMetadata `json:"artifact_manager_metadata" db:"artifact_manager_metadata"`
	Detail                         V2WorkflowRunResultDetail                   `json:"detail" db:"artifact_manager_detail"`
	DataSync                       *WorkflowRunResultSync                      `json:"sync" db:"sync"`
	Status                         string                                      `json:"status" db:"status"`
}

func (*V2WorkflowRunResult) GetDetail added in v0.53.1

func (r *V2WorkflowRunResult) GetDetail() (any, error)

func (*V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultArsenalDeploymentDetail added in v0.53.1

func (r *V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultArsenalDeploymentDetail() (*V2WorkflowRunResultArsenalDeploymentDetail, error)

func (*V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultDebianDetail added in v0.53.1

func (r *V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultDebianDetail() (*V2WorkflowRunResultDebianDetail, error)

func (*V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultDockerDetail added in v0.53.1

func (r *V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultDockerDetail() (*V2WorkflowRunResultDockerDetail, error)

func (*V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultGenericDetail added in v0.53.1

func (r *V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultGenericDetail() (*V2WorkflowRunResultGenericDetail, error)

func (*V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultHelmDetail added in v0.53.1

func (r *V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultHelmDetail() (*V2WorkflowRunResultHelmDetail, error)

func (*V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultPythonDetail added in v0.53.1

func (r *V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultPythonDetail() (*V2WorkflowRunResultPythonDetail, error)

func (*V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultReleaseDetail added in v0.53.1

func (r *V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultReleaseDetail() (*V2WorkflowRunResultReleaseDetail, error)

func (*V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultTestDetail added in v0.53.1

func (r *V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultTestDetail() (*V2WorkflowRunResultTestDetail, error)

func (*V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultVariableDetail added in v0.53.1

func (r *V2WorkflowRunResult) GetDetailAsV2WorkflowRunResultVariableDetail() (*V2WorkflowRunResultVariableDetail, error)

func (*V2WorkflowRunResult) Name added in v0.53.1

func (r *V2WorkflowRunResult) Name() string

func (*V2WorkflowRunResult) Typ added in v0.53.1

func (r *V2WorkflowRunResult) Typ() string

type V2WorkflowRunResultArsenalDeploymentDetail added in v0.53.1

type V2WorkflowRunResultArsenalDeploymentDetail struct {
	IntegrationName string                              `json:"integration_name" mapstructure:"integration_name"`
	DeploymentID    string                              `json:"deployment_id" mapstructure:"deployment_id"`
	DeploymentName  string                              `json:"deployment_name" mapstructure:"deployment_name"`
	StackID         string                              `json:"stack_id" mapstructure:"stack_id"`
	StackName       string                              `json:"stack_name" mapstructure:"stack_name"`
	StackPlatform   string                              `json:"stack_platform" mapstructure:"stack_platform"`
	Namespace       string                              `json:"namespace" mapstructure:"namespace"`
	Version         string                              `json:"version" mapstructure:"version"`
	Alternative     *ArsenalDeploymentDetailAlternative `json:"alternative" mapstructure:"alternative"`
}

type V2WorkflowRunResultArtifactManagerMetadata added in v0.53.1

type V2WorkflowRunResultArtifactManagerMetadata map[string]string

func (*V2WorkflowRunResultArtifactManagerMetadata) Get added in v0.53.1

func (*V2WorkflowRunResultArtifactManagerMetadata) Scan added in v0.53.1

func (x *V2WorkflowRunResultArtifactManagerMetadata) Scan(src interface{}) error

func (*V2WorkflowRunResultArtifactManagerMetadata) Set added in v0.53.1

func (V2WorkflowRunResultArtifactManagerMetadata) Value added in v0.53.1

type V2WorkflowRunResultDebianDetail added in v0.53.1

type V2WorkflowRunResultDebianDetail struct {
	Name          string   `json:"name" mapstructure:"name"`
	Size          int64    `json:"size" mapstructure:"size"`
	MD5           string   `json:"md5" mapstructure:"md5"`
	SHA1          string   `json:"sha1" mapstructure:"sha1"`
	SHA256        string   `json:"sha256" mapstructure:"sha256"`
	Components    []string `json:"components" mapstructure:"components"`
	Distributions []string `json:"distributions" mapstructure:"distributions"`
	Architectures []string `json:"architectures" mapstructure:"architectures"`
}

type V2WorkflowRunResultDetail added in v0.53.1

type V2WorkflowRunResultDetail struct {
	Data interface{} `json:"data"`
	Type string      `json:"type"`
}

func (*V2WorkflowRunResultDetail) MarshalJSON added in v0.53.1

func (s *V2WorkflowRunResultDetail) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*V2WorkflowRunResultDetail) Scan added in v0.53.1

func (s *V2WorkflowRunResultDetail) Scan(src interface{}) error

Scan V2WorkflowRunResultDetail

func (*V2WorkflowRunResultDetail) UnmarshalJSON added in v0.53.1

func (s *V2WorkflowRunResultDetail) UnmarshalJSON(source []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (V2WorkflowRunResultDetail) Value added in v0.53.1

Value returns driver.Value from V2WorkflowRunResultDetail

type V2WorkflowRunResultDockerDetail added in v0.53.1

type V2WorkflowRunResultDockerDetail struct {
	Name         string `json:"name" mapstructure:"name"`
	ID           string `json:"id" mapstructure:"id"`
	HumanSize    string `json:"human_size" mapstructure:"human_size"`
	HumanCreated string `json:"human_created" mapstructure:"human_created"`
}

type V2WorkflowRunResultGenericDetail added in v0.53.1

type V2WorkflowRunResultGenericDetail struct {
	Name   string      `json:"name" mapstructure:"name"`
	Size   int64       `json:"size" mapstructure:"size"`
	Mode   os.FileMode `json:"mode" mapstructure:"mode"`
	MD5    string      `json:"md5" mapstructure:"md5"`
	SHA1   string      `json:"sha1" mapstructure:"sha1"`
	SHA256 string      `json:"sha256" mapstructure:"sha256"`
}

type V2WorkflowRunResultHelmDetail added in v0.53.1

type V2WorkflowRunResultHelmDetail struct {
	Name         string `json:"name" mapstructure:"name"`
	AppVersion   string `json:"appVersion" mapstructure:"appVersion"`
	ChartVersion string `json:"chartVersion" mapstructure:"chartVersion"`
}

type V2WorkflowRunResultPythonDetail added in v0.53.1

type V2WorkflowRunResultPythonDetail struct {
	Name      string `json:"name" mapstructure:"name"`
	Version   string `json:"version" mapstructure:"version"`
	Extension string `json:"extension" mapstructure:"extension"`
}

type V2WorkflowRunResultReleaseDetail added in v0.53.1

type V2WorkflowRunResultReleaseDetail struct {
	Name    string          `json:"name" mapstructure:"name"`
	Version string          `json:"version" mapstructure:"version"`
	SBOM    json.RawMessage `json:"sbom" mapstructure:"sbom"`
}

type V2WorkflowRunResultTestDetail added in v0.53.1

type V2WorkflowRunResultTestDetail struct {
	Name        string           `json:"name" mapstructure:"name"`
	Size        int64            `json:"size" mapstructure:"size"`
	Mode        os.FileMode      `json:"mode" mapstructure:"mode"`
	MD5         string           `json:"md5" mapstructure:"md5"`
	SHA1        string           `json:"sha1" mapstructure:"sha1"`
	SHA256      string           `json:"sha256" mapstructure:"sha256"`
	TestsSuites JUnitTestsSuites `json:"tests_suites" mapstructure:"tests_suites"`
	TestStats   TestsStats       `json:"tests_stats" mapstructure:"tests_stats"`
}

type V2WorkflowRunResultType added in v0.53.1

type V2WorkflowRunResultType string

type V2WorkflowRunResultVariableDetail added in v0.53.1

type V2WorkflowRunResultVariableDetail struct {
	Name  string `json:"name" mapstructure:"name"`
	Value string `json:"value" mapstructure:"value"`
}

type V2WorkflowRunSearchFilter added in v0.53.1

type V2WorkflowRunSearchFilter struct {
	Key     string   `json:"key"`
	Options []string `json:"options"`
	Example string   `json:"example"`
}

type V2WorkflowRunStatus added in v0.53.1

type V2WorkflowRunStatus string
const (
	V2WorkflowRunStatusSkipped  V2WorkflowRunStatus = "Skipped"
	V2WorkflowRunStatusFail     V2WorkflowRunStatus = "Fail"
	V2WorkflowRunStatusSuccess  V2WorkflowRunStatus = "Success"
	V2WorkflowRunStatusStopped  V2WorkflowRunStatus = "Stopped"
	V2WorkflowRunStatusBuilding V2WorkflowRunStatus = "Building"
	V2WorkflowRunStatusCrafting V2WorkflowRunStatus = "Crafting"
)

func (V2WorkflowRunStatus) IsTerminated added in v0.53.1

func (s V2WorkflowRunStatus) IsTerminated() bool

type VCSArchiveRequest added in v0.52.0

type VCSArchiveRequest struct {
	Path   string `json:"path"`
	Format string `json:"format"`
	Commit string `json:"commit"`
}

type VCSAuth added in v0.52.0

type VCSAuth struct {
	Type     string
	URL      string
	URLApi   string // optional
	Username string
	Token    string

	SSHUsername string
	SSHPort     int
}

VCSAuth contains tokens (oauth2 tokens or personalAccessToken)

type VCSAuthProject added in v0.52.0

type VCSAuthProject struct {
	// VCS Authentication
	Username   string `json:"username,omitempty" db:"-"`
	Token      string `json:"token,omitempty" db:"-"`
	SSHKeyName string `json:"sshKeyName,omitempty" db:"-"`

	// Used by gerrit
	SSHUsername   string `json:"sshUsername,omitempty" db:"-"`
	SSHPort       int    `json:"sshPort,omitempty" db:"-"`
	SSHPrivateKey string `json:"sshPrivateKey,omitempty" db:"-"`
}

type VCSAuthor

type VCSAuthor struct {
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
	Email       string `json:"emailAddress"`
	Avatar      string `json:"avatar"`
	Slug        string `json:"slug"`
	ID          string `json:"id"`
}

VCSAuthor represents the auhor for every commit

type VCSAuthorizedClient

type VCSAuthorizedClient interface {
	VCSAuthorizedClientCommon
	PullRequests(ctx context.Context, repo string, opts VCSPullRequestOptions) ([]VCSPullRequest, error)
}

type VCSAuthorizedClientCommon

type VCSAuthorizedClientCommon interface {
	//Repos
	Repos(context.Context) ([]VCSRepo, error)
	RepoByFullname(ctx context.Context, fullname string) (VCSRepo, error)

	//Branches
	Branches(context.Context, string, VCSBranchesFilter) ([]VCSBranch, error)
	Branch(ctx context.Context, repo string, filters VCSBranchFilters) (*VCSBranch, error)

	//Tags
	Tags(ctx context.Context, repo string) ([]VCSTag, error)
	Tag(ctx context.Context, repo string, tagName string) (VCSTag, error)

	//Commits
	Commits(ctx context.Context, repo, branch, since, until string) ([]VCSCommit, error)
	Commit(ctx context.Context, repo, hash string) (VCSCommit, error)
	CommitsBetweenRefs(ctx context.Context, repo, base, head string) ([]VCSCommit, error)

	// PullRequests
	PullRequest(ctx context.Context, repo string, id string) (VCSPullRequest, error)
	PullRequestComment(ctx context.Context, repo string, c VCSPullRequestCommentRequest) error
	PullRequestCreate(ctx context.Context, repo string, pr VCSPullRequest) (VCSPullRequest, error)

	//Hooks
	CreateHook(ctx context.Context, repo string, hook *VCSHook) error
	UpdateHook(ctx context.Context, repo string, hook *VCSHook) error
	GetHook(ctx context.Context, repo, url string) (VCSHook, error)
	DeleteHook(ctx context.Context, repo string, hook VCSHook) error

	//Events
	GetEvents(ctx context.Context, repo string, dateRef time.Time) ([]interface{}, time.Duration, error)
	PushEvents(context.Context, string, []interface{}) ([]VCSPushEvent, error)
	CreateEvents(context.Context, string, []interface{}) ([]VCSCreateEvent, error)
	DeleteEvents(context.Context, string, []interface{}) ([]VCSDeleteEvent, error)
	PullRequestEvents(context.Context, string, []interface{}) ([]VCSPullRequestEvent, error)

	// Set build status on repository
	SetStatus(ctx context.Context, buildStatus VCSBuildStatus) error
	ListStatuses(ctx context.Context, repo string, ref string) ([]VCSCommitStatus, error)

	// Release
	Release(ctx context.Context, repo, tagName, releaseTitle, releaseDescription string) (*VCSRelease, error)
	UploadReleaseFile(ctx context.Context, repo string, releaseName string, uploadURL string, artifactName string, r io.Reader, length int) error

	// Forks
	ListForks(ctx context.Context, repo string) ([]VCSRepo, error)

	// File
	GetArchive(ctx context.Context, repo string, dir string, format string, commit string) (io.Reader, http.Header, error)
	ListContent(ctx context.Context, repo string, commit, dir string) ([]VCSContent, error)
	GetContent(ctx context.Context, repo string, commit, dir string) (VCSContent, error)

	// Search
	SearchPullRequest(ctx context.Context, repoFullName, commit, state string) (*VCSPullRequest, error)
}

VCSAuthorizedClientCommon is an interface for a connected client on a VCS Server.

type VCSAuthorizedClientService

type VCSAuthorizedClientService interface {
	VCSAuthorizedClientCommon
	PullRequests(ctx context.Context, repo string, mods ...VCSRequestModifier) ([]VCSPullRequest, error)
	IsGerrit(ctx context.Context, db gorp.SqlExecutor) (bool, error)
	IsBitbucketCloud() bool
}

type VCSBranch

type VCSBranch struct {
	ID           string   `json:"id"`
	DisplayID    string   `json:"display_id"`
	LatestCommit string   `json:"latest_commit"`
	Default      bool     `json:"default"`
	Parents      []string `json:"parents"`
}

VCSBranch represents branches known by the repositories manager

func GetDefaultBranch

func GetDefaultBranch(branches []VCSBranch) VCSBranch

GetDefaultBranch return the default branch

type VCSBranchFilters

type VCSBranchFilters struct {
	BranchName string
	Default    bool
}

type VCSBranchesFilter

type VCSBranchesFilter struct {
	Limit int64
}

type VCSBuildStatus added in v0.53.1

type VCSBuildStatus struct {
	// v2: fmt.Sprintf("%s-%s", event.ProjectKey, event.WorkflowName)
	Title string `json:"title"`

	// v1:eventNR.NodeName + ": " + eventNR.Status
	// v2: Workflow.Name + ": " +Status
	Description string `json:"description"`

	// v1: fmt.Sprintf("%s/project/%s/workflow/%s/run/%d", cdsUIURL, event.ProjectKey, event.WorkflowName, eventNR.Number)
	// v2: TODO
	URLCDS string `json:"url_cds"` //

	// v1: fmt.Sprintf("%s-%s-%s", event.ProjectKey, event.WorkflowName, eventNR.NodeName)
	// v2: fmt.Sprintf("%s-%s", event.ProjectKey, event.WorkflowName)
	Context string `json:"context"`

	Status string `json:"status"`

	RepositoryFullname string `json:"repository_fullname"`
	GitHash            string `json:"git_hash"`

	// from v1 workflow only
	GerritChange *GerritChangeEvent `json:"gerrit_change,omitempty"`
}

type VCSCommit

type VCSCommit struct {
	Hash      string    `json:"id"`
	Author    VCSAuthor `json:"author"`
	Committer VCSAuthor `json:"committer"`
	Timestamp int64     `json:"authorTimestamp"`
	Message   string    `json:"message"`
	URL       string    `json:"url"`
	Verified  bool      `json:"verified"`
	Signature string    `json:"signature"`
}

VCSCommit represents the commit in the repository

type VCSCommitStatus

type VCSCommitStatus struct {
	Ref        string    `json:"ref"`
	CreatedAt  time.Time `json:"created_at"`
	State      string    `json:"state"`
	Decription string    `json:"description"`
}

VCSCommitStatus represents a status on a VCS repository

type VCSConfiguration

type VCSConfiguration struct {
	Type string `json:"type"`
	URL  string `json:"url"`
}

VCSConfiguration represent a small vcs configuration

type VCSContent added in v0.52.0

type VCSContent struct {
	Name        string
	IsDirectory bool
	IsFile      bool
	Content     string
}

type VCSCreateEvent

type VCSCreateEvent VCSPushEvent

VCSCreateEvent represents a push events for polling

type VCSDeleteEvent

type VCSDeleteEvent struct {
	Branch VCSBranch `json:"branch"`
}

VCSDeleteEvent represents a push events for polling

type VCSEvent added in v0.53.1

type VCSEvent struct {
	ProjectEventV2
	VCSName  string `json:"vcs_name"`
	UserID   string `json:"user_id"`
	Username string `json:"username"`
}

type VCSGerritConfiguration added in v0.52.0

type VCSGerritConfiguration struct {
	SSHUsername   string `json:"sshUsername"`
	SSHPrivateKey string `json:"sshPrivateKey"`
	URL           string `json:"url"`
	SSHPort       int    `json:"sshport"`
}

type VCSHook

type VCSHook struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Events      []string `json:"events"`
	Method      string   `json:"method"`
	URL         string   `json:"url"`
	ContentType string   `json:"content_type"`
	Body        string   `json:"body"`
	Disable     bool     `json:"disable"`
	InsecureSSL bool     `json:"insecure_ssl"`
}

VCSHook represents a hook on a VCS repository

type VCSOptionsProject added in v0.52.0

type VCSOptionsProject struct {
	DisableWebhooks      bool   `json:"disableWebhooks,omitempty" db:"-"`
	DisableStatus        bool   `json:"disableStatus,omitempty" db:"-"`
	DisableStatusDetails bool   `json:"disableStatusDetails,omitempty" db:"-"`
	DisablePolling       bool   `json:"disablePolling,omitempty" db:"-"`
	URLAPI               string `json:"urlApi,omitempty" db:"-"` // optional
}

func (*VCSOptionsProject) Scan added in v0.52.0

func (v *VCSOptionsProject) Scan(src interface{}) error

func (VCSOptionsProject) Value added in v0.52.0

func (v VCSOptionsProject) Value() (driver.Value, error)

type VCSProject added in v0.52.0

type VCSProject struct {
	ID           string            `json:"id" db:"id"`
	Name         string            `json:"name" db:"name" cli:"name,key"`
	Type         string            `json:"type" db:"type"`
	Created      time.Time         `json:"created" db:"created"`
	LastModified time.Time         `json:"last_modified" db:"last_modified"`
	CreatedBy    string            `json:"created_by" db:"created_by"`
	ProjectID    int64             `json:"-" db:"project_id"`
	Description  string            `json:"description" db:"description"`
	URL          string            `json:"url" db:"url"`
	Auth         VCSAuthProject    `json:"auth" db:"auth" gorpmapping:"encrypted,ProjectID"`
	Options      VCSOptionsProject `json:"options" db:"options"`
}

func (VCSProject) Lint added in v0.53.0

func (v VCSProject) Lint(prj Project) error

type VCSPullRequest

type VCSPullRequest struct {
	ID       int          `json:"id"`
	ChangeID string       `json:"change_id"`
	URL      string       `json:"url"`
	User     VCSAuthor    `json:"user"`
	Head     VCSPushEvent `json:"head"`
	Base     VCSPushEvent `json:"base"`
	Title    string       `json:"title"`
	Merged   bool         `json:"merged"`
	Closed   bool         `json:"closed"`
	Revision string       `json:"revision"`
	Updated  time.Time    `json:"updated"`
	MergeBy  VCSAuthor    `json:"merge_by"`
	State    string       `json:"state"`
}

VCSPullRequest represents a pull request

type VCSPullRequestCommentRequest

type VCSPullRequestCommentRequest struct {
	ID       int    `json:"id"`
	ChangeID string `json:"change_id"` // gerrit only
	Revision string `json:"revision"`
	Message  string `json:"message"`
}

type VCSPullRequestEvent

type VCSPullRequestEvent struct {
	Action string       `json:"action"` // opened | closed
	URL    string       `json:"url"`
	Repo   string       `json:"repo"`
	User   VCSAuthor    `json:"user"`
	Head   VCSPushEvent `json:"head"`
	Base   VCSPushEvent `json:"base"`
	Branch VCSBranch    `json:"branch"`
}

VCSPullRequestEvent represents a push events for polling

type VCSPullRequestOptions

type VCSPullRequestOptions struct {
	State VCSPullRequestState
}

type VCSPullRequestState

type VCSPullRequestState string
const (
	VCSPullRequestStateAll    VCSPullRequestState = "all"
	VCSPullRequestStateOpen   VCSPullRequestState = "open"
	VCSPullRequestStateClosed VCSPullRequestState = "closed"
	VCSPullRequestStateMerged VCSPullRequestState = "merged"
)

func (VCSPullRequestState) IsValid

func (s VCSPullRequestState) IsValid() bool

type VCSPushEvent

type VCSPushEvent struct {
	Repo     string    `json:"repo"`
	Branch   VCSBranch `json:"branch"`
	Commit   VCSCommit `json:"commit"`
	CloneURL string    `json:"clone_url"`
}

VCSPushEvent represents a push events for polling

type VCSRelease

type VCSRelease struct {
	ID        int64  `json:"id"`
	UploadURL string `json:"upload_url"`
}

VCSRelease represents data about release on github, etc..

type VCSRemote

type VCSRemote struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

VCSRemote represents remotes known by the repositories manager

type VCSRepo

type VCSRepo struct {
	ID           string `json:"id"`
	Name         string `json:"name"`     //On Github: Name = Slug
	Slug         string `json:"slug"`     //On Github: Slug = Name
	Fullname     string `json:"fullname"` //On Stash : projectkey/slug, on Github : owner/slug
	URL          string `json:"url"`      //Web URL
	HTTPCloneURL string `json:"http_url"` //Git clone URL  "https://<baseURL>/scm/PRJ/my-repo.git"
	SSHCloneURL  string `json:"ssh_url"`  //Git clone URL  "ssh://git@<baseURL>/PRJ/my-repo.git"
}

VCSRepo represents data about repository even on stash, or github, etc...

type VCSRequestModifier

type VCSRequestModifier func(r *http.Request)

func VCSRequestModifierWithState

func VCSRequestModifierWithState(state VCSPullRequestState) VCSRequestModifier

type VCSSearch added in v0.53.0

type VCSSearch struct {
}

type VCSServer

type VCSServer interface {
	GetAuthorizedClient(context.Context, VCSAuth) (VCSAuthorizedClient, error)
}

VCSServer is an interface for a OAuth VCS Server. The goal of this interface is to return a VCSAuthorizedClient.

type VCSTag

type VCSTag struct {
	Tag     string    `json:"tag"`
	Sha     string    `json:"sha"` // Represent sha of tag
	Message string    `json:"message"`
	Tagger  VCSAuthor `json:"tagger"`
	Hash    string    `json:"hash"` // Represent hash of commit
}

VCSTag represents branches known by the repositories manager

type Variable

type Variable struct {
	ID    int64  `json:"id,omitempty" cli:"-"`
	Name  string `json:"name" cli:"name,key"`
	Value string `json:"value" cli:"value"`
	Type  string `json:"type" cli:"type"`
}

Variable represent a variable for a project or pipeline

func FromAplicationVariables

func FromAplicationVariables(appVars []ApplicationVariable) []Variable

func FromEnvironmentVariables

func FromEnvironmentVariables(envVars []EnvironmentVariable) []Variable

func FromProjectVariables

func FromProjectVariables(appVars []ProjectVariable) []Variable

func VariableFind

func VariableFind(vars []Variable, s string) *Variable

VariableFind return a variable given its name if it exists in array

func VariablesFilter

func VariablesFilter(vars []Variable, types ...string) []Variable

VariablesFilter return a slice of variables filtered by type

func VariablesPrefix

func VariablesPrefix(vars []Variable, prefix string) []Variable

VariablesPrefix add a prefix on all the variable in the slice

func (*Variable) ToApplicationVariable

func (v *Variable) ToApplicationVariable(appID int64) *ApplicationVariable

func (Variable) ToParameter

func (v Variable) ToParameter(prefix string) Parameter

type VariableAudit

type VariableAudit struct {
	ID         int        `json:"id"`
	Variables  []Variable `json:"variables"`
	Versionned time.Time  `json:"versionned"`
	Author     string     `json:"author"`
}

VariableAudit represent audit for a variable

type VariableEvent added in v0.53.1

type VariableEvent struct {
	ProjectEventV2
	Variable string `json:"variable"`
	UserID   string `json:"user_id"`
	Username string `json:"username"`
}

type Version

type Version struct {
	Version      string `json:"version" yaml:"version"`
	Architecture string `json:"architecture" yaml:"architecture"`
	OS           string `json:"os" yaml:"os"`
	GitHash      string `json:"git_hash" yaml:"git_hash"`
	BuildTime    string `json:"build_time" yaml:"build_time"`
	DBMigrate    string `json:"db_migrate,omitempty" yaml:"db_migrate,omitempty"`
}

Version is used by /mon/version

func VersionCurrent

func VersionCurrent() Version

VersionCurrent returns the current version

type Warning

type Warning struct {
	ID            int64             `json:"id" db:"id"`
	Key           string            `json:"key" db:"project_key"`
	AppName       string            `json:"application_name" db:"application_name"`
	PipName       string            `json:"pipeline_name" db:"pipeline_name"`
	WorkflowName  string            `json:"workflow_name" db:"workflow_name"`
	EnvName       string            `json:"environment_name" db:"environment_name"`
	Type          string            `json:"type" db:"type"`
	Element       string            `json:"element" db:"element"`
	Created       time.Time         `json:"created" db:"created"`
	MessageParams map[string]string `json:"message_params" db:"-"`
	Message       string            `json:"message" db:"-"`
	Hash          string            `json:"hash" db:"hash"`
	Ignored       bool              `json:"ignored" db:"ignored"`
}

Warning Represents warning database structure

func (*Warning) ComputeMessage

func (w *Warning) ComputeMessage(ctx context.Context, language string)

type WebHookExecution

type WebHookExecution struct {
	RequestURL    string              `json:"request_url"`
	RequestBody   []byte              `json:"request_body"`
	RequestHeader map[string][]string `json:"request_header"`
	RequestMethod string              `json:"request_method"`
}

WebHookExecution contains specific data for a webhook execution

type WebsocketEvent

type WebsocketEvent struct {
	Status string `json:"status"`
	Error  string `json:"error"`
	Event  Event  `json:"event"`
}

type WebsocketFilter

type WebsocketFilter struct {
	Type              WebsocketFilterType `json:"type"`
	ProjectKey        string              `json:"project_key"`
	ApplicationName   string              `json:"application_name"`
	PipelineName      string              `json:"pipeline_name"`
	EnvironmentName   string              `json:"environment_name"`
	WorkflowName      string              `json:"workflow_name"`
	WorkflowRunNumber int64               `json:"workflow_run_num"`
	WorkflowNodeRunID int64               `json:"workflow_node_run_id"`
	OperationUUID     string              `json:"operation_uuid"`
	HatcheryType      string              `json:"hatchery_type"`
}

func (WebsocketFilter) IsValid

func (f WebsocketFilter) IsValid() error

IsValid return an error if given filter is not valid.

func (WebsocketFilter) Key

func (f WebsocketFilter) Key() string

Key generates the unique key associated to given filter.

type WebsocketFilterType

type WebsocketFilterType string
const (
	WebsocketFilterTypeGlobal                  WebsocketFilterType = "global"
	WebsocketFilterTypeProject                 WebsocketFilterType = "project"
	WebsocketFilterTypeWorkflow                WebsocketFilterType = "workflow"
	WebsocketFilterTypeWorkflowRun             WebsocketFilterType = "workflow-run"
	WebsocketFilterTypeWorkflowNodeRun         WebsocketFilterType = "workflow-node-run"
	WebsocketFilterTypePipeline                WebsocketFilterType = "pipeline"
	WebsocketFilterTypeApplication             WebsocketFilterType = "application"
	WebsocketFilterTypeEnvironment             WebsocketFilterType = "environment"
	WebsocketFilterTypeQueue                   WebsocketFilterType = "queue"
	WebsocketFilterTypeOperation               WebsocketFilterType = "operation"
	WebsocketFilterTypeAscodeEvent             WebsocketFilterType = "ascode-event"
	WebsocketFilterTypeDryRunRetentionWorkflow WebsocketFilterType = "workflow-retention-dryrun"
)

func (WebsocketFilterType) IsValid

func (f WebsocketFilterType) IsValid() bool

type WebsocketFilters

type WebsocketFilters []WebsocketFilter

type WebsocketHatcheryFilter added in v0.53.0

type WebsocketHatcheryFilter struct {
	Region    string `json:"region"`
	ModelType string `json:"model_type"`
}

type WebsocketJobQueueEvent added in v0.53.0

type WebsocketJobQueueEvent struct {
	JobRunID     string `json:"job_run_id"`
	Region       string `json:"region"`
	ModelType    string `json:"model_type"`
	ProjectKey   string `json:"project_key"`
	WorkflowName string `json:"workflow_name"`
	JobID        string `json:"job_id"`
	RunNumber    int64  `json:"run_number"`
}

type Worker

type Worker struct {
	ID           string    `json:"id" cli:"-" db:"id"`
	Name         string    `json:"name" cli:"name,key" db:"name"`
	LastBeat     time.Time `json:"lastbeat" cli:"lastbeat" db:"last_beat"`
	ModelID      *int64    `json:"model_id" cli:"-"  db:"model_id"`
	ModelName    *string   `json:"model_name" cli:"-"  db:"model_name"`
	JobRunID     *int64    `json:"job_run_id" cli:"-"  db:"job_run_id"`
	Status       string    `json:"status" cli:"status" db:"status"` // Waiting, Building, Disabled, Unknown
	HatcheryID   *int64    `json:"hatchery_id,omitempty" cli:"-" db:"hatchery_id"`
	HatcheryName string    `json:"hatchery_name" cli:"-" db:"hatchery_name"` // If the hatchery service was deleted we will keep its name in the worker
	Uptodate     bool      `json:"uptodate" cli:"-" db:"-"`
	ConsumerID   string    `json:"-" cli:"-"  db:"auth_consumer_id"`
	Version      string    `json:"version" cli:"version"  db:"version"`
	OS           string    `json:"os" cli:"os"  db:"os"`
	Arch         string    `json:"arch" cli:"arch"  db:"arch"`
	PrivateKey   []byte    `json:"private_key,omitempty" cli:"-" db:"cypher_private_key" gorpmapping:"encrypted,ID,Name,JobRunID"`
}

Worker represents instances of CDS workers living to serve.

type WorkerDirectories added in v0.53.0

type WorkerDirectories struct {
	WorkingDir string
	BaseDir    string
}

type WorkerHookProjectIntegrationModel

type WorkerHookProjectIntegrationModel struct {
	ID                   int64                         `json:"id" db:"id" cli:"id,key"`
	ProjectIntegrationID int64                         `json:"project_integration_id" db:"project_integration_id" cli:"-"`
	Configuration        WorkerHookSetupTeardownConfig `json:"configuration" db:"configuration" cli:"configuration"`
	Disable              bool                          `json:"disable" db:"disable" cli:"disable"`
}

type WorkerHookSetupTeardownConfig

type WorkerHookSetupTeardownConfig struct {
	DisableOnRegions []string                                  `json:"disable_on_regions" yaml:"disable_on_regions"`
	ByCapabilities   map[string]WorkerHookSetupTeardownScripts `json:"by_capabilities" yaml:"by_capabilities"`
}

func (*WorkerHookSetupTeardownConfig) Scan

func (w *WorkerHookSetupTeardownConfig) Scan(src interface{}) error

Scan action.

func (WorkerHookSetupTeardownConfig) Value

Value returns driver.Value from WorkerHookSetupTeardownConfig.

type WorkerHookSetupTeardownScripts

type WorkerHookSetupTeardownScripts struct {
	Priority int    `json:"priority" yaml:"priority"`
	Label    string `json:"label" yaml:"label"`
	Setup    string `json:"setup" yaml:"setup"`
	Teardown string `json:"teardown" yaml:"teardown"`
}

type WorkerModelSecret

type WorkerModelSecret struct {
	ID            string    `json:"id" db:"id"`
	Created       time.Time `json:"created" cli:"created" db:"created"`
	WorkerModelID int64     `json:"worker_model_id" db:"worker_model_id"`
	Name          string    `json:"name" db:"name"`
	Value         string    `json:"value" db:"cipher_value" gorpmapping:"encrypted,WorkerModelID,Name"`
}

type WorkerModelSecrets

type WorkerModelSecrets []WorkerModelSecret

func (WorkerModelSecrets) ToMap

func (w WorkerModelSecrets) ToMap() map[string]string

type WorkerRegistrationForm

type WorkerRegistrationForm struct {
	BinaryCapabilities []string
	Version            string
	OS                 string
	Arch               string
}

WorkerRegistrationForm represents the arguments needed to register a worker

type WorkerStarterWorkerModel added in v0.53.0

type WorkerStarterWorkerModel struct {
	ModelV1 *Model

	// Worker model v2
	ModelV2       *V2WorkerModel
	PreCmd        string
	Cmd           string
	Shell         string
	PostCmd       string
	DockerSpec    V2WorkerModelDockerSpec
	OpenstackSpec V2WorkerModelOpenstackSpec
	VSphereSpec   V2WorkerModelVSphereSpec
	Commit        string
	Flavor        string
	Memory        int64
}

func (WorkerStarterWorkerModel) GetCmd added in v0.53.0

func (w WorkerStarterWorkerModel) GetCmd() string

func (WorkerStarterWorkerModel) GetDockerEnvs added in v0.53.0

func (w WorkerStarterWorkerModel) GetDockerEnvs() map[string]string

func (WorkerStarterWorkerModel) GetDockerImage added in v0.53.0

func (w WorkerStarterWorkerModel) GetDockerImage() string

func (WorkerStarterWorkerModel) GetDockerPassword added in v0.53.0

func (w WorkerStarterWorkerModel) GetDockerPassword() string

func (WorkerStarterWorkerModel) GetDockerUsername added in v0.53.0

func (w WorkerStarterWorkerModel) GetDockerUsername() string

func (WorkerStarterWorkerModel) GetFlavor added in v0.53.0

func (w WorkerStarterWorkerModel) GetFlavor(reqs RequirementList, defaultFlavor string) string

func (WorkerStarterWorkerModel) GetFullPath added in v0.53.0

func (w WorkerStarterWorkerModel) GetFullPath() string

func (WorkerStarterWorkerModel) GetLastModified added in v0.53.0

func (w WorkerStarterWorkerModel) GetLastModified() string

func (WorkerStarterWorkerModel) GetName added in v0.53.0

func (w WorkerStarterWorkerModel) GetName() string

func (WorkerStarterWorkerModel) GetOpenstackImage added in v0.53.0

func (w WorkerStarterWorkerModel) GetOpenstackImage() string

func (WorkerStarterWorkerModel) GetPath added in v0.53.0

func (w WorkerStarterWorkerModel) GetPath() string

func (WorkerStarterWorkerModel) GetPostCmd added in v0.53.0

func (w WorkerStarterWorkerModel) GetPostCmd() string

func (WorkerStarterWorkerModel) GetPreCmd added in v0.53.0

func (w WorkerStarterWorkerModel) GetPreCmd() string

func (WorkerStarterWorkerModel) GetShell added in v0.53.0

func (w WorkerStarterWorkerModel) GetShell() string

func (WorkerStarterWorkerModel) GetVSphereImage added in v0.53.0

func (w WorkerStarterWorkerModel) GetVSphereImage() string

func (WorkerStarterWorkerModel) GetVSpherePassword added in v0.53.0

func (w WorkerStarterWorkerModel) GetVSpherePassword() string

func (WorkerStarterWorkerModel) GetVSphereUsername added in v0.53.0

func (w WorkerStarterWorkerModel) GetVSphereUsername() string

func (WorkerStarterWorkerModel) IsPrivate added in v0.53.0

func (w WorkerStarterWorkerModel) IsPrivate() bool

type Workflow

type Workflow struct {
	ID                       int64                        `json:"id" db:"id" cli:"-"`
	Name                     string                       `json:"name" db:"name" cli:"name,key"`
	Description              string                       `json:"description,omitempty" db:"description" cli:"description"`
	Icon                     string                       `json:"icon,omitempty" db:"icon" cli:"-"`
	LastModified             time.Time                    `json:"last_modified" db:"last_modified" mapstructure:"-"`
	ProjectID                int64                        `json:"project_id,omitempty" db:"project_id" cli:"-"`
	ProjectKey               string                       `json:"project_key" db:"-" cli:"-"`
	Groups                   GroupPermissions             `json:"groups,omitempty" db:"-" cli:"-"`
	Permissions              Permissions                  `json:"permissions" db:"-" cli:"-"`
	Metadata                 Metadata                     `json:"metadata,omitempty" yaml:"metadata" db:"metadata"`
	Usage                    *Usage                       `json:"usage,omitempty" db:"-" cli:"-"`
	HistoryLength            int64                        `json:"history_length" db:"history_length" cli:"-"`
	PurgeTags                PurgeTags                    `json:"purge_tags,omitempty" db:"purge_tags" cli:"-"`
	RetentionPolicy          string                       `json:"retention_policy,omitempty" db:"retention_policy" cli:"-"`
	MaxRuns                  int64                        `json:"max_runs,omitempty" db:"max_runs" cli:"-"`
	Notifications            []WorkflowNotification       `json:"notifications,omitempty" db:"-" cli:"-"`
	FromRepository           string                       `json:"from_repository,omitempty" db:"from_repository" cli:"from"`
	DerivedFromWorkflowID    int64                        `json:"derived_from_workflow_id,omitempty" db:"derived_from_workflow_id" cli:"-"`
	DerivedFromWorkflowName  string                       `json:"derived_from_workflow_name,omitempty" db:"derived_from_workflow_name" cli:"-"`
	DerivationBranch         string                       `json:"derivation_branch,omitempty" db:"derivation_branch" cli:"-"`
	Audits                   []AuditWorkflow              `json:"audits,omitempty" db:"-"`
	Pipelines                map[int64]Pipeline           `json:"pipelines,omitempty" db:"-" cli:"-"  mapstructure:"-"`
	Applications             map[int64]Application        `json:"applications,omitempty" db:"-" cli:"-"  mapstructure:"-"`
	Environments             map[int64]Environment        `json:"environments,omitempty" db:"-" cli:"-"  mapstructure:"-"`
	ProjectIntegrations      map[int64]ProjectIntegration `json:"project_integrations,omitempty" db:"-" cli:"-"  mapstructure:"-"`
	HookModels               map[int64]WorkflowHookModel  `json:"hook_models,omitempty" db:"-" cli:"-"  mapstructure:"-"`
	OutGoingHookModels       map[int64]WorkflowHookModel  `json:"outgoing_hook_models,omitempty" db:"-" cli:"-"  mapstructure:"-"`
	AscodeActions            map[string]V2Action          `json:"action_as_code,omitempty" db:"-" cli:"-"  mapstructure:"-"`
	Labels                   []Label                      `json:"labels,omitempty" db:"-" cli:"labels"`
	ToDelete                 bool                         `json:"to_delete" db:"to_delete" cli:"-"`
	ToDeleteWithDependencies *bool                        `json:"to_delete_with_dependencies" db:"to_delete_with_dependencies" cli:"-"`
	Favorite                 bool                         `json:"favorite" db:"-" cli:"favorite"`
	WorkflowData             WorkflowData                 `json:"workflow_data" db:"workflow_data" cli:"-"`
	Integrations             []WorkflowProjectIntegration `json:"integrations,omitempty" db:"-" cli:"-"`
	AsCodeEvent              []AsCodeEvent                `json:"as_code_events,omitempty" db:"-" cli:"-"`
	// aggregates
	TemplateInstance *WorkflowTemplateInstance `json:"template_instance,omitempty" db:"-" cli:"-"`
	FromTemplate     string                    `json:"from_template,omitempty" db:"-" cli:"-"`
	TemplateUpToDate bool                      `json:"template_up_to_date,omitempty" db:"-" cli:"-"`
	URLs             URL                       `json:"urls" yaml:"-" db:"-" cli:"-"`
	Runs             []WorkflowRun             `json:"runs,omitempty" yaml:"-" db:"-" cli:"-"`
	Organization     string                    `json:"organization,omitempty" yaml:"-" db:"-" cli:"-"`
}

Workflow represents a pipeline based workflow

func (*Workflow) AddTrigger

func (w *Workflow) AddTrigger(name string, dest Node)

AddTrigger adds a trigger to the destination node from the node found by its name

func (*Workflow) AssignEmptyType

func (w *Workflow) AssignEmptyType()

AssignEmptyType fill node type field

func (*Workflow) FilterHooksConfig

func (w *Workflow) FilterHooksConfig(s ...string)

FilterHooksConfig filter all hooks configuration and remove some configuration key

func (*Workflow) GetApplication

func (w *Workflow) GetApplication(ID int64) Application

GetApplication retrieve application from workflow

func (*Workflow) GetEventIntegration

func (w *Workflow) GetEventIntegration() []WorkflowProjectIntegration

func (*Workflow) GetRepositories

func (w *Workflow) GetRepositories() []string

GetRepositories returns the list of repositories from applications

func (*Workflow) InitMaps

func (w *Workflow) InitMaps()

func (*Workflow) Normalize

func (w *Workflow) Normalize()

AssignEmptyType fill node type field This function should be called after completing the maps

func (*Workflow) ResetIDs

func (w *Workflow) ResetIDs()

ResetIDs resets all nodes, joins, integration ids

func (*Workflow) Scan

func (w *Workflow) Scan(src interface{}) error

func (*Workflow) SortNode

func (w *Workflow) SortNode()

Sort sorts the workflow

func (*Workflow) ValidateType

func (w *Workflow) ValidateType() error

ValidateType check if nodes have a correct nodeType

func (Workflow) Value

func (w Workflow) Value() (driver.Value, error)

func (*Workflow) VisitNode

func (w *Workflow) VisitNode(visitor func(*Node, *Workflow))

Visit all the workflow and apply the visitor func on all nodes

type WorkflowData

type WorkflowData struct {
	Node  Node   `json:"node" db:"-" cli:"-"`
	Joins []Node `json:"joins" db:"-" cli:"-"`
}

func (*WorkflowData) AncestorsNames

func (w *WorkflowData) AncestorsNames(n Node) []string

func (*WorkflowData) Array

func (w *WorkflowData) Array() []*Node

func (*WorkflowData) GetHooks

func (w *WorkflowData) GetHooks() map[string]*NodeHook

GetHooks returns the list of all hooks in the workflow tree

func (*WorkflowData) GetHooksMapRef

func (w *WorkflowData) GetHooksMapRef() map[string]NodeHook

GetHooksMapRef returns the list of all hooks in the workflow tree

func (*WorkflowData) Maps

func (w *WorkflowData) Maps() map[int64]*Node

func (*WorkflowData) NodeByID

func (w *WorkflowData) NodeByID(ID int64) *Node

func (*WorkflowData) NodeByName

func (w *WorkflowData) NodeByName(s string) *Node

func (*WorkflowData) NodeByRef

func (w *WorkflowData) NodeByRef(ref string) *Node

func (*WorkflowData) Scan

func (a *WorkflowData) Scan(src interface{}) error

Scan WorkflowData.

func (WorkflowData) Value

func (a WorkflowData) Value() (driver.Value, error)

Value returns driver.Value from WorkflowData.

type WorkflowDeleteDependencies

type WorkflowDeleteDependencies struct {
	DeletedDependencies        WorkflowDependencies `json:"deleted_dependencies"`
	UnlinkedAsCodeDependencies WorkflowDependencies `json:"unlinked_as_code_dependencies"`
}

type WorkflowDependencies

type WorkflowDependencies struct {
	Pipelines    []IDName `json:"pipelines"`
	Applications []IDName `json:"applications"`
	Environments []IDName `json:"environments"`
}

type WorkflowGroup

type WorkflowGroup struct {
	Workflow   Workflow `json:"workflow"`
	Permission int      `json:"permission"`
}

WorkflowGroup represents the permission to a workflow

type WorkflowHookModel

type WorkflowHookModel struct {
	ID            int64                  `json:"id" db:"id" cli:"-"`
	Name          string                 `json:"name" db:"name" cli:"name"`
	Type          string                 `json:"type"  db:"type"`
	Author        string                 `json:"author" db:"author"`
	Description   string                 `json:"description" db:"description"`
	Identifier    string                 `json:"identifier" db:"identifier"`
	Icon          string                 `json:"icon" db:"icon"`
	Command       string                 `json:"command" db:"command"`
	DefaultConfig WorkflowNodeHookConfig `json:"default_config" db:"-"`
	Disabled      bool                   `json:"disabled" db:"disabled"`
}

WorkflowHookModel represents a hook which can be used in workflows.

func GetBuiltinHookModelByName

func GetBuiltinHookModelByName(name string) *WorkflowHookModel

GetBuiltinHookModelByName retrieve the hook model

func GetBuiltinOutgoingHookModelByName

func GetBuiltinOutgoingHookModelByName(name string) *WorkflowHookModel

GetBuiltinOutgoingHookModelByName retrieve the outgoing hook model

func GetDefaultHookModel

func GetDefaultHookModel(modelName string) WorkflowHookModel

GetDefaultHookModel return the workflow hook model by its name

type WorkflowName

type WorkflowName struct {
	ID         int64  `json:"id" db:"id" cli:"-"`
	Name       string `json:"name" db:"name" cli:"name,key"`
	ProjectKey string `json:"project_key" db:"project_key" cli:"project_key"`
	ProjectID  int64  `json:"project_id" db:"project_id" cli:"-"`
}

type WorkflowNodeCondition

type WorkflowNodeCondition struct {
	Variable string `json:"variable" yaml:"variable"`
	Operator string `json:"operator" yaml:"operator"`
	Value    string `json:"value" yaml:"value"`
}

WorkflowNodeCondition represents a condition to trigger ot not a pipeline in a workflow. Operator can be =, !=, regex

type WorkflowNodeConditions

type WorkflowNodeConditions struct {
	PlainConditions []WorkflowNodeCondition `json:"plain,omitempty" yaml:"check,omitempty"`
	LuaScript       string                  `json:"lua_script,omitempty" yaml:"script,omitempty"`
}

WorkflowNodeConditions is either an array of WorkflowNodeCondition or a lua script

func (*WorkflowNodeConditions) Scan

func (w *WorkflowNodeConditions) Scan(src interface{}) error

Scan workflow template request.

func (WorkflowNodeConditions) Value

Value returns driver.Value from WorkflowNodeConditions request.

type WorkflowNodeContextDefaultPayloadVCS

type WorkflowNodeContextDefaultPayloadVCS struct {
	GitBranch     string `json:"git.branch" db:"-"`
	GitTag        string `json:"git.tag" db:"-"`
	GitHash       string `json:"git.hash" db:"-"`
	GitAuthor     string `json:"git.author" db:"-"`
	GitHashBefore string `json:"git.hash.before" db:"-"`
	GitRepository string `json:"git.repository" db:"-"`
	GitMessage    string `json:"git.message" db:"-"`
}

WorkflowNodeContextDefaultPayloadVCS represents a default payload when a workflow is attached to a repository Webhook

type WorkflowNodeHookConfig

type WorkflowNodeHookConfig map[string]WorkflowNodeHookConfigValue

WorkflowNodeHookConfig represents the configguration for a WorkflowNodeHook

func (WorkflowNodeHookConfig) Clone

Clone returns a copied dinstance of cfg

func (WorkflowNodeHookConfig) Equals

func (WorkflowNodeHookConfig) Filter

func (WorkflowNodeHookConfig) MergeWith

func (*WorkflowNodeHookConfig) Scan

func (w *WorkflowNodeHookConfig) Scan(src interface{}) error

Scan workflow template request.

func (WorkflowNodeHookConfig) Value

Value returns driver.Value from WorkflowNodeHookConfig request.

func (WorkflowNodeHookConfig) Values

Values return values of the WorkflowNodeHookConfig

type WorkflowNodeHookConfigValue

type WorkflowNodeHookConfigValue struct {
	Value              string   `json:"value"`
	Configurable       bool     `json:"configurable"`
	Type               string   `json:"type"`
	MultipleChoiceList []string `json:"multiple_choice_list"`
}

WorkflowNodeHookConfigValue represents the value of a node hook config

type WorkflowNodeJobRun

type WorkflowNodeJobRun struct {
	ProjectID          int64              `json:"project_id"`
	ID                 int64              `json:"id"`
	WorkflowNodeRunID  int64              `json:"workflow_node_run_id,omitempty"`
	Job                ExecutedJob        `json:"job"`
	Parameters         []Parameter        `json:"parameters,omitempty"`
	Status             string             `json:"status"`
	Retry              int                `json:"retry"`
	Queued             time.Time          `json:"queued,omitempty" cli:"queued"`
	QueuedSeconds      int64              `json:"queued_seconds,omitempty"`
	Start              time.Time          `json:"start,omitempty"`
	Done               time.Time          `json:"done,omitempty"`
	Model              string             `json:"model,omitempty"`
	ModelType          string             `json:"model_type,omitempty"`
	Region             *string            `json:"region,omitempty"`
	BookedBy           BookedBy           `json:"bookedby,omitempty"`
	SpawnInfos         []SpawnInfo        `json:"spawninfos"`
	ExecGroups         Groups             `json:"exec_groups"`
	Header             WorkflowRunHeaders `json:"header,omitempty"`
	ContainsService    bool               `json:"contains_service,omitempty"`
	HatcheryName       string             `json:"hatchery_name,omitempty"`
	WorkerName         string             `json:"worker_name,omitempty"`
	IntegrationPlugins []GRPCPlugin       `json:"integration_plugin,omitempty"`
	Contexts           JobRunContext      `json:"-"`
}

WorkflowNodeJobRun represents an job to be run

func (*WorkflowNodeJobRun) GetPuginBinary

func (wnjr *WorkflowNodeJobRun) GetPuginBinary(pluginType string, os string, arch string) *GRPCPluginBinary

func (WorkflowNodeJobRun) ToSummary

ToSummary transforms a WorkflowNodeJobRun into a WorkflowNodeJobRunSummary

func (*WorkflowNodeJobRun) Translate

func (wnjr *WorkflowNodeJobRun) Translate()

Translate translates messages in WorkflowNodeJobRun

type WorkflowNodeJobRunBooked

type WorkflowNodeJobRunBooked struct {
	ProjectKey   string `json:"project_key"`
	WorkflowName string `json:"workflow_name"`
	WorkflowID   int64  `json:"workflow_id"`
	RunID        int64  `json:"run_id"`
	NodeRunName  string `json:"node_run_name"`
	NodeRunID    int64  `json:"node_run_id"`
	JobName      string `json:"job_name"`
}

type WorkflowNodeJobRunCount

type WorkflowNodeJobRunCount struct {
	Count int64     `json:"version"`
	Since time.Time `json:"since"`
	Until time.Time `json:"until"`
}

WorkflowNodeJobRunCount return nb workflow run job since 'since'

type WorkflowNodeJobRunData

type WorkflowNodeJobRunData struct {
	NodeJobRun               WorkflowNodeJobRun
	Secrets                  []Variable
	Features                 map[FeatureName]bool
	AscodeActions            map[string]V2Action
	Number                   int64
	SubNumber                int64
	SigningKey               string
	GelfServiceAddr          string
	GelfServiceAddrEnableTLS bool
	CDNHttpAddr              string
	ProjectKey               string
	WorkflowName             string
	WorkflowID               int64
	RunID                    int64
	NodeRunName              string
}

WorkflowNodeJobRunData is returned to worker in answer to postTakeWorkflowJobHandler

type WorkflowNodeJobRunInfo

type WorkflowNodeJobRunInfo struct {
	ID                   int64       `json:"id"`
	WorkflowNodeJobRunID int64       `json:"workflow_node_job_run_id,omitempty"`
	WorkflowNodeRunID    int64       `json:"workflow_node_run_id,omitempty"`
	SpawnInfos           []SpawnInfo `json:"info"`
	Created              time.Time   `json:"created"`
}

WorkflowNodeJobRunInfo represents info on a job

type WorkflowNodeJobRunSummary

type WorkflowNodeJobRunSummary struct {
	ID                int64              `json:"id"`
	WorkflowNodeRunID int64              `json:"workflow_node_run_id,omitempty"`
	Status            string             `json:"status"`
	Queued            int64              `json:"queued,omitempty"`
	Start             int64              `json:"start,omitempty"`
	Done              int64              `json:"done,omitempty"`
	Job               ExecutedJobSummary `json:"job_summary,omitempty"`
	SpawnInfos        []SpawnInfo        `json:"spawninfos"`
	HatcheryName      string             `json:"hatchery_name,omitempty"`
	WorkerName        string             `json:"worker_name,omitempty"`
	WorkerModelName   string             `json:"worker_model_name,omitempty"`
}

WorkflowNodeJobRunSummary is a light representation of WorkflowNodeJobRun for CDS event

type WorkflowNodeOutgoingHookRunCallback

type WorkflowNodeOutgoingHookRunCallback struct {
	NodeHookID        int64     `json:"workflow_node_outgoing_hook_id"`
	Start             time.Time `json:"start"`
	Done              time.Time `json:"done"`
	Status            string    `json:"status"`
	Log               string    `json:"log"`
	WorkflowRunNumber *int64    `json:"workflow_run_number"`
}

WorkflowNodeOutgoingHookRunCallback is the callback coming from hooks uservice avec an outgoing hook execution

type WorkflowNodeRun

type WorkflowNodeRun struct {
	WorkflowRunID          int64                                `json:"workflow_run_id"`
	WorkflowID             int64                                `json:"workflow_id"`
	ApplicationID          int64                                `json:"application_id"`
	ID                     int64                                `json:"id"`
	WorkflowNodeID         int64                                `json:"workflow_node_id"`
	WorkflowNodeName       string                               `json:"workflow_node_name"`
	Number                 int64                                `json:"num"`
	SubNumber              int64                                `json:"subnumber"`
	Status                 string                               `json:"status"`
	Stages                 []Stage                              `json:"stages,omitempty"`
	Start                  time.Time                            `json:"start"`
	LastModified           time.Time                            `json:"last_modified"`
	Done                   time.Time                            `json:"done"`
	HookEvent              *WorkflowNodeRunHookEvent            `json:"hook_event,omitempty"`
	Manual                 *WorkflowNodeRunManual               `json:"manual,omitempty"`
	SourceNodeRuns         []int64                              `json:"source_node_runs,omitempty"`
	Payload                interface{}                          `json:"payload,omitempty"`
	PipelineParameters     []Parameter                          `json:"pipeline_parameters,omitempty"`
	BuildParameters        []Parameter                          `json:"build_parameters,omitempty"`
	Contexts               NodeRunContext                       `json:"contexts,omitempty"`
	Coverage               WorkflowNodeRunCoverage              `json:"coverage,omitempty"`
	Tests                  *TestsResults                        `json:"tests,omitempty"`
	Commits                []VCSCommit                          `json:"commits,omitempty"`
	TriggersRun            map[int64]WorkflowNodeTriggerRun     `json:"triggers_run,omitempty"`
	VCSRepository          string                               `json:"vcs_repository"`
	VCSTag                 string                               `json:"vcs_tag"`
	VCSBranch              string                               `json:"vcs_branch"`
	VCSHash                string                               `json:"vcs_hash"`
	VCSServer              string                               `json:"vcs_server"`
	CanBeRun               bool                                 `json:"can_be_run"`
	Header                 WorkflowRunHeaders                   `json:"header,omitempty"`
	UUID                   string                               `json:"uuid,omitempty"`
	OutgoingHook           *NodeOutGoingHook                    `json:"outgoinghook,omitempty"`
	HookExecutionTimeStamp int64                                `json:"hook_execution_timestamp,omitempty"`
	HookExecutionID        string                               `json:"execution_id,omitempty"`
	Callback               *WorkflowNodeOutgoingHookRunCallback `json:"callback,omitempty"`
	VCSReport              string                               `json:"vcs_report,omitempty"`
}

WorkflowNodeRun is as execution instance of a node. This type is duplicated for database persistence in the engine/api/workflow package

func (*WorkflowNodeRun) GetStageIndex

func (nodeRun *WorkflowNodeRun) GetStageIndex(job *WorkflowNodeJobRun) int

func (WorkflowNodeRun) Report

func (nr WorkflowNodeRun) Report() (string, error)

func (*WorkflowNodeRun) Translate

func (nr *WorkflowNodeRun) Translate()

Translate translates messages in WorkflowNodeRun

type WorkflowNodeRunCoverage

type WorkflowNodeRunCoverage struct {
	WorkflowID        int64                         `json:"workflow_id" db:"workflow_id"`
	WorkflowNodeRunID int64                         `json:"workflow_node_run_id" db:"workflow_node_run_id"`
	WorkflowRunID     int64                         `json:"workflow_run_id" db:"workflow_run_id"`
	ApplicationID     int64                         `json:"application_id" db:"application_id"`
	Num               int64                         `json:"run_number" db:"run_number"`
	Repository        string                        `json:"repository" db:"repository"`
	Branch            string                        `json:"branch" db:"branch"`
	Report            coverage.Report               `json:"report" db:"-"`
	Trend             WorkflowNodeRunCoverageTrends `json:"trend" db:"-"`
}

WorkflowNodeRunCoverage represents the code coverage report

type WorkflowNodeRunCoverageTrends

type WorkflowNodeRunCoverageTrends struct {
	CurrentBranch coverage.Report `json:"current_branch_report"`
	DefaultBranch coverage.Report `json:"default_branch_report"`
}

WorkflowNodeRunCoverageTrends represents code coverage trend with current branch and default branch

type WorkflowNodeRunHookEvent

type WorkflowNodeRunHookEvent struct {
	Payload              map[string]string `json:"payload" db:"-"`
	WorkflowNodeHookUUID string            `json:"uuid" db:"-"`
	ParentWorkflow       struct {
		Key       string `json:"key" db:"-"`
		Name      string `json:"name" db:"-"`
		Run       int64  `json:"run" db:"-"`
		HookRunID string `hook_run_id:"uuid" db:"-"`
	} `json:"parent_workflow" db:"-"`
}

WorkflowNodeRunHookEvent is an instanc of event received on a hook

type WorkflowNodeRunManual

type WorkflowNodeRunManual struct {
	Payload            interface{} `json:"payload" db:"-"`
	PipelineParameters []Parameter `json:"pipeline_parameter" db:"-"`
	OnlyFailedJobs     bool        `json:"only_failed_jobs" db:"-"`
	Resync             bool        `json:"resync" db:"-"`
	Username           string      `json:"username" db:"-"`
	Fullname           string      `json:"fullname" db:"-"`
	Email              string      `json:"email" db:"-"`
}

WorkflowNodeRunManual is an instanc of event received on a hook

type WorkflowNodeRunRelease

type WorkflowNodeRunRelease struct {
	TagName        string   `json:"tag_name"`
	ReleaseTitle   string   `json:"release_title"`
	ReleaseContent string   `json:"release_content"`
	Artifacts      []string `json:"artifacts,omitempty"`
}

WorkflowNodeRunRelease represents the request struct use by release builtin action for workflow

type WorkflowNodeRunVulnerability

type WorkflowNodeRunVulnerability struct {
	Summary              map[string]int64 `json:"summary"`
	DefaultBranchSummary map[string]int64 `json:"default_branch_summary"`
	PreviousRunSummary   map[string]int64 `json:"previous_run_summary"`
}

WorkflowNodeRunVulnerability content of the workflow node run vulnerability report

type WorkflowNodeTriggerRun

type WorkflowNodeTriggerRun struct {
	WorkflowDestNodeID int64  `json:"workflow_dest_node_id" db:"-"`
	Status             string `json:"status" db:"-"`
}

WorkflowNodeTriggerRun Represent the state of a trigger

type WorkflowNodeTriggerRuns

type WorkflowNodeTriggerRuns map[int64]WorkflowNodeTriggerRun

func (*WorkflowNodeTriggerRuns) Scan

func (a *WorkflowNodeTriggerRuns) Scan(src interface{}) error

func (WorkflowNodeTriggerRuns) Value

type WorkflowNotification

type WorkflowNotification struct {
	ID             int64                    `json:"id,omitempty" db:"id"`
	WorkflowID     int64                    `json:"workflow_id,omitempty" db:"workflow_id"`
	SourceNodeRefs []string                 `json:"source_node_ref,omitempty" db:"-"`
	NodeIDs        []int64                  `json:"node_id,omitempty" db:"-"`
	Type           string                   `json:"type" db:"type"`
	Settings       UserNotificationSettings `json:"settings" db:"-"`
	Integration    string                   `json:"integration,omitempty" db:"-"`
}

WorkflowNotification represents notifications on a workflow

type WorkflowOn added in v0.53.1

type WorkflowOn struct {
	Push               *WorkflowOnPush               `json:"push,omitempty"`
	PullRequest        *WorkflowOnPullRequest        `json:"pull-request,omitempty"`
	PullRequestComment *WorkflowOnPullRequestComment `json:"pull-request-comment,omitempty"`
	ModelUpdate        *WorkflowOnModelUpdate        `json:"model-update,omitempty"`
	WorkflowUpdate     *WorkflowOnWorkflowUpdate     `json:"workflow-update,omitempty"`
}

type WorkflowOnModelUpdate added in v0.53.1

type WorkflowOnModelUpdate struct {
	Models       []string `json:"models,omitempty"`
	TargetBranch string   `json:"target_branch,omitempty"`
}

type WorkflowOnPullRequest added in v0.53.1

type WorkflowOnPullRequest struct {
	Branches []string `json:"branches,omitempty"`
	Comment  string   `json:"comment,omitempty"`
	Paths    []string `json:"paths,omitempty"`
	Types    []string `json:"types,omitempty"`
}

type WorkflowOnPullRequestComment added in v0.53.1

type WorkflowOnPullRequestComment struct {
	Branches []string `json:"branches,omitempty"`
	Comment  string   `json:"comment,omitempty"`
	Paths    []string `json:"paths,omitempty"`
	Types    []string `json:"types,omitempty"`
}

type WorkflowOnPush added in v0.53.1

type WorkflowOnPush struct {
	Branches []string `json:"branches,omitempty"`
	Tags     []string `json:"tags,omitempty"`
	Paths    []string `json:"paths,omitempty"`
}

type WorkflowOnWorkflowUpdate added in v0.53.1

type WorkflowOnWorkflowUpdate struct {
	TargetBranch string `json:"target_branch,omitempty"`
}

type WorkflowProjectIntegration

type WorkflowProjectIntegration struct {
	ID                   int64              `json:"id" db:"id"`
	WorkflowID           int64              `json:"workflow_id" db:"workflow_id"`
	ProjectIntegrationID int64              `json:"project_integration_id" db:"project_integration_id"`
	ProjectIntegration   ProjectIntegration `json:"project_integration" db:"-"`
	Config               IntegrationConfig  `json:"config" db:"config"`
}

func (*WorkflowProjectIntegration) MergeWithModel

func (wpi *WorkflowProjectIntegration) MergeWithModel(model IntegrationModel)

type WorkflowQueue

type WorkflowQueue []WorkflowNodeJobRun

func (WorkflowQueue) Sort

func (q WorkflowQueue) Sort()

type WorkflowRepository added in v0.53.0

type WorkflowRepository struct {
	VCSServer string `json:"vcs,omitempty" jsonschema_extras:"order=1" jsonschema_description:"Server that host the git repository"`
	Name      string `json:"name,omitempty" jsonschema_extras:"order=2" jsonschema_description:"Name of the git repository: <org>/<name>"`
}

type WorkflowRun

type WorkflowRun struct {
	ID               int64                         `json:"id" db:"id"`
	Number           int64                         `json:"num" db:"num" cli:"num,key"`
	Version          *string                       `json:"version,omitempty" db:"version" cli:"version"`
	ProjectID        int64                         `json:"project_id,omitempty" db:"project_id"`
	WorkflowID       int64                         `json:"workflow_id" db:"workflow_id"`
	Status           string                        `json:"status" db:"status" cli:"status"`
	Workflow         Workflow                      `json:"workflow" db:"workflow"`
	Start            time.Time                     `json:"start" db:"start" cli:"start"`
	LastModified     time.Time                     `json:"last_modified" db:"last_modified"`
	WorkflowNodeRuns map[int64][]WorkflowNodeRun   `json:"nodes,omitempty" db:"-"`
	Infos            WorkflowRunInfos              `json:"infos,omitempty" db:"infos"`
	Tags             []WorkflowRunTag              `json:"tags,omitempty" db:"-" cli:"tags"`
	LastSubNumber    int64                         `json:"last_subnumber" db:"last_sub_num"`
	LastExecution    time.Time                     `json:"last_execution" db:"last_execution" cli:"last_execution"`
	ToDelete         bool                          `json:"to_delete" db:"to_delete" cli:"-"`
	JoinTriggersRun  WorkflowNodeTriggerRuns       `json:"join_triggers_run,omitempty" db:"join_triggers_run"`
	Header           WorkflowRunHeaders            `json:"header,omitempty" db:"header"`
	URLs             URL                           `json:"urls" yaml:"-" db:"-" cli:"-"`
	ReadOnly         bool                          `json:"read_only" yaml:"-" db:"read_only" cli:"-"`
	ToCraft          bool                          `json:"-" yaml:"-" db:"to_craft" cli:"-"`
	ToCraftOpts      *WorkflowRunPostHandlerOption `json:"-" yaml:"-" db:"to_craft_opts" cli:"-"`
}

WorkflowRun is an execution instance of a run

func (*WorkflowRun) GetAllParameters added in v0.52.0

func (r *WorkflowRun) GetAllParameters() map[string][]string

func (*WorkflowRun) GetOutgoingHookRun

func (r *WorkflowRun) GetOutgoingHookRun(uuid string) *WorkflowNodeRun

func (*WorkflowRun) HasParentWorkflow

func (r *WorkflowRun) HasParentWorkflow() bool

func (*WorkflowRun) PendingOutgoingHook

func (r *WorkflowRun) PendingOutgoingHook() map[string]*WorkflowNodeRun

func (*WorkflowRun) RootRun

func (r *WorkflowRun) RootRun() *WorkflowNodeRun

func (*WorkflowRun) Tag

func (r *WorkflowRun) Tag(tag, value string) bool

Tag push a new Tag in WorkflowRunTag and return if a tag was added or no

func (*WorkflowRun) TagExists

func (r *WorkflowRun) TagExists(tag string) bool

TagExists returns true if tag already exists

func (*WorkflowRun) Translate

func (r *WorkflowRun) Translate()

Translate translates messages in WorkflowNodeRun

type WorkflowRunContext added in v0.53.0

type WorkflowRunContext struct {
	CDS CDSContext        `json:"cds,omitempty"`
	Git GitContext        `json:"git,omitempty"`
	Env map[string]string `json:"env,omitempty"`
}

func (*WorkflowRunContext) Scan added in v0.53.0

func (m *WorkflowRunContext) Scan(src interface{}) error

func (WorkflowRunContext) Value added in v0.53.0

func (m WorkflowRunContext) Value() (driver.Value, error)

type WorkflowRunEvent added in v0.53.1

type WorkflowRunEvent struct {
	ProjectEventV2
	VCSName       string              `json:"vcs_name"`
	Repository    string              `json:"repository"`
	Workflow      string              `json:"workflow"`
	RunNumber     int64               `json:"run_number"`
	RunAttempt    int64               `json:"run_attempt"`
	Status        V2WorkflowRunStatus `json:"status"`
	WorkflowRunID string              `json:"workflow_run_id"`
	UserID        string              `json:"user_id"`
	Username      string              `json:"username"`
}

type WorkflowRunHeaders

type WorkflowRunHeaders map[string]string

func (*WorkflowRunHeaders) Get

func (h *WorkflowRunHeaders) Get(k string) (string, bool)

func (*WorkflowRunHeaders) Scan

func (h *WorkflowRunHeaders) Scan(src interface{}) error

func (*WorkflowRunHeaders) Set

func (h *WorkflowRunHeaders) Set(k, v string)

func (WorkflowRunHeaders) Value

func (h WorkflowRunHeaders) Value() (driver.Value, error)

type WorkflowRunInfo

type WorkflowRunInfo struct {
	APITime time.Time `json:"api_time,omitempty" db:"-"`
	Message SpawnMsg  `json:"message,omitempty" db:"-"`
	// UserMessage contains msg translated for end user
	UserMessage string `json:"user_message,omitempty" db:"-"`
	SubNumber   int64  `json:"sub_number,omitempty" db:"-"`
	Type        string `json:"type" db:"-"`
}

WorkflowRunInfo is an info on workflow run

type WorkflowRunInfos

type WorkflowRunInfos []WorkflowRunInfo

func (*WorkflowRunInfos) Scan

func (a *WorkflowRunInfos) Scan(src interface{}) error

func (WorkflowRunInfos) Value

func (a WorkflowRunInfos) Value() (driver.Value, error)

type WorkflowRunJobEvent added in v0.53.1

type WorkflowRunJobEvent struct {
	ProjectEventV2
	VCSName       string                 `json:"vcs_name"`
	Repository    string                 `json:"repository"`
	Workflow      string                 `json:"workflow"`
	WorkflowRunID string                 `json:"workflow_run_id"`
	RunJobID      string                 `json:"run_job_id"`
	RunNumber     int64                  `json:"run_number"`
	RunAttempt    int64                  `json:"run_attempt"`
	Region        string                 `json:"region"`
	Hatchery      string                 `json:"hatchery"`
	ModelType     string                 `json:"model_type"`
	JobID         string                 `json:"job_id"`
	Status        V2WorkflowRunJobStatus `json:"status"`
	UserID        string                 `json:"user_id"`
	Username      string                 `json:"username"`
}

type WorkflowRunJobManualEvent added in v0.53.1

type WorkflowRunJobManualEvent struct {
	ProjectEventV2
	VCSName       string              `json:"vcs_name"`
	Repository    string              `json:"repository"`
	Workflow      string              `json:"workflow"`
	JobID         string              `json:"job_id"`
	RunNumber     int64               `json:"run_number"`
	RunAttempt    int64               `json:"run_attempt"`
	Status        V2WorkflowRunStatus `json:"status"`
	WorkflowRunID string              `json:"workflow_run_id"`
	UserID        string              `json:"user_id"`
	Username      string              `json:"username"`
}

type WorkflowRunJobRunResultEvent added in v0.53.1

type WorkflowRunJobRunResultEvent struct {
	ProjectEventV2
	VCSName       string `json:"vcs_name"`
	Repository    string `json:"repository"`
	Workflow      string `json:"workflow"`
	WorkflowRunID string `json:"workflow_run_id"`
	RunJobID      string `json:"run_job_id"`
	RunNumber     int64  `json:"run_number"`
	RunAttempt    int64  `json:"run_attempt"`
	Region        string `json:"region"`
	Hatchery      string `json:"hatchery"`
	ModelType     string `json:"model_type"`
	JobID         string `json:"job_id"`
	Status        string `json:"status"`
	UserID        string `json:"user_id"`
	Username      string `json:"username"`
	RunResult     string `json:"run_result"`
}

type WorkflowRunJobsContext added in v0.53.0

type WorkflowRunJobsContext struct {
	WorkflowRunContext
	Jobs         JobsResultContext       `json:"jobs"`
	Needs        NeedsContext            `json:"needs"`
	Inputs       map[string]interface{}  `json:"inputs"`
	Steps        StepsContext            `json:"steps"`
	Matrix       map[string]string       `json:"matrix"`
	Integrations *JobIntegrationsContext `json:"integrations,omitempty"`
	Gate         map[string]interface{}  `json:"gate"`
	Vars         map[string]interface{}  `json:"vars"`
}

type WorkflowRunNumber

type WorkflowRunNumber struct {
	Num int64 `json:"num" cli:"run-number"`
}

WorkflowRunNumber contains a workflow run number

type WorkflowRunPostHandlerOption

type WorkflowRunPostHandlerOption struct {
	Hook           *WorkflowNodeRunHookEvent `json:"hook,omitempty"`
	Manual         *WorkflowNodeRunManual    `json:"manual,omitempty"`
	Number         *int64                    `json:"number,omitempty"`
	FromNodeIDs    []int64                   `json:"from_nodes,omitempty"`
	AuthConsumerID string                    `json:"auth_consumer,omitempty"`
}

WorkflowRunPostHandlerOption contains the body content for launch a workflow

func (*WorkflowRunPostHandlerOption) Scan

func (a *WorkflowRunPostHandlerOption) Scan(src interface{}) error

Scan WorkflowRunPostHandlerOption.

func (*WorkflowRunPostHandlerOption) Value

Value returns driver.Value from WorkflowRunPostHandlerOption.

type WorkflowRunResult

type WorkflowRunResult struct {
	ID                string                 `json:"id" db:"id"`
	Created           time.Time              `json:"created" db:"created"`
	WorkflowRunID     int64                  `json:"workflow_run_id" db:"workflow_run_id"`
	WorkflowNodeRunID int64                  `json:"workflow_node_run_id" db:"workflow_node_run_id"`
	WorkflowRunJobID  int64                  `json:"workflow_run_job_id" db:"workflow_run_job_id"`
	SubNum            int64                  `json:"sub_num" db:"sub_num"`
	Type              WorkflowRunResultType  `json:"type" db:"type"`
	DataRaw           json.RawMessage        `json:"data" db:"data"`
	DataSync          *WorkflowRunResultSync `json:"sync,omitempty" db:"sync"`
}

func (WorkflowRunResult) ComputeName added in v0.52.0

func (r WorkflowRunResult) ComputeName() (string, error)

func (WorkflowRunResult) ComputeUniqueKey added in v0.52.0

func (r WorkflowRunResult) ComputeUniqueKey() (string, error)

func (*WorkflowRunResult) GetArtifact

func (*WorkflowRunResult) GetArtifactManager

func (r *WorkflowRunResult) GetArtifactManager() (WorkflowRunResultArtifactManager, error)

func (*WorkflowRunResult) GetCoverage

func (*WorkflowRunResult) GetStaticFile

func (r *WorkflowRunResult) GetStaticFile() (WorkflowRunResultStaticFile, error)

type WorkflowRunResultArtifact

type WorkflowRunResultArtifact struct {
	WorkflowRunResultArtifactCommon
	Size       int64  `json:"size"`
	MD5        string `json:"md5"`
	CDNRefHash string `json:"cdn_hash"`
	Perm       uint32 `json:"perm"`
	FileType   string `json:"file_type"`
}

func (*WorkflowRunResultArtifact) IsValid

func (a *WorkflowRunResultArtifact) IsValid() error

type WorkflowRunResultArtifactCommon added in v0.52.0

type WorkflowRunResultArtifactCommon struct {
	Name string `json:"name"`
}

type WorkflowRunResultArtifactManager

type WorkflowRunResultArtifactManager struct {
	WorkflowRunResultArtifactCommon
	Size     int64  `json:"size"`
	MD5      string `json:"md5"`
	Path     string `json:"path"`
	Perm     uint32 `json:"perm"`
	RepoName string `json:"repository_name"`
	RepoType string `json:"repository_type"`
	FileType string `json:"file_type"`
}

func (*WorkflowRunResultArtifactManager) IsValid

type WorkflowRunResultCheck

type WorkflowRunResultCheck struct {
	Name       string                `json:"name"`
	RunID      int64                 `json:"run_id"`
	RunNodeID  int64                 `json:"run_node_id"`
	RunJobID   int64                 `json:"run_job_id"`
	ResultType WorkflowRunResultType `json:"result_type"`
}

type WorkflowRunResultCoverage

type WorkflowRunResultCoverage struct {
	WorkflowRunResultArtifactCommon
	Size       int64  `json:"size"`
	MD5        string `json:"md5"`
	CDNRefHash string `json:"cdn_hash"`
	Perm       uint32 `json:"perm"`
}

func (*WorkflowRunResultCoverage) IsValid

func (a *WorkflowRunResultCoverage) IsValid() error

type WorkflowRunResultDataKey

type WorkflowRunResultDataKey string

type WorkflowRunResultPromotion added in v0.52.0

type WorkflowRunResultPromotion struct {
	FromMaturity string    `json:"from_maturity"`
	ToMaturity   string    `json:"to_maturity"`
	Date         time.Time `json:"date"`
}

type WorkflowRunResultPromotionRequest added in v0.52.0

type WorkflowRunResultPromotionRequest struct {
	ToMaturity string   `json:"to_maturity"`
	IDs        []string `json:"ids"`
}

type WorkflowRunResultPromotionType added in v0.52.0

type WorkflowRunResultPromotionType string
const (
	WorkflowRunResultPromotionTypePromote WorkflowRunResultPromotionType = "promote"
	WorkflowRunResultPromotionTypeRelease WorkflowRunResultPromotionType = "release"
)

type WorkflowRunResultStaticFile

type WorkflowRunResultStaticFile struct {
	WorkflowRunResultArtifactCommon
	RemoteURL string `json:"remote_url"`
}

func (*WorkflowRunResultStaticFile) IsValid

func (a *WorkflowRunResultStaticFile) IsValid() error

type WorkflowRunResultSync added in v0.52.0

type WorkflowRunResultSync struct {
	Sync       bool                         `json:"sync"`
	Link       string                       `json:"link"`
	Error      string                       `json:"error"`
	Promotions []WorkflowRunResultPromotion `json:"promotions"`
	Releases   []WorkflowRunResultPromotion `json:"releases"`
}

func (*WorkflowRunResultSync) LatestPromotionOrRelease added in v0.52.0

func (s *WorkflowRunResultSync) LatestPromotionOrRelease() *WorkflowRunResultPromotion

func (*WorkflowRunResultSync) Scan added in v0.52.0

func (s *WorkflowRunResultSync) Scan(src interface{}) error

Scan WorkflowRunResultSync

func (WorkflowRunResultSync) Value added in v0.52.0

func (s WorkflowRunResultSync) Value() (driver.Value, error)

Value returns driver.Value from WorkflowRunResultSync

type WorkflowRunResultType

type WorkflowRunResultType string
const (
	WorkflowRunResultTypeArtifact        WorkflowRunResultType = "artifact"
	WorkflowRunResultTypeCoverage        WorkflowRunResultType = "coverage"
	WorkflowRunResultTypeArtifactManager WorkflowRunResultType = "artifact-manager"
	WorkflowRunResultTypeStaticFile      WorkflowRunResultType = "static-file"
)

type WorkflowRunResults added in v0.52.0

type WorkflowRunResults []WorkflowRunResult

func (WorkflowRunResults) Unique added in v0.52.0

Unique returns the last version of each results

type WorkflowRunSecret

type WorkflowRunSecret struct {
	ID            string `json:"-" db:"id"`
	WorkflowRunID int64  `json:"-" db:"workflow_run_id"`
	Type          string `json:"-" db:"type"`
	Context       string `json:"-" db:"context"`
	Name          string `json:"-" db:"name"`
	Value         []byte `json:"-" db:"cypher_value" gorpmapping:"encrypted,ID"`
}

func (WorkflowRunSecret) ToVariable added in v0.52.0

func (s WorkflowRunSecret) ToVariable() Variable

type WorkflowRunSecrets added in v0.52.0

type WorkflowRunSecrets []WorkflowRunSecret

func (WorkflowRunSecrets) ToVariables added in v0.52.0

func (s WorkflowRunSecrets) ToVariables() []Variable

type WorkflowRunStage added in v0.53.1

type WorkflowRunStage struct {
	WorkflowStage
	CanBeRun bool
	Jobs     map[string]V2WorkflowRunJobStatus
	Ended    bool
}

type WorkflowRunStages added in v0.53.1

type WorkflowRunStages map[string]WorkflowRunStage

func (WorkflowRunStages) ComputeStatus added in v0.53.1

func (wrs WorkflowRunStages) ComputeStatus()

type WorkflowRunSummary

type WorkflowRunSummary struct {
	ID            int64                         `json:"id" db:"id" cli:"-"`
	Version       *string                       `json:"version,omitempty" db:"version" cli:"version"`
	Number        int64                         `json:"num" db:"num" cli:"num,key"`
	Status        string                        `json:"status" db:"status" cli:"status"`
	Start         time.Time                     `json:"start" db:"start" cli:"start"`
	LastModified  time.Time                     `json:"last_modified" db:"last_modified" cli:"-"`
	LastSubNumber int64                         `json:"last_subnumber" db:"last_sub_num" cli:"-"`
	LastExecution time.Time                     `json:"last_execution" db:"last_execution" cli:"last_execution"`
	ToCraftOpts   *WorkflowRunPostHandlerOption `json:"-" yaml:"-" db:"to_craft_opts" cli:"-"`
	Tags          []WorkflowRunTag              `json:"tags,omitempty" db:"-" cli:"tags"`
}

type WorkflowRunTag

type WorkflowRunTag struct {
	WorkflowRunID int64  `json:"-" db:"workflow_run_id"`
	Tag           string `json:"tag,omitempty" db:"tag" cli:"tag"`
	Value         string `json:"value,omitempty" db:"value" cli:"value"`
}

WorkflowRunTag is a tag on workflow run

type WorkflowRunToKeep

type WorkflowRunToKeep struct {
	ID     int64  `json:"id"`
	Status string `json:"status"`
	Num    int64  `json:"num"`
}

type WorkflowRunVersion

type WorkflowRunVersion struct {
	Value string `json:"value"`
}

WorkflowRunVersion contains a workflow run version.

func (WorkflowRunVersion) IsValid

func (w WorkflowRunVersion) IsValid() error

type WorkflowStage added in v0.53.0

type WorkflowStage struct {
	Needs []string `json:"needs,omitempty" jsonschema_description:"Stage dependencies"`
}

type WorkflowTemplate

type WorkflowTemplate struct {
	ID           int64                      `json:"id" db:"id"`
	GroupID      int64                      `json:"group_id" db:"group_id"`
	Name         string                     `json:"name" db:"name"`
	Slug         string                     `json:"slug" db:"slug"`
	Description  string                     `json:"description" db:"description"`
	Parameters   WorkflowTemplateParameters `json:"parameters" db:"parameters"`
	Workflow     string                     `json:"value" db:"value"`
	Pipelines    PipelineTemplates          `json:"pipelines" db:"pipelines"`
	Applications ApplicationTemplates       `json:"applications" db:"applications"`
	Environments EnvironmentTemplates       `json:"environments" db:"environments"`
	Version      int64                      `json:"version" db:"version"`
	// aggregates
	Group         *Group                 `json:"group,omitempty" db:"-"`
	FirstAudit    *AuditWorkflowTemplate `json:"first_audit,omitempty" db:"-"`
	LastAudit     *AuditWorkflowTemplate `json:"last_audit,omitempty" db:"-"`
	Editable      bool                   `json:"editable,omitempty" db:"-"`
	ChangeMessage string                 `json:"change_message,omitempty" db:"-"`
}

WorkflowTemplate struct.

func (*WorkflowTemplate) CheckParams

CheckParams returns template parameters validity.

func (*WorkflowTemplate) IsValid

func (w *WorkflowTemplate) IsValid() error

IsValid returns workflow template validity.

func (WorkflowTemplate) Path

func (w WorkflowTemplate) Path() string

func (WorkflowTemplate) PathWithVersion

func (w WorkflowTemplate) PathWithVersion() string

func (*WorkflowTemplate) Scan

func (w *WorkflowTemplate) Scan(src interface{}) error

Scan workflow template.

func (*WorkflowTemplate) Update

func (w *WorkflowTemplate) Update(data WorkflowTemplate)

Update workflow template field from new data.

func (WorkflowTemplate) Value

func (w WorkflowTemplate) Value() (driver.Value, error)

Value returns driver.Value from workflow template.

type WorkflowTemplateBulk

type WorkflowTemplateBulk struct {
	ID                 int64                          `json:"id" db:"id"`
	UserID             string                         `json:"user_id" db:"authentified_user_id"`
	AuthConsumerID     string                         `json:"auth_consumer_id" db:"auth_consumer_id"`
	WorkflowTemplateID int64                          `json:"workflow_template_id" db:"workflow_template_id"`
	Status             OperationStatus                `json:"status" db:"status"`
	Parallel           bool                           `json:"parallel" db:"parallel"`
	Operations         WorkflowTemplateBulkOperations `json:"operations" db:"operations"`
}

WorkflowTemplateBulk contains info about a template bulk task.

func (*WorkflowTemplateBulk) UpdateOperation added in v0.53.0

type WorkflowTemplateBulkOperation

type WorkflowTemplateBulkOperation struct {
	Status  OperationStatus         `json:"status"`
	Error   string                  `json:"error,omitempty"`
	Request WorkflowTemplateRequest `json:"request"`
}

WorkflowTemplateBulkOperation contains one operation of a template bulk task.

type WorkflowTemplateBulkOperations

type WorkflowTemplateBulkOperations []WorkflowTemplateBulkOperation

WorkflowTemplateBulkOperations struct.

func (*WorkflowTemplateBulkOperations) Scan

func (w *WorkflowTemplateBulkOperations) Scan(src interface{}) error

Scan pipeline templates.

func (WorkflowTemplateBulkOperations) Value

Value returns driver.Value from workflow template bulk operations.

type WorkflowTemplateError

type WorkflowTemplateError struct {
	Type    string `json:"type"`
	Number  int    `json:"number"`
	Line    int    `json:"line"`
	Message string `json:"message"`
}

WorkflowTemplateError contains info about template parsing error.

func (WorkflowTemplateError) Error

func (w WorkflowTemplateError) Error() string

type WorkflowTemplateInstance

type WorkflowTemplateInstance struct {
	ID                      int64                   `json:"id" db:"id"`
	WorkflowTemplateID      int64                   `json:"workflow_template_id" db:"workflow_template_id"`
	ProjectID               int64                   `json:"project_id" db:"project_id"`
	WorkflowID              *int64                  `json:"workflow_id" db:"workflow_id"`
	WorkflowTemplateVersion int64                   `json:"workflow_template_version" db:"workflow_template_version"`
	Request                 WorkflowTemplateRequest `json:"request" db:"request"`
	WorkflowName            string                  `json:"workflow_name" db:"workflow_name"`
	// aggregates
	FirstAudit *AuditWorkflowTemplateInstance `json:"first_audit,omitempty" db:"-"`
	LastAudit  *AuditWorkflowTemplateInstance `json:"last_audit,omitempty" db:"-"`
	Template   *WorkflowTemplate              `json:"template,omitempty" db:"-"`
	Project    *Project                       `json:"project,omitempty" db:"-"`
	Workflow   *Workflow                      `json:"workflow,omitempty" db:"-"`
}

WorkflowTemplateInstance struct.

type WorkflowTemplateParameter

type WorkflowTemplateParameter struct {
	Key      string                `json:"key"`
	Type     TemplateParameterType `json:"type"`
	Required bool                  `json:"required"`
}

WorkflowTemplateParameter struct.

func (*WorkflowTemplateParameter) IsValid

func (w *WorkflowTemplateParameter) IsValid() error

IsValid returns pipeline template validity.

type WorkflowTemplateParameters

type WorkflowTemplateParameters []WorkflowTemplateParameter

WorkflowTemplateParameters struct.

func (*WorkflowTemplateParameters) Scan

func (w *WorkflowTemplateParameters) Scan(src interface{}) error

Scan workflow template parameters.

func (WorkflowTemplateParameters) Value

Value returns driver.Value from workflow template parameters.

type WorkflowTemplateParsed

type WorkflowTemplateParsed struct {
	Workflow     *template.Template
	Pipelines    []*template.Template
	Applications []*template.Template
	Environments []*template.Template
}

WorkflowTemplateParsed struct.

type WorkflowTemplateRequest

type WorkflowTemplateRequest struct {
	ProjectKey   string            `json:"project_key"`
	WorkflowName string            `json:"workflow_name"`
	Parameters   map[string]string `json:"parameters"`
	Detached     bool              `json:"detached,omitempty"`
	Branch       string            `json:"branch,omitempty"`
	Message      string            `json:"message,omitempty"`
}

WorkflowTemplateRequest struct use for execution request.

func (*WorkflowTemplateRequest) Scan

func (w *WorkflowTemplateRequest) Scan(src interface{}) error

Scan workflow template request.

func (WorkflowTemplateRequest) Value

Value returns driver.Value from workflow template request.

type Workflows

type Workflows []Workflow

func (Workflows) Filter

func (workflows Workflows) Filter(f func(w Workflow) bool) Workflows

func (Workflows) IDs

func (workflows Workflows) IDs() []int64

func (Workflows) Names

func (workflows Workflows) Names() []string

Source Files

Directories

Path Synopsis
artifactory/xray/mock_xray
Package mock_xray is a generated GoMock package.
Package mock_xray is a generated GoMock package.
mock_artifact_manager
Package mock_artifact_manager is a generated GoMock package.
Package mock_artifact_manager is a generated GoMock package.
mock_cdsclient
Package mock_cdsclient is a generated GoMock package.
Package mock_cdsclient is a generated GoMock package.
v1
v2
mock_hatchery
Package mock_hatchery is a generated GoMock package.
Package mock_hatchery is a generated GoMock package.
interpolate module
izanami module
log
Package namesgenerator original package is https://github.com/moby/moby/tree/master/pkg/namesgenerator Moby is licensed under the Apache License, Version 2.0.
Package namesgenerator original package is https://github.com/moby/moby/tree/master/pkg/namesgenerator Moby is licensed under the Apache License, Version 2.0.
vcs
git

Jump to

Keyboard shortcuts

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