v1alpha1

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the cd v1alpha1 API group +kubebuilder:object:generate=true +groupName=cd.grhili.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "cd.grhili.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type CDOperatorConfig

type CDOperatorConfig struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   CDOperatorConfigSpec   `json:"spec,omitempty"`
	Status CDOperatorConfigStatus `json:"status,omitempty"`
}

CDOperatorConfig is the Schema for the cdoperatorconfigs API +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:scope=Cluster +kubebuilder:printcolumn:name="LogLevel",type=string,JSONPath=`.spec.logLevel` +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (*CDOperatorConfig) DeepCopy

func (in *CDOperatorConfig) DeepCopy() *CDOperatorConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CDOperatorConfig.

func (*CDOperatorConfig) DeepCopyInto

func (in *CDOperatorConfig) DeepCopyInto(out *CDOperatorConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CDOperatorConfig) DeepCopyObject

func (in *CDOperatorConfig) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CDOperatorConfigList

type CDOperatorConfigList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []CDOperatorConfig `json:"items"`
}

CDOperatorConfigList contains a list of CDOperatorConfig +kubebuilder:object:root=true

func (*CDOperatorConfigList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CDOperatorConfigList.

func (*CDOperatorConfigList) DeepCopyInto

func (in *CDOperatorConfigList) DeepCopyInto(out *CDOperatorConfigList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CDOperatorConfigList) DeepCopyObject

func (in *CDOperatorConfigList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CDOperatorConfigSpec

type CDOperatorConfigSpec struct {
	// GitHubToken is the GitHub authentication token for API access
	GitHubToken string `json:"githubToken"`

	// GitHubOrg is the GitHub organization name to monitor
	GitHubOrg string `json:"githubOrg"`

	// ReconcileInterval is the interval between reconciliation loops
	ReconcileInterval metav1.Duration `json:"reconcileInterval"`

	// WorkerPoolSize is the number of concurrent workers for processing
	WorkerPoolSize int `json:"workerPoolSize"`

	// MetricsEnabled indicates whether Prometheus metrics are enabled
	MetricsEnabled bool `json:"metricsEnabled"`

	// MetricsPort is the port for exposing Prometheus metrics
	MetricsPort int `json:"metricsPort"`

	// TracingEnabled indicates whether OpenTelemetry tracing is enabled
	TracingEnabled bool `json:"tracingEnabled"`

	// LogLevel is the logging level (debug, info, warn, error)
	LogLevel string `json:"logLevel"`
}

CDOperatorConfigSpec defines the desired state of CDOperatorConfig

func (*CDOperatorConfigSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CDOperatorConfigSpec.

func (*CDOperatorConfigSpec) DeepCopyInto

func (in *CDOperatorConfigSpec) DeepCopyInto(out *CDOperatorConfigSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CDOperatorConfigStatus

type CDOperatorConfigStatus struct {
	// ObservedGeneration reflects the generation of the most recently observed CDOperatorConfig
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

CDOperatorConfigStatus defines the observed state of CDOperatorConfig

func (*CDOperatorConfigStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CDOperatorConfigStatus.

func (*CDOperatorConfigStatus) DeepCopyInto

func (in *CDOperatorConfigStatus) DeepCopyInto(out *CDOperatorConfigStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ClusterConfig

type ClusterConfig struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ClusterConfigSpec   `json:"spec,omitempty"`
	Status ClusterConfigStatus `json:"status,omitempty"`
}

ClusterConfig is the Schema for the clusterconfigs API +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Cluster",type=string,JSONPath=`.spec.clusterName` +kubebuilder:printcolumn:name="Mode",type=string,JSONPath=`.spec.argocdMode` +kubebuilder:printcolumn:name="Healthy",type=boolean,JSONPath=`.status.healthy` +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (*ClusterConfig) DeepCopy

func (in *ClusterConfig) DeepCopy() *ClusterConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfig.

func (*ClusterConfig) DeepCopyInto

func (in *ClusterConfig) DeepCopyInto(out *ClusterConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterConfig) DeepCopyObject

func (in *ClusterConfig) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterConfigList

type ClusterConfigList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ClusterConfig `json:"items"`
}

ClusterConfigList contains a list of ClusterConfig +kubebuilder:object:root=true

func (*ClusterConfigList) DeepCopy

func (in *ClusterConfigList) DeepCopy() *ClusterConfigList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfigList.

func (*ClusterConfigList) DeepCopyInto

func (in *ClusterConfigList) DeepCopyInto(out *ClusterConfigList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterConfigList) DeepCopyObject

func (in *ClusterConfigList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterConfigSpec

type ClusterConfigSpec struct {
	// ClusterName is the unique identifier for this cluster
	ClusterName string `json:"clusterName"`

	// ArgoCDMode determines how to connect to ArgoCD (internal or external)
	// +kubebuilder:validation:Enum=internal;external
	ArgoCDMode string `json:"argocdMode"`

	// ArgoCDEndpoint is the ArgoCD API endpoint URL (required for external mode)
	ArgoCDEndpoint string `json:"argocdEndpoint,omitempty"`

	// ArgoCDToken is the ArgoCD authentication token (required for external mode)
	ArgoCDToken string `json:"argocdToken,omitempty"`
}

ClusterConfigSpec defines the desired state of ClusterConfig

func (*ClusterConfigSpec) DeepCopy

func (in *ClusterConfigSpec) DeepCopy() *ClusterConfigSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfigSpec.

func (*ClusterConfigSpec) DeepCopyInto

func (in *ClusterConfigSpec) DeepCopyInto(out *ClusterConfigSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ClusterConfigStatus

type ClusterConfigStatus struct {
	// Healthy indicates if the cluster connection is healthy
	Healthy bool `json:"healthy"`

	// LastChecked is the timestamp of the last health check
	LastChecked metav1.Time `json:"lastChecked,omitempty"`

	// Message contains additional status information
	Message string `json:"message,omitempty"`
}

ClusterConfigStatus defines the observed state of ClusterConfig

func (*ClusterConfigStatus) DeepCopy

func (in *ClusterConfigStatus) DeepCopy() *ClusterConfigStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfigStatus.

func (*ClusterConfigStatus) DeepCopyInto

func (in *ClusterConfigStatus) DeepCopyInto(out *ClusterConfigStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DriftMonitor

type DriftMonitor struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   DriftMonitorSpec   `json:"spec,omitempty"`
	Status DriftMonitorStatus `json:"status,omitempty"`
}

DriftMonitor is the Schema for the driftmonitors API +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Cluster",type=string,JSONPath=`.spec.cluster` +kubebuilder:printcolumn:name="Synced",type=boolean,JSONPath=`.status.synced` +kubebuilder:printcolumn:name="DeployedSHA",type=string,JSONPath=`.status.deployedSHA` +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (*DriftMonitor) DeepCopy

func (in *DriftMonitor) DeepCopy() *DriftMonitor

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriftMonitor.

func (*DriftMonitor) DeepCopyInto

func (in *DriftMonitor) DeepCopyInto(out *DriftMonitor)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DriftMonitor) DeepCopyObject

func (in *DriftMonitor) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type DriftMonitorList

type DriftMonitorList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []DriftMonitor `json:"items"`
}

DriftMonitorList contains a list of DriftMonitor +kubebuilder:object:root=true

func (*DriftMonitorList) DeepCopy

func (in *DriftMonitorList) DeepCopy() *DriftMonitorList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriftMonitorList.

func (*DriftMonitorList) DeepCopyInto

func (in *DriftMonitorList) DeepCopyInto(out *DriftMonitorList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DriftMonitorList) DeepCopyObject

func (in *DriftMonitorList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type DriftMonitorSpec

type DriftMonitorSpec struct {
	// TrackerRef references the associated PullRequestTracker
	TrackerRef corev1.ObjectReference `json:"trackerRef"`

	// Cluster is the target cluster name to monitor
	Cluster string `json:"cluster"`
}

DriftMonitorSpec defines the desired state of DriftMonitor

func (*DriftMonitorSpec) DeepCopy

func (in *DriftMonitorSpec) DeepCopy() *DriftMonitorSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriftMonitorSpec.

func (*DriftMonitorSpec) DeepCopyInto

func (in *DriftMonitorSpec) DeepCopyInto(out *DriftMonitorSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DriftMonitorStatus

type DriftMonitorStatus struct {
	// Synced indicates if the deployment is synced with the merged PR
	Synced bool `json:"synced"`

	// LastCheck is the timestamp of the last drift check
	LastCheck metav1.Time `json:"lastCheck,omitempty"`

	// Message contains additional status information
	Message string `json:"message,omitempty"`

	// ObservedGeneration reflects the generation most recently observed by the controller
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// DeployedSHA is the commit SHA currently deployed in the cluster
	// +optional
	DeployedSHA string `json:"deployedSHA,omitempty"`

	// ExpectedSHA is the expected commit SHA from the merged PR
	// +optional
	ExpectedSHA string `json:"expectedSHA,omitempty"`

	// Conditions represent the latest available observations of the DriftMonitor's state
	// +optional
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

DriftMonitorStatus defines the observed state of DriftMonitor

func (*DriftMonitorStatus) DeepCopy

func (in *DriftMonitorStatus) DeepCopy() *DriftMonitorStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriftMonitorStatus.

func (*DriftMonitorStatus) DeepCopyInto

func (in *DriftMonitorStatus) DeepCopyInto(out *DriftMonitorStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExternalTestSpec

type ExternalTestSpec struct {
	// Name is a unique identifier for this test within the policy
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`

	// Provider identifies the CI system (jenkins, github-actions, gitlab)
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Enum=jenkins;github-actions;gitlab
	Provider string `json:"provider"`

	// JobName is the test job/workflow/pipeline name in the CI system.
	// Format is provider-specific:
	//   - Jenkins: "folder/job-name"
	//   - GitHub Actions: "workflow.yml" or workflow ID
	//   - GitLab: project ID or URL-encoded path
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	JobName string `json:"jobName"`

	// Parameters are passed to the test job as variables/inputs.
	// Supports variable substitution: ${pr.number}, ${pr.head.sha}, ${cd.version}, etc.
	// +optional
	Parameters map[string]string `json:"parameters,omitempty"`

	// Timeout is the maximum duration for this specific test to complete.
	// If not specified, uses the policy-level timeout.
	// +optional
	Timeout metav1.Duration `json:"timeout,omitempty"`

	// Required indicates if this test must pass for promotion to proceed.
	// If false, test failure is logged but doesn't block promotion (warning only).
	// +optional
	// +kubebuilder:default=true
	Required bool `json:"required"`
}

ExternalTestSpec defines a single external test that must be executed as part of promotion. Tests are triggered in external CI systems (Jenkins, GitHub Actions, GitLab CI).

func (*ExternalTestSpec) DeepCopy

func (in *ExternalTestSpec) DeepCopy() *ExternalTestSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalTestSpec.

func (*ExternalTestSpec) DeepCopyInto

func (in *ExternalTestSpec) DeepCopyInto(out *ExternalTestSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PromotionPolicy

type PromotionPolicy struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   PromotionPolicySpec   `json:"spec,omitempty"`
	Status PromotionPolicyStatus `json:"status,omitempty"`
}

PromotionPolicy is the Schema for the promotionpolicies API. It defines promotion rules between environments with external test gates.

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:scope=Namespaced,shortName=pp +kubebuilder:printcolumn:name="From",type=string,JSONPath=`.spec.sourceEnvironment` +kubebuilder:printcolumn:name="To",type=string,JSONPath=`.spec.targetEnvironment` +kubebuilder:printcolumn:name="Auto",type=boolean,JSONPath=`.spec.autoPromote` +kubebuilder:printcolumn:name="Tests",type=integer,JSONPath=`.spec.externalTests.length` +kubebuilder:printcolumn:name="Promotions",type=integer,JSONPath=`.status.totalPromotions` +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (*PromotionPolicy) DeepCopy

func (in *PromotionPolicy) DeepCopy() *PromotionPolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PromotionPolicy.

func (*PromotionPolicy) DeepCopyInto

func (in *PromotionPolicy) DeepCopyInto(out *PromotionPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PromotionPolicy) DeepCopyObject

func (in *PromotionPolicy) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PromotionPolicyList

type PromotionPolicyList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PromotionPolicy `json:"items"`
}

PromotionPolicyList contains a list of PromotionPolicy. +kubebuilder:object:root=true

func (*PromotionPolicyList) DeepCopy

func (in *PromotionPolicyList) DeepCopy() *PromotionPolicyList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PromotionPolicyList.

func (*PromotionPolicyList) DeepCopyInto

func (in *PromotionPolicyList) DeepCopyInto(out *PromotionPolicyList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PromotionPolicyList) DeepCopyObject

func (in *PromotionPolicyList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PromotionPolicySpec

type PromotionPolicySpec struct {
	// SourceEnvironment is the environment to promote from (e.g., "dev", "staging")
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	SourceEnvironment string `json:"sourceEnvironment"`

	// TargetEnvironment is the environment to promote to (e.g., "staging", "prod")
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	TargetEnvironment string `json:"targetEnvironment"`

	// ExternalTests defines tests that must pass before promotion can proceed.
	// Tests are executed in parallel. If any required test fails, promotion is blocked.
	// +optional
	ExternalTests []ExternalTestSpec `json:"externalTests,omitempty"`

	// AutoPromote controls whether promotion happens automatically when all tests pass.
	// If false, promotion requires manual approval (e.g., adding a promotion label).
	// +optional
	// +kubebuilder:default=true
	AutoPromote bool `json:"autoPromote"`

	// Timeout is the maximum duration to wait for all tests to complete.
	// If tests don't complete within this time, they are marked as timed out.
	// +optional
	// +kubebuilder:default="45m"
	Timeout metav1.Duration `json:"timeout,omitempty"`
}

PromotionPolicySpec defines the desired state of PromotionPolicy. A promotion policy defines the rules for promoting deployments from one environment to another, including external tests that must pass before promotion is allowed.

func (*PromotionPolicySpec) DeepCopy

func (in *PromotionPolicySpec) DeepCopy() *PromotionPolicySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PromotionPolicySpec.

func (*PromotionPolicySpec) DeepCopyInto

func (in *PromotionPolicySpec) DeepCopyInto(out *PromotionPolicySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PromotionPolicyStatus

type PromotionPolicyStatus struct {
	// Conditions track the policy's operational status
	// +optional
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// LastApplied is the timestamp when this policy was last used for promotion
	// +optional
	LastApplied metav1.Time `json:"lastApplied,omitempty"`

	// TotalPromotions tracks how many times this policy has been successfully applied
	// +optional
	TotalPromotions int64 `json:"totalPromotions,omitempty"`

	// LastTestResults contains the results from the most recent test execution
	// +optional
	LastTestResults []TestResult `json:"lastTestResults,omitempty"`
}

PromotionPolicyStatus defines the observed state of PromotionPolicy.

func (*PromotionPolicyStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PromotionPolicyStatus.

func (*PromotionPolicyStatus) DeepCopyInto

func (in *PromotionPolicyStatus) DeepCopyInto(out *PromotionPolicyStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PromotionRecord

type PromotionRecord struct {
	// FromEnvironment is the source environment
	FromEnvironment string `json:"fromEnvironment"`

	// ToEnvironment is the target environment
	ToEnvironment string `json:"toEnvironment"`

	// PromotedAt is the timestamp of the promotion
	PromotedAt metav1.Time `json:"promotedAt"`

	// PromotedBy indicates who/what triggered the promotion (cd-operator, manual, etc.)
	PromotedBy string `json:"promotedBy"`

	// TestResults contains the test outcomes that gated this promotion
	// +optional
	TestResults []TestRun `json:"testResults,omitempty"`

	// PolicyName is the name of the PromotionPolicy that governed this promotion
	// +optional
	PolicyName string `json:"policyName,omitempty"`
}

PromotionRecord tracks a single promotion event from one environment to another. Provides audit trail of deployments across environments.

func (*PromotionRecord) DeepCopy

func (in *PromotionRecord) DeepCopy() *PromotionRecord

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PromotionRecord.

func (*PromotionRecord) DeepCopyInto

func (in *PromotionRecord) DeepCopyInto(out *PromotionRecord)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PullRequestTracker

type PullRequestTracker struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   PullRequestTrackerSpec   `json:"spec,omitempty"`
	Status PullRequestTrackerStatus `json:"status,omitempty"`
}

PullRequestTracker is the Schema for the pullrequesttrackers API +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Repo",type=string,JSONPath=`.spec.repoOwner` +kubebuilder:printcolumn:name="PR",type=integer,JSONPath=`.spec.prNumber` +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state` +kubebuilder:printcolumn:name="HeadSHA",type=string,JSONPath=`.status.headSHA` +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (*PullRequestTracker) DeepCopy

func (in *PullRequestTracker) DeepCopy() *PullRequestTracker

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PullRequestTracker.

func (*PullRequestTracker) DeepCopyInto

func (in *PullRequestTracker) DeepCopyInto(out *PullRequestTracker)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PullRequestTracker) DeepCopyObject

func (in *PullRequestTracker) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PullRequestTrackerList

type PullRequestTrackerList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PullRequestTracker `json:"items"`
}

PullRequestTrackerList contains a list of PullRequestTracker +kubebuilder:object:root=true

func (*PullRequestTrackerList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PullRequestTrackerList.

func (*PullRequestTrackerList) DeepCopyInto

func (in *PullRequestTrackerList) DeepCopyInto(out *PullRequestTrackerList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PullRequestTrackerList) DeepCopyObject

func (in *PullRequestTrackerList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PullRequestTrackerSpec

type PullRequestTrackerSpec struct {
	// RepoOwner is the GitHub repository owner
	RepoOwner string `json:"repoOwner"`

	// RepoName is the GitHub repository name
	RepoName string `json:"repoName"`

	// PRNumber is the pull request number
	PRNumber int `json:"prNumber"`
}

PullRequestTrackerSpec defines the desired state of PullRequestTracker

func (*PullRequestTrackerSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PullRequestTrackerSpec.

func (*PullRequestTrackerSpec) DeepCopyInto

func (in *PullRequestTrackerSpec) DeepCopyInto(out *PullRequestTrackerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PullRequestTrackerStatus

type PullRequestTrackerStatus struct {
	// State represents the current state of the PR (discovered|qualified|merged|failed)
	State string `json:"state,omitempty"`

	// LastUpdate is the timestamp of the last status update
	LastUpdate metav1.Time `json:"lastUpdate,omitempty"`

	// ObservedGeneration reflects the generation most recently observed by the controller
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// HeadSHA is the commit SHA at the head of the PR branch
	// +optional
	HeadSHA string `json:"headSHA,omitempty"`

	// Conditions represent the latest available observations of the PullRequestTracker's state
	// +optional
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// LastProcessedAt is the timestamp when this PR was last processed by webhook or polling
	// Used for deduplication to prevent webhook/poll conflicts in hybrid mode
	// +optional
	LastProcessedAt metav1.Time `json:"lastProcessedAt,omitempty"`

	// LastProcessedBy indicates the source that last processed this PR (webhook|polling)
	// +optional
	LastProcessedBy string `json:"lastProcessedBy,omitempty"`

	// ExtractedMetadata contains metadata extracted during qualification
	// +optional
	ExtractedMetadata map[string]string `json:"extractedMetadata,omitempty"`

	// GeneratedLabels contains labels generated from extracted metadata
	// +optional
	GeneratedLabels map[string]string `json:"generatedLabels,omitempty"`

	// CurrentEnvironment tracks the environment where the PR is currently deployed
	// Used for promotion flow to determine source environment for test triggers
	// +optional
	CurrentEnvironment string `json:"currentEnvironment,omitempty"`

	// TestRuns tracks external test executions triggered for promotion gates
	// +optional
	TestRuns []TestRun `json:"testRuns,omitempty"`

	// PromotionHistory tracks all environment promotions for this PR
	// +optional
	PromotionHistory []PromotionRecord `json:"promotionHistory,omitempty"`
}

PullRequestTrackerStatus defines the observed state of PullRequestTracker

func (*PullRequestTrackerStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PullRequestTrackerStatus.

func (*PullRequestTrackerStatus) DeepCopyInto

func (in *PullRequestTrackerStatus) DeepCopyInto(out *PullRequestTrackerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TestResult

type TestResult struct {
	// Name of the test (matches ExternalTestSpec.Name)
	Name string `json:"name"`

	// Status of the test (success, failure, timeout, etc.)
	Status string `json:"status"`

	// StartedAt is when the test was triggered
	StartedAt metav1.Time `json:"startedAt"`

	// CompletedAt is when the test finished
	// +optional
	CompletedAt metav1.Time `json:"completedAt,omitempty"`

	// Message contains additional context (error message, summary, etc.)
	// +optional
	Message string `json:"message,omitempty"`

	// URL is the web link to view the test run
	// +optional
	URL string `json:"url,omitempty"`
}

TestResult captures the outcome of a single external test execution.

func (*TestResult) DeepCopy

func (in *TestResult) DeepCopy() *TestResult

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestResult.

func (*TestResult) DeepCopyInto

func (in *TestResult) DeepCopyInto(out *TestResult)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TestRun

type TestRun struct {
	// ID is the unique identifier for this test run in the CI system
	ID string `json:"id"`

	// Provider identifies the CI system (jenkins, github-actions, gitlab)
	Provider string `json:"provider"`

	// JobName is the test job/workflow/pipeline name that was triggered
	JobName string `json:"jobName"`

	// Status is the current test status (pending, running, success, failure, timeout)
	Status string `json:"status"`

	// URL is the web link to view the test run in the CI system
	// +optional
	URL string `json:"url,omitempty"`

	// TriggeredAt is when the test was triggered
	TriggeredAt metav1.Time `json:"triggeredAt"`

	// CompletedAt is when the test finished (if completed)
	// +optional
	CompletedAt metav1.Time `json:"completedAt,omitempty"`

	// Duration is the total test execution time
	// +optional
	Duration metav1.Duration `json:"duration,omitempty"`

	// Message contains additional context about the test run (errors, summary, etc.)
	// +optional
	Message string `json:"message,omitempty"`
}

TestRun represents a triggered external test run for promotion gating. Tracks the execution of tests in external CI systems (Jenkins, GitHub Actions, GitLab CI).

func (*TestRun) DeepCopy

func (in *TestRun) DeepCopy() *TestRun

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestRun.

func (*TestRun) DeepCopyInto

func (in *TestRun) DeepCopyInto(out *TestRun)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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