@@ -118,7 +118,7 @@ type PipelineRepository interface {
118
118
FindActiveByInFilter (envId int , appIdIncludes []int ) (pipelines []* Pipeline , err error )
119
119
FindActivePipelineAppIdsByInFilter (envId int , appIdIncludes []int ) ([]int , error )
120
120
FindActiveByNotFilter (envId int , appIdExcludes []int ) (pipelines []* Pipeline , err error )
121
- FindAllPipelinesByChartsOverrideAndAppIdAndChartId ( chartOverridden bool , appId int , chartId int ) (pipelines []* Pipeline , err error )
121
+ FindAllPipelinesWithoutOverriddenCharts ( appId int ) (pipelineIds []int , err error )
122
122
FindActiveByAppIdAndPipelineId (appId int , pipelineId int ) ([]* Pipeline , error )
123
123
FindActiveByAppIdAndEnvId (appId int , envId int ) (* Pipeline , error )
124
124
SetDeploymentAppCreatedInPipeline (deploymentAppCreated bool , pipelineId int , userId int32 ) error
@@ -577,19 +577,16 @@ func (impl *PipelineRepositoryImpl) FindActiveByNotFilter(envId int, appIdExclud
577
577
return pipelines , err
578
578
}
579
579
580
- func (impl * PipelineRepositoryImpl ) FindAllPipelinesByChartsOverrideAndAppIdAndChartId (hasConfigOverridden bool , appId int , chartId int ) (pipelines []* Pipeline , err error ) {
581
- err = impl .dbConnection .Model (& pipelines ).
582
- Column ("pipeline.*" ).
583
- Join ("inner join charts on pipeline.app_id = charts.app_id" ).
584
- Join ("inner join chart_env_config_override ceco on charts.id = ceco.chart_id" ).
585
- Where ("pipeline.app_id = ?" , appId ).
586
- Where ("charts.id = ?" , chartId ).
587
- Where ("ceco.is_override = ?" , hasConfigOverridden ).
588
- Where ("pipeline.deleted = ?" , false ).
589
- Where ("ceco.active = ?" , true ).
590
- Where ("charts.active = ?" , true ).
591
- Select ()
592
- return pipelines , err
580
+ func (impl * PipelineRepositoryImpl ) FindAllPipelinesWithoutOverriddenCharts (appId int ) (pipelineIds []int , err error ) {
581
+ err = impl .dbConnection .Model ().Table ("pipeline" ).Column ("pipeline.id" ).
582
+ Where ("pipeline.deleted = ?" , false ).Where ("pipeline.app_id = ?" , appId ).
583
+ Where (`pipeline.environment_id NOT IN (
584
+ SELECT ceco.target_environment FROM chart_env_config_override ceco
585
+ INNER JOIN charts ON charts.id = ceco.chart_id
586
+ WHERE charts.app_id = ? AND charts.active = ? AND ceco.is_override = ?
587
+ AND ceco.active = ? AND ceco.latest = ?)` , appId , true , true , true , true ).
588
+ Select (& pipelineIds )
589
+ return pipelineIds , err
593
590
}
594
591
595
592
func (impl * PipelineRepositoryImpl ) FindActiveByAppIdAndPipelineId (appId int , pipelineId int ) ([]* Pipeline , error ) {
0 commit comments