Repository: devtron-labs/devtron
Pull request #3041 (2023-02-27 08:33:47)

release: PR for v0.6.12
Updates in git-sensor micro-service and charts

sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=devtron-labs_devtron&pullRequest=3041)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=devtron-labs_devtron&pullRequest=3041) No Coverage information  
[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=devtron-labs_devtron&pullRequest=3041&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=devtron-labs_devtron&pullRequest=3041&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=devtron-labs_devtron&pullRequest=3041)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=devtron-labs_devtron&pullRequest=3041&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=devtron-labs_devtron&pullRequest=3041) No Coverage information  
[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=devtron-labs_devtron&pullRequest=3041&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=devtron-labs_devtron&pullRequest=3041&metric=new_duplicated_lines_density&view=list)



Patch:
diff --git a/CHANGELOG/release-notes-v0.6.12.md b/CHANGELOG/release-notes-v0.6.12.md
new file mode 100644
index 000000000..3ea447d07
--- /dev/null
+++ b/CHANGELOG/release-notes-v0.6.12.md
@@ -0,0 +1,46 @@
+## v0.6.12
+
+## Bugs
+- fix: chart repository fixes (#2730)
+- fix: conditionally setting s3 config in workflow object (#3014)
+- fix: fixed condition for updating health timeline and status (#3003)
+- fix: added deployment app type support for app create api, separated cron time for helm app status update (#2995)
+- fix: helm deploy hibernate fix (#2983)
+- fix: duplicate name in charts and chart Group (#2942)
+- fix: sorting app environment containers in app listing api  (#2935)
+- fix: Multigit bug fix in case of preCD and postCD (#2920)
+- fix: Injected support for cloning linked ci pipelines via workflow cloning API (#2944)
+- fix: k8s log stream cpu issue (#2929)
+- fix: cd pipeline delete, 404 issue (#2939)
+- fix: finished on time update fix (#2932)
+- fix: updated log type for pipeline status methods (#2926)
+- fix: pvc mounted on pods for cache handling  (#2912)
+- fix: Installed apps rbac optimisation (#2918)
+- fix: event notification calls missing for Build Success and Cd Deployment Success for helm type (#2898)
+- fix: ingress url missing (#2915)
+## Enhancements
+- feat: deployment pipeline partially delete. (#2950)
+- feat: jira issue validator plugin added (#2968)
+- feat: add configuration for only logging pg queries exceeding a threshold duration (#2946)
+- feat: add api to change deployment app type for all cd pipelines in an environment (#2975)
+- feat: App grouping BE (#2979)
+- feat: Resource browser child ref (#2913)
+- feat: cluster bearer token hide from dashboard (#2894)
+- feat: added option to propagate custom tag to k8s resources for that application (#2841)
+- feat: argo stack upgrade (#2597)
+- feat: Showing app status on app listing page (#2799)
+## Documentation
+- docs: sso login doc (#2854)
+- docs: Some correction in Documentation at install devtron/ configuration / ingress setup (#2981)
+- docs: sso login doc (#2854)
+- docs: Added preset plugins (#2904)
+- docs: mount pvc (#2941)
+- docs: minor updates ingress (#2931)
+## Others
+- bug: resolve failing bulk pipeline delete api (#3042)
+- removed server mode hardcoding (#3031)
+- fi: fixed incorrect userId in ci audit entries (#3011)
+- plugin jira icon added (#2977)
+- task: added api for getting default template values (#2905)
+
+
diff --git a/Wire.go b/Wire.go
index 5e35c118a..3932ba141 100644
--- a/Wire.go
+++ b/Wire.go
@@ -407,8 +407,8 @@ func InitializeApp() (*App, error) {
 		pubsub.NewWorkflowStatusUpdateHandlerImpl,
 		wire.Bind(new(pubsub.WorkflowStatusUpdateHandler), new(*pubsub.WorkflowStatusUpdateHandlerImpl)),
 
-		pubsub.NewApplicationStatusUpdateHandlerImpl,
-		wire.Bind(new(pubsub.ApplicationStatusUpdateHandler), new(*pubsub.ApplicationStatusUpdateHandlerImpl)),
+		pubsub.NewApplicationStatusHandlerImpl,
+		wire.Bind(new(pubsub.ApplicationStatusHandler), new(*pubsub.ApplicationStatusHandlerImpl)),
 
 		pubsub.NewCiEventHandlerImpl,
 		wire.Bind(new(pubsub.CiEventHandler), new(*pubsub.CiEventHandlerImpl)),
diff --git a/api/appStore/InstalledAppRestHandler.go b/api/appStore/InstalledAppRestHandler.go
index fa5d519c8..3745896bc 100644
--- a/api/appStore/InstalledAppRestHandler.go
+++ b/api/appStore/InstalledAppRestHandler.go
@@ -26,6 +26,8 @@ import (
 	openapi "github.com/devtron-labs/devtron/api/helm-app/openapiClient"
 	"github.com/devtron-labs/devtron/api/restHandler/common"
 	"github.com/devtron-labs/devtron/client/argocdServer/application"
+	"github.com/devtron-labs/devtron/internal/constants"
+	util2 "github.com/devtron-labs/devtron/internal/util"
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
 	"github.com/devtron-labs/devtron/pkg/appStore/deployment/service"
 	"github.com/devtron-labs/devtron/pkg/cluster"
@@ -34,6 +36,7 @@ import (
 	"github.com/devtron-labs/devtron/util/argo"
 	"github.com/devtron-labs/devtron/util/rbac"
 	"github.com/devtron-labs/devtron/util/response"
+	"github.com/go-pg/pg"
 	"github.com/gorilla/mux"
 	"go.uber.org/zap"
 	"gopkg.in/go-playground/validator.v9"
@@ -410,6 +413,12 @@ func (handler *InstalledAppRestHandlerImpl) FetchAppDetailsForInstalledApp(w htt
 	}
 	handler.Logger.Infow("request payload, FetchAppDetailsForInstalledApp, app store", "installedAppId", installedAppId, "envId", envId)
 
+	err = handler.installedAppService.CheckAppExistsByInstalledAppId(installedAppId)
+	if err == pg.ErrNoRows {
+		common.WriteJsonResp(w, err, "App not found in database", http.StatusBadRequest)
+		return
+	}
+
 	appDetail, err := handler.installedAppService.FindAppDetailsForAppstoreApplication(installedAppId, envId)
 	if err != nil {
 		handler.Logger.Errorw("service err, FetchAppDetailsForInstalledApp, app store", "err", err, "installedAppId", installedAppId, "envId", envId)
@@ -434,16 +443,34 @@ func (handler *InstalledAppRestHandlerImpl) FetchAppDetailsForInstalledApp(w htt
 	}
 	//rback block ends here
 	if len(appDetail.AppName) > 0 && len(appDetail.EnvironmentName) > 0 {
-		handler.fetchResourceTree(w, r, &appDetail)
+		err = handler.fetchResourceTree(w, r, &appDetail)
+		if appDetail.DeploymentAppType == util2.PIPELINE_DEPLOYMENT_TYPE_ACD {
+			apiError, ok := err.(*util2.ApiError)
+			if ok && apiError != nil {
+				if apiError.Code == constants.AppDetailResourceTreeNotFound && appDetail.DeploymentAppDeleteRequest == true {
+					err = handler.installedAppService.MarkGitOpsInstalledAppsDeletedIfArgoAppIsDeleted(installedAppId, envId)
+					appDeleteErr, appDeleteErrOk := err.(*util2.ApiError)
+					if appDeleteErrOk && appDeleteErr != nil {
+						common.WriteJsonResp(w, fmt.Errorf(appDeleteErr.InternalMessage), nil, appDeleteErr.HttpStatusCode)
+						return
+					}
+				}
+			}
+		} else if err != nil {
+			common.WriteJsonResp(w, fmt.Errorf("error in fetching resource tree"), nil, http.StatusInternalServerError)
+			return
+		}
+
 	} else {
 		appDetail.ResourceTree = map[string]interface{}{}
 		handler.Logger.Warnw("appName and envName not found - avoiding resource tree call", "app", appDetail.AppName, "env", appDetail.EnvironmentName)
 	}
-	common.WriteJsonResp(w, err, appDetail, http.StatusOK)
+	common.WriteJsonResp(w, nil, appDetail, http.StatusOK)
 }
 
-func (handler *InstalledAppRestHandlerImpl) fetchResourceTree(w http.ResponseWriter, r *http.Request, appDetail *bean2.AppDetailContainer) {
+func (handler *InstalledAppRestHandlerImpl) fetchResourceTree(w http.ResponseWriter, r *http.Request, appDetail *bean2.AppDetailContainer) error {
 	ctx := r.Context()
 	cn, _ := w.(http.CloseNotifier)
-	handler.installedAppService.FetchResourceTree(ctx, cn, appDetail)
+	_, err := handler.installedAppService.FetchResourceTree(ctx, cn, appDetail)
+	return err
 }
diff --git a/api/appStore/deployment/AppStoreDeploymentRestHandler.go b/api/appStore/deployment/AppStoreDeploymentRestHandler.go
index 5c92c1705..42a115149 100644
--- a/api/appStore/deployment/AppStoreDeploymentRestHandler.go
+++ b/api/appStore/deployment/AppStoreDeploymentRestHandler.go
@@ -258,11 +258,20 @@ func (handler AppStoreDeploymentRestHandlerImpl) DeleteInstalledApp(w http.Respo
 	if len(force) > 0 {
 		forceDelete, err = strconv.ParseBool(force)
 		if err != nil {
-			handler.Logger.Errorw("request err, DeleteInstalledApp", "err", err, "installAppId", installAppId)
 			common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
 			return
 		}
 	}
+	partialDelete := false
+	partialDeleteStr := v.Get("partialDelete")
+	if len(partialDeleteStr) > 0 {
+		partialDelete, err = strconv.ParseBool(partialDeleteStr)
+		if err != nil {
+			common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
+			return
+		}
+	}
+
 	handler.Logger.Infow("request payload, DeleteInstalledApp", "installAppId", installAppId)
 	token := r.Header.Get("token")
 	installedApp, err := handler.appStoreDeploymentService.GetInstalledApp(installAppId)
@@ -294,7 +303,7 @@ func (handler AppStoreDeploymentRestHandlerImpl) DeleteInstalledApp(w http.Respo
 	}
 	//rbac block ends here
 
-	request := appStoreBean.InstallAppVersionDTO{}
+	request := &appStoreBean.InstallAppVersionDTO{}
 	request.InstalledAppId = installAppId
 	request.AppName = installedApp.AppName
 	request.AppId = installedApp.AppId
@@ -304,6 +313,7 @@ func (handler AppStoreDeploymentRestHandlerImpl) DeleteInstalledApp(w http.Respo
 	request.AppOfferingMode = installedApp.AppOfferingMode
 	request.ClusterId = installedApp.ClusterId
 	request.Namespace = installedApp.Namespace
+	request.AcdPartialDelete = partialDelete
 	ctx, cancel := context.WithCancel(r.Context())
 	if cn, ok := w.(http.CloseNotifier); ok {
 		go func(done <-chan struct{}, closed <-chan bool) {
@@ -325,13 +335,15 @@ func (handler AppStoreDeploymentRestHandlerImpl) DeleteInstalledApp(w http.Respo
 		}
 		ctx = context.WithValue(r.Context(), "token", acdToken)
 	}
-	res, err := handler.appStoreDeploymentService.DeleteInstalledApp(ctx, &request)
+
+	request, err = handler.appStoreDeploymentService.DeleteInstalledApp(ctx, request)
 	if err != nil {
 		handler.Logger.Errorw("service err, DeleteInstalledApp", "err", err, "installAppId", installAppId)
 		common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
 		return
 	}
-	common.WriteJsonResp(w, err, res, http.StatusOK)
+
+	common.WriteJsonResp(w, err, request, http.StatusOK)
 }
 
 func (handler *AppStoreDeploymentRestHandlerImpl) LinkHelmApplicationToChartStore(w http.ResponseWriter, r *http.Request) {
diff --git a/api/bean/AppView.go b/api/bean/AppView.go
index 681ac4f5d..ed5bf2b27 100644
--- a/api/bean/AppView.go
+++ b/api/bean/AppView.go
@@ -113,6 +113,7 @@ type DeploymentDetailContainer struct {
 	ClusterName                   string          `json:"clusterName,omitempty"`
 	DockerRegistryId              string          `json:"dockerRegistryId,omitempty"`
 	IpsAccessProvided             bool            `json:"ipsAccessProvided"`
+	DeploymentAppDeleteRequest    bool            `json:"deploymentAppDeleteRequest"`
 }
 
 type AppDetailContainer struct {
@@ -124,14 +125,15 @@ type AppDetailContainer struct {
 }
 
 type Environment struct {
-	AppStatus       string `json:"appStatus"` //this is not the status of environment , this make sense with a specific app only
-	EnvironmentId   int    `json:"environmentId"`
-	EnvironmentName string `json:"environmentName"`
-	AppMetrics      *bool  `json:"appMetrics"`
-	InfraMetrics    *bool  `json:"infraMetrics"`
-	Prod            bool   `json:"prod"`
-	ChartRefId      int    `json:"chartRefId"`
-	LastDeployed    string `json:"lastDeployed"`
+	AppStatus                  string `json:"appStatus"` //this is not the status of environment , this make sense with a specific app only
+	EnvironmentId              int    `json:"environmentId"`
+	EnvironmentName            string `json:"environmentName"`
+	AppMetrics                 *bool  `json:"appMetrics"`
+	InfraMetrics               *bool  `json:"infraMetrics"`
+	Prod                       bool   `json:"prod"`
+	ChartRefId                 int    `json:"chartRefId"`
+	LastDeployed               string `json:"lastDeployed"`
+	DeploymentAppDeleteRequest bool   `json:"deploymentAppDeleteRequest"`
 }
 
 type InstanceDetail struct {
diff --git a/api/restHandler/AppListingRestHandler.go b/api/restHandler/AppListingRestHandler.go
index c1b0abbb2..68b7bdcf1 100644
--- a/api/restHandler/AppListingRestHandler.go
+++ b/api/restHandler/AppListingRestHandler.go
@@ -29,6 +29,7 @@ import (
 	"github.com/devtron-labs/devtron/api/restHandler/common"
 	"github.com/devtron-labs/devtron/client/argocdServer/application"
 	"github.com/devtron-labs/devtron/client/cron"
+	"github.com/devtron-labs/devtron/internal/constants"
 	"github.com/devtron-labs/devtron/internal/sql/repository/pipelineConfig"
 	"github.com/devtron-labs/devtron/internal/util"
 	"github.com/devtron-labs/devtron/pkg/app"
@@ -44,6 +45,7 @@ import (
 	"github.com/devtron-labs/devtron/util/argo"
 	"github.com/devtron-labs/devtron/util/k8s"
 	"github.com/devtron-labs/devtron/util/rbac"
+	"github.com/go-pg/pg"
 	"github.com/gorilla/mux"
 	"go.opentelemetry.io/otel"
 	"go.uber.org/zap"
@@ -355,6 +357,20 @@ func (handler AppListingRestHandlerImpl) FetchAppDetails(w http.ResponseWriter,
 		common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
 		return
 	}
+	pipelines, err := handler.pipelineRepository.FindActiveByAppIdAndEnvironmentId(appId, envId)
+	if err == pg.ErrNoRows {
+		common.WriteJsonResp(w, err, "pipeline Not found in database", http.StatusNotFound)
+		return
+	}
+	if len(pipelines) == 0 {
+		common.WriteJsonResp(w, fmt.Errorf("app deleted"), nil, http.StatusNotFound)
+		return
+	}
+	if len(pipelines) != 1 {
+		common.WriteJsonResp(w, err, "multiple pipelines found for an envId", http.StatusBadRequest)
+		return
+	}
+	cdPipeline := pipelines[0]
 	appDetail, err := handler.appListingService.FetchAppDetails(r.Context(), appId, envId)
 	if err != nil {
 		handler.logger.Errorw("service err, FetchAppDetails", "err", err, "appId", appId, "envId", envId)
@@ -367,7 +383,31 @@ func (handler AppListingRestHandlerImpl) FetchAppDetails(w http.ResponseWriter,
 		common.WriteJsonResp(w, fmt.Errorf("unauthorized user"), nil, http.StatusForbidden)
 		return
 	}
-	appDetail = handler.fetchResourceTree(w, r, appId, envId, appDetail)
+	acdToken, err := handler.argoUserService.GetLatestDevtronArgoCdUserToken()
+	if err != nil {
+		common.WriteJsonResp(w, fmt.Errorf("error in getting acd token"), nil, http.StatusInternalServerError)
+		return
+	}
+	appDetail, err = handler.fetchResourceTree(w, r, appId, envId, appDetail, acdToken, cdPipeline)
+	if appDetail.DeploymentAppType == util.PIPELINE_DEPLOYMENT_TYPE_ACD {
+		apiError, ok := err.(*util.ApiError)
+		if ok && apiError != nil {
+			if apiError.Code == constants.AppDetailResourceTreeNotFound && appDetail.DeploymentAppDeleteRequest == true {
+				acdAppFound, _ := handler.pipeline.MarkGitOpsDevtronAppsDeletedWhereArgoAppIsDeleted(appId, envId, acdToken, cdPipeline)
+				if acdAppFound {
+					common.WriteJsonResp(w, fmt.Errorf("unable to fetch resource tree"), nil, http.StatusInternalServerError)
+					return
+				} else {
+					common.WriteJsonResp(w, fmt.Errorf("app deleted"), nil, http.StatusNotFound)
+					return
+				}
+			}
+		}
+	}
+	if err != nil {
+		common.WriteJsonResp(w, fmt.Errorf("unable to fetch resource tree"), nil, http.StatusInternalServerError)
+		return
+	}
 	common.WriteJsonResp(w, err, appDetail, http.StatusOK)
 }
 
@@ -624,7 +664,8 @@ func (handler AppListingRestHandlerImpl) RedirectToLinkouts(w http.ResponseWrite
 func (handler AppListingRestHandlerImpl) fetchResourceTreeFromInstallAppService(w http.ResponseWriter, r *http.Request, appDetail bean.AppDetailContainer) bean.AppDetailContainer {
 	rctx := r.Context()
 	cn, _ := w.(http.CloseNotifier)
-	return handler.installedAppService.FetchResourceTree(rctx, cn, &appDetail)
+	_, _ = handler.installedAppService.FetchResourceTree(rctx, cn, &appDetail)
+	return appDetail
 }
 func (handler AppListingRestHandlerImpl) GetHostUrlsByBatch(w http.ResponseWriter, r *http.Request) {
 	vars := r.URL.Query()
@@ -659,6 +700,16 @@ func (handler AppListingRestHandlerImpl) GetHostUrlsByBatch(w http.ResponseWrite
 		common.WriteJsonResp(w, fmt.Errorf("error in parsing envId : %s must be integer", envIdParam), nil, http.StatusBadRequest)
 		return
 	}
+	pipelines, err := handler.pipelineRepository.FindActiveByAppIdAndEnvironmentId(appId, envId)
+	if err == pg.ErrNoRows {
+		common.WriteJsonResp(w, err, "pipeline Not found in database", http.StatusNotFound)
+		return
+	}
+	if len(pipelines) != 1 {
+		common.WriteJsonResp(w, err, "multiple pipelines found for an envId", http.StatusBadRequest)
+		return
+	}
+	cdPipeline := pipelines[0]
 	appDetail, err, appId = handler.getAppDetails(r.Context(), appIdParam, installedAppIdParam, envId)
 	if err != nil {
 		handler.logger.Errorw("error occurred while getting app details", "appId", appIdParam, "installedAppId", installedAppIdParam, "envId", envId)
@@ -686,7 +737,12 @@ func (handler AppListingRestHandlerImpl) GetHostUrlsByBatch(w http.ResponseWrite
 	if installedAppIdParam != "" {
 		appDetail = handler.fetchResourceTreeFromInstallAppService(w, r, appDetail)
 	} else {
-		appDetail = handler.fetchResourceTree(w, r, appId, envId, appDetail)
+		acdToken, err := handler.argoUserService.GetLatestDevtronArgoCdUserToken()
+		if err != nil {
+			common.WriteJsonResp(w, fmt.Errorf("error in getting acd token"), nil, http.StatusInternalServerError)
+			return
+		}
+		appDetail, err = handler.fetchResourceTree(w, r, appId, envId, appDetail, acdToken, cdPipeline)
 	}
 
 	resourceTree := appDetail.ResourceTree
@@ -737,20 +793,9 @@ func (handler AppListingRestHandlerImpl) getAppDetails(ctx context.Context, appI
 }
 
 // TODO: move this to service
-func (handler AppListingRestHandlerImpl) fetchResourceTree(w http.ResponseWriter, r *http.Request, appId int, envId int, appDetail bean.AppDetailContainer) bean.AppDetailContainer {
+func (handler AppListingRestHandlerImpl) fetchResourceTree(w http.ResponseWriter, r *http.Request, appId int, envId int, appDetail bean.AppDetailContainer, acdToken string, cdPipeline *pipelineConfig.Pipeline) (bean.AppDetailContainer, error) {
 	if len(appDetail.AppName) > 0 && len(appDetail.EnvironmentName) > 0 && util.IsAcdApp(appDetail.DeploymentAppType) {
 		//RBAC enforcer Ends
-		cdPipelines, err := handler.pipelineRepository.FindActiveByAppIdAndEnvironmentId(appId, envId)
-		if err != nil {
-			handler.logger.Errorw("error in getting cdPipeline by appId and envId", "err", err, "appid", appId, "envId", envId)
-			common.WriteJsonResp(w, err, "", http.StatusInternalServerError)
-			return appDetail
-		}
-		if len(cdPipelines) != 1 {
-			common.WriteJsonResp(w, err, "", http.StatusInternalServerError)
-			return appDetail
-		}
-		cdPipeline := cdPipelines[0]
 		query := &application2.ResourcesQuery{
 			ApplicationName: &cdPipeline.DeploymentAppName,
 		}
@@ -765,23 +810,18 @@ func (handler AppListingRestHandlerImpl) fetchResourceTree(w http.ResponseWriter
 			}(ctx.Done(), cn.CloseNotify())
 		}
 		defer cancel()
-		acdToken, err := handler.argoUserService.GetLatestDevtronArgoCdUserToken()
-		if err != nil {
-			handler.logger.Errorw("error in getting acd token", "err", err)
-			common.WriteJsonResp(w, err, "", http.StatusInternalServerError)
-			return appDetail
-		}
 		ctx = context.WithValue(ctx, "token", acdToken)
 		start := time.Now()
 		resp, err := handler.application.ResourceTree(ctx, query)
 		elapsed := time.Since(start)
 		if err != nil {
-			handler.logger.Errorw("service err, FetchAppDetails, resource tree",
-				"err", err,
-				"app", appId,
-				"env", envId)
-
-			return appDetail
+			handler.logger.Errorw("service err, FetchAppDetails, resource tree", "err", err, "app", appId, "env", envId)
+			err = &util.ApiError{
+				Code:            constants.AppDetailResourceTreeNotFound,
+				InternalMessage: "app detail fetched, failed to get resource tree from acd",
+				UserMessage:     "Error fetching detail, if you have recently created this deployment pipeline please try after sometime.",
+			}
+			return appDetail, err
 		}
 		if resp.Status == string(health.HealthStatusHealthy) {
 			status, err := handler.appListingService.ISLastReleaseStopType(appId, envId)
@@ -849,7 +889,7 @@ func (handler AppListingRestHandlerImpl) fetchResourceTree(w http.ResponseWriter
 		appDetail.ResourceTree = map[string]interface{}{}
 		handler.logger.Warnw("appName and envName not found - avoiding resource tree call", "app", appDetail.AppName, "env", appDetail.EnvironmentName)
 	}
-	return appDetail
+	return appDetail, nil
 }
 
 func (handler AppListingRestHandlerImpl) ManualSyncAcdPipelineDeploymentStatus(w http.ResponseWriter, r *http.Request) {
diff --git a/api/restHandler/app/DeploymentPipelineRestHandler.go b/api/restHandler/app/DeploymentPipelineRestHandler.go
index 40e64a06c..ed0e2dcf3 100644
--- a/api/restHandler/app/DeploymentPipelineRestHandler.go
+++ b/api/restHandler/app/DeploymentPipelineRestHandler.go
@@ -245,6 +245,8 @@ func (handler PipelineConfigRestHandlerImpl) PatchCdPipeline(w http.ResponseWrit
 			err = handler.validator.Struct(cdPipeline.Pipeline)
 		} else if cdPipeline.Action == bean.CD_DELETE {
 			err = handler.validator.Var(cdPipeline.Pipeline.Id, "gt=0")
+		} else if cdPipeline.Action == bean.CD_DELETE_PARTIAL {
+			err = handler.validator.Var(cdPipeline.Pipeline.Id, "gt=0")
 		}
 	}
 	if err != nil {
diff --git a/api/router/pubsub/ApplicationStatusHandler.go b/api/router/pubsub/ApplicationStatusHandler.go
new file mode 100644
index 000000000..72ee8fa8a
--- /dev/null
+++ b/api/router/pubsub/ApplicationStatusHandler.go
@@ -0,0 +1,219 @@
+/*
+ * Copyright (c) 2020 Devtron Labs
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package pubsub
+
+import (
+	"context"
+	"encoding/json"
+	"errors"
+	"github.com/devtron-labs/devtron/internal/sql/repository/pipelineConfig"
+	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
+	repository4 "github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
+	"time"
+
+	v1alpha12 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
+	pubsub "github.com/devtron-labs/common-lib/pubsub-lib"
+	"github.com/devtron-labs/devtron/pkg/app"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/service"
+	"github.com/devtron-labs/devtron/pkg/pipeline"
+	"github.com/go-pg/pg"
+	"go.uber.org/zap"
+)
+
+type ApplicationStatusHandler interface {
+	Subscribe() error
+	SubscribeDeleteStatus() error
+}
+
+type ApplicationStatusHandlerImpl struct {
+	logger                    *zap.SugaredLogger
+	pubsubClient              *pubsub.PubSubClientServiceImpl
+	appService                app.AppService
+	workflowDagExecutor       pipeline.WorkflowDagExecutor
+	installedAppService       service.InstalledAppService
+	appStoreDeploymentService service.AppStoreDeploymentService
+	pipelineBuilder           pipeline.PipelineBuilder
+	pipelineRepository        pipelineConfig.PipelineRepository
+	installedAppRepository    repository4.InstalledAppRepository
+}
+
+func NewApplicationStatusHandlerImpl(logger *zap.SugaredLogger, pubsubClient *pubsub.PubSubClientServiceImpl, appService app.AppService,
+	workflowDagExecutor pipeline.WorkflowDagExecutor, installedAppService service.InstalledAppService,
+	appStoreDeploymentService service.AppStoreDeploymentService, pipelineBuilder pipeline.PipelineBuilder,
+	pipelineRepository pipelineConfig.PipelineRepository, installedAppRepository repository4.InstalledAppRepository) *ApplicationStatusHandlerImpl {
+	appStatusUpdateHandlerImpl := &ApplicationStatusHandlerImpl{
+		logger:                    logger,
+		pubsubClient:              pubsubClient,
+		appService:                appService,
+		workflowDagExecutor:       workflowDagExecutor,
+		installedAppService:       installedAppService,
+		appStoreDeploymentService: appStoreDeploymentService,
+		pipelineBuilder:           pipelineBuilder,
+		pipelineRepository:        pipelineRepository,
+		installedAppRepository:    installedAppRepository,
+	}
+	err := appStatusUpdateHandlerImpl.Subscribe()
+	if err != nil {
+		//logger.Error("err", err)
+		return nil
+	}
+	err = appStatusUpdateHandlerImpl.SubscribeDeleteStatus()
+	if err != nil {
+		return nil
+	}
+	return appStatusUpdateHandlerImpl
+}
+
+type ApplicationDetail struct {
+	Application *v1alpha12.Application `json:"application"`
+	StatusTime  time.Time              `json:"statusTime"`
+}
+
+func (impl *ApplicationStatusHandlerImpl) Subscribe() error {
+	callback := func(msg *pubsub.PubSubMsg) {
+		impl.logger.Debugw("APP_STATUS_UPDATE_REQ", "stage", "raw", "data", msg.Data)
+		applicationDetail := ApplicationDetail{}
+		err := json.Unmarshal([]byte(msg.Data), &applicationDetail)
+		if err != nil {
+			impl.logger.Errorw("unmarshal error on app update status", "err", err)
+			return
+		}
+		app := applicationDetail.Application
+		if app == nil {
+			return
+		}
+		if applicationDetail.StatusTime.IsZero() {
+			applicationDetail.StatusTime = time.Now()
+		}
+		isSucceeded, err := impl.appService.UpdateDeploymentStatusAndCheckIsSucceeded(app, applicationDetail.StatusTime)
+		if err != nil {
+			impl.logger.Errorw("error on application status update", "err", err, "msg", string(msg.Data))
+			//TODO - check update for charts - fix this call
+			if err == pg.ErrNoRows {
+				// if not found in charts (which is for devtron apps) try to find in installed app (which is for devtron charts)
+				_, err := impl.installedAppService.UpdateInstalledAppVersionStatus(app)
+				if err != nil {
+					impl.logger.Errorw("error on application status update", "err", err, "msg", string(msg.Data))
+					return
+				}
+			}
+			// return anyway whether updates or failure, no further processing for charts status update
+			return
+		}
+
+		// invoke DagExecutor, for cd success which will trigger post stage if exist.
+		if isSucceeded {
+			impl.logger.Debugw("git hash history", "list", app.Status.History)
+			gitHash := ""
+			if app != nil {
+				gitHash = app.Status.Sync.Revision
+			}
+			err = impl.workflowDagExecutor.HandleDeploymentSuccessEvent(gitHash, 0)
+			if err != nil {
+				impl.logger.Errorw("deployment success event error", "gitHash", gitHash, "err", err)
+				return
+			}
+		}
+		impl.logger.Debugw("application status update completed", "app", app.Name)
+	}
+
+	err := impl.pubsubClient.Subscribe(pubsub.APPLICATION_STATUS_UPDATE_TOPIC, callback)
+	if err != nil {
+		impl.logger.Error(err)
+		return err
+	}
+	return nil
+}
+
+func (impl *ApplicationStatusHandlerImpl) SubscribeDeleteStatus() error {
+	callback := func(msg *pubsub.PubSubMsg) {
+		impl.logger.Debug("received app delete event")
+
+		impl.logger.Debugw("APP_STATUS_DELETE_REQ", "stage", "raw", "data", msg.Data)
+		applicationDetail := ApplicationDetail{}
+		err := json.Unmarshal([]byte(msg.Data), &applicationDetail)
+		if err != nil {
+			impl.logger.Errorw("unmarshal error on app delete status", "err", err)
+			return
+		}
+		app := applicationDetail.Application
+		if app == nil {
+			return
+		}
+		err = impl.updateArgoAppDeleteStatus(app)
+		if err != nil {
+			impl.logger.Errorw("error in updating pipeline delete status", "err", err)
+		}
+	}
+	err := impl.pubsubClient.Subscribe(pubsub.APPLICATION_STATUS_DELETE_TOPIC, callback)
+	if err != nil {
+		impl.logger.Errorw("error in subscribing to argo application status delete topic", "err", err)
+		return err
+	}
+	return nil
+}
+
+func (impl *ApplicationStatusHandlerImpl) updateArgoAppDeleteStatus(app *v1alpha12.Application) error {
+	pipeline, err := impl.pipelineRepository.GetArgoPipelineByArgoAppName(app.ObjectMeta.Name)
+	if err != nil && err != pg.ErrNoRows {
+		impl.logger.Errorw("error in fetching pipeline from Pipeline Repository", "err", err)
+		return err
+	}
+	if pipeline.Deleted == true {
+		impl.logger.Errorw("invalid nats message, pipeline already deleted")
+		return errors.New("invalid nats message, pipeline already deleted")
+	}
+	if err == pg.ErrNoRows {
+		//Helm app deployed using argocd
+		var gitHash string
+		if app.Operation != nil && app.Operation.Sync != nil {
+			gitHash = app.Operation.Sync.Revision
+		} else if app.Status.OperationState != nil && app.Status.OperationState.Operation.Sync != nil {
+			gitHash = app.Status.OperationState.Operation.Sync.Revision
+		}
+		model, err := impl.installedAppRepository.GetInstalledAppByGitHash(gitHash)
+		if err != nil {
+			impl.logger.Errorw("error in fetching installed app by git hash from installed app repository", "err", err)
+			return err
+		}
+		deleteRequest := &appStoreBean.InstallAppVersionDTO{}
+		deleteRequest.ForceDelete = false
+		deleteRequest.AcdPartialDelete = false
+		deleteRequest.InstalledAppId = model.InstalledAppId
+		deleteRequest.AppId = model.AppId
+		deleteRequest.AppName = model.AppName
+		deleteRequest.Namespace = model.Namespace
+		deleteRequest.ClusterId = model.ClusterId
+		deleteRequest.EnvironmentId = model.EnvironmentId
+		deleteRequest.AppOfferingMode = model.AppOfferingMode
+		deleteRequest.UserId = 1
+		_, err = impl.appStoreDeploymentService.DeleteInstalledApp(context.Background(), deleteRequest)
+		if err != nil {
+			impl.logger.Errorw("error in deleting installed app", "err", err)
+			return err
+		}
+	} else {
+		// devtron app
+		err = impl.pipelineBuilder.DeleteCdPipeline(&pipeline, context.Background(), true, false, 0)
+		if err != nil {
+			impl.logger.Errorw("error in deleting cd pipeline", "err", err)
+			return err
+		}
+	}
+	return nil
+}
diff --git a/api/router/pubsub/ApplicationStatusUpdateHandler.go b/api/router/pubsub/ApplicationStatusUpdateHandler.go
deleted file mode 100644
index f1ad49df1..000000000
--- a/api/router/pubsub/ApplicationStatusUpdateHandler.go
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2020 Devtron Labs
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package pubsub
-
-import (
-	"encoding/json"
-	"time"
-
-	v1alpha12 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
-	pubsub "github.com/devtron-labs/common-lib/pubsub-lib"
-	"github.com/devtron-labs/devtron/pkg/app"
-	"github.com/devtron-labs/devtron/pkg/appStore/deployment/service"
-	"github.com/devtron-labs/devtron/pkg/pipeline"
-	"github.com/go-pg/pg"
-	"go.uber.org/zap"
-)
-
-type ApplicationStatusUpdateHandler interface {
-	Subscribe() error
-}
-
-type ApplicationStatusUpdateHandlerImpl struct {
-	logger              *zap.SugaredLogger
-	pubsubClient        *pubsub.PubSubClientServiceImpl
-	appService          app.AppService
-	workflowDagExecutor pipeline.WorkflowDagExecutor
-	installedAppService service.InstalledAppService
-}
-
-func NewApplicationStatusUpdateHandlerImpl(logger *zap.SugaredLogger, pubsubClient *pubsub.PubSubClientServiceImpl, appService app.AppService,
-	workflowDagExecutor pipeline.WorkflowDagExecutor, installedAppService service.InstalledAppService) *ApplicationStatusUpdateHandlerImpl {
-	appStatusUpdateHandlerImpl := &ApplicationStatusUpdateHandlerImpl{
-		logger:              logger,
-		pubsubClient:        pubsubClient,
-		appService:          appService,
-		workflowDagExecutor: workflowDagExecutor,
-		installedAppService: installedAppService,
-	}
-	err := appStatusUpdateHandlerImpl.Subscribe()
-	if err != nil {
-		//logger.Error("err", err)
-		return nil
-	}
-	return appStatusUpdateHandlerImpl
-}
-
-type ApplicationDetail struct {
-	Application *v1alpha12.Application `json:"application"`
-	StatusTime  time.Time              `json:"statusTime"`
-}
-
-func (impl *ApplicationStatusUpdateHandlerImpl) Subscribe() error {
-	callback := func(msg *pubsub.PubSubMsg) {
-		impl.logger.Debugw("APP_STATUS_UPDATE_REQ", "stage", "raw", "data", msg.Data)
-		applicationDetail := ApplicationDetail{}
-		err := json.Unmarshal([]byte(msg.Data), &applicationDetail)
-		if err != nil {
-			impl.logger.Errorw("unmarshal error on app update status", "err", err)
-			return
-		}
-		app := applicationDetail.Application
-		if app == nil {
-			return
-		}
-		if applicationDetail.StatusTime.IsZero() {
-			applicationDetail.StatusTime = time.Now()
-		}
-		isSucceeded, err := impl.appService.UpdateDeploymentStatusAndCheckIsSucceeded(app, applicationDetail.StatusTime)
-		if err != nil {
-			impl.logger.Errorw("error on application status update", "err", err, "msg", string(msg.Data))
-			//TODO - check update for charts - fix this call
-			if err == pg.ErrNoRows {
-				// if not found in charts (which is for devtron apps) try to find in installed app (which is for devtron charts)
-				_, err := impl.installedAppService.UpdateInstalledAppVersionStatus(app)
-				if err != nil {
-					impl.logger.Errorw("error on application status update", "err", err, "msg", string(msg.Data))
-					return
-				}
-			}
-			// return anyway whether updates or failure, no further processing for charts status update
-			return
-		}
-
-		// invoke DagExecutor, for cd success which will trigger post stage if exist.
-		if isSucceeded {
-			impl.logger.Debugw("git hash history", "list", app.Status.History)
-			gitHash := ""
-			if app != nil {
-				gitHash = app.Status.Sync.Revision
-			}
-			err = impl.workflowDagExecutor.HandleDeploymentSuccessEvent(gitHash, 0)
-			if err != nil {
-				impl.logger.Errorw("deployment success event error", "gitHash", gitHash, "err", err)
-				return
-			}
-		}
-		impl.logger.Debugw("application status update completed", "app", app.Name)
-	}
-
-	err := impl.pubsubClient.Subscribe(pubsub.APPLICATION_STATUS_UPDATE_TOPIC, callback)
-	if err != nil {
-		impl.logger.Error(err)
-		return err
-	}
-	return nil
-}
diff --git a/api/router/router.go b/api/router/router.go
index b3915f86c..4ac04f750 100644
--- a/api/router/router.go
+++ b/api/router/router.go
@@ -73,7 +73,7 @@ type MuxRouter struct {
 	UserRouter                         user.UserRouter
 	gitWebhookHandler                  pubsub.GitWebhookHandler
 	workflowUpdateHandler              pubsub.WorkflowStatusUpdateHandler
-	appUpdateHandler                   pubsub.ApplicationStatusUpdateHandler
+	appUpdateHandler                   pubsub.ApplicationStatusHandler
 	ciEventHandler                     pubsub.CiEventHandler
 	ChartRefRouter                     ChartRefRouter
 	ConfigMapRouter                    ConfigMapRouter
@@ -130,7 +130,7 @@ func NewMuxRouter(logger *zap.SugaredLogger, HelmRouter PipelineTriggerRouter, P
 	TeamRouter team.TeamRouter,
 	gitWebhookHandler pubsub.GitWebhookHandler,
 	workflowUpdateHandler pubsub.WorkflowStatusUpdateHandler,
-	appUpdateHandler pubsub.ApplicationStatusUpdateHandler,
+	appUpdateHandler pubsub.ApplicationStatusHandler,
 	ciEventHandler pubsub.CiEventHandler, pubsubClient *pubsub2.PubSubClientServiceImpl, UserRouter user.UserRouter,
 	ChartRefRouter ChartRefRouter, ConfigMapRouter ConfigMapRouter, AppStoreRouter appStore.AppStoreRouter, chartRepositoryRouter chartRepo.ChartRepositoryRouter,
 	ReleaseMetricsRouter ReleaseMetricsRouter, deploymentGroupRouter DeploymentGroupRouter, batchOperationRouter BatchOperationRouter,
diff --git a/charts/devtron/Chart.yaml b/charts/devtron/Chart.yaml
index bc9585c08..33fd7569c 100644
--- a/charts/devtron/Chart.yaml
+++ b/charts/devtron/Chart.yaml
@@ -1,6 +1,6 @@
 apiVersion: v2
 name: devtron-operator
-appVersion: 0.6.11
+appVersion: 0.6.12
 description: Chart to configure and install Devtron. Devtron is a Kubernetes Orchestration system.
 keywords:
   - Devtron
@@ -11,12 +11,12 @@ keywords:
   - argocd
   - Hyperion
 engine: gotpl
-version: 0.22.49
+version: 0.22.50
 sources:
   - https://github.com/devtron-labs/charts
 dependencies:
 - name: argo-cd
-  version: "5.2.0"
+  version: "5.9.1"
   repository: https://argoproj.github.io/argo-helm
   condition: argo-cd.enabled
 - name: security
diff --git a/charts/devtron/devtron-bom.yaml b/charts/devtron/devtron-bom.yaml
index f79a64a47..365ee2a2a 100644
--- a/charts/devtron/devtron-bom.yaml
+++ b/charts/devtron/devtron-bom.yaml
@@ -1,16 +1,16 @@
 installer:
-  release: "v0.6.11"
+  release: "v0.6.12"
   image: "quay.io/devtron/inception"
   tag: "1d2b87e5-185-11095"
   
 components:
   dashboard:
-    image: "quay.io/devtron/dashboard:c49004b1-325-12557"
+    image: "quay.io/devtron/dashboard:250c7c3f-325-12823"
   devtron:
-    image: "quay.io/devtron/hyperion:c35045c2-280-12565"
-    cicdImage: "quay.io/devtron/devtron:c35045c2-326-12555"
+    image: "quay.io/devtron/hyperion:f12eae0d-280-12836"
+    cicdImage: "quay.io/devtron/devtron:f12eae0d-434-12846"
   argocdDexServer:
-    image: "ghcr.io/dexidp/dex:v2.30.2"
+    image: "ghcr.io/dexidp/dex:v2.35.3"
     initContainer:
       authenticator: "quay.io/devtron/authenticator:6e466830-393-11943"
   kubelink:
@@ -24,16 +24,16 @@ components:
     envVars:
       devtron:
         GIT_BRANCH: "main"
-        GIT_HASH: "c35045c218d95741522fee8b27ee42e3956ba4c6"
+        GIT_HASH: "f12eae0d785dc3f98773946516cb2726ed96fdac"
       casbin:
         GIT_BRANCH: "main"
-        GIT_HASH: "c35045c218d95741522fee8b27ee42e3956ba4c6"
+        GIT_HASH: "f12eae0d785dc3f98773946516cb2726ed96fdac"
         
 argo-cd:
   global:
     image:
       repository: quay.io/argoproj/argocd
-      tag: "v2.4.0"
+      tag: "v2.5.2"
       imagePullPolicy: IfNotPresent
 
 notifier:
diff --git a/charts/devtron/templates/argocd-secret.yaml b/charts/devtron/templates/argocd-secret.yaml
index 3a90a6f62..70890bac9 100644
--- a/charts/devtron/templates/argocd-secret.yaml
+++ b/charts/devtron/templates/argocd-secret.yaml
@@ -20,6 +20,7 @@ metadata:
     "helm.sh/resource-policy": keep
   name: argocd-cm
 data:
+  timeout.hard.reconciliation: "0"
   timeout.reconciliation: 60s
   repositories: |-
     - name: devtron
diff --git a/charts/devtron/values.yaml b/charts/devtron/values.yaml
index be6939a95..020e4fcf4 100644
--- a/charts/devtron/values.yaml
+++ b/charts/devtron/values.yaml
@@ -1,7 +1,7 @@
 installer:
   repo: "devtron-labs/devtron"
 #  For Kubernetes version < 1.16, set release: legacy. You won't be able to upgrade Devtron unless you upgrade the K8s version to 1.16 or above.
-  release: "v0.6.11" #You can use a branch name or a release tag name as a release, for gitee as source only "main" is supported as of now
+  release: "v0.6.12" #You can use a branch name or a release tag name as a release, for gitee as source only "main" is supported as of now
   image: quay.io/devtron/inception
   tag: 1d2b87e5-185-11095
   source: "github" # Available options are github and gitee
@@ -43,12 +43,12 @@ components:
       sentry: "false"
       sentryEnv: "PRODUCTION"
       applicationMetrics: "true"
-    image: "quay.io/devtron/dashboard:c49004b1-325-12557"
+    image: "quay.io/devtron/dashboard:250c7c3f-325-12823"
     imagePullPolicy: IfNotPresent
 
   devtron:
-    image: "quay.io/devtron/hyperion:c35045c2-280-12565"
-    cicdImage: "quay.io/devtron/devtron:c35045c2-326-12555"
+    image: "quay.io/devtron/hyperion:f12eae0d-280-12836"
+    cicdImage: "quay.io/devtron/devtron:f12eae0d-434-12846"
     imagePullPolicy: IfNotPresent
     customOverrides: {}
     serviceMonitor:
@@ -74,7 +74,7 @@ components:
       #      - devtron.example.com
 
   argocdDexServer:
-    image: "ghcr.io/dexidp/dex:v2.30.2"
+    image: "ghcr.io/dexidp/dex:v2.35.3"
     imagePullPolicy: IfNotPresent
     initContainer:
       authenticator: "quay.io/devtron/authenticator:6e466830-393-11943"
@@ -98,13 +98,13 @@ components:
         SCRIPT_LOCATION: "scripts/sql/"
         GIT_REPO_URL: "https://github.com/devtron-labs/devtron.git"
         DB_NAME: "orchestrator"
-        GIT_HASH: "c35045c218d95741522fee8b27ee42e3956ba4c6"
+        GIT_HASH: "f12eae0d785dc3f98773946516cb2726ed96fdac"
       casbin:
         GIT_BRANCH: "main"
         SCRIPT_LOCATION: "scripts/casbin/"
         GIT_REPO_URL: "https://github.com/devtron-labs/devtron.git"
         DB_NAME: "casbin"
-        GIT_HASH: "c35045c218d95741522fee8b27ee42e3956ba4c6"
+        GIT_HASH: "f12eae0d785dc3f98773946516cb2726ed96fdac"
 
 # values for argocd integration
 argo-cd:
@@ -115,7 +115,7 @@ argo-cd:
       # -- If defined, a repository applied to all Argo CD deployments
       repository: quay.io/argoproj/argocd
       # -- Overrides the global Argo CD image tag whose default is the chart appVersion
-      tag: "v2.4.0"
+      tag: "v2.5.2"
       # -- If defined, a imagePullPolicy applied to all Argo CD deployments
       imagePullPolicy: IfNotPresent
   configs:
diff --git a/cmd/external-app/wire_gen.go b/cmd/external-app/wire_gen.go
index a4bddafad..4c57637a8 100644
--- a/cmd/external-app/wire_gen.go
+++ b/cmd/external-app/wire_gen.go
@@ -1,7 +1,8 @@
 // Code generated by Wire. DO NOT EDIT.
 
 //go:generate go run github.com/google/wire/cmd/wire
-//+build !wireinject
+//go:build !wireinject
+// +build !wireinject
 
 package main
 
diff --git a/go.mod b/go.mod
index ebff02a18..2be9183f6 100644
--- a/go.mod
+++ b/go.mod
@@ -15,7 +15,7 @@ require (
 	github.com/coreos/go-oidc v2.2.1+incompatible
 	github.com/davecgh/go-spew v1.1.1
 	github.com/devtron-labs/authenticator v0.4.31-0.20221213131053-6e4668309f53
-	github.com/devtron-labs/common-lib v0.0.0-20230109070754-ff4dca200a2c
+	github.com/devtron-labs/common-lib v0.0.0-20230220122715-29f6f63d39e9
 	github.com/evanphx/json-patch v5.6.0+incompatible
 	github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
 	github.com/go-pg/pg v6.15.1+incompatible
diff --git a/go.sum b/go.sum
index 569aa8196..1f053746a 100644
--- a/go.sum
+++ b/go.sum
@@ -298,6 +298,18 @@ github.com/devtron-labs/common-lib v0.0.0-20221208044859-269008fed09b h1:yGXerrq
 github.com/devtron-labs/common-lib v0.0.0-20221208044859-269008fed09b/go.mod h1:R24nOqgk4buk9zv+BXzORfObZsOe3NE9P55KrZXGX9k=
 github.com/devtron-labs/common-lib v0.0.0-20230109070754-ff4dca200a2c h1:jz7yPUlIJXFg9AvJh2fb0QW7JT6+RKj8LOl1mWM/HQA=
 github.com/devtron-labs/common-lib v0.0.0-20230109070754-ff4dca200a2c/go.mod h1:R24nOqgk4buk9zv+BXzORfObZsOe3NE9P55KrZXGX9k=
+github.com/devtron-labs/common-lib v0.0.0-20230202071119-47116fd18242 h1:FfS2R86Ft/WFShnwGu4z14iOKZAPhfDV7tvvlaJfRmI=
+github.com/devtron-labs/common-lib v0.0.0-20230202071119-47116fd18242/go.mod h1:R24nOqgk4buk9zv+BXzORfObZsOe3NE9P55KrZXGX9k=
+github.com/devtron-labs/common-lib v0.0.0-20230202123846-6a2fbc3adf9a h1:W7iFtOdOj/pYLBLkVxkpXIGX8La5nCq3tZey1wtSeCo=
+github.com/devtron-labs/common-lib v0.0.0-20230202123846-6a2fbc3adf9a/go.mod h1:R24nOqgk4buk9zv+BXzORfObZsOe3NE9P55KrZXGX9k=
+github.com/devtron-labs/common-lib v0.0.0-20230202130856-d4ef0e6ba405 h1:PHtTohiRePmGWkNCykvLY6Mpebke4GlW4fvO9zHzn5E=
+github.com/devtron-labs/common-lib v0.0.0-20230202130856-d4ef0e6ba405/go.mod h1:R24nOqgk4buk9zv+BXzORfObZsOe3NE9P55KrZXGX9k=
+github.com/devtron-labs/common-lib v0.0.0-20230202133846-0be4c43dd7f2 h1:O0NgzYI+dF2OxncbzfcsscIPV6Kf1G6O3SXec7yhs7E=
+github.com/devtron-labs/common-lib v0.0.0-20230202133846-0be4c43dd7f2/go.mod h1:R24nOqgk4buk9zv+BXzORfObZsOe3NE9P55KrZXGX9k=
+github.com/devtron-labs/common-lib v0.0.0-20230220060258-e0dba0258e97 h1:3gzBIn0k/4/Cal0px0HuzOcbDP/12C8U+nUN0GzolIA=
+github.com/devtron-labs/common-lib v0.0.0-20230220060258-e0dba0258e97/go.mod h1:R24nOqgk4buk9zv+BXzORfObZsOe3NE9P55KrZXGX9k=
+github.com/devtron-labs/common-lib v0.0.0-20230220122715-29f6f63d39e9 h1:JKaG846oVWXdx+1zqb777sYEhvmYOEJOI+Wroc4AQaI=
+github.com/devtron-labs/common-lib v0.0.0-20230220122715-29f6f63d39e9/go.mod h1:R24nOqgk4buk9zv+BXzORfObZsOe3NE9P55KrZXGX9k=
 github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
 github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
 github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
diff --git a/internal/sql/repository/AppListingRepository.go b/internal/sql/repository/AppListingRepository.go
index ff372bafb..860b35048 100644
--- a/internal/sql/repository/AppListingRepository.go
+++ b/internal/sql/repository/AppListingRepository.go
@@ -165,7 +165,8 @@ func (impl AppListingRepositoryImpl) DeploymentDetailsByAppIdAndEnvId(ctx contex
 	var deploymentDetail bean.DeploymentDetailContainer
 	query := "SELECT env.environment_name, a.app_name, ceco.namespace, u.email_id as last_deployed_by" +
 		" , cia.material_info as material_info_json_string, pco.created_on AS last_deployed_time, pco.pipeline_release_counter as release_version" +
-		" , env.default, cia.data_source, p.pipeline_name as last_deployed_pipeline, cia.id as ci_artifact_id, p.deployment_app_type, p.ci_pipeline_id" +
+		" , env.default, cia.data_source, p.pipeline_name as last_deployed_pipeline, cia.id as ci_artifact_id" +
+		", p.deployment_app_type, p.ci_pipeline_id, p.deployment_app_delete_request" +
 		" FROM chart_env_config_override ceco" +
 		" INNER JOIN environment env ON env.id=ceco.target_environment" +
 		" INNER JOIN pipeline_config_override pco ON pco.env_config_override_id = ceco.id" +
@@ -260,9 +261,9 @@ func (impl AppListingRepositoryImpl) FetchAppDetail(ctx context.Context, appId i
 
 	// other environment tab
 	var otherEnvironments []bean.Environment
-	query := "SELECT p.environment_id,env.environment_name from pipeline p" +
+	query := "SELECT p.environment_id,env.environment_name,p.deployment_app_delete_request from pipeline p" +
 		" INNER JOIN environment env on env.id=p.environment_id" +
-		" where p.app_id=? and p.deleted = FALSE AND env.active = TRUE GROUP by 1,2"
+		" where p.app_id=? and p.deleted = FALSE AND env.active = TRUE GROUP by 1,2,3"
 	impl.Logger.Debugw("other env query:", query)
 	_, err = impl.dbConnection.Query(&otherEnvironments, query, appId)
 
@@ -450,7 +451,7 @@ func (impl AppListingRepositoryImpl) FetchOtherEnvironment(appId int) ([]*bean.E
 	var otherEnvironments []*bean.Environment
 	query := "select OE.*,B.status as app_status " +
 		"FROM " +
-		"(SELECT p.environment_id,env.environment_name, p.last_deployed,  env_app_m.app_metrics, env.default as prod, env_app_m.infra_metrics from ( SELECT pl.id,pl.app_id,pl.environment_id,pl.deleted,MAX(pco.created_on) as last_deployed from pipeline pl LEFT JOIN pipeline_config_override pco on pco.pipeline_id = pl.id WHERE pl.app_id = ? and pl.deleted = FALSE GROUP BY pl.id) p INNER JOIN environment env on env.id=p.environment_id LEFT JOIN env_level_app_metrics env_app_m on env.id=env_app_m.env_id and p.app_id = env_app_m.app_id where p.app_id=? and p.deleted = FALSE AND env.active = TRUE GROUP BY 1,2,3,4,5,6) OE " +
+		"(SELECT p.environment_id,env.environment_name, p.last_deployed,  env_app_m.app_metrics, env.default as prod, env_app_m.infra_metrics, p.deployment_app_delete_request from ( SELECT pl.id,pl.app_id,pl.environment_id,pl.deleted, pl.deployment_app_delete_request,MAX(pco.created_on) as last_deployed from pipeline pl LEFT JOIN pipeline_config_override pco on pco.pipeline_id = pl.id WHERE pl.app_id = ? and pl.deleted = FALSE GROUP BY pl.id) p INNER JOIN environment env on env.id=p.environment_id LEFT JOIN env_level_app_metrics env_app_m on env.id=env_app_m.env_id and p.app_id = env_app_m.app_id where p.app_id=? and p.deleted = FALSE AND env.active = TRUE GROUP BY 1,2,3,4,5,6,7) OE " +
 		" LEFT JOIN app_status B ON OE.environment_id = B.env_id AND B.app_id = ? ;"
 	impl.Logger.Debugw("other env query:", query)
 	_, err := impl.dbConnection.Query(&otherEnvironments, query, appId, appId, appId)
diff --git a/internal/sql/repository/pipelineConfig/CdWorfkflowRepository.go b/internal/sql/repository/pipelineConfig/CdWorfkflowRepository.go
index 380647c4c..44e7e010b 100644
--- a/internal/sql/repository/pipelineConfig/CdWorfkflowRepository.go
+++ b/internal/sql/repository/pipelineConfig/CdWorfkflowRepository.go
@@ -190,14 +190,15 @@ type TriggerWorkflowStatus struct {
 }
 
 type CdWorkflowStatus struct {
-	CiPipelineId int    `json:"ci_pipeline_id"`
-	PipelineId   int    `json:"pipeline_id"`
-	PipelineName string `json:"pipeline_name,omitempty"`
-	DeployStatus string `json:"deploy_status"`
-	PreStatus    string `json:"pre_status"`
-	PostStatus   string `json:"post_status"`
-	WorkflowType string `json:"workflow_type,omitempty"`
-	WfrId        int    `json:"wfr_id,omitempty"`
+	CiPipelineId               int    `json:"ci_pipeline_id"`
+	PipelineId                 int    `json:"pipeline_id"`
+	PipelineName               string `json:"pipeline_name,omitempty"`
+	DeployStatus               string `json:"deploy_status"`
+	PreStatus                  string `json:"pre_status"`
+	PostStatus                 string `json:"post_status"`
+	WorkflowType               string `json:"workflow_type,omitempty"`
+	WfrId                      int    `json:"wfr_id,omitempty"`
+	DeploymentAppDeleteRequest bool   `json:"deploymentAppDeleteRequest"`
 }
 
 type CiWorkflowStatus struct {
diff --git a/internal/sql/repository/pipelineConfig/PipelineRepository.go b/internal/sql/repository/pipelineConfig/PipelineRepository.go
index f86630003..3fde67434 100644
--- a/internal/sql/repository/pipelineConfig/PipelineRepository.go
+++ b/internal/sql/repository/pipelineConfig/PipelineRepository.go
@@ -58,6 +58,7 @@ type Pipeline struct {
 	DeploymentAppCreated          bool        `sql:"deployment_app_created,notnull"`
 	DeploymentAppType             string      `sql:"deployment_app_type,notnull"` //helm, acd
 	DeploymentAppName             string      `sql:"deployment_app_name"`
+	DeploymentAppDeleteRequest    bool        `sql:"deployment_app_delete_request,notnull"`
 	Environment                   repository.Environment
 	sql.AuditLog
 }
@@ -101,6 +102,7 @@ type PipelineRepository interface {
 	FindIdsByProjectIdsAndEnvironmentIds(projectIds, environmentIds []int) ([]int, error)
 
 	GetArgoPipelineByArgoAppName(argoAppName string) (Pipeline, error)
+	GetPartiallyDeletedPipelineByStatus(appId int, envId int) (Pipeline, error)
 	FindActiveByAppIds(appIds []int) (pipelines []*Pipeline, err error)
 }
 
@@ -130,7 +132,7 @@ func (impl PipelineRepositoryImpl) GetConnection() *pg.DB {
 func (impl PipelineRepositoryImpl) FindByIdsIn(ids []int) ([]*Pipeline, error) {
 	var pipelines []*Pipeline
 	err := impl.dbConnection.Model(&pipelines).
-		Column("pipeline.*", "App.app_name", "Environment.environment_name", "Environment.Cluster").
+		Column("pipeline.*", "App", "Environment", "Environment.Cluster").
 		Join("inner join app a on pipeline.app_id = a.id").
 		Join("inner join environment e on pipeline.environment_id = e.id").
 		Join("inner join cluster c on c.id = e.cluster_id").
@@ -577,6 +579,21 @@ func (impl PipelineRepositoryImpl) GetArgoPipelineByArgoAppName(argoAppName stri
 	return pipeline, nil
 }
 
+func (impl PipelineRepositoryImpl) GetPartiallyDeletedPipelineByStatus(appId int, envId int) (Pipeline, error) {
+	var pipeline Pipeline
+	err := impl.dbConnection.Model(&pipeline).
+		Column("pipeline.*", "App.app_name", "Environment.namespace").
+		Where("app_id = ?", appId).
+		Where("environment_id = ?", envId).
+		Where("deployment_app_delete_request = ?", true).
+		Where("deployment_app_type = ?", util.PIPELINE_DEPLOYMENT_TYPE_ACD).
+		Where("deleted = ?", false).Select()
+	if err != nil && err != pg.ErrNoRows {
+		impl.logger.Errorw("error in updating argo pipeline delete status")
+	}
+	return pipeline, err
+}
+
 func (impl PipelineRepositoryImpl) FindActiveByAppIds(appIds []int) (pipelines []*Pipeline, err error) {
 	err = impl.dbConnection.Model(&pipelines).
 		Column("pipeline.*", "App", "Environment").
diff --git a/internal/sql/repository/pipelineConfig/mocks/PipelineRepository.go b/internal/sql/repository/pipelineConfig/mocks/PipelineRepository.go
index b5784a038..af52498bc 100644
--- a/internal/sql/repository/pipelineConfig/mocks/PipelineRepository.go
+++ b/internal/sql/repository/pipelineConfig/mocks/PipelineRepository.go
@@ -771,6 +771,27 @@ func (_m *PipelineRepository) GetConnection() *pg.DB {
 	return r0
 }
 
+// GetPartiallyDeletedPipelineByStatus provides a mock function with given fields: appId, envId
+func (_m *PipelineRepository) GetPartiallyDeletedPipelineByStatus(appId int, envId int) (pipelineConfig.Pipeline, error) {
+	ret := _m.Called(appId, envId)
+
+	var r0 pipelineConfig.Pipeline
+	if rf, ok := ret.Get(0).(func(int, int) pipelineConfig.Pipeline); ok {
+		r0 = rf(appId, envId)
+	} else {
+		r0 = ret.Get(0).(pipelineConfig.Pipeline)
+	}
+
+	var r1 error
+	if rf, ok := ret.Get(1).(func(int, int) error); ok {
+		r1 = rf(appId, envId)
+	} else {
+		r1 = ret.Error(1)
+	}
+
+	return r0, r1
+}
+
 // PipelineExists provides a mock function with given fields: pipelineName
 func (_m *PipelineRepository) PipelineExists(pipelineName string) (bool, error) {
 	ret := _m.Called(pipelineName)
diff --git a/manifests/install/devtron-installer.yaml b/manifests/install/devtron-installer.yaml
index 17a1520ea..c2d076534 100644
--- a/manifests/install/devtron-installer.yaml
+++ b/manifests/install/devtron-installer.yaml
@@ -4,4 +4,4 @@ metadata:
   name: installer-devtron
   namespace: devtroncd
 spec:
-  url: https://raw.githubusercontent.com/devtron-labs/devtron/v0.6.11/manifests/installation-script
+  url: https://raw.githubusercontent.com/devtron-labs/devtron/v0.6.12/manifests/installation-script
diff --git a/manifests/installation-script b/manifests/installation-script
index ccdfd0b06..8b7eafa7f 100644
--- a/manifests/installation-script
+++ b/manifests/installation-script
@@ -1,4 +1,4 @@
-LTAG="v0.6.11";
+LTAG="v0.6.12";
 REPO_RAW_URL="https://raw.githubusercontent.com/devtron-labs/devtron/";
 
 operatorSecret = kubectl get secret -n devtroncd devtron-operator-secret;
diff --git a/manifests/release.txt b/manifests/release.txt
index 7e5624ddd..087b3d42d 100644
--- a/manifests/release.txt
+++ b/manifests/release.txt
@@ -1,1 +1,1 @@
-stable -1 v0.6.11
+stable -1 v0.6.12
diff --git a/manifests/version.txt b/manifests/version.txt
index 882307ccd..00a9fa57a 100644
--- a/manifests/version.txt
+++ b/manifests/version.txt
@@ -1,1 +1,1 @@
-v0.6.11
+v0.6.12
diff --git a/manifests/yamls/dashboard.yaml b/manifests/yamls/dashboard.yaml
index ed8d5a0e7..6493f0e8b 100644
--- a/manifests/yamls/dashboard.yaml
+++ b/manifests/yamls/dashboard.yaml
@@ -231,7 +231,7 @@ spec:
             - name: envoy-config-volume
               mountPath: /etc/envoy-config/
         - name: dashboard
-          image: "quay.io/devtron/dashboard:c49004b1-325-12557"
+          image: "quay.io/devtron/dashboard:250c7c3f-325-12823"
           imagePullPolicy: IfNotPresent
           ports:
             - name: app
diff --git a/manifests/yamls/devtron.yaml b/manifests/yamls/devtron.yaml
index e7336bda2..cc7aacc46 100644
--- a/manifests/yamls/devtron.yaml
+++ b/manifests/yamls/devtron.yaml
@@ -54,7 +54,7 @@ data:
   CD_NODE_TAINTS_VALUE: "ci"
   CD_ARTIFACT_LOCATION_FORMAT: "%d/%d.zip"
   DEFAULT_CD_NAMESPACE: "devtron-cd"
-  DEFAULT_CI_IMAGE: "quay.io/devtron/ci-runner:8fdedc64-138-12561"
+  DEFAULT_CI_IMAGE: "quay.io/devtron/ci-runner:b5d06d54-138-12821"
   DEFAULT_CD_TIMEOUT: "3600"
   WF_CONTROLLER_INSTANCE_ID: "devtron-runner"
   CI_LOGS_KEY_PREFIX: "ci-artifacts"
@@ -158,7 +158,7 @@ spec:
       serviceAccountName: devtron
       containers:
         - name: devtron
-          image: "quay.io/devtron/devtron:c35045c2-326-12555"
+          image: "quay.io/devtron/devtron:f12eae0d-434-12846"
           imagePullPolicy: IfNotPresent
           lifecycle:
             preStop:
diff --git a/manifests/yamls/gitsensor.yaml b/manifests/yamls/gitsensor.yaml
index b9ae0be1f..7c0a6cc37 100644
--- a/manifests/yamls/gitsensor.yaml
+++ b/manifests/yamls/gitsensor.yaml
@@ -55,7 +55,7 @@ spec:
       terminationGracePeriodSeconds: 10
       containers:
         - name: git-sensor
-          image: "quay.io/devtron/git-sensor:a71fe1ae-200-12562"
+          image: "quay.io/devtron/git-sensor:f73daf19-200-12822"
           ports:
             - containerPort: 8080
               name: sensor
diff --git a/manifests/yamls/migrator.yaml b/manifests/yamls/migrator.yaml
index 8749cb3db..2bc6f71b8 100644
--- a/manifests/yamls/migrator.yaml
+++ b/manifests/yamls/migrator.yaml
@@ -39,7 +39,7 @@ spec:
         - name: MIGRATE_TO_VERSION
           value: "0"
         - name: GIT_HASH
-          value: c35045c218d95741522fee8b27ee42e3956ba4c6
+          value: f12eae0d785dc3f98773946516cb2726ed96fdac
         envFrom:
           - secretRef:
               name: postgresql-migrator
@@ -80,7 +80,7 @@ spec:
         - name: MIGRATE_TO_VERSION
           value: "0"
         - name: GIT_HASH
-          value: c35045c218d95741522fee8b27ee42e3956ba4c6
+          value: f12eae0d785dc3f98773946516cb2726ed96fdac
         - name: GIT_BRANCH
           value: main
         envFrom:
@@ -124,7 +124,7 @@ spec:
         - name: GIT_BRANCH
           value: main
         - name: GIT_HASH
-          value: a71fe1aef5389d49f79e0f7569056288cd109600
+          value: f73daf194acb016ea8e160ad46779299ad989bca
         envFrom:
           - secretRef:
               name: postgresql-migrator
diff --git a/pkg/app/AppService.go b/pkg/app/AppService.go
index 10039263d..01ecd8652 100644
--- a/pkg/app/AppService.go
+++ b/pkg/app/AppService.go
@@ -26,6 +26,8 @@ import (
 	"github.com/caarlos0/env"
 	pubsub "github.com/devtron-labs/common-lib/pubsub-lib"
 	client2 "github.com/devtron-labs/devtron/api/helm-app"
+	repository4 "github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/service"
 	application3 "github.com/devtron-labs/devtron/client/k8s/application"
 	bean2 "github.com/devtron-labs/devtron/pkg/bean"
 	"github.com/devtron-labs/devtron/pkg/chart"
@@ -153,6 +155,8 @@ type AppServiceImpl struct {
 	appStatusConfig                        *AppStatusConfig
 	gitOpsConfigRepository                 repository.GitOpsConfigRepository
 	appStatusService                       appStatus.AppStatusService
+	installedAppRepository                 repository4.InstalledAppRepository
+	AppStoreDeploymentService              service.AppStoreDeploymentService
 	k8sApplicationService                  k8s.K8sApplicationService
 }
 
@@ -211,7 +215,10 @@ func NewAppService(
 	pipelineStatusTimelineService PipelineStatusTimelineService,
 	appStatusConfig *AppStatusConfig,
 	gitOpsConfigRepository repository.GitOpsConfigRepository,
-	appStatusService appStatus.AppStatusService, k8sApplicationService k8s.K8sApplicationService) *AppServiceImpl {
+	appStatusService appStatus.AppStatusService,
+	installedAppRepository repository4.InstalledAppRepository,
+	AppStoreDeploymentService service.AppStoreDeploymentService,
+	k8sApplicationService k8s.K8sApplicationService) *AppServiceImpl {
 	appServiceImpl := &AppServiceImpl{
 		environmentConfigRepository:            environmentConfigRepository,
 		mergeUtil:                              mergeUtil,
@@ -264,6 +271,8 @@ func NewAppService(
 		appStatusConfig:                        appStatusConfig,
 		gitOpsConfigRepository:                 gitOpsConfigRepository,
 		appStatusService:                       appStatusService,
+		installedAppRepository:                 installedAppRepository,
+		AppStoreDeploymentService:              AppStoreDeploymentService,
 		k8sApplicationService:                  k8sApplicationService,
 	}
 	return appServiceImpl
diff --git a/pkg/app/PipelineStatusTimelineService.go b/pkg/app/PipelineStatusTimelineService.go
index 82302dda2..574ba234b 100644
--- a/pkg/app/PipelineStatusTimelineService.go
+++ b/pkg/app/PipelineStatusTimelineService.go
@@ -42,13 +42,14 @@ func NewPipelineStatusTimelineServiceImpl(logger *zap.SugaredLogger,
 }
 
 type PipelineTimelineDetailDto struct {
-	DeploymentStartedOn  time.Time                    `json:"deploymentStartedOn"`
-	DeploymentFinishedOn time.Time                    `json:"deploymentFinishedOn"`
-	TriggeredBy          string                       `json:"triggeredBy"`
-	Timelines            []*PipelineStatusTimelineDto `json:"timelines"`
-	StatusLastFetchedAt  time.Time                    `json:"statusLastFetchedAt"`
-	StatusFetchCount     int                          `json:"statusFetchCount"`
-	WfrStatus            string                       `json:"wfrStatus"`
+	DeploymentStartedOn        time.Time                    `json:"deploymentStartedOn"`
+	DeploymentFinishedOn       time.Time                    `json:"deploymentFinishedOn"`
+	TriggeredBy                string                       `json:"triggeredBy"`
+	Timelines                  []*PipelineStatusTimelineDto `json:"timelines"`
+	StatusLastFetchedAt        time.Time                    `json:"statusLastFetchedAt"`
+	StatusFetchCount           int                          `json:"statusFetchCount"`
+	WfrStatus                  string                       `json:"wfrStatus"`
+	DeploymentAppDeleteRequest bool                         `json:"deploymentAppDeleteRequest"`
 }
 
 type PipelineStatusTimelineDto struct {
@@ -186,13 +187,14 @@ func (impl *PipelineStatusTimelineServiceImpl) FetchTimelines(appId, envId, wfrI
 		}
 	}
 	timelineDetail := &PipelineTimelineDetailDto{
-		TriggeredBy:          triggeredByUser.EmailId,
-		DeploymentStartedOn:  deploymentStartedOn,
-		DeploymentFinishedOn: deploymentFinishedOn,
-		Timelines:            timelineDtos,
-		StatusLastFetchedAt:  statusLastFetchedAt,
-		StatusFetchCount:     statusFetchCount,
-		WfrStatus:            wfrStatus,
+		TriggeredBy:                triggeredByUser.EmailId,
+		DeploymentStartedOn:        deploymentStartedOn,
+		DeploymentFinishedOn:       deploymentFinishedOn,
+		Timelines:                  timelineDtos,
+		StatusLastFetchedAt:        statusLastFetchedAt,
+		StatusFetchCount:           statusFetchCount,
+		WfrStatus:                  wfrStatus,
+		DeploymentAppDeleteRequest: wfr.CdWorkflow.Pipeline.DeploymentAppDeleteRequest,
 	}
 	return timelineDetail, nil
 }
diff --git a/pkg/appStore/bean/bean.go b/pkg/appStore/bean/bean.go
index 139282ab5..de4924053 100644
--- a/pkg/appStore/bean/bean.go
+++ b/pkg/appStore/bean/bean.go
@@ -95,6 +95,7 @@ type InstallAppVersionDTO struct {
 	EnvironmentName              string                     `json:"-"`
 	InstallAppVersionChartDTO    *InstallAppVersionChartDTO `json:"-"`
 	DeploymentAppType            string                     `json:"deploymentAppType"`
+	AcdPartialDelete             bool                       `json:"acdPartialDelete"`
 	AppStoreApplicationVersionId int
 }
 
diff --git a/pkg/appStore/deployment/repository/InstalledAppRepository.go b/pkg/appStore/deployment/repository/InstalledAppRepository.go
index 3c69797cc..f7c1dd1c1 100644
--- a/pkg/appStore/deployment/repository/InstalledAppRepository.go
+++ b/pkg/appStore/deployment/repository/InstalledAppRepository.go
@@ -19,6 +19,7 @@ package repository
 
 import (
 	"github.com/devtron-labs/devtron/internal/sql/repository/app"
+	util2 "github.com/devtron-labs/devtron/internal/util"
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
 	appStoreDiscoverRepository "github.com/devtron-labs/devtron/pkg/appStore/discover/repository"
 	"github.com/devtron-labs/devtron/pkg/cluster/repository"
@@ -59,6 +60,8 @@ type InstalledAppRepository interface {
 	GetInstalledApplicationByClusterIdAndNamespaceAndAppName(clusterId int, namespace string, appName string) (*InstalledApps, error)
 	GetAppAndEnvDetailsForDeploymentAppTypeInstalledApps(deploymentAppType string, clusterIds []int) ([]*InstalledApps, error)
 	GetDeploymentSuccessfulStatusCountForTelemetry() (int, error)
+	GetGitOpsInstalledAppsWhereArgoAppDeletedIsTrue(installedAppId int, envId int) (InstalledApps, error)
+	GetInstalledAppByGitHash(gitHash string) (InstallAppDeleteRequest, error)
 }
 
 type InstalledAppRepositoryImpl struct {
@@ -66,21 +69,32 @@ type InstalledAppRepositoryImpl struct {
 	Logger       *zap.SugaredLogger
 }
 
+type InstallAppDeleteRequest struct {
+	InstalledAppId  int    `json:"installed_app_id,omitempty,notnull"`
+	AppName         string `json:"app_name,omitempty"`
+	AppId           int    `json:"app_id,omitempty"`
+	EnvironmentId   int    `json:"environment_id,omitempty"`
+	AppOfferingMode string `json:"app_offering_mode"`
+	ClusterId       int    `json:"cluster_id"`
+	Namespace       string `json:"namespace"`
+}
+
 func NewInstalledAppRepositoryImpl(Logger *zap.SugaredLogger, dbConnection *pg.DB) *InstalledAppRepositoryImpl {
 	return &InstalledAppRepositoryImpl{dbConnection: dbConnection, Logger: Logger}
 }
 
 type InstalledApps struct {
-	TableName         struct{}                              `sql:"installed_apps" pg:",discard_unknown_columns"`
-	Id                int                                   `sql:"id,pk"`
-	AppId             int                                   `sql:"app_id,notnull"`
-	EnvironmentId     int                                   `sql:"environment_id,notnull"`
-	Active            bool                                  `sql:"active, notnull"`
-	GitOpsRepoName    string                                `sql:"git_ops_repo_name"`
-	DeploymentAppType string                                `sql:"deployment_app_type"`
-	Status            appStoreBean.AppstoreDeploymentStatus `sql:"status"`
-	App               app.App
-	Environment       repository.Environment
+	TableName                  struct{}                              `sql:"installed_apps" pg:",discard_unknown_columns"`
+	Id                         int                                   `sql:"id,pk"`
+	AppId                      int                                   `sql:"app_id,notnull"`
+	EnvironmentId              int                                   `sql:"environment_id,notnull"`
+	Active                     bool                                  `sql:"active, notnull"`
+	GitOpsRepoName             string                                `sql:"git_ops_repo_name"`
+	DeploymentAppType          string                                `sql:"deployment_app_type"`
+	Status                     appStoreBean.AppstoreDeploymentStatus `sql:"status"`
+	DeploymentAppDeleteRequest bool                                  `sql:"deployment_app_delete_request"`
+	App                        app.App
+	Environment                repository.Environment
 	sql.AuditLog
 }
 
@@ -118,6 +132,7 @@ type InstalledAppsWithChartDetails struct {
 	ClusterId                    int       `json:"clusterId"`
 	AppOfferingMode              string    `json:"app_offering_mode"`
 	AppStatus                    string    `json:"app_status"`
+	DeploymentAppDeleteRequest   bool      `json:"deploymentAppDeleteRequest"`
 }
 
 type InstalledAppAndEnvDetails struct {
@@ -249,7 +264,7 @@ func (impl InstalledAppRepositoryImpl) GetAllInstalledApps(filter *appStoreBean.
 	query = "select iav.updated_on, iav.id as installed_app_version_id, ch.name as chart_repo_name,"
 	query = query + " env.environment_name, env.id as environment_id, a.app_name, a.app_offering_mode, asav.icon, asav.name as app_store_application_name,"
 	query = query + " env.namespace, cluster.cluster_name, a.team_id, cluster.id as cluster_id, "
-	query = query + " asav.id as app_store_application_version_id, ia.id , asav.deprecated , app_status.status as app_status"
+	query = query + " asav.id as app_store_application_version_id, ia.id , asav.deprecated , app_status.status as app_status, ia.deployment_app_delete_request"
 	query = query + " from installed_app_versions iav"
 	query = query + " inner join installed_apps ia on iav.installed_app_id = ia.id"
 	query = query + " inner join app a on a.id = ia.app_id"
@@ -491,3 +506,34 @@ func (impl InstalledAppRepositoryImpl) GetDeploymentSuccessfulStatusCountForTele
 	}
 	return count, err
 }
+
+func (impl InstalledAppRepositoryImpl) GetGitOpsInstalledAppsWhereArgoAppDeletedIsTrue(installedAppId int, envId int) (InstalledApps, error) {
+	var installedApps InstalledApps
+	err := impl.dbConnection.Model(&installedApps).
+		Column("installed_apps.*", "App.app_name", "Environment.namespace", "Environment.cluster_id", "Environment.environment_name").
+		Where("deployment_app_delete_request = ?", true).
+		Where("installed_apps.active = ?", true).
+		Where("installed_apps.id = ?", installedAppId).
+		Where("installed_apps.environment_id = ?", envId).
+		Where("deployment_app_type = ?", util2.PIPELINE_DEPLOYMENT_TYPE_ACD).
+		Select()
+	if err != nil && err != pg.ErrNoRows {
+		impl.Logger.Errorw("error in fetching pipeline while udating delete status", "err", err)
+		return installedApps, err
+	}
+	return installedApps, nil
+}
+func (impl InstalledAppRepositoryImpl) GetInstalledAppByGitHash(gitHash string) (InstallAppDeleteRequest, error) {
+	model := InstallAppDeleteRequest{}
+	query := "select iv.installed_app_id, a.app_name, i.app_id, i.environment_id, a.app_offering_mode, e.cluster_id, e.namespace " +
+		" from app a inner join installed_apps i on a.id=i.app_id  " +
+		"inner join installed_app_versions iv on i.id=iv.installed_app_id " +
+		"inner join installed_app_version_history ivh on ivh.installed_app_version_id=iv.id " +
+		"inner join environment e on e.id=i.environment_id where ivh.git_hash=?;"
+	_, err := impl.dbConnection.Query(&model, query, gitHash)
+	if err != nil {
+		impl.Logger.Errorw("error in getting delete request data", "err", err)
+		return model, err
+	}
+	return model, nil
+}
diff --git a/pkg/appStore/deployment/service/AppStoreDeploymentService.go b/pkg/appStore/deployment/service/AppStoreDeploymentService.go
index e0a5b197e..2f174fc54 100644
--- a/pkg/appStore/deployment/service/AppStoreDeploymentService.go
+++ b/pkg/appStore/deployment/service/AppStoreDeploymentService.go
@@ -527,13 +527,6 @@ func (impl AppStoreDeploymentServiceImpl) GetAllInstalledAppsByAppStoreId(w http
 }
 
 func (impl AppStoreDeploymentServiceImpl) DeleteInstalledApp(ctx context.Context, installAppVersionRequest *appStoreBean.InstallAppVersionDTO) (*appStoreBean.InstallAppVersionDTO, error) {
-
-	environment, err := impl.environmentRepository.FindById(installAppVersionRequest.EnvironmentId)
-	if err != nil {
-		impl.logger.Errorw("fetching error", "err", err)
-		return nil, err
-	}
-
 	dbConnection := impl.installedAppRepository.GetConnection()
 	tx, err := dbConnection.Begin()
 	if err != nil {
@@ -542,59 +535,90 @@ func (impl AppStoreDeploymentServiceImpl) DeleteInstalledApp(ctx context.Context
 	// Rollback tx on error.
 	defer tx.Rollback()
 
-	app, err := impl.appRepository.FindById(installAppVersionRequest.AppId)
+	environment, err := impl.environmentRepository.FindById(installAppVersionRequest.EnvironmentId)
 	if err != nil {
+		impl.logger.Errorw("fetching error", "err", err)
 		return nil, err
 	}
-	app.Active = false
-	app.UpdatedBy = installAppVersionRequest.UserId
-	app.UpdatedOn = time.Now()
-	err = impl.appRepository.UpdateWithTxn(app, tx)
+	app, err := impl.appRepository.FindById(installAppVersionRequest.AppId)
 	if err != nil {
-		impl.logger.Errorw("error in update entity ", "entity", app)
 		return nil, err
 	}
-
 	model, err := impl.installedAppRepository.GetInstalledApp(installAppVersionRequest.InstalledAppId)
 	if err != nil {
 		impl.logger.Errorw("error in fetching installed app", "id", installAppVersionRequest.InstalledAppId, "err", err)
 		return nil, err
 	}
-	model.Active = false
-	model.UpdatedBy = installAppVersionRequest.UserId
-	model.UpdatedOn = time.Now()
-	_, err = impl.installedAppRepository.UpdateInstalledApp(model, tx)
-	if err != nil {
-		impl.logger.Errorw("error while creating install app", "error", err)
-		return nil, err
-	}
-	models, err := impl.installedAppRepository.GetInstalledAppVersionByInstalledAppId(installAppVersionRequest.InstalledAppId)
-	if err != nil {
-		impl.logger.Errorw("error while fetching install app versions", "error", err)
-		return nil, err
-	}
-	for _, item := range models {
-		item.Active = false
-		item.UpdatedBy = installAppVersionRequest.UserId
-		item.UpdatedOn = time.Now()
-		_, err = impl.installedAppRepository.UpdateInstalledAppVersion(item, tx)
+
+	if installAppVersionRequest.AcdPartialDelete == true {
+		if util2.IsBaseStack() || util2.IsHelmApp(app.AppOfferingMode) || util.IsHelmApp(model.DeploymentAppType) {
+			err = impl.appStoreDeploymentHelmService.DeleteDeploymentApp(ctx, app.AppName, environment.Name, installAppVersionRequest)
+		} else {
+			err = impl.appStoreDeploymentArgoCdService.DeleteDeploymentApp(ctx, app.AppName, environment.Name, installAppVersionRequest)
+		}
 		if err != nil {
-			impl.logger.Errorw("error while fetching from db", "error", err)
+			impl.logger.Errorw("error on delete installed app", "err", err)
+			return nil, err
+		}
+		model.DeploymentAppDeleteRequest = true
+		model.UpdatedBy = installAppVersionRequest.UserId
+		model.UpdatedOn = time.Now()
+		_, err = impl.installedAppRepository.UpdateInstalledApp(model, tx)
+		if err != nil {
+			impl.logger.Errorw("error while creating install app", "error", err)
 			return nil, err
 		}
-	}
 
-	if util2.IsBaseStack() || util2.IsHelmApp(app.AppOfferingMode) || util.IsHelmApp(model.DeploymentAppType) {
-		// there might be a case if helm release gets uninstalled from helm cli.
-		//in this case on deleting the app from API, it should not give error as it should get deleted from db, otherwise due to delete error, db does not get clean
-		// so in helm, we need to check first if the release exists or not, if exists then only delete
-		err = impl.appStoreDeploymentHelmService.DeleteInstalledApp(ctx, app.AppName, environment.Name, installAppVersionRequest, model, tx)
 	} else {
-		err = impl.appStoreDeploymentArgoCdService.DeleteInstalledApp(ctx, app.AppName, environment.Name, installAppVersionRequest, model, tx)
-	}
+		//soft delete app
+		app.Active = false
+		app.UpdatedBy = installAppVersionRequest.UserId
+		app.UpdatedOn = time.Now()
+		err = impl.appRepository.UpdateWithTxn(app, tx)
+		if err != nil {
+			impl.logger.Errorw("error in update entity ", "entity", app)
+			return nil, err
+		}
 
-	if err != nil {
-		return nil, err
+		// soft delete install app
+		model.Active = false
+		model.UpdatedBy = installAppVersionRequest.UserId
+		model.UpdatedOn = time.Now()
+		_, err = impl.installedAppRepository.UpdateInstalledApp(model, tx)
+		if err != nil {
+			impl.logger.Errorw("error while creating install app", "error", err)
+			return nil, err
+		}
+		models, err := impl.installedAppRepository.GetInstalledAppVersionByInstalledAppId(installAppVersionRequest.InstalledAppId)
+		if err != nil {
+			impl.logger.Errorw("error while fetching install app versions", "error", err)
+			return nil, err
+		}
+
+		// soft delete install app versions
+		for _, item := range models {
+			item.Active = false
+			item.UpdatedBy = installAppVersionRequest.UserId
+			item.UpdatedOn = time.Now()
+			_, err = impl.installedAppRepository.UpdateInstalledAppVersion(item, tx)
+			if err != nil {
+				impl.logger.Errorw("error while fetching from db", "error", err)
+				return nil, err
+			}
+		}
+
+		if util2.IsBaseStack() || util2.IsHelmApp(app.AppOfferingMode) || util.IsHelmApp(model.DeploymentAppType) {
+			// there might be a case if helm release gets uninstalled from helm cli.
+			//in this case on deleting the app from API, it should not give error as it should get deleted from db, otherwise due to delete error, db does not get clean
+			// so in helm, we need to check first if the release exists or not, if exists then only delete
+			err = impl.appStoreDeploymentHelmService.DeleteInstalledApp(ctx, app.AppName, environment.Name, installAppVersionRequest, model, tx)
+		} else {
+			err = impl.appStoreDeploymentArgoCdService.DeleteInstalledApp(ctx, app.AppName, environment.Name, installAppVersionRequest, model, tx)
+		}
+		if err != nil {
+			impl.logger.Errorw("error on delete installed app", "err", err)
+			return nil, err
+		}
 	}
 	err = tx.Commit()
 	if err != nil {
diff --git a/pkg/appStore/deployment/service/InstalledAppService.go b/pkg/appStore/deployment/service/InstalledAppService.go
index 09535be22..81b0763dc 100644
--- a/pkg/appStore/deployment/service/InstalledAppService.go
+++ b/pkg/appStore/deployment/service/InstalledAppService.go
@@ -78,7 +78,9 @@ type InstalledAppService interface {
 	DeployDefaultChartOnCluster(bean *cluster2.ClusterBean, userId int32) (bool, error)
 	FindAppDetailsForAppstoreApplication(installedAppId, envId int) (bean2.AppDetailContainer, error)
 	UpdateInstalledAppVersionStatus(application *v1alpha1.Application) (bool, error)
-	FetchResourceTree(rctx context.Context, cn http.CloseNotifier, appDetail *bean2.AppDetailContainer) bean2.AppDetailContainer
+	FetchResourceTree(rctx context.Context, cn http.CloseNotifier, appDetail *bean2.AppDetailContainer) (bean2.AppDetailContainer, error)
+	MarkGitOpsInstalledAppsDeletedIfArgoAppIsDeleted(installedAppId int, envId int) error
+	CheckAppExistsByInstalledAppId(installedAppId int) error
 }
 
 type InstalledAppServiceImpl struct {
@@ -765,6 +767,7 @@ func (impl *InstalledAppServiceImpl) FindAppDetailsForAppstoreApplication(instal
 		Deprecated:                    installedAppVerison.AppStoreApplicationVersion.Deprecated,
 		ClusterId:                     installedAppVerison.InstalledApp.Environment.ClusterId,
 		DeploymentAppType:             installedAppVerison.InstalledApp.DeploymentAppType,
+		DeploymentAppDeleteRequest:    installedAppVerison.InstalledApp.DeploymentAppDeleteRequest,
 	}
 	userInfo, err := impl.userService.GetByIdIncludeDeleted(installedAppVerison.AuditLog.UpdatedBy)
 	if err != nil {
@@ -886,7 +889,7 @@ func (impl InstalledAppServiceImpl) GetInstalledAppVersionHistoryValues(installe
 	values.ValuesYaml = versionHistory.ValuesYamlRaw
 	return values, err
 }
-func (impl InstalledAppServiceImpl) FetchResourceTree(rctx context.Context, cn http.CloseNotifier, appDetail *bean2.AppDetailContainer) bean2.AppDetailContainer {
+func (impl InstalledAppServiceImpl) FetchResourceTree(rctx context.Context, cn http.CloseNotifier, appDetail *bean2.AppDetailContainer) (bean2.AppDetailContainer, error) {
 	if util.IsAcdApp(appDetail.DeploymentAppType) {
 		acdAppName := appDetail.AppName + "-" + appDetail.EnvironmentName
 		query := &application.ResourcesQuery{
@@ -905,7 +908,7 @@ func (impl InstalledAppServiceImpl) FetchResourceTree(rctx context.Context, cn h
 		acdToken, err := impl.argoUserService.GetLatestDevtronArgoCdUserToken()
 		if err != nil {
 			impl.logger.Errorw("error in getting acd token", "err", err)
-			return *appDetail
+			return *appDetail, err
 		}
 		ctx = context.WithValue(ctx, "token", acdToken)
 		defer cancel()
@@ -921,7 +924,7 @@ func (impl InstalledAppServiceImpl) FetchResourceTree(rctx context.Context, cn h
 				UserMessage:     "app detail fetched, failed to get resource tree from acd",
 			}
 			appDetail.ResourceTree = map[string]interface{}{}
-			return *appDetail
+			return *appDetail, err
 		}
 		// TODO: using this resp.Status to update in app_status table
 		appDetail.ResourceTree = util3.InterfaceToMapAdapter(resp)
@@ -953,5 +956,63 @@ func (impl InstalledAppServiceImpl) FetchResourceTree(rctx context.Context, cn h
 			appDetail.ResourceTree = map[string]interface{}{}
 		}
 	}
-	return *appDetail
+	return *appDetail, nil
+}
+
+func (impl InstalledAppServiceImpl) MarkGitOpsInstalledAppsDeletedIfArgoAppIsDeleted(installedAppId int, envId int) error {
+	apiError := &util.ApiError{}
+	installedApp, err := impl.installedAppRepository.GetGitOpsInstalledAppsWhereArgoAppDeletedIsTrue(installedAppId, envId)
+	if err != nil {
+		impl.logger.Errorw("error in fetching partially deleted argoCd apps from installed app repo", "err", err)
+		apiError.HttpStatusCode = http.StatusInternalServerError
+		apiError.InternalMessage = "error in fetching partially deleted argoCd apps from installed app repo"
+		return apiError
+	}
+	acdToken, err := impl.argoUserService.GetLatestDevtronArgoCdUserToken()
+	if err != nil {
+		impl.logger.Errorw("error in getting acd token", "err", err)
+		apiError.HttpStatusCode = http.StatusInternalServerError
+		apiError.InternalMessage = "error in getting acd token"
+		return apiError
+	}
+
+	ctx := context.Background()
+	ctx = context.WithValue(ctx, "token", acdToken)
+
+	acdAppName := fmt.Sprintf("%s-%s", installedApp.App.AppName, installedApp.Environment.Name)
+	_, err = impl.acdClient.Get(ctx, &application.ApplicationQuery{Name: &acdAppName})
+
+	if err == nil {
+		apiError.HttpStatusCode = http.StatusInternalServerError
+		apiError.InternalMessage = "App Exist in argo, error in fetching resource tree"
+		return apiError
+	}
+
+	impl.logger.Warnw("app not found in argo, deleting from db ", "err", err)
+	//make call to delete it from pipeline DB
+	deleteRequest := &appStoreBean.InstallAppVersionDTO{}
+	deleteRequest.ForceDelete = false
+	deleteRequest.AcdPartialDelete = false
+	deleteRequest.InstalledAppId = installedApp.Id
+	deleteRequest.AppId = installedApp.AppId
+	deleteRequest.AppName = installedApp.App.AppName
+	deleteRequest.Namespace = installedApp.Environment.Namespace
+	deleteRequest.ClusterId = installedApp.Environment.ClusterId
+	deleteRequest.EnvironmentId = installedApp.EnvironmentId
+	deleteRequest.AppOfferingMode = installedApp.App.AppOfferingMode
+	deleteRequest.UserId = 1
+	_, err = impl.appStoreDeploymentService.DeleteInstalledApp(context.Background(), deleteRequest)
+	if err != nil {
+		impl.logger.Errorw("error in deleting installed app", "err", err)
+		apiError.HttpStatusCode = http.StatusNotFound
+		apiError.InternalMessage = "error in deleting installed app"
+		return apiError
+	}
+	apiError.HttpStatusCode = http.StatusNotFound
+	return apiError
+}
+
+func (impl InstalledAppServiceImpl) CheckAppExistsByInstalledAppId(installedAppId int) error {
+	_, err := impl.installedAppRepository.GetInstalledApp(installedAppId)
+	return err
 }
diff --git a/pkg/appStore/deployment/tool/AppStoreDeploymentHelmService.go b/pkg/appStore/deployment/tool/AppStoreDeploymentHelmService.go
index b4f494010..2a80b4242 100644
--- a/pkg/appStore/deployment/tool/AppStoreDeploymentHelmService.go
+++ b/pkg/appStore/deployment/tool/AppStoreDeploymentHelmService.go
@@ -29,6 +29,7 @@ type AppStoreDeploymentHelmService interface {
 	OnUpdateRepoInInstalledApp(ctx context.Context, installAppVersionRequest *appStoreBean.InstallAppVersionDTO) (*appStoreBean.InstallAppVersionDTO, error)
 	UpdateRequirementDependencies(environment *clusterRepository.Environment, installedAppVersion *repository.InstalledAppVersions, installAppVersionRequest *appStoreBean.InstallAppVersionDTO, appStoreAppVersion *appStoreDiscoverRepository.AppStoreApplicationVersion) error
 	UpdateInstalledApp(ctx context.Context, installAppVersionRequest *appStoreBean.InstallAppVersionDTO, environment *clusterRepository.Environment, installedAppVersion *repository.InstalledAppVersions) (*appStoreBean.InstallAppVersionDTO, error)
+	DeleteDeploymentApp(ctx context.Context, appName string, environmentName string, installAppVersionRequest *appStoreBean.InstallAppVersionDTO) error
 }
 
 type AppStoreDeploymentHelmServiceImpl struct {
@@ -117,7 +118,6 @@ func (impl AppStoreDeploymentHelmServiceImpl) GetAppStatus(installedAppAndEnvDet
 }
 
 func (impl AppStoreDeploymentHelmServiceImpl) DeleteInstalledApp(ctx context.Context, appName string, environmentName string, installAppVersionRequest *appStoreBean.InstallAppVersionDTO, installedApps *repository.InstalledApps, dbTransaction *pg.Tx) error {
-
 	appIdentifier := &client.AppIdentifier{
 		ClusterId:   installAppVersionRequest.ClusterId,
 		ReleaseName: installAppVersionRequest.AppName,
@@ -291,3 +291,6 @@ func (impl *AppStoreDeploymentHelmServiceImpl) updateApplicationWithChartInfo(ct
 	}
 	return nil
 }
+func (impl *AppStoreDeploymentHelmServiceImpl) DeleteDeploymentApp(ctx context.Context, appName string, environmentName string, installAppVersionRequest *appStoreBean.InstallAppVersionDTO) error {
+	return nil
+}
diff --git a/pkg/appStore/deployment/tool/gitops/AppStoreDeploymentArgoCdService.go b/pkg/appStore/deployment/tool/gitops/AppStoreDeploymentArgoCdService.go
index 7495e8be1..61b355925 100644
--- a/pkg/appStore/deployment/tool/gitops/AppStoreDeploymentArgoCdService.go
+++ b/pkg/appStore/deployment/tool/gitops/AppStoreDeploymentArgoCdService.go
@@ -43,6 +43,7 @@ type AppStoreDeploymentArgoCdService interface {
 	OnUpdateRepoInInstalledApp(ctx context.Context, installAppVersionRequest *appStoreBean.InstallAppVersionDTO) (*appStoreBean.InstallAppVersionDTO, error)
 	UpdateRequirementDependencies(environment *clusterRepository.Environment, installedAppVersion *repository.InstalledAppVersions, installAppVersionRequest *appStoreBean.InstallAppVersionDTO, appStoreAppVersion *appStoreDiscoverRepository.AppStoreApplicationVersion) error
 	UpdateInstalledApp(ctx context.Context, installAppVersionRequest *appStoreBean.InstallAppVersionDTO, environment *clusterRepository.Environment, installedAppVersion *repository.InstalledAppVersions) (*appStoreBean.InstallAppVersionDTO, error)
+	DeleteDeploymentApp(ctx context.Context, appName string, environmentName string, installAppVersionRequest *appStoreBean.InstallAppVersionDTO) error
 }
 
 type AppStoreDeploymentArgoCdServiceImpl struct {
@@ -149,33 +150,13 @@ func (impl AppStoreDeploymentArgoCdServiceImpl) GetAppStatus(installedAppAndEnvD
 }
 
 func (impl AppStoreDeploymentArgoCdServiceImpl) DeleteInstalledApp(ctx context.Context, appName string, environmentName string, installAppVersionRequest *appStoreBean.InstallAppVersionDTO, installedApps *repository.InstalledApps, dbTransaction *pg.Tx) error {
-	acdAppName := appName + "-" + environmentName
-	err := impl.deleteACD(acdAppName, ctx)
-	if err != nil {
-		impl.Logger.Errorw("error in deleting ACD ", "name", acdAppName, "err", err)
-		if installAppVersionRequest.ForceDelete {
-			impl.Logger.Warnw("error while deletion of app in acd, continue to delete in db as this operation is force delete", "error", err)
-		} else {
-			//statusError, _ := err.(*errors2.StatusError)
-			if strings.Contains(err.Error(), "code = NotFound") {
-				err = &util.ApiError{
-					UserMessage:     "Could not delete as application not found in argocd",
-					InternalMessage: err.Error(),
-				}
-			} else {
-				err = &util.ApiError{
-					UserMessage:     "Could not delete application",
-					InternalMessage: err.Error(),
-				}
-			}
-			return err
-		}
-	}
 
-	err = impl.appStatusService.DeleteWithAppIdEnvId(dbTransaction, installedApps.AppId, installedApps.EnvironmentId)
-	if err != nil {
+	err := impl.appStatusService.DeleteWithAppIdEnvId(dbTransaction, installedApps.AppId, installedApps.EnvironmentId)
+	if err != nil && err != pg.ErrNoRows {
 		impl.Logger.Errorw("error in deleting app_status", "appId", installedApps.AppId, "envId", installedApps.EnvironmentId, "err", err)
 		return err
+	} else if err == pg.ErrNoRows {
+		impl.Logger.Warnw("App status not present, skipping app status delete ")
 	}
 
 	deployment, err := impl.chartGroupDeploymentRepository.FindByInstalledAppId(installedApps.Id)
@@ -540,3 +521,29 @@ func (impl AppStoreDeploymentArgoCdServiceImpl) updateValuesYaml(environment *cl
 	installAppVersionRequest.GitHash = commitHash
 	return installAppVersionRequest, nil
 }
+
+func (impl AppStoreDeploymentArgoCdServiceImpl) DeleteDeploymentApp(ctx context.Context, appName string, environmentName string, installAppVersionRequest *appStoreBean.InstallAppVersionDTO) error {
+	acdAppName := appName + "-" + environmentName
+	err := impl.deleteACD(acdAppName, ctx)
+	if err != nil {
+		impl.Logger.Errorw("error in deleting ACD ", "name", acdAppName, "err", err)
+		if installAppVersionRequest.ForceDelete {
+			impl.Logger.Warnw("error while deletion of app in acd, continue to delete in db as this operation is force delete", "error", err)
+		} else {
+			//statusError, _ := err.(*errors2.StatusError)
+			if strings.Contains(err.Error(), "code = NotFound") {
+				err = &util.ApiError{
+					UserMessage:     "Could not delete as application not found in argocd",
+					InternalMessage: err.Error(),
+				}
+			} else {
+				err = &util.ApiError{
+					UserMessage:     "Could not delete application",
+					InternalMessage: err.Error(),
+				}
+			}
+			return err
+		}
+	}
+	return nil
+}
diff --git a/pkg/appWorkflow/AppWorkflowService.go b/pkg/appWorkflow/AppWorkflowService.go
index c0e513885..c08bc4cc5 100644
--- a/pkg/appWorkflow/AppWorkflowService.go
+++ b/pkg/appWorkflow/AppWorkflowService.go
@@ -69,13 +69,14 @@ type AppWorkflowDto struct {
 }
 
 type AppWorkflowMappingDto struct {
-	Id            int    `json:"id,omitempty"`
-	AppWorkflowId int    `json:"appWorkflowId"`
-	Type          string `json:"type"`
-	ComponentId   int    `json:"componentId"`
-	ParentId      int    `json:"parentId"`
-	ParentType    string `json:"parentType"`
-	UserId        int32  `json:"-"`
+	Id                         int    `json:"id,omitempty"`
+	AppWorkflowId              int    `json:"appWorkflowId"`
+	Type                       string `json:"type"`
+	ComponentId                int    `json:"componentId"`
+	ParentId                   int    `json:"parentId"`
+	ParentType                 string `json:"parentType"`
+	DeploymentAppDeleteRequest bool   `json:"deploymentAppDeleteRequest"`
+	UserId                     int32  `json:"-"`
 }
 
 type AllAppWorkflowComponentDetails struct {
@@ -285,6 +286,16 @@ func (impl AppWorkflowServiceImpl) FindAppWorkflowMapping(workflowId int) ([]App
 			AppWorkflowId: w.AppWorkflowId,
 			ParentType:    w.ParentType,
 		}
+		if w.Type == "CD_PIPELINE" {
+			pipeline, err := impl.pipelineRepository.FindById(w.ComponentId)
+			if err != nil && err != pg.ErrNoRows {
+				impl.Logger.Errorw("err", "err", err)
+				return nil, err
+			}
+			if pipeline != nil {
+				workflow.DeploymentAppDeleteRequest = pipeline.DeploymentAppDeleteRequest
+			}
+		}
 		workflows = append(workflows, workflow)
 	}
 	return workflows, err
diff --git a/pkg/bean/app.go b/pkg/bean/app.go
index e0a621170..f59c37346 100644
--- a/pkg/bean/app.go
+++ b/pkg/bean/app.go
@@ -474,6 +474,8 @@ type CDPipelineConfigObject struct {
 	ParentPipelineType            string                                 `json:"parentPipelineType"`
 	DeploymentAppType             string                                 `json:"deploymentAppType"`
 	AppName                       string                                 `json:"appName"`
+	DeploymentAppDeleteRequest    bool                                   `json:"deploymentAppDeleteRequest"`
+	DeploymentAppCreated          bool                                   `json:"deploymentAppCreated"`
 	//Downstream         []int                             `json:"downstream"` //PipelineCounter of downstream	(for future reference only)
 }
 
@@ -522,6 +524,7 @@ const (
 	CD_CREATE CdPatchAction = iota
 	CD_DELETE               //delete this pipeline
 	CD_UPDATE
+	CD_DELETE_PARTIAL // Partially delete means it will only delete ACD app
 )
 
 type DeploymentAppTypeChangeRequest struct {
diff --git a/pkg/bulkAction/BulkUpdateService.go b/pkg/bulkAction/BulkUpdateService.go
index 99e234c1f..027876e78 100644
--- a/pkg/bulkAction/BulkUpdateService.go
+++ b/pkg/bulkAction/BulkUpdateService.go
@@ -1437,7 +1437,7 @@ func (impl BulkUpdateServiceImpl) PerformBulkDeleteActionOnCdPipelines(impactedP
 			EnvironmentName: pipeline.Environment.Name,
 		}
 		if !dryRun {
-			err := impl.pipelineBuilder.DeleteCdPipeline(pipeline, ctx, forceDelete, userId)
+			err := impl.pipelineBuilder.DeleteCdPipeline(pipeline, ctx, forceDelete, true, userId)
 			if err != nil {
 				impl.logger.Errorw("error in deleting cd pipeline", "err", err, "pipelineId", pipeline.Id)
 				respDto.DeletionResult = fmt.Sprintf("Not able to delete pipeline, %v", err)
diff --git a/pkg/pipeline/CdHandler.go b/pkg/pipeline/CdHandler.go
index 8f0d27795..12cf6053f 100644
--- a/pkg/pipeline/CdHandler.go
+++ b/pkg/pipeline/CdHandler.go
@@ -858,9 +858,11 @@ func (impl *CdHandlerImpl) FetchAppWorkflowStatusForTriggerView(appId int) ([]*p
 		return cdWorkflowStatus, err
 	}
 	pipelineIds := make([]int, 0)
+	partialDeletedPipelines := make(map[int]bool)
 	//pipelineIdsMap := make(map[int]int)
 	for _, pipeline := range pipelines {
 		pipelineIds = append(pipelineIds, pipeline.Id)
+		partialDeletedPipelines[pipeline.Id] = pipeline.DeploymentAppDeleteRequest
 	}
 
 	if len(pipelineIds) == 0 {
@@ -914,6 +916,7 @@ func (impl *CdHandlerImpl) FetchAppWorkflowStatusForTriggerView(appId int) ([]*p
 			}
 			cdMap[item.PipelineId] = cdWorkflowStatus
 		}
+		cdMap[item.PipelineId].DeploymentAppDeleteRequest = partialDeletedPipelines[item.PipelineId]
 	}
 
 	for _, item := range cdMap {
diff --git a/pkg/pipeline/CiCdPipelineOrchestrator.go b/pkg/pipeline/CiCdPipelineOrchestrator.go
index 9abd3c760..3a673da29 100644
--- a/pkg/pipeline/CiCdPipelineOrchestrator.go
+++ b/pkg/pipeline/CiCdPipelineOrchestrator.go
@@ -1345,6 +1345,7 @@ func (impl CiCdPipelineOrchestratorImpl) GetCdPipelinesForApp(appId int) (cdPipe
 			PreStageConfigMapSecretNames:  preStageConfigmapSecrets,
 			PostStageConfigMapSecretNames: postStageConfigmapSecrets,
 			DeploymentAppType:             dbPipeline.DeploymentAppType,
+			DeploymentAppDeleteRequest:    dbPipeline.DeploymentAppDeleteRequest,
 		}
 		pipelines = append(pipelines, pipeline)
 	}
diff --git a/pkg/pipeline/PipelineBuilder.go b/pkg/pipeline/PipelineBuilder.go
index 937392e00..600c42d5b 100644
--- a/pkg/pipeline/PipelineBuilder.go
+++ b/pkg/pipeline/PipelineBuilder.go
@@ -21,6 +21,7 @@ import (
 	"context"
 	"encoding/json"
 	"fmt"
+	application2 "github.com/argoproj/argo-cd/v2/pkg/apiclient/application"
 	client "github.com/devtron-labs/devtron/api/helm-app"
 	app2 "github.com/devtron-labs/devtron/internal/sql/repository/app"
 	"github.com/devtron-labs/devtron/internal/sql/repository/appStatus"
@@ -36,6 +37,7 @@ import (
 	"github.com/devtron-labs/devtron/pkg/user"
 	util3 "github.com/devtron-labs/devtron/pkg/util"
 	"github.com/devtron-labs/devtron/util/rbac"
+	"github.com/devtron-labs/devtron/util/argo"
 	"net/http"
 	"net/url"
 	"sort"
@@ -43,7 +45,6 @@ import (
 	"strings"
 	"time"
 
-	application2 "github.com/argoproj/argo-cd/v2/pkg/apiclient/application"
 	"github.com/caarlos0/env"
 	bean2 "github.com/devtron-labs/devtron/api/bean"
 	"github.com/devtron-labs/devtron/client/argocdServer"
@@ -101,7 +102,7 @@ type PipelineBuilder interface {
 	CreateCdPipelines(cdPipelines *bean.CdPipelines, ctx context.Context) (*bean.CdPipelines, error)
 	GetApp(appId int) (application *bean.CreateAppDTO, err error)
 	PatchCdPipelines(cdPipelines *bean.CDPatchRequest, ctx context.Context) (*bean.CdPipelines, error)
-	DeleteCdPipeline(pipeline *pipelineConfig.Pipeline, ctx context.Context, forceDelete bool, userId int32) (err error)
+	DeleteCdPipeline(pipeline *pipelineConfig.Pipeline, ctx context.Context, forceDelete bool, acdDelete bool, userId int32) (err error)
 	ChangeDeploymentType(ctx context.Context, request *bean.DeploymentAppTypeChangeRequest) (*bean.DeploymentAppTypeChangeResponse, error)
 	DeleteDeploymentAppsForEnvironment(ctx context.Context, environmentId int, currentDeploymentAppType bean.DeploymentType, exclusionList []int, includeApps []int, userId int32) (*bean.DeploymentAppTypeChangeResponse, error)
 	DeleteDeploymentApps(ctx context.Context, pipelines []*pipelineConfig.Pipeline, userId int32) *bean.DeploymentAppTypeChangeResponse
@@ -133,6 +134,7 @@ type PipelineBuilder interface {
 	DeleteCiPipeline(request *bean.CiPatchRequest) (*bean.CiPipeline, error)
 	IsGitOpsRequiredForCD(pipelineCreateRequest *bean.CdPipelines) bool
 	SetPipelineDeploymentAppType(pipelineCreateRequest *bean.CdPipelines, isGitOpsConfigured bool)
+	MarkGitOpsDevtronAppsDeletedWhereArgoAppIsDeleted(appId int, envId int, acdToken string, pipeline *pipelineConfig.Pipeline) (bool, error)
 	GetCiPipelineByEnvironment(envId int, emailId string, checkAuthBatch func(emailId string, appObject []string, envObject []string) (map[string]bool, map[string]bool)) ([]*bean.CiConfigRequest, error)
 	GetCdPipelinesByEnvironment(envId int, emailId string, checkAuthBatch func(emailId string, appObject []string, envObject []string) (map[string]bool, map[string]bool)) (cdPipelines *bean.CdPipelines, err error)
 	GetExternalCiByEnvironment(envId int, emailId string, checkAuthBatch func(emailId string, appObject []string, envObject []string) (map[string]bool, map[string]bool)) (ciConfig []*bean.ExternalCiConfig, err error)
@@ -192,6 +194,7 @@ type PipelineBuilderImpl struct {
 	globalStrategyMetadataChartRefMappingRepository chartRepoRepository.GlobalStrategyMetadataChartRefMappingRepository
 	deploymentConfig                                *DeploymentServiceTypeConfig
 	appStatusRepository                             appStatus.AppStatusRepository
+	ArgoUserService                                 argo.ArgoUserService
 	workflowDagExecutor                             WorkflowDagExecutor
 	enforcerUtil                                    rbac.EnforcerUtil
 }
@@ -241,7 +244,7 @@ func NewPipelineBuilderImpl(logger *zap.SugaredLogger,
 	globalStrategyMetadataChartRefMappingRepository chartRepoRepository.GlobalStrategyMetadataChartRefMappingRepository,
 	deploymentConfig *DeploymentServiceTypeConfig, appStatusRepository appStatus.AppStatusRepository,
 	workflowDagExecutor WorkflowDagExecutor,
-	enforcerUtil rbac.EnforcerUtil) *PipelineBuilderImpl {
+	enforcerUtil rbac.EnforcerUtil, ArgoUserService argo.ArgoUserService) *PipelineBuilderImpl {
 	return &PipelineBuilderImpl{
 		logger:                        logger,
 		ciCdPipelineOrchestrator:      ciCdPipelineOrchestrator,
@@ -294,6 +297,7 @@ func NewPipelineBuilderImpl(logger *zap.SugaredLogger,
 		globalStrategyMetadataChartRefMappingRepository: globalStrategyMetadataChartRefMappingRepository,
 		deploymentConfig:                                deploymentConfig,
 		appStatusRepository:                             appStatusRepository,
+		ArgoUserService:                                 ArgoUserService,
 		workflowDagExecutor:                             workflowDagExecutor,
 		enforcerUtil:                                    enforcerUtil,
 	}
@@ -1559,15 +1563,22 @@ func (impl PipelineBuilderImpl) PatchCdPipelines(cdPipelines *bean.CDPatchReques
 			impl.logger.Errorw("error in getting cd pipeline by id", "err", err, "id", cdPipelines.Pipeline.Id)
 			return pipelineRequest, err
 		}
-
-		err = impl.DeleteCdPipeline(pipeline, ctx, cdPipelines.ForceDelete, cdPipelines.UserId)
+		err = impl.DeleteCdPipeline(pipeline, ctx, cdPipelines.ForceDelete, false, cdPipelines.UserId)
+		return pipelineRequest, err
+	case bean.CD_DELETE_PARTIAL:
+		pipeline, err := impl.pipelineRepository.FindById(cdPipelines.Pipeline.Id)
+		if err != nil {
+			impl.logger.Errorw("error in getting cd pipeline by id", "err", err, "id", cdPipelines.Pipeline.Id)
+			return pipelineRequest, err
+		}
+		err = impl.DeleteCdPipelinePartial(pipeline, ctx, cdPipelines.ForceDelete, cdPipelines.UserId)
 		return pipelineRequest, err
 	default:
 		return nil, &util.ApiError{Code: "404", HttpStatusCode: 404, UserMessage: "operation not supported"}
 	}
 }
 
-func (impl PipelineBuilderImpl) DeleteCdPipeline(pipeline *pipelineConfig.Pipeline, ctx context.Context, forceDelete bool, userId int32) (err error) {
+func (impl PipelineBuilderImpl) DeleteCdPipeline(pipeline *pipelineConfig.Pipeline, ctx context.Context, forceDelete, deleteFromAcd bool, userId int32) (err error) {
 	//getting children CD pipeline details
 	childNodes, err := impl.appWorkflowRepository.FindWFCDMappingByParentCDPipelineId(pipeline.Id)
 	if err != nil && err != pg.ErrNoRows {
@@ -1677,6 +1688,98 @@ func (impl PipelineBuilderImpl) DeleteCdPipeline(pipeline *pipelineConfig.Pipeli
 		deploymentAppName := fmt.Sprintf("%s-%s", pipeline.App.AppName, pipeline.Environment.Name)
 		if util.IsAcdApp(pipeline.DeploymentAppType) {
 			//todo: provide option for cascading to user
+			impl.logger.Debugw("acd app is already deleted for this pipeline", "pipeline", pipeline)
+			if deleteFromAcd {
+				cascadeDelete := true
+				req := &application2.ApplicationDeleteRequest{
+					Name:    &deploymentAppName,
+					Cascade: &cascadeDelete,
+				}
+				if _, err := impl.application.Delete(ctx, req); err != nil {
+					impl.logger.Errorw("err in deleting pipeline on argocd", "id", pipeline, "err", err)
+
+					if forceDelete {
+						impl.logger.Warnw("error while deletion of app in acd, continue to delete in db as this operation is force delete", "error", err)
+					} else {
+						//statusError, _ := err.(*errors2.StatusError)
+						if strings.Contains(err.Error(), "code = NotFound") {
+							err = &util.ApiError{
+								UserMessage:     "Could not delete as application not found in argocd",
+								InternalMessage: err.Error(),
+							}
+						} else {
+							err = &util.ApiError{
+								UserMessage:     "Could not delete application",
+								InternalMessage: err.Error(),
+							}
+						}
+						return err
+					}
+				}
+
+				impl.logger.Infow("app deleted from argocd", "id", pipeline.Id, "pipelineName", pipeline.Name, "app", deploymentAppName)
+			}
+		} else if util.IsHelmApp(pipeline.DeploymentAppType) {
+			appIdentifier := &client.AppIdentifier{
+				ClusterId:   pipeline.Environment.ClusterId,
+				ReleaseName: deploymentAppName,
+				Namespace:   pipeline.Environment.Namespace,
+			}
+			deleteResponse, err := impl.helmAppService.DeleteApplication(ctx, appIdentifier)
+			if err != nil {
+				impl.logger.Errorw("error in deleting helm application", "error", err, "appIdentifier", appIdentifier)
+				return err
+			}
+			if deleteResponse == nil || !deleteResponse.GetSuccess() {
+				return errors.New("delete application response unsuccessful")
+			}
+		}
+	}
+	err = tx.Commit()
+	if err != nil {
+		impl.logger.Errorw("error in committing db transaction", "err", err)
+		return err
+	}
+	return nil
+}
+
+func (impl PipelineBuilderImpl) DeleteCdPipelinePartial(pipeline *pipelineConfig.Pipeline, ctx context.Context, forceDelete bool, userId int32) (err error) {
+	//getting children CD pipeline details
+	childNodes, err := impl.appWorkflowRepository.FindWFCDMappingByParentCDPipelineId(pipeline.Id)
+	if err != nil && err != pg.ErrNoRows {
+		impl.logger.Errorw("error in getting children cd details", "err", err)
+		return err
+	} else if len(childNodes) > 0 {
+		impl.logger.Debugw("cannot delete cd pipeline, contains children cd")
+		return fmt.Errorf("Please delete children CD pipelines before deleting this pipeline.")
+	}
+	//getting deployment group for this pipeline
+	deploymentGroupNames, err := impl.deploymentGroupRepository.GetNamesByAppIdAndEnvId(pipeline.EnvironmentId, pipeline.AppId)
+	if err != nil && err != pg.ErrNoRows {
+		impl.logger.Errorw("error in getting deployment group names by appId and envId", "err", err)
+		return err
+	} else if len(deploymentGroupNames) > 0 {
+		groupNamesByte, err := json.Marshal(deploymentGroupNames)
+		if err != nil {
+			impl.logger.Errorw("error in marshaling deployment group names", "err", err, "deploymentGroupNames", deploymentGroupNames)
+		}
+		impl.logger.Debugw("cannot delete cd pipeline, is being used in deployment group")
+		return fmt.Errorf("Please remove this CD pipeline from deployment groups : %s", string(groupNamesByte))
+	}
+	dbConnection := impl.pipelineRepository.GetConnection()
+	tx, err := dbConnection.Begin()
+	if err != nil {
+		return err
+	}
+	// Rollback tx on error.
+	defer tx.Rollback()
+
+	//delete app from argo cd, if created
+	if pipeline.DeploymentAppCreated == true && pipeline.DeploymentAppDeleteRequest == false {
+		deploymentAppName := fmt.Sprintf("%s-%s", pipeline.App.AppName, pipeline.Environment.Name)
+		if util.IsAcdApp(pipeline.DeploymentAppType) {
+			//todo: provide option for cascading to user
+			impl.logger.Debugw("acd app is already deleted for this pipeline", "pipeline", pipeline)
 			cascadeDelete := true
 			req := &application2.ApplicationDeleteRequest{
 				Name:    &deploymentAppName,
@@ -1704,20 +1807,12 @@ func (impl PipelineBuilderImpl) DeleteCdPipeline(pipeline *pipelineConfig.Pipeli
 				}
 			}
 			impl.logger.Infow("app deleted from argocd", "id", pipeline.Id, "pipelineName", pipeline.Name, "app", deploymentAppName)
-		} else if util.IsHelmApp(pipeline.DeploymentAppType) {
-			appIdentifier := &client.AppIdentifier{
-				ClusterId:   pipeline.Environment.ClusterId,
-				ReleaseName: deploymentAppName,
-				Namespace:   pipeline.Environment.Namespace,
-			}
-			deleteResponse, err := impl.helmAppService.DeleteApplication(ctx, appIdentifier)
+			pipeline.DeploymentAppDeleteRequest = true
+			err = impl.pipelineRepository.Update(pipeline, tx)
 			if err != nil {
-				impl.logger.Errorw("error in deleting helm application", "error", err, "appIdentifier", appIdentifier)
+				impl.logger.Errorw("error in partially delete cd pipeline", "err", err)
 				return err
 			}
-			if deleteResponse == nil || !deleteResponse.GetSuccess() {
-				return errors.New("delete application response unsuccessful")
-			}
 		}
 	}
 	err = tx.Commit()
@@ -2511,6 +2606,7 @@ func (impl PipelineBuilderImpl) GetCdPipelinesForApp(appId int) (cdPipelines *be
 			DeploymentAppType:             dbPipeline.DeploymentAppType,
 			ParentPipelineType:            appWorkflowMapping.ParentType,
 			ParentPipelineId:              appWorkflowMapping.ParentId,
+			DeploymentAppDeleteRequest:    dbPipeline.DeploymentAppDeleteRequest,
 		}
 		pipelines = append(pipelines, pipeline)
 	}
@@ -3039,6 +3135,7 @@ func (impl PipelineBuilderImpl) GetCdPipelineById(pipelineId int) (cdPipeline *b
 		ParentPipelineId:              appWorkflowMapping.ParentId,
 		ParentPipelineType:            appWorkflowMapping.ParentType,
 		DeploymentAppType:             dbPipeline.DeploymentAppType,
+		DeploymentAppCreated:          dbPipeline.DeploymentAppCreated,
 	}
 
 	return cdPipeline, err
@@ -3246,7 +3343,7 @@ func (impl PipelineBuilderImpl) BulkDeleteCdPipelines(impactedPipelines []*pipel
 			EnvironmentName: pipeline.Environment.Name,
 		}
 		if !dryRun {
-			err := impl.DeleteCdPipeline(pipeline, ctx, forceDelete, userId)
+			err := impl.DeleteCdPipeline(pipeline, ctx, forceDelete, true, userId)
 			if err != nil {
 				impl.logger.Errorw("error in deleting cd pipeline", "err", err, "pipelineId", pipeline.Id)
 				respDto.DeletionResult = fmt.Sprintf("Not able to delete pipeline, %v", err)
@@ -3413,6 +3510,28 @@ func (impl PipelineBuilderImpl) buildResponses() []bean.ResponseSchemaObject {
 	return responseSchemaObjects
 }
 
+func (impl PipelineBuilderImpl) MarkGitOpsDevtronAppsDeletedWhereArgoAppIsDeleted(appId int, envId int, acdToken string, pipeline *pipelineConfig.Pipeline) (bool, error) {
+
+	acdAppFound := false
+	ctx := context.Background()
+	ctx = context.WithValue(ctx, "token", acdToken)
+	acdAppName := pipeline.DeploymentAppName
+	_, err := impl.application.Get(ctx, &application2.ApplicationQuery{Name: &acdAppName})
+	if err == nil {
+		// acd app is not yet deleted so return
+		acdAppFound = true
+		return acdAppFound, err
+	}
+	impl.logger.Warnw("app not found in argo, deleting from db ", "err", err)
+	//make call to delete it from pipeline DB because it's ACD counterpart is deleted
+	err = impl.DeleteCdPipeline(pipeline, context.Background(), true, false, 0)
+	if err != nil {
+		impl.logger.Errorw("error in deleting cd pipeline", "err", err)
+		return acdAppFound, err
+	}
+	return acdAppFound, nil
+}
+
 func (impl PipelineBuilderImpl) GetCiPipelineByEnvironment(envId int, emailId string, checkAuthBatch func(emailId string, appObject []string, envObject []string) (map[string]bool, map[string]bool)) ([]*bean.CiConfigRequest, error) {
 	ciPipelines, err := impl.pipelineRepository.FindActiveByEnvId(envId)
 	if err != nil && err != pg.ErrNoRows {
diff --git a/releasenotes.md b/releasenotes.md
index 97585a7fe..3ea447d07 100644
--- a/releasenotes.md
+++ b/releasenotes.md
@@ -1,40 +1,46 @@
-## v0.6.11
+## v0.6.12
 
 ## Bugs
-- fix: Nats server version upgrade (#2837)
-- fix: K8s side resources error handled some unable to fetch some kinds in cluster (#2896)
-- fix: helm and gitOps pipeline feature gap changes (#2891)
-- fix: Adding /Deleting git material reflection in workflow editor and build & deploy (#2744)
-- fix: issue resolved for notification on deployment trigger and telemetry summary event (#2893)
-- fix: helm manifest output in deployment history (#2822)
-- fix: sending appName in the response of getAppWorkflow API (#2879)
-- fix: cluster not reachable handling (#2872)
-- fix: bitbucket gitops config fixes (#2768)
-- fix: updated sonarqube plugin script (#2855)
-- fix: updated the description in sonarqube migration (#2853)
-- fix: External Ci Trigger - Won't show images for manual Cd pipelines (#2802)
-- fix: app create api bug fix if chart ref is different (#2851)
-- fix: Dockerfile git repo delete tooltip view to build config (#2792)
+- fix: chart repository fixes (#2730)
+- fix: conditionally setting s3 config in workflow object (#3014)
+- fix: fixed condition for updating health timeline and status (#3003)
+- fix: added deployment app type support for app create api, separated cron time for helm app status update (#2995)
+- fix: helm deploy hibernate fix (#2983)
+- fix: duplicate name in charts and chart Group (#2942)
+- fix: sorting app environment containers in app listing api  (#2935)
+- fix: Multigit bug fix in case of preCD and postCD (#2920)
+- fix: Injected support for cloning linked ci pipelines via workflow cloning API (#2944)
+- fix: k8s log stream cpu issue (#2929)
+- fix: cd pipeline delete, 404 issue (#2939)
+- fix: finished on time update fix (#2932)
+- fix: updated log type for pipeline status methods (#2926)
+- fix: pvc mounted on pods for cache handling  (#2912)
+- fix: Installed apps rbac optimisation (#2918)
+- fix: event notification calls missing for Build Success and Cd Deployment Success for helm type (#2898)
+- fix: ingress url missing (#2915)
 ## Enhancements
-- feat: Support of reuse container image in containers section in reference chart 4-17 (#2675)
-- feat: Added Rollout chart 4.17 and Deployment chart 1.1 with canary using flagger and Istio support (#2910)
-- feat: Codacy plugin integration (#2892)
-- feat: Semgrep plugin integration (#2877)
-- perf: Tracing observability tool integration (#2782)
-- feat: Option for changing project in Helm apps and project assignment to CLI helm apps. (#2780)
-- feat: Audit logs for resource deletion from devtron UI  (#2791)
-- feat: verify token function scope made public (#2856)
-- feat: Sonarqube polling script update (#2846)
-- feat: deployment status restructuring (#2825)
+- feat: deployment pipeline partially delete. (#2950)
+- feat: jira issue validator plugin added (#2968)
+- feat: add configuration for only logging pg queries exceeding a threshold duration (#2946)
+- feat: add api to change deployment app type for all cd pipelines in an environment (#2975)
+- feat: App grouping BE (#2979)
+- feat: Resource browser child ref (#2913)
+- feat: cluster bearer token hide from dashboard (#2894)
+- feat: added option to propagate custom tag to k8s resources for that application (#2841)
+- feat: argo stack upgrade (#2597)
+- feat: Showing app status on app listing page (#2799)
 ## Documentation
-- docs: removed command to install a particular version of Devtron (#2888)
-- docs: Updated README.md file for Devtron chart (#2887)
-- docs: added manage tags (#2907)
-- docs: updated target platform (#2857)
-- docs: updated aws external secret doc (#2781)
-- docs: updated broken links and minor updates (resource browser) (#2844)
-- docs: added cluster, k8s resource browser, k8s resource permission (#2787)
+- docs: sso login doc (#2854)
+- docs: Some correction in Documentation at install devtron/ configuration / ingress setup (#2981)
+- docs: sso login doc (#2854)
+- docs: Added preset plugins (#2904)
+- docs: mount pvc (#2941)
+- docs: minor updates ingress (#2931)
 ## Others
-- task: added new fields for eso secrets (#2899)
-- task: updated deployment status timeline api for helm based pipelines (#2897)
-- task: updated logic for adding health status timeline (#2870)
+- bug: resolve failing bulk pipeline delete api (#3042)
+- removed server mode hardcoding (#3031)
+- fi: fixed incorrect userId in ci audit entries (#3011)
+- plugin jira icon added (#2977)
+- task: added api for getting default template values (#2905)
+
+
diff --git a/scripts/sql/117_app_delete_status.down.sql b/scripts/sql/117_app_delete_status.down.sql
new file mode 100644
index 000000000..a66d077d3
--- /dev/null
+++ b/scripts/sql/117_app_delete_status.down.sql
@@ -0,0 +1,2 @@
+ALTER TABLE "public"."pipeline" DROP COLUMN "deployment_app_delete_request";
+ALTER TABLE "public"."installed_apps" DROP COLUMN "deployment_app_delete_request";
\ No newline at end of file
diff --git a/scripts/sql/117_app_delete_status.up.sql b/scripts/sql/117_app_delete_status.up.sql
new file mode 100644
index 000000000..ae561f481
--- /dev/null
+++ b/scripts/sql/117_app_delete_status.up.sql
@@ -0,0 +1,8 @@
+ALTER TABLE "public"."pipeline" ADD COLUMN deployment_app_delete_request bool DEFAULT false;
+ALTER TABLE "public"."installed_apps" ADD COLUMN deployment_app_delete_request bool DEFAULT false;
+
+update pipeline set deployment_app_delete_request=true
+where deleted=true AND deployment_app_type='argo_cd' AND deployment_app_created=true;
+
+update installed_apps set deployment_app_delete_request=true
+where active=true AND deployment_app_type='argo_cd';
\ No newline at end of file
diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go
index be7db1969..4db8e3db5 100644
--- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go
+++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go
@@ -49,6 +49,9 @@ const (
 	APPLICATION_STATUS_UPDATE_TOPIC     string = "APPLICATION_STATUS_UPDATE"
 	APPLICATION_STATUS_UPDATE_GROUP     string = "APPLICATION_STATUS_UPDATE_GROUP-1"
 	APPLICATION_STATUS_UPDATE_DURABLE   string = "APPLICATION_STATUS_UPDATE_DURABLE-1"
+	APPLICATION_STATUS_DELETE_TOPIC     string = "APPLICATION_STATUS_DELETE"
+	APPLICATION_STATUS_DELETE_GROUP     string = "APPLICATION_STATUS_DELETE_GROUP-1"
+	APPLICATION_STATUS_DELETE_DURABLE   string = "APPLICATION_STATUS_DELETE_DURABLE-1"
 	CRON_EVENTS                         string = "CRON_EVENTS"
 	CRON_EVENTS_GROUP                   string = "CRON_EVENTS_GROUP-2"
 	CRON_EVENTS_DURABLE                 string = "CRON_EVENTS_DURABLE-2"
@@ -102,6 +105,7 @@ var natsTopicMapping = map[string]NatsTopic{
 	CD_STAGE_COMPLETE_TOPIC: {topicName: CD_STAGE_COMPLETE_TOPIC, streamName: CI_RUNNER_STREAM, queueName: CD_COMPLETE_GROUP, consumerName: CD_COMPLETE_DURABLE},
 
 	APPLICATION_STATUS_UPDATE_TOPIC: {topicName: APPLICATION_STATUS_UPDATE_TOPIC, streamName: KUBEWATCH_STREAM, queueName: APPLICATION_STATUS_UPDATE_GROUP, consumerName: APPLICATION_STATUS_UPDATE_DURABLE},
+	APPLICATION_STATUS_DELETE_TOPIC: {topicName: APPLICATION_STATUS_DELETE_TOPIC, streamName: KUBEWATCH_STREAM, queueName: APPLICATION_STATUS_DELETE_GROUP, consumerName: APPLICATION_STATUS_DELETE_DURABLE},
 	CRON_EVENTS:                     {topicName: CRON_EVENTS, streamName: KUBEWATCH_STREAM, queueName: CRON_EVENTS_GROUP, consumerName: CRON_EVENTS_DURABLE},
 	WORKFLOW_STATUS_UPDATE_TOPIC:    {topicName: WORKFLOW_STATUS_UPDATE_TOPIC, streamName: KUBEWATCH_STREAM, queueName: WORKFLOW_STATUS_UPDATE_GROUP, consumerName: WORKFLOW_STATUS_UPDATE_DURABLE},
 	CD_WORKFLOW_STATUS_UPDATE:       {topicName: CD_WORKFLOW_STATUS_UPDATE, streamName: KUBEWATCH_STREAM, queueName: CD_WORKFLOW_STATUS_UPDATE_GROUP, consumerName: CD_WORKFLOW_STATUS_UPDATE_DURABLE},
@@ -129,6 +133,7 @@ var NatsConsumerWiseConfigMapping = map[string]NatsConsumerConfig{
 	WORKFLOW_STATUS_UPDATE_DURABLE:      {},
 	CRON_EVENTS_DURABLE:                 {},
 	APPLICATION_STATUS_UPDATE_DURABLE:   {},
+	APPLICATION_STATUS_DELETE_DURABLE:   {},
 	CD_COMPLETE_DURABLE:                 {},
 	CI_COMPLETE_DURABLE:                 {},
 	WEBHOOK_EVENT_DURABLE:               {},
@@ -246,6 +251,7 @@ func AddStream(js nats.JetStreamContext, streamConfig *nats.StreamConfig, stream
 			log.Fatal("Error while getting stream info", "stream name", streamName, "error", err)
 		} else {
 			config := streamInfo.Config
+			streamConfig.Name = streamName
 			if checkConfigChangeReqd(&config, streamConfig) {
 				_, err1 := js.UpdateStream(&config)
 				if err1 != nil {
@@ -260,8 +266,9 @@ func AddStream(js nats.JetStreamContext, streamConfig *nats.StreamConfig, stream
 func checkConfigChangeReqd(existingConfig *nats.StreamConfig, toUpdateConfig *nats.StreamConfig) bool {
 	configChanged := false
 	newStreamSubjects := GetStreamSubjects(toUpdateConfig.Name)
-	if toUpdateConfig.MaxAge != time.Duration(0) && toUpdateConfig.MaxAge != existingConfig.MaxAge || len(newStreamSubjects) != len(existingConfig.Subjects) {
+	if ((toUpdateConfig.MaxAge != time.Duration(0)) && (toUpdateConfig.MaxAge != existingConfig.MaxAge)) || (len(newStreamSubjects) != len(existingConfig.Subjects)) {
 		existingConfig.MaxAge = toUpdateConfig.MaxAge
+		existingConfig.Subjects = newStreamSubjects
 		configChanged = true
 	}
 
diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/NatsClient.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/NatsClient.go
index 8ec46ce0b..48ad2dd42 100644
--- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/NatsClient.go
+++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/NatsClient.go
@@ -19,11 +19,10 @@ package pubsub_lib
 
 import (
 	"encoding/json"
-	"time"
-
 	"github.com/caarlos0/env"
 	"github.com/nats-io/nats.go"
 	"go.uber.org/zap"
+	"time"
 )
 
 type NatsClient struct {
diff --git a/vendor/modules.txt b/vendor/modules.txt
index a0c426263..6b99eadb0 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -327,7 +327,7 @@ github.com/devtron-labs/authenticator/jwt
 github.com/devtron-labs/authenticator/middleware
 github.com/devtron-labs/authenticator/oidc
 github.com/devtron-labs/authenticator/password
-# github.com/devtron-labs/common-lib v0.0.0-20230109070754-ff4dca200a2c
+# github.com/devtron-labs/common-lib v0.0.0-20230220122715-29f6f63d39e9
 ## explicit; go 1.18
 github.com/devtron-labs/common-lib/blob-storage
 github.com/devtron-labs/common-lib/pubsub-lib
diff --git a/wire_gen.go b/wire_gen.go
index 39cc8779f..b1836be8d 100644
--- a/wire_gen.go
+++ b/wire_gen.go
@@ -1,7 +1,8 @@
 // Code generated by Wire. DO NOT EDIT.
 
 //go:generate go run github.com/google/wire/cmd/wire
-//+build !wireinject
+//go:build !wireinject
+// +build !wireinject
 
 package main
 
@@ -69,13 +70,13 @@ import (
 	"github.com/devtron-labs/devtron/pkg/appStore/deployment/common"
 	"github.com/devtron-labs/devtron/pkg/appStore/deployment/fullMode"
 	repository3 "github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
-	service2 "github.com/devtron-labs/devtron/pkg/appStore/deployment/service"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/service"
 	"github.com/devtron-labs/devtron/pkg/appStore/deployment/tool"
 	"github.com/devtron-labs/devtron/pkg/appStore/deployment/tool/gitops"
 	"github.com/devtron-labs/devtron/pkg/appStore/discover/repository"
 	service3 "github.com/devtron-labs/devtron/pkg/appStore/discover/service"
 	"github.com/devtron-labs/devtron/pkg/appStore/values/repository"
-	"github.com/devtron-labs/devtron/pkg/appStore/values/service"
+	service2 "github.com/devtron-labs/devtron/pkg/appStore/values/service"
 	appWorkflow2 "github.com/devtron-labs/devtron/pkg/appWorkflow"
 	"github.com/devtron-labs/devtron/pkg/attributes"
 	"github.com/devtron-labs/devtron/pkg/auth"
@@ -331,11 +332,24 @@ func InitializeApp() (*App, error) {
 		return nil, err
 	}
 	appStatusServiceImpl := appStatus2.NewAppStatusServiceImpl(appStatusRepositoryImpl, sugaredLogger, enforcerImpl, enforcerUtilImpl)
+	clusterInstalledAppsRepositoryImpl := repository3.NewClusterInstalledAppsRepositoryImpl(db, sugaredLogger)
+	appStoreDeploymentHelmServiceImpl := appStoreDeploymentTool.NewAppStoreDeploymentHelmServiceImpl(sugaredLogger, helmAppServiceImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl, helmAppClientImpl, installedAppRepositoryImpl)
+	refChartProxyDir := _wireRefChartProxyDirValue
+	appStoreDeploymentFullModeServiceImpl := appStoreDeploymentFullMode.NewAppStoreDeploymentFullModeServiceImpl(sugaredLogger, chartTemplateServiceImpl, refChartProxyDir, repositoryServiceClientImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl, applicationServiceClientImpl, argoK8sClientImpl, gitFactory, acdAuthConfig, globalEnvVariables, installedAppRepositoryImpl, tokenCache, argoUserServiceImpl, gitOpsConfigRepositoryImpl)
+	chartGroupDeploymentRepositoryImpl := repository3.NewChartGroupDeploymentRepositoryImpl(db, sugaredLogger)
+	installedAppVersionHistoryRepositoryImpl := repository3.NewInstalledAppVersionHistoryRepositoryImpl(sugaredLogger, db)
+	appStoreDeploymentCommonServiceImpl := appStoreDeploymentCommon.NewAppStoreDeploymentCommonServiceImpl(sugaredLogger, installedAppRepositoryImpl)
+	appStoreDeploymentArgoCdServiceImpl := appStoreDeploymentGitopsTool.NewAppStoreDeploymentArgoCdServiceImpl(sugaredLogger, appStoreDeploymentFullModeServiceImpl, applicationServiceClientImpl, chartGroupDeploymentRepositoryImpl, installedAppRepositoryImpl, installedAppVersionHistoryRepositoryImpl, chartTemplateServiceImpl, gitFactory, argoUserServiceImpl, appStoreDeploymentCommonServiceImpl, helmAppServiceImpl, gitOpsConfigRepositoryImpl, appStatusServiceImpl)
+	deploymentServiceTypeConfig, err := service.GetDeploymentServiceTypeConfig()
+	if err != nil {
+		return nil, err
+	}
+	appStoreDeploymentServiceImpl := service.NewAppStoreDeploymentServiceImpl(sugaredLogger, installedAppRepositoryImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl, clusterInstalledAppsRepositoryImpl, appRepositoryImpl, appStoreDeploymentHelmServiceImpl, appStoreDeploymentArgoCdServiceImpl, environmentServiceImpl, clusterServiceImplExtended, helmAppServiceImpl, appStoreDeploymentCommonServiceImpl, globalEnvVariables, installedAppVersionHistoryRepositoryImpl, gitOpsConfigRepositoryImpl, attributesServiceImpl, deploymentServiceTypeConfig)
 	k8sClientServiceImpl := application2.NewK8sClientServiceImpl(sugaredLogger, clusterRepositoryImpl)
 	k8sResourceHistoryRepositoryImpl := repository8.NewK8sResourceHistoryRepositoryImpl(db, sugaredLogger)
 	k8sResourceHistoryServiceImpl := kubernetesResourceAuditLogs.Newk8sResourceHistoryServiceImpl(k8sResourceHistoryRepositoryImpl, sugaredLogger, appRepositoryImpl, environmentRepositoryImpl)
 	k8sApplicationServiceImpl := k8s.NewK8sApplicationServiceImpl(sugaredLogger, clusterServiceImplExtended, pumpImpl, k8sClientServiceImpl, helmAppServiceImpl, k8sUtil, acdAuthConfig, k8sResourceHistoryServiceImpl)
-	appServiceImpl := app2.NewAppService(envConfigOverrideRepositoryImpl, pipelineOverrideRepositoryImpl, mergeUtil, sugaredLogger, ciArtifactRepositoryImpl, pipelineRepositoryImpl, dbMigrationConfigRepositoryImpl, eventRESTClientImpl, eventSimpleFactoryImpl, applicationServiceClientImpl, tokenCache, acdAuthConfig, enforcerImpl, enforcerUtilImpl, userServiceImpl, appListingRepositoryImpl, appRepositoryImpl, environmentRepositoryImpl, pipelineConfigRepositoryImpl, configMapRepositoryImpl, appLevelMetricsRepositoryImpl, envLevelAppMetricsRepositoryImpl, chartRepositoryImpl, ciPipelineMaterialRepositoryImpl, cdWorkflowRepositoryImpl, commonServiceImpl, imageScanDeployInfoRepositoryImpl, imageScanHistoryRepositoryImpl, argoK8sClientImpl, gitFactory, pipelineStrategyHistoryServiceImpl, configMapHistoryServiceImpl, deploymentTemplateHistoryServiceImpl, chartTemplateServiceImpl, refChartDir, chartRefRepositoryImpl, chartServiceImpl, helmAppClientImpl, argoUserServiceImpl, pipelineStatusTimelineRepositoryImpl, appCrudOperationServiceImpl, configMapHistoryRepositoryImpl, pipelineStrategyHistoryRepositoryImpl, deploymentTemplateHistoryRepositoryImpl, dockerRegistryIpsConfigServiceImpl, pipelineStatusTimelineResourcesServiceImpl, pipelineStatusSyncDetailServiceImpl, pipelineStatusTimelineServiceImpl, appStatusConfig, gitOpsConfigRepositoryImpl, appStatusServiceImpl, k8sApplicationServiceImpl)
+	appServiceImpl := app2.NewAppService(envConfigOverrideRepositoryImpl, pipelineOverrideRepositoryImpl, mergeUtil, sugaredLogger, ciArtifactRepositoryImpl, pipelineRepositoryImpl, dbMigrationConfigRepositoryImpl, eventRESTClientImpl, eventSimpleFactoryImpl, applicationServiceClientImpl, tokenCache, acdAuthConfig, enforcerImpl, enforcerUtilImpl, userServiceImpl, appListingRepositoryImpl, appRepositoryImpl, environmentRepositoryImpl, pipelineConfigRepositoryImpl, configMapRepositoryImpl, appLevelMetricsRepositoryImpl, envLevelAppMetricsRepositoryImpl, chartRepositoryImpl, ciPipelineMaterialRepositoryImpl, cdWorkflowRepositoryImpl, commonServiceImpl, imageScanDeployInfoRepositoryImpl, imageScanHistoryRepositoryImpl, argoK8sClientImpl, gitFactory, pipelineStrategyHistoryServiceImpl, configMapHistoryServiceImpl, deploymentTemplateHistoryServiceImpl, chartTemplateServiceImpl, refChartDir, chartRefRepositoryImpl, chartServiceImpl, helmAppClientImpl, argoUserServiceImpl, pipelineStatusTimelineRepositoryImpl, appCrudOperationServiceImpl, configMapHistoryRepositoryImpl, pipelineStrategyHistoryRepositoryImpl, deploymentTemplateHistoryRepositoryImpl, dockerRegistryIpsConfigServiceImpl, pipelineStatusTimelineResourcesServiceImpl, pipelineStatusSyncDetailServiceImpl, pipelineStatusTimelineServiceImpl, appStatusConfig, gitOpsConfigRepositoryImpl, appStatusServiceImpl, installedAppRepositoryImpl, appStoreDeploymentServiceImpl, k8sApplicationServiceImpl)
 	validate, err := util.IntValidator()
 	if err != nil {
 		return nil, err
@@ -395,11 +409,11 @@ func InitializeApp() (*App, error) {
 	ciTemplateHistoryServiceImpl := history.NewCiTemplateHistoryServiceImpl(ciTemplateHistoryRepositoryImpl, sugaredLogger)
 	globalStrategyMetadataRepositoryImpl := chartRepoRepository.NewGlobalStrategyMetadataRepositoryImpl(db, sugaredLogger)
 	globalStrategyMetadataChartRefMappingRepositoryImpl := chartRepoRepository.NewGlobalStrategyMetadataChartRefMappingRepositoryImpl(db, sugaredLogger)
-	deploymentServiceTypeConfig, err := pipeline.GetDeploymentServiceTypeConfig()
+	pipelineDeploymentServiceTypeConfig, err := pipeline.GetDeploymentServiceTypeConfig()
 	if err != nil {
 		return nil, err
 	}
-	pipelineBuilderImpl := pipeline.NewPipelineBuilderImpl(sugaredLogger, ciCdPipelineOrchestratorImpl, dockerArtifactStoreRepositoryImpl, materialRepositoryImpl, appRepositoryImpl, pipelineRepositoryImpl, propertiesConfigServiceImpl, ciTemplateRepositoryImpl, ciPipelineRepositoryImpl, applicationServiceClientImpl, chartRepositoryImpl, ciArtifactRepositoryImpl, ecrConfig, envConfigOverrideRepositoryImpl, environmentRepositoryImpl, pipelineConfigRepositoryImpl, utilMergeUtil, appWorkflowRepositoryImpl, ciConfig, cdWorkflowRepositoryImpl, appServiceImpl, imageScanResultRepositoryImpl, argoK8sClientImpl, gitFactory, attributesServiceImpl, acdAuthConfig, gitOpsConfigRepositoryImpl, pipelineStrategyHistoryServiceImpl, prePostCiScriptHistoryServiceImpl, prePostCdScriptHistoryServiceImpl, deploymentTemplateHistoryServiceImpl, appLevelMetricsRepositoryImpl, pipelineStageServiceImpl, chartRefRepositoryImpl, chartTemplateServiceImpl, chartServiceImpl, helmAppServiceImpl, deploymentGroupRepositoryImpl, ciPipelineMaterialRepositoryImpl, userServiceImpl, ciTemplateServiceImpl, ciTemplateOverrideRepositoryImpl, gitMaterialHistoryServiceImpl, ciTemplateHistoryServiceImpl, ciPipelineHistoryServiceImpl, globalStrategyMetadataRepositoryImpl, globalStrategyMetadataChartRefMappingRepositoryImpl, deploymentServiceTypeConfig, appStatusRepositoryImpl, workflowDagExecutorImpl, enforcerUtilImpl)
+	pipelineBuilderImpl := pipeline.NewPipelineBuilderImpl(sugaredLogger, ciCdPipelineOrchestratorImpl, dockerArtifactStoreRepositoryImpl, materialRepositoryImpl, appRepositoryImpl, pipelineRepositoryImpl, propertiesConfigServiceImpl, ciTemplateRepositoryImpl, ciPipelineRepositoryImpl, applicationServiceClientImpl, chartRepositoryImpl, ciArtifactRepositoryImpl, ecrConfig, envConfigOverrideRepositoryImpl, environmentRepositoryImpl, pipelineConfigRepositoryImpl, utilMergeUtil, appWorkflowRepositoryImpl, ciConfig, cdWorkflowRepositoryImpl, appServiceImpl, imageScanResultRepositoryImpl, argoK8sClientImpl, gitFactory, attributesServiceImpl, acdAuthConfig, gitOpsConfigRepositoryImpl, pipelineStrategyHistoryServiceImpl, prePostCiScriptHistoryServiceImpl, prePostCdScriptHistoryServiceImpl, deploymentTemplateHistoryServiceImpl, appLevelMetricsRepositoryImpl, pipelineStageServiceImpl, chartRefRepositoryImpl, chartTemplateServiceImpl, chartServiceImpl, helmAppServiceImpl, deploymentGroupRepositoryImpl, ciPipelineMaterialRepositoryImpl, userServiceImpl, ciTemplateServiceImpl, ciTemplateOverrideRepositoryImpl, gitMaterialHistoryServiceImpl, ciTemplateHistoryServiceImpl, ciPipelineHistoryServiceImpl, globalStrategyMetadataRepositoryImpl, globalStrategyMetadataChartRefMappingRepositoryImpl, pipelineDeploymentServiceTypeConfig, appStatusRepositoryImpl, workflowDagExecutorImpl, enforcerUtilImpl, argoUserServiceImpl)
 	dbMigrationServiceImpl := pipeline.NewDbMogrationService(sugaredLogger, dbMigrationConfigRepositoryImpl)
 	globalCMCSRepositoryImpl := repository.NewGlobalCMCSRepositoryImpl(sugaredLogger, db)
 	globalCMCSServiceImpl := pipeline.NewGlobalCMCSServiceImpl(sugaredLogger, globalCMCSRepositoryImpl)
@@ -433,22 +447,9 @@ func InitializeApp() (*App, error) {
 	dbConfigServiceImpl := pipeline.NewDbConfigService(dbConfigRepositoryImpl, sugaredLogger)
 	migrateDbRestHandlerImpl := restHandler.NewMigrateDbRestHandlerImpl(dockerRegistryConfigImpl, sugaredLogger, gitRegistryConfigImpl, dbConfigServiceImpl, userServiceImpl, validate, dbMigrationServiceImpl, enforcerImpl)
 	migrateDbRouterImpl := router.NewMigrateDbRouterImpl(migrateDbRestHandlerImpl)
-	refChartProxyDir := _wireRefChartProxyDirValue
 	appStoreVersionValuesRepositoryImpl := appStoreValuesRepository.NewAppStoreVersionValuesRepositoryImpl(sugaredLogger, db)
-	appStoreValuesServiceImpl := service.NewAppStoreValuesServiceImpl(sugaredLogger, appStoreApplicationVersionRepositoryImpl, installedAppRepositoryImpl, appStoreVersionValuesRepositoryImpl, userServiceImpl)
-	chartGroupDeploymentRepositoryImpl := repository3.NewChartGroupDeploymentRepositoryImpl(db, sugaredLogger)
-	appStoreDeploymentFullModeServiceImpl := appStoreDeploymentFullMode.NewAppStoreDeploymentFullModeServiceImpl(sugaredLogger, chartTemplateServiceImpl, refChartProxyDir, repositoryServiceClientImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl, applicationServiceClientImpl, argoK8sClientImpl, gitFactory, acdAuthConfig, globalEnvVariables, installedAppRepositoryImpl, tokenCache, argoUserServiceImpl, gitOpsConfigRepositoryImpl)
-	clusterInstalledAppsRepositoryImpl := repository3.NewClusterInstalledAppsRepositoryImpl(db, sugaredLogger)
-	appStoreDeploymentHelmServiceImpl := appStoreDeploymentTool.NewAppStoreDeploymentHelmServiceImpl(sugaredLogger, helmAppServiceImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl, helmAppClientImpl, installedAppRepositoryImpl)
-	installedAppVersionHistoryRepositoryImpl := repository3.NewInstalledAppVersionHistoryRepositoryImpl(sugaredLogger, db)
-	appStoreDeploymentCommonServiceImpl := appStoreDeploymentCommon.NewAppStoreDeploymentCommonServiceImpl(sugaredLogger, installedAppRepositoryImpl)
-	appStoreDeploymentArgoCdServiceImpl := appStoreDeploymentGitopsTool.NewAppStoreDeploymentArgoCdServiceImpl(sugaredLogger, appStoreDeploymentFullModeServiceImpl, applicationServiceClientImpl, chartGroupDeploymentRepositoryImpl, installedAppRepositoryImpl, installedAppVersionHistoryRepositoryImpl, chartTemplateServiceImpl, gitFactory, argoUserServiceImpl, appStoreDeploymentCommonServiceImpl, helmAppServiceImpl, gitOpsConfigRepositoryImpl, appStatusServiceImpl)
-	serviceDeploymentServiceTypeConfig, err := service2.GetDeploymentServiceTypeConfig()
-	if err != nil {
-		return nil, err
-	}
-	appStoreDeploymentServiceImpl := service2.NewAppStoreDeploymentServiceImpl(sugaredLogger, installedAppRepositoryImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl, clusterInstalledAppsRepositoryImpl, appRepositoryImpl, appStoreDeploymentHelmServiceImpl, appStoreDeploymentArgoCdServiceImpl, environmentServiceImpl, clusterServiceImplExtended, helmAppServiceImpl, appStoreDeploymentCommonServiceImpl, globalEnvVariables, installedAppVersionHistoryRepositoryImpl, gitOpsConfigRepositoryImpl, attributesServiceImpl, serviceDeploymentServiceTypeConfig)
-	installedAppServiceImpl, err := service2.NewInstalledAppServiceImpl(sugaredLogger, installedAppRepositoryImpl, chartTemplateServiceImpl, refChartProxyDir, repositoryServiceClientImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl, teamRepositoryImpl, appRepositoryImpl, applicationServiceClientImpl, appStoreValuesServiceImpl, pubSubClientServiceImpl, tokenCache, chartGroupDeploymentRepositoryImpl, environmentServiceImpl, argoK8sClientImpl, gitFactory, acdAuthConfig, gitOpsConfigRepositoryImpl, userServiceImpl, appStoreDeploymentFullModeServiceImpl, appStoreDeploymentServiceImpl, installedAppVersionHistoryRepositoryImpl, argoUserServiceImpl, helmAppClientImpl, helmAppServiceImpl, attributesRepositoryImpl, appStatusServiceImpl)
+	appStoreValuesServiceImpl := service2.NewAppStoreValuesServiceImpl(sugaredLogger, appStoreApplicationVersionRepositoryImpl, installedAppRepositoryImpl, appStoreVersionValuesRepositoryImpl, userServiceImpl)
+	installedAppServiceImpl, err := service.NewInstalledAppServiceImpl(sugaredLogger, installedAppRepositoryImpl, chartTemplateServiceImpl, refChartProxyDir, repositoryServiceClientImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl, teamRepositoryImpl, appRepositoryImpl, applicationServiceClientImpl, appStoreValuesServiceImpl, pubSubClientServiceImpl, tokenCache, chartGroupDeploymentRepositoryImpl, environmentServiceImpl, argoK8sClientImpl, gitFactory, acdAuthConfig, gitOpsConfigRepositoryImpl, userServiceImpl, appStoreDeploymentFullModeServiceImpl, appStoreDeploymentServiceImpl, installedAppVersionHistoryRepositoryImpl, argoUserServiceImpl, helmAppClientImpl, helmAppServiceImpl, attributesRepositoryImpl, appStatusServiceImpl)
 	if err != nil {
 		return nil, err
 	}
@@ -522,7 +523,7 @@ func InitializeApp() (*App, error) {
 	teamRouterImpl := team2.NewTeamRouterImpl(teamRestHandlerImpl)
 	gitWebhookHandlerImpl := pubsub.NewGitWebhookHandler(sugaredLogger, pubSubClientServiceImpl, gitWebhookServiceImpl)
 	workflowStatusUpdateHandlerImpl := pubsub.NewWorkflowStatusUpdateHandlerImpl(sugaredLogger, pubSubClientServiceImpl, ciHandlerImpl, cdHandlerImpl, eventSimpleFactoryImpl, eventRESTClientImpl, cdWorkflowRepositoryImpl)
-	applicationStatusUpdateHandlerImpl := pubsub.NewApplicationStatusUpdateHandlerImpl(sugaredLogger, pubSubClientServiceImpl, appServiceImpl, workflowDagExecutorImpl, installedAppServiceImpl)
+	applicationStatusHandlerImpl := pubsub.NewApplicationStatusHandlerImpl(sugaredLogger, pubSubClientServiceImpl, appServiceImpl, workflowDagExecutorImpl, installedAppServiceImpl, appStoreDeploymentServiceImpl, pipelineBuilderImpl, pipelineRepositoryImpl, installedAppRepositoryImpl)
 	roleGroupServiceImpl := user.NewRoleGroupServiceImpl(userAuthRepositoryImpl, sugaredLogger, userRepositoryImpl, roleGroupRepositoryImpl, userCommonServiceImpl)
 	userRestHandlerImpl := user2.NewUserRestHandlerImpl(userServiceImpl, validate, sugaredLogger, enforcerImpl, roleGroupServiceImpl, userCommonServiceImpl)
 	userRouterImpl := user2.NewUserRouterImpl(userRestHandlerImpl)
@@ -563,7 +564,7 @@ func InitializeApp() (*App, error) {
 	batchOperationRouterImpl := router.NewBatchOperationRouterImpl(batchOperationRestHandlerImpl, sugaredLogger)
 	chartGroupEntriesRepositoryImpl := repository3.NewChartGroupEntriesRepositoryImpl(db, sugaredLogger)
 	chartGroupReposotoryImpl := repository3.NewChartGroupReposotoryImpl(db, sugaredLogger)
-	chartGroupServiceImpl := service2.NewChartGroupServiceImpl(chartGroupEntriesRepositoryImpl, chartGroupReposotoryImpl, sugaredLogger, chartGroupDeploymentRepositoryImpl, installedAppRepositoryImpl, appStoreVersionValuesRepositoryImpl, userAuthServiceImpl)
+	chartGroupServiceImpl := service.NewChartGroupServiceImpl(chartGroupEntriesRepositoryImpl, chartGroupReposotoryImpl, sugaredLogger, chartGroupDeploymentRepositoryImpl, installedAppRepositoryImpl, appStoreVersionValuesRepositoryImpl, userAuthServiceImpl)
 	chartGroupRestHandlerImpl := restHandler.NewChartGroupRestHandlerImpl(chartGroupServiceImpl, sugaredLogger, userServiceImpl, enforcerImpl, validate)
 	chartGroupRouterImpl := router.NewChartGroupRouterImpl(chartGroupRestHandlerImpl)
 	testSuitRestHandlerImpl := restHandler.NewTestSuitRestHandlerImpl(sugaredLogger, userServiceImpl, validate, enforcerImpl, enforcerUtilImpl, eventClientConfig, httpClient)
@@ -683,7 +684,7 @@ func InitializeApp() (*App, error) {
 	}
 	ciStatusUpdateCronImpl := cron.NewCiStatusUpdateCronImpl(sugaredLogger, appServiceImpl, ciWorkflowStatusUpdateConfig, ciPipelineRepositoryImpl, ciHandlerImpl)
 	appGroupingRouterImpl := router.NewAppGroupingRouterImpl(pipelineConfigRestHandlerImpl, appWorkflowRestHandlerImpl)
-	muxRouter := router.NewMuxRouter(sugaredLogger, pipelineTriggerRouterImpl, pipelineConfigRouterImpl, migrateDbRouterImpl, appListingRouterImpl, environmentRouterImpl, clusterRouterImpl, webhookRouterImpl, userAuthRouterImpl, applicationRouterImpl, cdRouterImpl, projectManagementRouterImpl, gitProviderRouterImpl, gitHostRouterImpl, dockerRegRouterImpl, notificationRouterImpl, teamRouterImpl, gitWebhookHandlerImpl, workflowStatusUpdateHandlerImpl, applicationStatusUpdateHandlerImpl, ciEventHandlerImpl, pubSubClientServiceImpl, userRouterImpl, chartRefRouterImpl, configMapRouterImpl, appStoreRouterImpl, chartRepositoryRouterImpl, releaseMetricsRouterImpl, deploymentGroupRouterImpl, batchOperationRouterImpl, chartGroupRouterImpl, testSuitRouterImpl, imageScanRouterImpl, policyRouterImpl, gitOpsConfigRouterImpl, dashboardRouterImpl, attributesRouterImpl, userAttributesRouterImpl, commonRouterImpl, grafanaRouterImpl, ssoLoginRouterImpl, telemetryRouterImpl, telemetryEventClientImplExtended, bulkUpdateRouterImpl, webhookListenerRouterImpl, appRouterImpl, coreAppRouterImpl, helmAppRouterImpl, k8sApplicationRouterImpl, pProfRouterImpl, deploymentConfigRouterImpl, dashboardTelemetryRouterImpl, commonDeploymentRouterImpl, externalLinkRouterImpl, globalPluginRouterImpl, moduleRouterImpl, serverRouterImpl, apiTokenRouterImpl, cdApplicationStatusUpdateHandlerImpl, k8sCapacityRouterImpl, webhookHelmRouterImpl, globalCMCSRouterImpl, userTerminalAccessRouterImpl, ciStatusUpdateCronImpl, appGroupingRouterImpl)
+	muxRouter := router.NewMuxRouter(sugaredLogger, pipelineTriggerRouterImpl, pipelineConfigRouterImpl, migrateDbRouterImpl, appListingRouterImpl, environmentRouterImpl, clusterRouterImpl, webhookRouterImpl, userAuthRouterImpl, applicationRouterImpl, cdRouterImpl, projectManagementRouterImpl, gitProviderRouterImpl, gitHostRouterImpl, dockerRegRouterImpl, notificationRouterImpl, teamRouterImpl, gitWebhookHandlerImpl, workflowStatusUpdateHandlerImpl, applicationStatusHandlerImpl, ciEventHandlerImpl, pubSubClientServiceImpl, userRouterImpl, chartRefRouterImpl, configMapRouterImpl, appStoreRouterImpl, chartRepositoryRouterImpl, releaseMetricsRouterImpl, deploymentGroupRouterImpl, batchOperationRouterImpl, chartGroupRouterImpl, testSuitRouterImpl, imageScanRouterImpl, policyRouterImpl, gitOpsConfigRouterImpl, dashboardRouterImpl, attributesRouterImpl, userAttributesRouterImpl, commonRouterImpl, grafanaRouterImpl, ssoLoginRouterImpl, telemetryRouterImpl, telemetryEventClientImplExtended, bulkUpdateRouterImpl, webhookListenerRouterImpl, appRouterImpl, coreAppRouterImpl, helmAppRouterImpl, k8sApplicationRouterImpl, pProfRouterImpl, deploymentConfigRouterImpl, dashboardTelemetryRouterImpl, commonDeploymentRouterImpl, externalLinkRouterImpl, globalPluginRouterImpl, moduleRouterImpl, serverRouterImpl, apiTokenRouterImpl, cdApplicationStatusUpdateHandlerImpl, k8sCapacityRouterImpl, webhookHelmRouterImpl, globalCMCSRouterImpl, userTerminalAccessRouterImpl, ciStatusUpdateCronImpl, appGroupingRouterImpl)
 	mainApp := NewApp(muxRouter, sugaredLogger, sseSSE, syncedEnforcer, db, pubSubClientServiceImpl, sessionManager, posthogClient)
 	return mainApp, nil
 }


Test patch:
diff --git a/pkg/appStore/deployment/service/AppStoreDeploymentService_test.go b/pkg/appStore/deployment/service/AppStoreDeploymentService_test.go
index 1e14acbc0..a8615fec7 100644
--- a/pkg/appStore/deployment/service/AppStoreDeploymentService_test.go
+++ b/pkg/appStore/deployment/service/AppStoreDeploymentService_test.go
@@ -134,7 +134,7 @@ func initAppStoreDeploymentService(t *testing.T, internalUse bool) *AppStoreDepl
 
 	appStoreDiscoverRepository := appStoreDiscoverRepository.NewAppStoreApplicationVersionRepositoryImpl(sugaredLogger, db)
 
-	environmentRepository := repository2.NewEnvironmentRepositoryImpl(db)
+	environmentRepository := repository2.NewEnvironmentRepositoryImpl(db, sugaredLogger, nil)
 
 	k8sUtil := util.NewK8sUtil(sugaredLogger, &client.RuntimeConfig{LocalDevMode: true})
 
diff --git a/pkg/pipeline/GitopsOrHelmOption_test.go b/pkg/pipeline/GitopsOrHelmOption_test.go
index 405151130..c82e39141 100644
--- a/pkg/pipeline/GitopsOrHelmOption_test.go
+++ b/pkg/pipeline/GitopsOrHelmOption_test.go
@@ -24,8 +24,7 @@ func TestGitopsOrHelmOption(t *testing.T) {
 			nil, nil, nil,
 			nil, nil, nil, nil,
 			nil, nil, nil, nil,
-			nil, nil, nil, nil, nil,
-			nil, nil, nil, &DeploymentServiceTypeConfig{IsInternalUse: false}, nil, nil, nil)
+			nil, nil, nil, nil, nil, nil, nil, nil, &DeploymentServiceTypeConfig{IsInternalUse: false}, nil, nil, nil, nil)
 
 		pipelineCreateRequest := &bean.CdPipelines{
 			Pipelines: []*bean.CDPipelineConfigObject{
@@ -78,9 +77,7 @@ func TestGitopsOrHelmOption(t *testing.T) {
 			nil, nil, nil,
 			nil, nil, nil, nil,
 			nil, nil, nil, nil,
-			nil, nil, nil, nil,
-			nil, nil, nil, nil,
-			&DeploymentServiceTypeConfig{IsInternalUse: false}, nil, nil, nil)
+			nil, nil, nil, nil, nil, nil, nil, nil, &DeploymentServiceTypeConfig{IsInternalUse: false}, nil, nil, nil, nil)
 
 		pipelineCreateRequest := &bean.CdPipelines{
 			Pipelines: []*bean.CDPipelineConfigObject{
@@ -133,8 +130,7 @@ func TestGitopsOrHelmOption(t *testing.T) {
 			nil, nil, nil,
 			nil, nil, nil, nil,
 			nil, nil, nil, nil,
-			nil, nil, nil, nil, nil, nil,
-			nil, nil, &DeploymentServiceTypeConfig{IsInternalUse: true}, nil, nil, nil)
+			nil, nil, nil, nil, nil, nil, nil, nil, &DeploymentServiceTypeConfig{IsInternalUse: true}, nil, nil, nil, nil)
 
 		pipelineCreateRequestHelm := &bean.CdPipelines{
 			Pipelines: []*bean.CDPipelineConfigObject{
@@ -225,8 +221,7 @@ func TestGitopsOrHelmOption(t *testing.T) {
 			nil, nil, nil,
 			nil, nil, nil, nil,
 			nil, nil, nil, nil,
-			nil, nil, nil, nil, nil, nil,
-			nil, nil, &DeploymentServiceTypeConfig{IsInternalUse: false}, nil, nil, nil)
+			nil, nil, nil, nil, nil, nil, nil, nil, &DeploymentServiceTypeConfig{IsInternalUse: false}, nil, nil, nil, nil)
 
 		pipelineCreateRequest := &bean.CdPipelines{
 			Pipelines: []*bean.CDPipelineConfigObject{
@@ -283,8 +278,7 @@ func TestGitopsOrHelmOption(t *testing.T) {
 			nil, nil, nil,
 			nil, nil, nil, nil,
 			nil, nil, nil, nil,
-			nil, nil, nil, nil, nil, nil,
-			nil, nil, &DeploymentServiceTypeConfig{IsInternalUse: true}, nil, nil, nil)
+			nil, nil, nil, nil, nil, nil, nil, nil, &DeploymentServiceTypeConfig{IsInternalUse: true}, nil, nil, nil, nil)
 
 		pipelineCreateRequest := &bean.CdPipelines{
 			Pipelines: []*bean.CDPipelineConfigObject{