@@ -98,10 +98,10 @@ func RegisterDeploymentPlugin[Config, DeployTargetConfig any](plugin DeploymentP
98
98
deploymentServiceServer = & DeploymentPluginServiceServer [Config , DeployTargetConfig ]{base : plugin }
99
99
}
100
100
101
- // RegisterPipelineSyncPlugin registers the given pipeline sync plugin.
101
+ // RegisterStagePlugin registers the given stage plugin.
102
102
// It will be used when running the piped.
103
- func RegisterPipelineSyncPlugin [Config , DeployTargetConfig any ](plugin StagePlugin [Config , DeployTargetConfig ]) {
104
- deploymentServiceServer = & PipelineSyncPluginServiceServer [Config , DeployTargetConfig ]{base : plugin }
103
+ func RegisterStagePlugin [Config , DeployTargetConfig any ](plugin StagePlugin [Config , DeployTargetConfig ]) {
104
+ deploymentServiceServer = & StagePluginServiceServer [Config , DeployTargetConfig ]{base : plugin }
105
105
}
106
106
107
107
type logPersister interface {
@@ -193,8 +193,8 @@ func (s *DeploymentPluginServiceServer[Config, DeployTargetConfig]) ExecuteStage
193
193
return executeStage (ctx , s .base , & s .config , nil , client , request , s .logger ) // TODO: pass the deployTargets
194
194
}
195
195
196
- // PipelineSyncPluginServiceServer is the gRPC server that handles requests from the piped.
197
- type PipelineSyncPluginServiceServer [Config , DeployTargetConfig any ] struct {
196
+ // StagePluginServiceServer is the gRPC server that handles requests from the piped.
197
+ type StagePluginServiceServer [Config , DeployTargetConfig any ] struct {
198
198
deployment.UnimplementedDeploymentServiceServer
199
199
commonFields
200
200
@@ -203,25 +203,25 @@ type PipelineSyncPluginServiceServer[Config, DeployTargetConfig any] struct {
203
203
}
204
204
205
205
// Name returns the name of the plugin.
206
- func (s * PipelineSyncPluginServiceServer [Config , DeployTargetConfig ]) Name () string {
206
+ func (s * StagePluginServiceServer [Config , DeployTargetConfig ]) Name () string {
207
207
return s .base .Name ()
208
208
}
209
209
210
210
// Version returns the version of the plugin.
211
- func (s * PipelineSyncPluginServiceServer [Config , DeployTargetConfig ]) Version () string {
211
+ func (s * StagePluginServiceServer [Config , DeployTargetConfig ]) Version () string {
212
212
return s .base .Version ()
213
213
}
214
214
215
215
// Register registers the server to the given gRPC server.
216
- func (s * PipelineSyncPluginServiceServer [Config , DeployTargetConfig ]) Register (server * grpc.Server ) {
216
+ func (s * StagePluginServiceServer [Config , DeployTargetConfig ]) Register (server * grpc.Server ) {
217
217
deployment .RegisterDeploymentServiceServer (server , s )
218
218
}
219
219
220
- func (s * PipelineSyncPluginServiceServer [Config , DeployTargetConfig ]) setCommonFields (fields commonFields ) {
220
+ func (s * StagePluginServiceServer [Config , DeployTargetConfig ]) setCommonFields (fields commonFields ) {
221
221
s .commonFields = fields
222
222
}
223
223
224
- func (s * PipelineSyncPluginServiceServer [Config , DeployTargetConfig ]) setConfig (bytes []byte ) error {
224
+ func (s * StagePluginServiceServer [Config , DeployTargetConfig ]) setConfig (bytes []byte ) error {
225
225
if bytes == nil {
226
226
return nil
227
227
}
@@ -231,27 +231,27 @@ func (s *PipelineSyncPluginServiceServer[Config, DeployTargetConfig]) setConfig(
231
231
return nil
232
232
}
233
233
234
- func (s * PipelineSyncPluginServiceServer [Config , DeployTargetConfig ]) FetchDefinedStages (context.Context , * deployment.FetchDefinedStagesRequest ) (* deployment.FetchDefinedStagesResponse , error ) {
234
+ func (s * StagePluginServiceServer [Config , DeployTargetConfig ]) FetchDefinedStages (context.Context , * deployment.FetchDefinedStagesRequest ) (* deployment.FetchDefinedStagesResponse , error ) {
235
235
return & deployment.FetchDefinedStagesResponse {Stages : s .base .FetchDefinedStages ()}, nil
236
236
}
237
- func (s * PipelineSyncPluginServiceServer [Config , DeployTargetConfig ]) DetermineVersions (context.Context , * deployment.DetermineVersionsRequest ) (* deployment.DetermineVersionsResponse , error ) {
237
+ func (s * StagePluginServiceServer [Config , DeployTargetConfig ]) DetermineVersions (context.Context , * deployment.DetermineVersionsRequest ) (* deployment.DetermineVersionsResponse , error ) {
238
238
return & deployment.DetermineVersionsResponse {}, nil
239
239
}
240
- func (s * PipelineSyncPluginServiceServer [Config , DeployTargetConfig ]) DetermineStrategy (context.Context , * deployment.DetermineStrategyRequest ) (* deployment.DetermineStrategyResponse , error ) {
240
+ func (s * StagePluginServiceServer [Config , DeployTargetConfig ]) DetermineStrategy (context.Context , * deployment.DetermineStrategyRequest ) (* deployment.DetermineStrategyResponse , error ) {
241
241
return & deployment.DetermineStrategyResponse {Unsupported : true }, nil
242
242
}
243
- func (s * PipelineSyncPluginServiceServer [Config , DeployTargetConfig ]) BuildPipelineSyncStages (ctx context.Context , request * deployment.BuildPipelineSyncStagesRequest ) (* deployment.BuildPipelineSyncStagesResponse , error ) {
243
+ func (s * StagePluginServiceServer [Config , DeployTargetConfig ]) BuildPipelineSyncStages (ctx context.Context , request * deployment.BuildPipelineSyncStagesRequest ) (* deployment.BuildPipelineSyncStagesResponse , error ) {
244
244
client := & Client {
245
245
base : s .client ,
246
246
pluginName : s .Name (),
247
247
}
248
248
249
249
return buildPipelineSyncStages (ctx , s .base , & s .config , client , request , s .logger ) // TODO: pass the real client
250
250
}
251
- func (s * PipelineSyncPluginServiceServer [Config , DeployTargetConfig ]) BuildQuickSyncStages (context.Context , * deployment.BuildQuickSyncStagesRequest ) (* deployment.BuildQuickSyncStagesResponse , error ) {
251
+ func (s * StagePluginServiceServer [Config , DeployTargetConfig ]) BuildQuickSyncStages (context.Context , * deployment.BuildQuickSyncStagesRequest ) (* deployment.BuildQuickSyncStagesResponse , error ) {
252
252
return nil , status .Errorf (codes .Unimplemented , "method BuildQuickSyncStages not implemented" )
253
253
}
254
- func (s * PipelineSyncPluginServiceServer [Config , DeployTargetConfig ]) ExecuteStage (ctx context.Context , request * deployment.ExecuteStageRequest ) (response * deployment.ExecuteStageResponse , _ error ) {
254
+ func (s * StagePluginServiceServer [Config , DeployTargetConfig ]) ExecuteStage (ctx context.Context , request * deployment.ExecuteStageRequest ) (response * deployment.ExecuteStageResponse , _ error ) {
255
255
lp := s .logPersister .StageLogPersister (request .GetInput ().GetDeployment ().GetId (), request .GetInput ().GetStage ().GetId ())
256
256
defer func () {
257
257
// When termination signal received and the stage is not completed yet, we should not mark the log persister as completed.
0 commit comments