Repository: devtron-labs/devtron
Pull request #1469 (2022-04-05 09:08:38)

FIX: App store apis merge into single and package refactor
# Description

Api Modification and Package Refactor for Deployment History, Deployment History Info, Rollback.

Combine rest handlers for same purpose of apis like deployment history will have single api for both hyperion and full mode.
Packages refactor

Fixes # (issue) : https://github.com/devtron-labs/devtron/issues/1419

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

# How Has This Been Tested?

- [x] Deployment History for both EA_Only/FULL
- [x] Deployment History Info  for both EA_Only/FULL
- [x] Rollback for both EA_Only/FULL


# Checklist:

* [x] The title of the PR states what changed and the related issues number (used for the release note).
* [ ] Does this PR require documentation updates?
* [ ] I've updated documentation as required by this PR.
* [x] I have performed a self-review of my own code
* [ ] I have commented my code, particularly in hard-to-understand areas
* [x] I have tested it for all user roles
* [ ] I have added all the required unit/api test cases






Patch:
diff --git a/Wire.go b/Wire.go
index c9fb3bb92..bec3752b4 100644
--- a/Wire.go
+++ b/Wire.go
@@ -65,11 +65,11 @@ import (
 	"github.com/devtron-labs/devtron/pkg/app"
 	"github.com/devtron-labs/devtron/pkg/appClone"
 	"github.com/devtron-labs/devtron/pkg/appClone/batch"
-	appStore "github.com/devtron-labs/devtron/pkg/appStore"
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
 	appStoreDeploymentFullMode "github.com/devtron-labs/devtron/pkg/appStore/deployment/fullMode"
+	repository4 "github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/service"
 	appStoreDeploymentGitopsTool "github.com/devtron-labs/devtron/pkg/appStore/deployment/tool/gitops"
-	appStoreRepository "github.com/devtron-labs/devtron/pkg/appStore/repository"
 	"github.com/devtron-labs/devtron/pkg/appWorkflow"
 	"github.com/devtron-labs/devtron/pkg/attributes"
 	"github.com/devtron-labs/devtron/pkg/commonService"
@@ -430,8 +430,8 @@ func InitializeApp() (*App, error) {
 
 		appStoreRestHandler.NewInstalledAppRestHandlerImpl,
 		wire.Bind(new(appStoreRestHandler.InstalledAppRestHandler), new(*appStoreRestHandler.InstalledAppRestHandlerImpl)),
-		appStore.NewInstalledAppServiceImpl,
-		wire.Bind(new(appStore.InstalledAppService), new(*appStore.InstalledAppServiceImpl)),
+		service.NewInstalledAppServiceImpl,
+		wire.Bind(new(service.InstalledAppService), new(*service.InstalledAppServiceImpl)),
 
 		appStoreRestHandler.NewAppStoreRouterImpl,
 		wire.Bind(new(appStoreRestHandler.AppStoreRouter), new(*appStoreRestHandler.AppStoreRouterImpl)),
@@ -514,18 +514,18 @@ func InitializeApp() (*App, error) {
 		router.NewBatchOperationRouterImpl,
 		wire.Bind(new(router.BatchOperationRouter), new(*router.BatchOperationRouterImpl)),
 
-		appStoreRepository.NewChartGroupReposotoryImpl,
-		wire.Bind(new(appStoreRepository.ChartGroupReposotory), new(*appStoreRepository.ChartGroupReposotoryImpl)),
-		appStoreRepository.NewChartGroupEntriesRepositoryImpl,
-		wire.Bind(new(appStoreRepository.ChartGroupEntriesRepository), new(*appStoreRepository.ChartGroupEntriesRepositoryImpl)),
-		appStore.NewChartGroupServiceImpl,
-		wire.Bind(new(appStore.ChartGroupService), new(*appStore.ChartGroupServiceImpl)),
+		repository4.NewChartGroupReposotoryImpl,
+		wire.Bind(new(repository4.ChartGroupReposotory), new(*repository4.ChartGroupReposotoryImpl)),
+		repository4.NewChartGroupEntriesRepositoryImpl,
+		wire.Bind(new(repository4.ChartGroupEntriesRepository), new(*repository4.ChartGroupEntriesRepositoryImpl)),
+		service.NewChartGroupServiceImpl,
+		wire.Bind(new(service.ChartGroupService), new(*service.ChartGroupServiceImpl)),
 		restHandler.NewChartGroupRestHandlerImpl,
 		wire.Bind(new(restHandler.ChartGroupRestHandler), new(*restHandler.ChartGroupRestHandlerImpl)),
 		router.NewChartGroupRouterImpl,
 		wire.Bind(new(router.ChartGroupRouter), new(*router.ChartGroupRouterImpl)),
-		appStoreRepository.NewChartGroupDeploymentRepositoryImpl,
-		wire.Bind(new(appStoreRepository.ChartGroupDeploymentRepository), new(*appStoreRepository.ChartGroupDeploymentRepositoryImpl)),
+		repository4.NewChartGroupDeploymentRepositoryImpl,
+		wire.Bind(new(repository4.ChartGroupDeploymentRepository), new(*repository4.ChartGroupDeploymentRepositoryImpl)),
 
 		commonService.NewCommonServiceImpl,
 		wire.Bind(new(commonService.CommonService), new(*commonService.CommonServiceImpl)),
diff --git a/api/appStore/AppStoreRouter.go b/api/appStore/AppStoreRouter.go
index 665034d27..cfe055e93 100644
--- a/api/appStore/AppStoreRouter.go
+++ b/api/appStore/AppStoreRouter.go
@@ -47,45 +47,34 @@ func NewAppStoreRouterImpl(restHandler InstalledAppRestHandler,
 }
 
 func (router AppStoreRouterImpl) Init(configRouter *mux.Router) {
-
-	configRouter.Path("/application/update").
-		HandlerFunc(router.deployRestHandler.UpdateInstalledApp).Methods("PUT")
-
 	// deployment router starts
 	appStoreDeploymentSubRouter := configRouter.PathPrefix("/deployment").Subrouter()
 	router.appStoreDeploymentRouter.Init(appStoreDeploymentSubRouter)
 	// deployment router ends
 
-	configRouter.Path("/application/exists").
-		HandlerFunc(router.deployRestHandler.CheckAppExists).Methods("POST")
-	configRouter.Path("/group/install").
-		HandlerFunc(router.deployRestHandler.DeployBulk).Methods("POST")
+	// values router starts
+	appStoreValuesSubRouter := configRouter.PathPrefix("/values").Subrouter()
+	router.appStoreValuesRouter.Init(appStoreValuesSubRouter)
+	// values router ends
 
 	// discover router starts
 	appStoreDiscoverSubRouter := configRouter.PathPrefix("/discover").Subrouter()
 	router.appStoreDiscoverRouter.Init(appStoreDiscoverSubRouter)
 	// discover router ends
 
+	configRouter.Path("/application/update").
+		HandlerFunc(router.deployRestHandler.UpdateInstalledApp).Methods("PUT")
+	configRouter.Path("/application/exists").
+		HandlerFunc(router.deployRestHandler.CheckAppExists).Methods("POST")
+	configRouter.Path("/group/install").
+		HandlerFunc(router.deployRestHandler.DeployBulk).Methods("POST")
 	configRouter.Path("/installed-app/detail").Queries("installed-app-id", "{installed-app-id}").Queries("env-id", "{env-id}").
 		HandlerFunc(router.deployRestHandler.FetchAppDetailsForInstalledApp).
 		Methods("GET")
-
 	configRouter.Path("/installed-app").
 		HandlerFunc(router.deployRestHandler.GetAllInstalledApp).Methods("GET")
-
 	configRouter.Path("/application/version/{installedAppVersionId}").
 		HandlerFunc(router.deployRestHandler.GetInstalledAppVersion).Methods("GET")
-
-	// values router starts
-	appStoreValuesSubRouter := configRouter.PathPrefix("/values").Subrouter()
-	router.appStoreValuesRouter.Init(appStoreValuesSubRouter)
-	// values router ends
-
 	configRouter.Path("/cluster-component/install/{clusterId}").
 		HandlerFunc(router.deployRestHandler.DefaultComponentInstallation).Methods("POST")
-
-	configRouter.Path("/installed-app/deployment-history").Queries("installedAppId", "{installedAppId}").
-		HandlerFunc(router.deployRestHandler.GetDeploymentHistory).Methods("GET")
-	configRouter.Path("/installed-app/deployment-history/info").Queries("installedAppId", "{installedAppId}").Queries("version", "{version}").
-		HandlerFunc(router.deployRestHandler.GetDeploymentHistoryValues).Methods("GET")
 }
diff --git a/api/appStore/AppStoreDeploymentRestHandler.go b/api/appStore/InstalledAppRestHandler.go
similarity index 84%
rename from api/appStore/AppStoreDeploymentRestHandler.go
rename to api/appStore/InstalledAppRestHandler.go
index 8a97f6513..6059ce39b 100644
--- a/api/appStore/AppStoreDeploymentRestHandler.go
+++ b/api/appStore/InstalledAppRestHandler.go
@@ -28,9 +28,8 @@ import (
 	"github.com/devtron-labs/devtron/client/argocdServer/application"
 	"github.com/devtron-labs/devtron/internal/constants"
 	"github.com/devtron-labs/devtron/internal/util"
-	"github.com/devtron-labs/devtron/pkg/appStore"
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
-	appStoreDeployment "github.com/devtron-labs/devtron/pkg/appStore/deployment"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/service"
 	"github.com/devtron-labs/devtron/pkg/cluster"
 	"github.com/devtron-labs/devtron/pkg/user"
 	"github.com/devtron-labs/devtron/pkg/user/casbin"
@@ -53,8 +52,6 @@ type InstalledAppRestHandler interface {
 	CheckAppExists(w http.ResponseWriter, r *http.Request)
 	DefaultComponentInstallation(w http.ResponseWriter, r *http.Request)
 	FetchAppDetailsForInstalledApp(w http.ResponseWriter, r *http.Request)
-	GetDeploymentHistory(w http.ResponseWriter, r *http.Request)
-	GetDeploymentHistoryValues(w http.ResponseWriter, r *http.Request)
 }
 
 type InstalledAppRestHandlerImpl struct {
@@ -62,17 +59,17 @@ type InstalledAppRestHandlerImpl struct {
 	userAuthService           user.UserService
 	enforcer                  casbin.Enforcer
 	enforcerUtil              rbac.EnforcerUtil
-	installedAppService       appStore.InstalledAppService
+	installedAppService       service.InstalledAppService
 	validator                 *validator.Validate
 	clusterService            cluster.ClusterService
 	acdServiceClient          application.ServiceClient
-	appStoreDeploymentService appStoreDeployment.AppStoreDeploymentService
+	appStoreDeploymentService service.AppStoreDeploymentService
 }
 
 func NewInstalledAppRestHandlerImpl(Logger *zap.SugaredLogger, userAuthService user.UserService,
-	enforcer casbin.Enforcer, enforcerUtil rbac.EnforcerUtil, installedAppService appStore.InstalledAppService,
+	enforcer casbin.Enforcer, enforcerUtil rbac.EnforcerUtil, installedAppService service.InstalledAppService,
 	validator *validator.Validate, clusterService cluster.ClusterService, acdServiceClient application.ServiceClient,
-	appStoreDeploymentService appStoreDeployment.AppStoreDeploymentService,
+	appStoreDeploymentService service.AppStoreDeploymentService,
 ) *InstalledAppRestHandlerImpl {
 	return &InstalledAppRestHandlerImpl{
 		Logger:                    Logger,
@@ -468,74 +465,4 @@ func (handler *InstalledAppRestHandlerImpl) FetchAppDetailsForInstalledApp(w htt
 		handler.Logger.Infow("appName and envName not found - avoiding resource tree call", "app", appDetail.AppName, "env", appDetail.EnvironmentName)
 	}
 	common.WriteJsonResp(w, err, appDetail, http.StatusOK)
-}
-
-func (handler *InstalledAppRestHandlerImpl) GetDeploymentHistory(w http.ResponseWriter, r *http.Request) {
-	vars := mux.Vars(r)
-	installedAppId, err := strconv.Atoi(vars["installedAppId"])
-	if err != nil {
-		handler.Logger.Errorw("request err", "error", err, "installedAppId", installedAppId)
-		common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
-		return
-	}
-	token := r.Header.Get("token")
-	installedApp, err := handler.appStoreDeploymentService.GetInstalledApp(installedAppId)
-	if err != nil {
-		handler.Logger.Errorw("service err, GetDeploymentHistoryValues", "err", err, "installedAppId", installedAppId)
-		common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
-		return
-	}
-	//rbac block starts from here
-	object := handler.enforcerUtil.GetHelmObject(installedApp.AppId, installedApp.EnvironmentId)
-	if ok := handler.enforcer.Enforce(token, casbin.ResourceHelmApp, casbin.ActionGet, object); !ok {
-		common.WriteJsonResp(w, fmt.Errorf("unauthorized user"), nil, http.StatusForbidden)
-		return
-	}
-	//rback block ends here
-	response, err := handler.installedAppService.GetInstalledAppVersionHistory(installedAppId)
-	if err != nil {
-		common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
-		return
-	}
-
-	common.WriteJsonResp(w, err, response, http.StatusOK)
-}
-
-func (handler *InstalledAppRestHandlerImpl) GetDeploymentHistoryValues(w http.ResponseWriter, r *http.Request) {
-	vars := mux.Vars(r)
-	installedAppId, err := strconv.Atoi(vars["installedAppId"])
-	if err != nil {
-		handler.Logger.Errorw("request err", "error", err, "installedAppId", installedAppId)
-		common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
-		return
-	}
-	installedAppVersionHistoryId, err := strconv.Atoi(vars["version"])
-	if err != nil {
-		handler.Logger.Errorw("request err", "error", err, "installedAppVersionHistoryId", installedAppVersionHistoryId)
-		common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
-		return
-	}
-
-	token := r.Header.Get("token")
-	installedApp, err := handler.appStoreDeploymentService.GetInstalledApp(installedAppId)
-	if err != nil {
-		handler.Logger.Errorw("service err, GetDeploymentHistoryValues", "err", err, "installedAppId", installedAppId)
-		common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
-		return
-	}
-	//rbac block starts from here
-	object := handler.enforcerUtil.GetHelmObject(installedApp.AppId, installedApp.EnvironmentId)
-	if ok := handler.enforcer.Enforce(token, casbin.ResourceHelmApp, casbin.ActionGet, object); !ok {
-		common.WriteJsonResp(w, fmt.Errorf("unauthorized user"), nil, http.StatusForbidden)
-		return
-	}
-	//rback block ends here
-
-	response, err := handler.installedAppService.GetInstalledAppVersionHistoryValues(installedAppVersionHistoryId)
-	if err != nil {
-		common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
-		return
-	}
-
-	common.WriteJsonResp(w, err, response, http.StatusOK)
-}
+}
\ No newline at end of file
diff --git a/api/appStore/deployment/AppStoreDeploymentRestHandler.go b/api/appStore/deployment/AppStoreDeploymentRestHandler.go
index 58ef9abf8..1c588d6e2 100644
--- a/api/appStore/deployment/AppStoreDeploymentRestHandler.go
+++ b/api/appStore/deployment/AppStoreDeploymentRestHandler.go
@@ -24,12 +24,11 @@ import (
 	"fmt"
 	client "github.com/devtron-labs/devtron/api/helm-app"
 	openapi "github.com/devtron-labs/devtron/api/helm-app/openapiClient"
-	openapi2 "github.com/devtron-labs/devtron/api/openapi/openapiClient"
 	"github.com/devtron-labs/devtron/api/restHandler/common"
 	"github.com/devtron-labs/devtron/internal/util"
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
-	appStoreDeployment "github.com/devtron-labs/devtron/pkg/appStore/deployment"
 	appStoreDeploymentCommon "github.com/devtron-labs/devtron/pkg/appStore/deployment/common"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/service"
 	"github.com/devtron-labs/devtron/pkg/user"
 	"github.com/devtron-labs/devtron/pkg/user/casbin"
 	util2 "github.com/devtron-labs/devtron/util"
@@ -40,7 +39,6 @@ import (
 	"net/http"
 	"strconv"
 	"strings"
-	"time"
 )
 
 type AppStoreDeploymentRestHandler interface {
@@ -48,7 +46,6 @@ type AppStoreDeploymentRestHandler interface {
 	GetInstalledAppsByAppStoreId(w http.ResponseWriter, r *http.Request)
 	DeleteInstalledApp(w http.ResponseWriter, r *http.Request)
 	LinkHelmApplicationToChartStore(w http.ResponseWriter, r *http.Request)
-	RollbackApplication(w http.ResponseWriter, r *http.Request)
 }
 
 type AppStoreDeploymentRestHandlerImpl struct {
@@ -57,14 +54,15 @@ type AppStoreDeploymentRestHandlerImpl struct {
 	enforcer                   casbin.Enforcer
 	enforcerUtil               rbac.EnforcerUtil
 	enforcerUtilHelm           rbac.EnforcerUtilHelm
-	appStoreDeploymentService  appStoreDeployment.AppStoreDeploymentService
+	appStoreDeploymentService  service.AppStoreDeploymentService
 	appStoreDeploymentServiceC appStoreDeploymentCommon.AppStoreDeploymentCommonService
 	validator                  *validator.Validate
 	helmAppService             client.HelmAppService
+	helmAppRestHandler         client.HelmAppRestHandler
 }
 
 func NewAppStoreDeploymentRestHandlerImpl(Logger *zap.SugaredLogger, userAuthService user.UserService,
-	enforcer casbin.Enforcer, enforcerUtil rbac.EnforcerUtil, enforcerUtilHelm rbac.EnforcerUtilHelm, appStoreDeploymentService appStoreDeployment.AppStoreDeploymentService,
+	enforcer casbin.Enforcer, enforcerUtil rbac.EnforcerUtil, enforcerUtilHelm rbac.EnforcerUtilHelm, appStoreDeploymentService service.AppStoreDeploymentService,
 	validator *validator.Validate, helmAppService client.HelmAppService, appStoreDeploymentServiceC appStoreDeploymentCommon.AppStoreDeploymentCommonService,
 ) *AppStoreDeploymentRestHandlerImpl {
 	return &AppStoreDeploymentRestHandlerImpl{
@@ -314,61 +312,4 @@ func (handler *AppStoreDeploymentRestHandlerImpl) LinkHelmApplicationToChartStor
 	}
 
 	common.WriteJsonResp(w, err, res, http.StatusOK)
-}
-
-func (handler *AppStoreDeploymentRestHandlerImpl) RollbackApplication(w http.ResponseWriter, r *http.Request) {
-	request := &openapi2.RollbackReleaseRequest{}
-	decoder := json.NewDecoder(r.Body)
-	err := decoder.Decode(request)
-	if err != nil {
-		common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
-		return
-	}
-
-	userId, err := handler.userAuthService.GetLoggedInUser(r)
-	if userId == 0 || err != nil {
-		common.WriteJsonResp(w, err, "Unauthorized User", http.StatusUnauthorized)
-		return
-	}
-
-	// get installed app which can not be null
-	installedApp, err := handler.appStoreDeploymentService.GetInstalledApp(int(request.GetInstalledAppId()))
-	if err != nil {
-		handler.Logger.Errorw("Error in getting installed app", "err", err)
-		common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
-		return
-	}
-	installedApp.UserId = userId
-	if installedApp == nil {
-		handler.Logger.Errorw("Installed App can not be null", "request", request)
-		common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
-		return
-	}
-
-	//rbac block starts from here
-	var rbacObject string
-	token := r.Header.Get("token")
-	if installedApp.AppOfferingMode == util2.SERVER_MODE_HYPERION {
-		rbacObject = handler.enforcerUtilHelm.GetHelmObjectByClusterId(installedApp.ClusterId, installedApp.Namespace, installedApp.AppName)
-	} else {
-		rbacObject = handler.enforcerUtil.GetHelmObjectByAppNameAndEnvId(installedApp.AppName, installedApp.EnvironmentId)
-	}
-	if ok := handler.enforcer.Enforce(token, casbin.ResourceHelmApp, casbin.ActionUpdate, rbacObject); !ok {
-		common.WriteJsonResp(w, fmt.Errorf("unauthorized user"), nil, http.StatusForbidden)
-		return
-	}
-	//rbac block ends here
-
-	ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
-	defer cancel()
-	success, err := handler.appStoreDeploymentService.RollbackApplication(ctx, request, installedApp, userId)
-	if err != nil {
-		handler.Logger.Errorw("Error in Rollback release", "err", err, "payload", request)
-		common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
-		return
-	}
-	res := &openapi2.RollbackReleaseResponse{
-		Success: &success,
-	}
-	common.WriteJsonResp(w, err, res, http.StatusOK)
-}
+}
\ No newline at end of file
diff --git a/api/appStore/deployment/AppStoreDeploymentRouter.go b/api/appStore/deployment/AppStoreDeploymentRouter.go
index ad4c03211..c35dbdcf0 100644
--- a/api/appStore/deployment/AppStoreDeploymentRouter.go
+++ b/api/appStore/deployment/AppStoreDeploymentRouter.go
@@ -48,7 +48,4 @@ func (router AppStoreDeploymentRouterImpl) Init(configRouter *mux.Router) {
 
 	configRouter.Path("/application/helm/link-to-chart-store").
 		HandlerFunc(router.appStoreDeploymentRestHandler.LinkHelmApplicationToChartStore).Methods("PUT")
-
-	configRouter.Path("/application/rollback").
-		HandlerFunc(router.appStoreDeploymentRestHandler.RollbackApplication).Methods("PUT")
 }
diff --git a/api/appStore/deployment/CommonDeploymentRestHandler.go b/api/appStore/deployment/CommonDeploymentRestHandler.go
new file mode 100644
index 000000000..3c8135085
--- /dev/null
+++ b/api/appStore/deployment/CommonDeploymentRestHandler.go
@@ -0,0 +1,275 @@
+/*
+ * 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 appStoreDeployment
+
+import (
+	"context"
+	"encoding/json"
+	"fmt"
+	client "github.com/devtron-labs/devtron/api/helm-app"
+	openapi2 "github.com/devtron-labs/devtron/api/openapi/openapiClient"
+	"github.com/devtron-labs/devtron/api/restHandler/common"
+	"github.com/devtron-labs/devtron/internal/util"
+	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
+	appStoreDeploymentCommon "github.com/devtron-labs/devtron/pkg/appStore/deployment/common"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/service"
+	"github.com/devtron-labs/devtron/pkg/user"
+	"github.com/devtron-labs/devtron/pkg/user/casbin"
+	util2 "github.com/devtron-labs/devtron/util"
+	"github.com/devtron-labs/devtron/util/k8sObjectsUtil"
+	"github.com/devtron-labs/devtron/util/rbac"
+	"github.com/gorilla/mux"
+	"go.uber.org/zap"
+	"gopkg.in/go-playground/validator.v9"
+	"net/http"
+	"strconv"
+	"time"
+)
+
+type CommonDeploymentRestHandler interface {
+	GetDeploymentHistory(w http.ResponseWriter, r *http.Request)
+	GetDeploymentHistoryValues(w http.ResponseWriter, r *http.Request)
+	RollbackApplication(w http.ResponseWriter, r *http.Request)
+}
+
+type CommonDeploymentRestHandlerImpl struct {
+	Logger                     *zap.SugaredLogger
+	userAuthService            user.UserService
+	enforcer                   casbin.Enforcer
+	enforcerUtil               rbac.EnforcerUtil
+	enforcerUtilHelm           rbac.EnforcerUtilHelm
+	appStoreDeploymentService  service.AppStoreDeploymentService
+	appStoreDeploymentServiceC appStoreDeploymentCommon.AppStoreDeploymentCommonService
+	validator                  *validator.Validate
+	helmAppService             client.HelmAppService
+	helmAppRestHandler         client.HelmAppRestHandler
+}
+
+func NewCommonDeploymentRestHandlerImpl(Logger *zap.SugaredLogger, userAuthService user.UserService,
+	enforcer casbin.Enforcer, enforcerUtil rbac.EnforcerUtil, enforcerUtilHelm rbac.EnforcerUtilHelm, appStoreDeploymentService service.AppStoreDeploymentService,
+	validator *validator.Validate, helmAppService client.HelmAppService, appStoreDeploymentServiceC appStoreDeploymentCommon.AppStoreDeploymentCommonService,
+	helmAppRestHandler client.HelmAppRestHandler) *CommonDeploymentRestHandlerImpl {
+	return &CommonDeploymentRestHandlerImpl{
+		Logger:                     Logger,
+		userAuthService:            userAuthService,
+		enforcer:                   enforcer,
+		enforcerUtil:               enforcerUtil,
+		enforcerUtilHelm:           enforcerUtilHelm,
+		appStoreDeploymentService:  appStoreDeploymentService,
+		validator:                  validator,
+		helmAppService:             helmAppService,
+		appStoreDeploymentServiceC: appStoreDeploymentServiceC,
+		helmAppRestHandler:         helmAppRestHandler,
+	}
+}
+func (handler *CommonDeploymentRestHandlerImpl) getAppOfferingMode(installedAppId string, appId string) (string, *appStoreBean.InstallAppVersionDTO, error) {
+	installedAppDto := &appStoreBean.InstallAppVersionDTO{}
+	var appOfferingMode string
+	if len(appId) > 0 {
+		appIdentifier, err := handler.helmAppService.DecodeAppId(appId)
+		if err != nil {
+			err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "invalid app id"}
+			return appOfferingMode, installedAppDto, err
+		}
+		installedAppDto, err = handler.appStoreDeploymentServiceC.GetInstalledAppByClusterNamespaceAndName(appIdentifier.ClusterId, appIdentifier.Namespace, appIdentifier.ReleaseName)
+		if err != nil {
+			err = &util.ApiError{HttpStatusCode: http.StatusInternalServerError, UserMessage: "unable to find app in database"}
+			return appOfferingMode, installedAppDto, err
+		}
+		// this is the case when hyperion apps does not linked yet
+		if installedAppDto == nil {
+			installedAppDto = &appStoreBean.InstallAppVersionDTO{}
+			appOfferingMode = util2.SERVER_MODE_HYPERION
+			installedAppDto.InstalledAppId = 0
+			installedAppDto.AppOfferingMode = appOfferingMode
+			appIdentifier, err := handler.helmAppService.DecodeAppId(appId)
+			if err != nil {
+				err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "invalid app id"}
+				return appOfferingMode, installedAppDto, err
+			}
+			installedAppDto.ClusterId = appIdentifier.ClusterId
+			installedAppDto.Namespace = appIdentifier.Namespace
+			installedAppDto.AppName = appIdentifier.ReleaseName
+		}
+	} else if len(installedAppId) > 0 {
+		installedAppId, err := strconv.Atoi(installedAppId)
+		if err != nil {
+			err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "invalid installed app id"}
+			return appOfferingMode, installedAppDto, err
+		}
+		installedAppDto, err = handler.appStoreDeploymentServiceC.GetInstalledAppByInstalledAppId(installedAppId)
+		if err != nil {
+			err = &util.ApiError{HttpStatusCode: http.StatusInternalServerError, UserMessage: "unable to find app in database"}
+			return appOfferingMode, installedAppDto, err
+		}
+	} else {
+		err := &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "app id missing in request"}
+		return appOfferingMode, installedAppDto, err
+	}
+	if installedAppDto != nil && installedAppDto.InstalledAppId > 0 {
+		appOfferingMode = installedAppDto.AppOfferingMode
+	}
+	return appOfferingMode, installedAppDto, nil
+}
+
+func (handler *CommonDeploymentRestHandlerImpl) GetDeploymentHistory(w http.ResponseWriter, r *http.Request) {
+	userId, err := handler.userAuthService.GetLoggedInUser(r)
+	if userId == 0 || err != nil {
+		common.WriteJsonResp(w, err, "Unauthorized User", http.StatusUnauthorized)
+		return
+	}
+	v := r.URL.Query()
+	installedAppId := v.Get("installedAppId")
+	appId := v.Get("appId")
+	appOfferingMode, installedAppDto, err := handler.getAppOfferingMode(installedAppId, appId)
+	if err != nil {
+		common.WriteJsonResp(w, err, "bad request", http.StatusBadRequest)
+		return
+	}
+	installedAppDto.UserId = userId
+	//rbac block starts from here
+	var rbacObject string
+	token := r.Header.Get("token")
+	if appOfferingMode == util2.SERVER_MODE_HYPERION {
+		rbacObject = handler.enforcerUtilHelm.GetHelmObjectByClusterId(installedAppDto.ClusterId, installedAppDto.Namespace, installedAppDto.AppName)
+	} else {
+		rbacObject = handler.enforcerUtil.GetHelmObjectByAppNameAndEnvId(installedAppDto.AppName, installedAppDto.EnvironmentId)
+	}
+	if ok := handler.enforcer.Enforce(token, casbin.ResourceHelmApp, casbin.ActionGet, rbacObject); !ok {
+		common.WriteJsonResp(w, fmt.Errorf("unauthorized user"), nil, http.StatusForbidden)
+		return
+	}
+	//rbac block ends here
+
+	ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
+	defer cancel()
+	res, err := handler.appStoreDeploymentService.GetDeploymentHistory(ctx, installedAppDto)
+	if err != nil {
+		common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
+		return
+	}
+	common.WriteJsonResp(w, err, res, http.StatusOK)
+}
+
+func (handler *CommonDeploymentRestHandlerImpl) GetDeploymentHistoryValues(w http.ResponseWriter, r *http.Request) {
+	userId, err := handler.userAuthService.GetLoggedInUser(r)
+	if userId == 0 || err != nil {
+		common.WriteJsonResp(w, err, "Unauthorized User", http.StatusUnauthorized)
+		return
+	}
+	vars := mux.Vars(r)
+	v := r.URL.Query()
+	installedAppId := v.Get("installedAppId")
+	appId := v.Get("appId")
+	appOfferingMode, installedAppDto, err := handler.getAppOfferingMode(installedAppId, appId)
+	if err != nil {
+		common.WriteJsonResp(w, err, "bad request", http.StatusBadRequest)
+		return
+	}
+	installedAppDto.UserId = userId
+	installedAppVersionHistoryId, err := strconv.Atoi(vars["version"])
+	if err != nil {
+		handler.Logger.Errorw("request err", "error", err, "installedAppVersionHistoryId", installedAppVersionHistoryId)
+		common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
+		return
+	}
+	//rbac block starts from here
+	var rbacObject string
+	token := r.Header.Get("token")
+	if appOfferingMode == util2.SERVER_MODE_HYPERION {
+		rbacObject = handler.enforcerUtilHelm.GetHelmObjectByClusterId(installedAppDto.ClusterId, installedAppDto.Namespace, installedAppDto.AppName)
+	} else {
+		rbacObject = handler.enforcerUtil.GetHelmObjectByAppNameAndEnvId(installedAppDto.AppName, installedAppDto.EnvironmentId)
+	}
+	if ok := handler.enforcer.Enforce(token, casbin.ResourceHelmApp, casbin.ActionGet, rbacObject); !ok {
+		common.WriteJsonResp(w, fmt.Errorf("unauthorized user"), nil, http.StatusForbidden)
+		return
+	}
+	//rbac block ends here
+
+	ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
+	defer cancel()
+	res, err := handler.appStoreDeploymentService.GetDeploymentHistoryInfo(ctx, installedAppDto, installedAppVersionHistoryId)
+	if err != nil {
+		common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
+		return
+	}
+	if appOfferingMode == util2.SERVER_MODE_HYPERION {
+		canUpdate := handler.enforcer.Enforce(token, casbin.ResourceHelmApp, casbin.ActionUpdate, rbacObject)
+		if !canUpdate && res != nil && res.Manifest != nil {
+			modifiedManifest, err := k8sObjectsUtil.HideValuesIfSecretForWholeYamlInput(*res.Manifest)
+			if err != nil {
+				handler.Logger.Errorw("error in hiding secret values", "err", err)
+				common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
+				return
+			}
+			res.Manifest = &modifiedManifest
+		}
+	}
+	common.WriteJsonResp(w, err, res, http.StatusOK)
+}
+
+func (handler *CommonDeploymentRestHandlerImpl) RollbackApplication(w http.ResponseWriter, r *http.Request) {
+	userId, err := handler.userAuthService.GetLoggedInUser(r)
+	if userId == 0 || err != nil {
+		common.WriteJsonResp(w, err, "Unauthorized User", http.StatusUnauthorized)
+		return
+	}
+	request := &openapi2.RollbackReleaseRequest{}
+	decoder := json.NewDecoder(r.Body)
+	err = decoder.Decode(request)
+	if err != nil {
+		common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
+		return
+	}
+	installedAppId := ""
+	if request.GetInstalledAppId() > 0 {
+		installedAppId = fmt.Sprint(request.GetInstalledAppId())
+	}
+	appOfferingMode, installedAppDto, err := handler.getAppOfferingMode(installedAppId, *request.HAppId)
+	if err != nil {
+		common.WriteJsonResp(w, err, "bad request", http.StatusBadRequest)
+	}
+	installedAppDto.UserId = userId
+	//rbac block starts from here
+	var rbacObject string
+	token := r.Header.Get("token")
+	if appOfferingMode == util2.SERVER_MODE_HYPERION {
+		rbacObject = handler.enforcerUtilHelm.GetHelmObjectByClusterId(installedAppDto.ClusterId, installedAppDto.Namespace, installedAppDto.AppName)
+	} else {
+		rbacObject = handler.enforcerUtil.GetHelmObjectByAppNameAndEnvId(installedAppDto.AppName, installedAppDto.EnvironmentId)
+	}
+	if ok := handler.enforcer.Enforce(token, casbin.ResourceHelmApp, casbin.ActionUpdate, rbacObject); !ok {
+		common.WriteJsonResp(w, fmt.Errorf("unauthorized user"), nil, http.StatusForbidden)
+		return
+	}
+	//rbac block ends here
+
+	ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
+	defer cancel()
+	success, err := handler.appStoreDeploymentService.RollbackApplication(ctx, request, installedAppDto, userId)
+	if err != nil {
+		handler.Logger.Errorw("Error in Rollback release", "err", err, "payload", request)
+		common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
+		return
+	}
+	res := &openapi2.RollbackReleaseResponse{
+		Success: &success,
+	}
+	common.WriteJsonResp(w, err, res, http.StatusOK)
+}
diff --git a/api/appStore/deployment/CommonDeploymentRouter.go b/api/appStore/deployment/CommonDeploymentRouter.go
new file mode 100644
index 000000000..a5cd1cf03
--- /dev/null
+++ b/api/appStore/deployment/CommonDeploymentRouter.go
@@ -0,0 +1,48 @@
+/*
+ * 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 appStoreDeployment
+
+import (
+	"github.com/gorilla/mux"
+)
+
+type CommonDeploymentRouter interface {
+	Init(configRouter *mux.Router)
+}
+
+type CommonDeploymentRouterImpl struct {
+	commonDeploymentRestHandler CommonDeploymentRestHandler
+}
+
+func NewCommonDeploymentRouterImpl(commonDeploymentRestHandler CommonDeploymentRestHandler) *CommonDeploymentRouterImpl {
+	return &CommonDeploymentRouterImpl{
+		commonDeploymentRestHandler: commonDeploymentRestHandler,
+	}
+}
+
+func (router CommonDeploymentRouterImpl) Init(configRouter *mux.Router) {
+	configRouter.Path("/deployment-history").
+		HandlerFunc(router.commonDeploymentRestHandler.GetDeploymentHistory).Methods("GET")
+
+	configRouter.Path("/deployment-history/info").
+		Queries("version", "{version}").
+		HandlerFunc(router.commonDeploymentRestHandler.GetDeploymentHistoryValues).Methods("GET")
+
+	configRouter.Path("/rollback").
+		HandlerFunc(router.commonDeploymentRestHandler.RollbackApplication).Methods("PUT")
+}
diff --git a/api/appStore/deployment/wire_appStoreDeployment.go b/api/appStore/deployment/wire_appStoreDeployment.go
index 8e99f127c..188f06006 100644
--- a/api/appStore/deployment/wire_appStoreDeployment.go
+++ b/api/appStore/deployment/wire_appStoreDeployment.go
@@ -1,26 +1,31 @@
 package appStoreDeployment
 
 import (
-	appStoreDeployment "github.com/devtron-labs/devtron/pkg/appStore/deployment"
 	appStoreDeploymentCommon "github.com/devtron-labs/devtron/pkg/appStore/deployment/common"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/service"
 	appStoreDeploymentTool "github.com/devtron-labs/devtron/pkg/appStore/deployment/tool"
-	appStoreRepository "github.com/devtron-labs/devtron/pkg/appStore/repository"
 	"github.com/google/wire"
 )
 
 var AppStoreDeploymentWireSet = wire.NewSet(
-	appStoreRepository.NewClusterInstalledAppsRepositoryImpl,
-	wire.Bind(new(appStoreRepository.ClusterInstalledAppsRepository), new(*appStoreRepository.ClusterInstalledAppsRepositoryImpl)),
+	repository.NewClusterInstalledAppsRepositoryImpl,
+	wire.Bind(new(repository.ClusterInstalledAppsRepository), new(*repository.ClusterInstalledAppsRepositoryImpl)),
 	appStoreDeploymentCommon.NewAppStoreDeploymentCommonServiceImpl,
 	wire.Bind(new(appStoreDeploymentCommon.AppStoreDeploymentCommonService), new(*appStoreDeploymentCommon.AppStoreDeploymentCommonServiceImpl)),
 	appStoreDeploymentTool.NewAppStoreDeploymentHelmServiceImpl,
 	wire.Bind(new(appStoreDeploymentTool.AppStoreDeploymentHelmService), new(*appStoreDeploymentTool.AppStoreDeploymentHelmServiceImpl)),
-	appStoreDeployment.NewAppStoreDeploymentServiceImpl,
-	wire.Bind(new(appStoreDeployment.AppStoreDeploymentService), new(*appStoreDeployment.AppStoreDeploymentServiceImpl)),
+	service.NewAppStoreDeploymentServiceImpl,
+	wire.Bind(new(service.AppStoreDeploymentService), new(*service.AppStoreDeploymentServiceImpl)),
 	NewAppStoreDeploymentRestHandlerImpl,
 	wire.Bind(new(AppStoreDeploymentRestHandler), new(*AppStoreDeploymentRestHandlerImpl)),
 	NewAppStoreDeploymentRouterImpl,
 	wire.Bind(new(AppStoreDeploymentRouter), new(*AppStoreDeploymentRouterImpl)),
-	appStoreRepository.NewInstalledAppVersionHistoryRepositoryImpl,
-	wire.Bind(new(appStoreRepository.InstalledAppVersionHistoryRepository), new(*appStoreRepository.InstalledAppVersionHistoryRepositoryImpl)),
+	repository.NewInstalledAppVersionHistoryRepositoryImpl,
+	wire.Bind(new(repository.InstalledAppVersionHistoryRepository), new(*repository.InstalledAppVersionHistoryRepositoryImpl)),
+
+	NewCommonDeploymentRestHandlerImpl,
+	wire.Bind(new(CommonDeploymentRestHandler), new(*CommonDeploymentRestHandlerImpl)),
+	NewCommonDeploymentRouterImpl,
+	wire.Bind(new(CommonDeploymentRouter), new(*CommonDeploymentRouterImpl)),
 )
diff --git a/api/appStore/discover/AppStoreRestHandler.go b/api/appStore/discover/AppStoreRestHandler.go
index 7b2c9123c..f49bc892d 100644
--- a/api/appStore/discover/AppStoreRestHandler.go
+++ b/api/appStore/discover/AppStoreRestHandler.go
@@ -20,7 +20,7 @@ package appStoreDiscover
 import (
 	"github.com/devtron-labs/devtron/api/restHandler/common"
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
-	appStoreDiscover "github.com/devtron-labs/devtron/pkg/appStore/discover"
+	"github.com/devtron-labs/devtron/pkg/appStore/discover/service"
 	"github.com/devtron-labs/devtron/pkg/user"
 	"github.com/devtron-labs/devtron/pkg/user/casbin"
 	"github.com/gorilla/mux"
@@ -39,13 +39,13 @@ type AppStoreRestHandler interface {
 }
 
 type AppStoreRestHandlerImpl struct {
-	Logger           *zap.SugaredLogger
-	appStoreService  appStoreDiscover.AppStoreService
-	userAuthService  user.UserService
-	enforcer         casbin.Enforcer
+	Logger          *zap.SugaredLogger
+	appStoreService service.AppStoreService
+	userAuthService user.UserService
+	enforcer        casbin.Enforcer
 }
 
-func NewAppStoreRestHandlerImpl(Logger *zap.SugaredLogger, userAuthService user.UserService, appStoreService appStoreDiscover.AppStoreService,
+func NewAppStoreRestHandlerImpl(Logger *zap.SugaredLogger, userAuthService user.UserService, appStoreService service.AppStoreService,
 	enforcer casbin.Enforcer) *AppStoreRestHandlerImpl {
 	return &AppStoreRestHandlerImpl{
 		Logger:           Logger,
diff --git a/api/appStore/discover/wire_appStoreDiscover.go b/api/appStore/discover/wire_appStoreDiscover.go
index def82f098..1469d42d6 100644
--- a/api/appStore/discover/wire_appStoreDiscover.go
+++ b/api/appStore/discover/wire_appStoreDiscover.go
@@ -1,8 +1,8 @@
 package appStoreDiscover
 
 import (
-	appStoreDiscover "github.com/devtron-labs/devtron/pkg/appStore/discover"
 	appStoreDiscoverRepository "github.com/devtron-labs/devtron/pkg/appStore/discover/repository"
+	"github.com/devtron-labs/devtron/pkg/appStore/discover/service"
 	"github.com/google/wire"
 )
 
@@ -11,8 +11,8 @@ var AppStoreDiscoverWireSet = wire.NewSet(
 	wire.Bind(new(appStoreDiscoverRepository.AppStoreRepository), new(*appStoreDiscoverRepository.AppStoreRepositoryImpl)),
 	appStoreDiscoverRepository.NewAppStoreApplicationVersionRepositoryImpl,
 	wire.Bind(new(appStoreDiscoverRepository.AppStoreApplicationVersionRepository), new(*appStoreDiscoverRepository.AppStoreApplicationVersionRepositoryImpl)),
-	appStoreDiscover.NewAppStoreServiceImpl,
-	wire.Bind(new(appStoreDiscover.AppStoreService), new(*appStoreDiscover.AppStoreServiceImpl)),
+	service.NewAppStoreServiceImpl,
+	wire.Bind(new(service.AppStoreService), new(*service.AppStoreServiceImpl)),
 	NewAppStoreRestHandlerImpl,
 	wire.Bind(new(AppStoreRestHandler), new(*AppStoreRestHandlerImpl)),
 	NewAppStoreDiscoverRouterImpl,
diff --git a/api/appStore/values/AppStoreValuesRestHandler.go b/api/appStore/values/AppStoreValuesRestHandler.go
index 91c97d42b..09d0938a1 100644
--- a/api/appStore/values/AppStoreValuesRestHandler.go
+++ b/api/appStore/values/AppStoreValuesRestHandler.go
@@ -21,7 +21,7 @@ import (
 	"encoding/json"
 	"github.com/devtron-labs/devtron/api/restHandler/common"
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
-	appStoreValues "github.com/devtron-labs/devtron/pkg/appStore/values"
+	"github.com/devtron-labs/devtron/pkg/appStore/values/service"
 	"github.com/devtron-labs/devtron/pkg/user"
 	"github.com/gorilla/mux"
 	"go.uber.org/zap"
@@ -43,11 +43,11 @@ type AppStoreValuesRestHandler interface {
 type AppStoreValuesRestHandlerImpl struct {
 	Logger                *zap.SugaredLogger
 	userAuthService       user.UserService
-	appStoreValuesService appStoreValues.AppStoreValuesService
+	appStoreValuesService service.AppStoreValuesService
 }
 
 func NewAppStoreValuesRestHandlerImpl(Logger *zap.SugaredLogger, userAuthService user.UserService,
-	appStoreValuesService appStoreValues.AppStoreValuesService) *AppStoreValuesRestHandlerImpl {
+	appStoreValuesService service.AppStoreValuesService) *AppStoreValuesRestHandlerImpl {
 	return &AppStoreValuesRestHandlerImpl{
 		Logger:                Logger,
 		userAuthService:       userAuthService,
@@ -224,7 +224,7 @@ func (handler AppStoreValuesRestHandlerImpl) GetSelectedChartMetadata(w http.Res
 		return
 	}
 	decoder := json.NewDecoder(r.Body)
-	var request appStoreValues.ChartMetaDataRequestWrapper
+	var request service.ChartMetaDataRequestWrapper
 	err = decoder.Decode(&request)
 	if err != nil {
 		handler.Logger.Errorw("request err, GetSelectedChartMetadata", "err", err, "request", request)
diff --git a/api/appStore/values/wire_appStoreValues.go b/api/appStore/values/wire_appStoreValues.go
index a5f84bdbb..7a21a676e 100644
--- a/api/appStore/values/wire_appStoreValues.go
+++ b/api/appStore/values/wire_appStoreValues.go
@@ -1,9 +1,9 @@
 package appStoreValues
 
 import (
-	appStoreRepository "github.com/devtron-labs/devtron/pkg/appStore/repository"
-	appStoreValues "github.com/devtron-labs/devtron/pkg/appStore/values"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
 	appStoreValuesRepository "github.com/devtron-labs/devtron/pkg/appStore/values/repository"
+	"github.com/devtron-labs/devtron/pkg/appStore/values/service"
 	"github.com/google/wire"
 )
 
@@ -12,10 +12,10 @@ var AppStoreValuesWireSet = wire.NewSet(
 	wire.Bind(new(AppStoreValuesRouter), new(*AppStoreValuesRouterImpl)),
 	NewAppStoreValuesRestHandlerImpl,
 	wire.Bind(new(AppStoreValuesRestHandler), new(*AppStoreValuesRestHandlerImpl)),
-	appStoreValues.NewAppStoreValuesServiceImpl,
-	wire.Bind(new(appStoreValues.AppStoreValuesService), new(*appStoreValues.AppStoreValuesServiceImpl)),
+	service.NewAppStoreValuesServiceImpl,
+	wire.Bind(new(service.AppStoreValuesService), new(*service.AppStoreValuesServiceImpl)),
 	appStoreValuesRepository.NewAppStoreVersionValuesRepositoryImpl,
 	wire.Bind(new(appStoreValuesRepository.AppStoreVersionValuesRepository), new(*appStoreValuesRepository.AppStoreVersionValuesRepositoryImpl)),
-	appStoreRepository.NewInstalledAppRepositoryImpl,
-	wire.Bind(new(appStoreRepository.InstalledAppRepository), new(*appStoreRepository.InstalledAppRepositoryImpl)),
+	repository.NewInstalledAppRepositoryImpl,
+	wire.Bind(new(repository.InstalledAppRepository), new(*repository.InstalledAppRepositoryImpl)),
 )
diff --git a/api/helm-app/HelmAppRestHandler.go b/api/helm-app/HelmAppRestHandler.go
index 5badf2203..d5b1a5f74 100644
--- a/api/helm-app/HelmAppRestHandler.go
+++ b/api/helm-app/HelmAppRestHandler.go
@@ -5,7 +5,6 @@ import (
 	"encoding/json"
 	"errors"
 	openapi "github.com/devtron-labs/devtron/api/helm-app/openapiClient"
-	openapi2 "github.com/devtron-labs/devtron/api/openapi/openapiClient"
 	"github.com/devtron-labs/devtron/api/restHandler/common"
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
 	appStoreDeploymentCommon "github.com/devtron-labs/devtron/pkg/appStore/deployment/common"
@@ -18,7 +17,6 @@ import (
 	"net/http"
 	"strconv"
 	"strings"
-	"time"
 )
 
 type HelmAppRestHandler interface {
@@ -26,13 +24,10 @@ type HelmAppRestHandler interface {
 	GetApplicationDetail(w http.ResponseWriter, r *http.Request)
 	Hibernate(w http.ResponseWriter, r *http.Request)
 	UnHibernate(w http.ResponseWriter, r *http.Request)
-	GetDeploymentHistory(w http.ResponseWriter, r *http.Request)
 	GetReleaseInfo(w http.ResponseWriter, r *http.Request)
 	GetDesiredManifest(w http.ResponseWriter, r *http.Request)
 	DeleteApplication(w http.ResponseWriter, r *http.Request)
 	UpdateApplication(w http.ResponseWriter, r *http.Request)
-	GetDeploymentDetail(w http.ResponseWriter, r *http.Request)
-	RollbackApplication(w http.ResponseWriter, r *http.Request)
 }
 
 type HelmAppRestHandlerImpl struct {
@@ -174,42 +169,6 @@ func (handler *HelmAppRestHandlerImpl) UnHibernate(w http.ResponseWriter, r *htt
 	common.WriteJsonResp(w, err, res, http.StatusOK)
 }
 
-func (handler *HelmAppRestHandlerImpl) GetDeploymentHistory(w http.ResponseWriter, r *http.Request) {
-	vars := mux.Vars(r)
-	appId := vars["appId"]
-	appIdentifier, err := handler.helmAppService.DecodeAppId(appId)
-	if err != nil {
-		common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
-		return
-	}
-	// RBAC enforcer applying
-	rbacObject := handler.enforcerUtil.GetHelmObjectByClusterId(appIdentifier.ClusterId, appIdentifier.Namespace, appIdentifier.ReleaseName)
-	token := r.Header.Get("token")
-	if ok := handler.enforcer.Enforce(token, casbin.ResourceHelmApp, casbin.ActionGet, rbacObject); !ok {
-		common.WriteJsonResp(w, errors.New("unauthorized"), nil, http.StatusForbidden)
-		return
-	}
-	//RBAC enforcer Ends
-
-	deploymentHistory, err := handler.helmAppService.GetDeploymentHistory(context.Background(), appIdentifier)
-	if err != nil {
-		common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
-		return
-	}
-
-	installedApp, err := handler.appStoreDeploymentCommonService.GetInstalledAppByClusterNamespaceAndName(appIdentifier.ClusterId, appIdentifier.Namespace, appIdentifier.ReleaseName)
-	if err != nil {
-		common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
-		return
-	}
-
-	res := &DeploymentHistoryAndInstalledAppInfo{
-		DeploymentHistory: deploymentHistory.GetDeploymentHistory(),
-		InstalledAppInfo:  convertToInstalledAppInfo(installedApp),
-	}
-	common.WriteJsonResp(w, err, res, http.StatusOK)
-}
-
 func (handler *HelmAppRestHandlerImpl) GetReleaseInfo(w http.ResponseWriter, r *http.Request) {
 	vars := mux.Vars(r)
 	appId := vars["appId"]
@@ -376,83 +335,6 @@ func (handler *HelmAppRestHandlerImpl) UpdateApplication(w http.ResponseWriter,
 	common.WriteJsonResp(w, err, res, http.StatusOK)
 }
 
-func (handler *HelmAppRestHandlerImpl) GetDeploymentDetail(w http.ResponseWriter, r *http.Request) {
-	vars := mux.Vars(r)
-	appId := vars["appId"]
-	version, err := strconv.ParseInt(vars["version"], 10, 32)
-	if err != nil {
-		common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
-		return
-	}
-	appIdentifier, err := handler.helmAppService.DecodeAppId(appId)
-	if err != nil {
-		common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
-		return
-	}
-	// RBAC enforcer applying
-	rbacObject := handler.enforcerUtil.GetHelmObjectByClusterId(appIdentifier.ClusterId, appIdentifier.Namespace, appIdentifier.ReleaseName)
-	token := r.Header.Get("token")
-	if ok := handler.enforcer.Enforce(token, casbin.ResourceHelmApp, casbin.ActionGet, rbacObject); !ok {
-		common.WriteJsonResp(w, errors.New("unauthorized"), nil, http.StatusForbidden)
-		return
-	}
-	//RBAC enforcer Ends
-	res, err := handler.helmAppService.GetDeploymentDetail(context.Background(), appIdentifier, int32(version))
-	if err != nil {
-		common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
-		return
-	}
-
-	// Obfuscate secrets if user does not have edit access
-	canUpdate := handler.enforcer.Enforce(token, casbin.ResourceHelmApp, casbin.ActionUpdate, rbacObject)
-	if !canUpdate && res != nil && res.Manifest != nil {
-		modifiedManifest, err := k8sObjectsUtil.HideValuesIfSecretForWholeYamlInput(*res.Manifest)
-		if err != nil {
-			handler.logger.Errorw("error in hiding secret values", "err", err)
-			common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
-			return
-		}
-		res.Manifest = &modifiedManifest
-	}
-
-	common.WriteJsonResp(w, err, res, http.StatusOK)
-}
-
-func (handler *HelmAppRestHandlerImpl) RollbackApplication(w http.ResponseWriter, r *http.Request) {
-	request := &openapi2.RollbackReleaseRequest{}
-	decoder := json.NewDecoder(r.Body)
-	err := decoder.Decode(request)
-	if err != nil {
-		common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
-		return
-	}
-	appIdentifier, err := handler.helmAppService.DecodeAppId(request.GetHAppId())
-	if err != nil {
-		common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
-		return
-	}
-	// RBAC enforcer applying
-	rbacObject := handler.enforcerUtil.GetHelmObjectByClusterId(appIdentifier.ClusterId, appIdentifier.Namespace, appIdentifier.ReleaseName)
-	token := r.Header.Get("token")
-	if ok := handler.enforcer.Enforce(token, casbin.ResourceHelmApp, casbin.ActionUpdate, rbacObject); !ok {
-		common.WriteJsonResp(w, errors.New("unauthorized"), nil, http.StatusForbidden)
-		return
-	}
-	//RBAC enforcer Ends
-
-	ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
-	defer cancel()
-	success, err := handler.helmAppService.RollbackRelease(ctx, appIdentifier, request.GetVersion())
-	if err != nil {
-		handler.logger.Errorw("error in rollback helm release", "err", err)
-		common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
-		return
-	}
-	res := &openapi2.RollbackReleaseResponse{
-		Success: &success,
-	}
-	common.WriteJsonResp(w, err, res, http.StatusOK)
-}
 
 func (handler *HelmAppRestHandlerImpl) checkHelmAuth(token string, object string) bool {
 	if ok := handler.enforcer.Enforce(token, casbin.ResourceHelmApp, casbin.ActionGet, strings.ToLower(object)); !ok {
diff --git a/api/helm-app/HelmAppRouter.go b/api/helm-app/HelmAppRouter.go
index 6cc560282..97774b2d2 100644
--- a/api/helm-app/HelmAppRouter.go
+++ b/api/helm-app/HelmAppRouter.go
@@ -23,9 +23,6 @@ func (impl *HelmAppRouterImpl) InitAppListRouter(helmRouter *mux.Router) {
 	helmRouter.Path("/hibernate").HandlerFunc(impl.helmAppRestHandler.Hibernate).Methods("POST")
 	helmRouter.Path("/unhibernate").HandlerFunc(impl.helmAppRestHandler.UnHibernate).Methods("POST")
 
-	helmRouter.Path("/deployment-history").Queries("appId", "{appId}").
-		HandlerFunc(impl.helmAppRestHandler.GetDeploymentHistory).Methods("GET")
-
 	helmRouter.Path("/release-info").Queries("appId", "{appId}").
 		HandlerFunc(impl.helmAppRestHandler.GetReleaseInfo).Methods("GET")
 
@@ -35,9 +32,4 @@ func (impl *HelmAppRouterImpl) InitAppListRouter(helmRouter *mux.Router) {
 
 	helmRouter.Path("/delete").Queries("appId", "{appId}").
 		HandlerFunc(impl.helmAppRestHandler.DeleteApplication).Methods("DELETE")
-
-	helmRouter.Path("/deployment-detail").Queries("appId", "{appId}").Queries("version", "{version}").
-		HandlerFunc(impl.helmAppRestHandler.GetDeploymentDetail).Methods("GET")
-
-	helmRouter.Path("/rollback").HandlerFunc(impl.helmAppRestHandler.RollbackApplication).Methods("PUT")
 }
diff --git a/api/helm-app/HelmAppService.go b/api/helm-app/HelmAppService.go
index 316c931c7..66f7431a5 100644
--- a/api/helm-app/HelmAppService.go
+++ b/api/helm-app/HelmAppService.go
@@ -33,6 +33,7 @@ type HelmAppService interface {
 	UpdateApplicationWithChartInfo(ctx context.Context, clusterId int, updateReleaseRequest *InstallReleaseRequest) (*openapi.UpdateReleaseResponse, error)
 	IsReleaseInstalled(ctx context.Context, app *AppIdentifier) (bool, error)
 	RollbackRelease(ctx context.Context, app *AppIdentifier, version int32) (bool, error)
+	GetClusterConf(clusterId int) (*ClusterConfig, error)
 }
 
 type HelmAppServiceImpl struct {
@@ -134,7 +135,7 @@ func (impl *HelmAppServiceImpl) hibernateResponseAdaptor(in []*HibernateStatus)
 	return resStatus
 }
 func (impl *HelmAppServiceImpl) HibernateApplication(ctx context.Context, app *AppIdentifier, hibernateRequest *openapi.HibernateRequest) ([]*openapi.HibernateStatus, error) {
-	conf, err := impl.getClusterConf(app.ClusterId)
+	conf, err := impl.GetClusterConf(app.ClusterId)
 	if err != nil {
 		return nil, err
 	}
@@ -150,7 +151,7 @@ func (impl *HelmAppServiceImpl) HibernateApplication(ctx context.Context, app *A
 
 func (impl *HelmAppServiceImpl) UnHibernateApplication(ctx context.Context, app *AppIdentifier, hibernateRequest *openapi.HibernateRequest) ([]*openapi.HibernateStatus, error) {
 
-	conf, err := impl.getClusterConf(app.ClusterId)
+	conf, err := impl.GetClusterConf(app.ClusterId)
 	if err != nil {
 		return nil, err
 	}
@@ -164,7 +165,7 @@ func (impl *HelmAppServiceImpl) UnHibernateApplication(ctx context.Context, app
 	return response, nil
 }
 
-func (impl *HelmAppServiceImpl) getClusterConf(clusterId int) (*ClusterConfig, error) {
+func (impl *HelmAppServiceImpl) GetClusterConf(clusterId int) (*ClusterConfig, error) {
 	cluster, err := impl.clusterService.FindById(clusterId)
 	if err != nil {
 		impl.logger.Errorw("error in fetching cluster detail", "err", err)
@@ -179,7 +180,7 @@ func (impl *HelmAppServiceImpl) getClusterConf(clusterId int) (*ClusterConfig, e
 	return config, nil
 }
 func (impl *HelmAppServiceImpl) GetApplicationDetail(ctx context.Context, app *AppIdentifier) (*AppDetail, error) {
-	config, err := impl.getClusterConf(app.ClusterId)
+	config, err := impl.GetClusterConf(app.ClusterId)
 	if err != nil {
 		impl.logger.Errorw("error in fetching cluster detail", "err", err)
 		return nil, err
@@ -195,7 +196,7 @@ func (impl *HelmAppServiceImpl) GetApplicationDetail(ctx context.Context, app *A
 }
 
 func (impl *HelmAppServiceImpl) GetDeploymentHistory(ctx context.Context, app *AppIdentifier) (*HelmAppDeploymentHistory, error) {
-	config, err := impl.getClusterConf(app.ClusterId)
+	config, err := impl.GetClusterConf(app.ClusterId)
 	if err != nil {
 		impl.logger.Errorw("error in fetching cluster detail", "err", err)
 		return nil, err
@@ -210,7 +211,7 @@ func (impl *HelmAppServiceImpl) GetDeploymentHistory(ctx context.Context, app *A
 }
 
 func (impl *HelmAppServiceImpl) GetValuesYaml(ctx context.Context, app *AppIdentifier) (*ReleaseInfo, error) {
-	config, err := impl.getClusterConf(app.ClusterId)
+	config, err := impl.GetClusterConf(app.ClusterId)
 	if err != nil {
 		impl.logger.Errorw("error in fetching cluster detail", "err", err)
 		return nil, err
@@ -225,7 +226,7 @@ func (impl *HelmAppServiceImpl) GetValuesYaml(ctx context.Context, app *AppIdent
 }
 
 func (impl *HelmAppServiceImpl) GetDesiredManifest(ctx context.Context, app *AppIdentifier, resource *openapi.ResourceIdentifier) (*openapi.DesiredManifestResponse, error) {
-	config, err := impl.getClusterConf(app.ClusterId)
+	config, err := impl.GetClusterConf(app.ClusterId)
 	if err != nil {
 		impl.logger.Errorw("error in fetching cluster detail", "clusterId", app.ClusterId, "err", err)
 		return nil, err
@@ -257,7 +258,7 @@ func (impl *HelmAppServiceImpl) GetDesiredManifest(ctx context.Context, app *App
 }
 
 func (impl *HelmAppServiceImpl) DeleteApplication(ctx context.Context, app *AppIdentifier) (*openapi.UninstallReleaseResponse, error) {
-	config, err := impl.getClusterConf(app.ClusterId)
+	config, err := impl.GetClusterConf(app.ClusterId)
 	if err != nil {
 		impl.logger.Errorw("error in fetching cluster detail", "clusterId", app.ClusterId, "err", err)
 		return nil, err
@@ -282,7 +283,7 @@ func (impl *HelmAppServiceImpl) DeleteApplication(ctx context.Context, app *AppI
 }
 
 func (impl *HelmAppServiceImpl) UpdateApplication(ctx context.Context, app *AppIdentifier, request *openapi.UpdateReleaseRequest) (*openapi.UpdateReleaseResponse, error) {
-	config, err := impl.getClusterConf(app.ClusterId)
+	config, err := impl.GetClusterConf(app.ClusterId)
 	if err != nil {
 		impl.logger.Errorw("error in fetching cluster detail", "clusterId", app.ClusterId, "err", err)
 		return nil, err
@@ -310,7 +311,7 @@ func (impl *HelmAppServiceImpl) UpdateApplication(ctx context.Context, app *AppI
 }
 
 func (impl *HelmAppServiceImpl) GetDeploymentDetail(ctx context.Context, app *AppIdentifier, version int32) (*openapi.HelmAppDeploymentManifestDetail, error) {
-	config, err := impl.getClusterConf(app.ClusterId)
+	config, err := impl.GetClusterConf(app.ClusterId)
 	if err != nil {
 		impl.logger.Errorw("error in fetching cluster detail", "clusterId", app.ClusterId, "err", err)
 		return nil, err
@@ -340,7 +341,7 @@ func (impl *HelmAppServiceImpl) GetDeploymentDetail(ctx context.Context, app *Ap
 }
 
 func (impl *HelmAppServiceImpl) InstallRelease(ctx context.Context, clusterId int, installReleaseRequest *InstallReleaseRequest) (*InstallReleaseResponse, error) {
-	config, err := impl.getClusterConf(clusterId)
+	config, err := impl.GetClusterConf(clusterId)
 	if err != nil {
 		impl.logger.Errorw("error in fetching cluster detail", "clusterId", clusterId, "err", err)
 		return nil, err
@@ -358,7 +359,7 @@ func (impl *HelmAppServiceImpl) InstallRelease(ctx context.Context, clusterId in
 }
 
 func (impl *HelmAppServiceImpl) UpdateApplicationWithChartInfo(ctx context.Context, clusterId int, updateReleaseRequest *InstallReleaseRequest) (*openapi.UpdateReleaseResponse, error) {
-	config, err := impl.getClusterConf(clusterId)
+	config, err := impl.GetClusterConf(clusterId)
 	if err != nil {
 		impl.logger.Errorw("error in fetching cluster detail", "clusterId", clusterId, "err", err)
 		return nil, err
@@ -380,7 +381,7 @@ func (impl *HelmAppServiceImpl) UpdateApplicationWithChartInfo(ctx context.Conte
 }
 
 func (impl *HelmAppServiceImpl) IsReleaseInstalled(ctx context.Context, app *AppIdentifier) (bool, error) {
-	config, err := impl.getClusterConf(app.ClusterId)
+	config, err := impl.GetClusterConf(app.ClusterId)
 	if err != nil {
 		impl.logger.Errorw("error in fetching cluster detail", "clusterId", app.ClusterId, "err", err)
 		return false, err
@@ -402,7 +403,7 @@ func (impl *HelmAppServiceImpl) IsReleaseInstalled(ctx context.Context, app *App
 }
 
 func (impl *HelmAppServiceImpl) RollbackRelease(ctx context.Context, app *AppIdentifier, version int32) (bool, error) {
-	config, err := impl.getClusterConf(app.ClusterId)
+	config, err := impl.GetClusterConf(app.ClusterId)
 	if err != nil {
 		impl.logger.Errorw("error in fetching cluster detail", "clusterId", app.ClusterId, "err", err)
 		return false, err
diff --git a/api/restHandler/ChartGroupRestHandler.go b/api/restHandler/ChartGroupRestHandler.go
index 7ebb3974c..baedd035f 100644
--- a/api/restHandler/ChartGroupRestHandler.go
+++ b/api/restHandler/ChartGroupRestHandler.go
@@ -21,7 +21,7 @@ import (
 	"encoding/json"
 	"fmt"
 	"github.com/devtron-labs/devtron/api/restHandler/common"
-	appStore "github.com/devtron-labs/devtron/pkg/appStore"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/service"
 	"github.com/devtron-labs/devtron/pkg/user"
 	"github.com/devtron-labs/devtron/pkg/user/casbin"
 	"github.com/gorilla/mux"
@@ -34,14 +34,14 @@ import (
 const CHART_GROUP_DELETE_SUCCESS_RESP = "Chart group deleted successfully."
 
 type ChartGroupRestHandlerImpl struct {
-	ChartGroupService appStore.ChartGroupService
+	ChartGroupService service.ChartGroupService
 	Logger            *zap.SugaredLogger
 	userAuthService   user.UserService
 	enforcer          casbin.Enforcer
 	validator         *validator.Validate
 }
 
-func NewChartGroupRestHandlerImpl(ChartGroupService appStore.ChartGroupService,
+func NewChartGroupRestHandlerImpl(ChartGroupService service.ChartGroupService,
 	Logger *zap.SugaredLogger, userAuthService user.UserService,
 	enforcer casbin.Enforcer, validator *validator.Validate) *ChartGroupRestHandlerImpl {
 	return &ChartGroupRestHandlerImpl{
@@ -71,7 +71,7 @@ func (impl *ChartGroupRestHandlerImpl) CreateChartGroup(w http.ResponseWriter, r
 		return
 	}
 	decoder := json.NewDecoder(r.Body)
-	var request appStore.ChartGroupBean
+	var request service.ChartGroupBean
 	err = decoder.Decode(&request)
 	if err != nil {
 		impl.Logger.Errorw("request err, CreateChartGroup", "err", err, "payload", request)
@@ -112,7 +112,7 @@ func (impl *ChartGroupRestHandlerImpl) UpdateChartGroup(w http.ResponseWriter, r
 		return
 	}
 	decoder := json.NewDecoder(r.Body)
-	var request appStore.ChartGroupBean
+	var request service.ChartGroupBean
 	err = decoder.Decode(&request)
 	if err != nil {
 		impl.Logger.Errorw("request err, UpdateChartGroup", "err", err, "payload", request)
@@ -153,7 +153,7 @@ func (impl *ChartGroupRestHandlerImpl) SaveChartGroupEntries(w http.ResponseWrit
 		return
 	}
 	decoder := json.NewDecoder(r.Body)
-	var request appStore.ChartGroupBean
+	var request service.ChartGroupBean
 	err = decoder.Decode(&request)
 	if err != nil {
 		impl.Logger.Errorw("request err, SaveChartGroupEntries", "err", err, "payload", request)
@@ -319,7 +319,7 @@ func(impl *ChartGroupRestHandlerImpl) DeleteChartGroup(w http.ResponseWriter, r
 		return
 	}
 	decoder := json.NewDecoder(r.Body)
-	var request appStore.ChartGroupBean
+	var request service.ChartGroupBean
 	err = decoder.Decode(&request)
 	if err != nil {
 		impl.Logger.Errorw("request err, DeleteChartGroup", "err", err, "payload", request)
diff --git a/api/router/pubsub/ApplicationStatusUpdateHandler.go b/api/router/pubsub/ApplicationStatusUpdateHandler.go
index 1b94d19da..9ecfb2826 100644
--- a/api/router/pubsub/ApplicationStatusUpdateHandler.go
+++ b/api/router/pubsub/ApplicationStatusUpdateHandler.go
@@ -22,7 +22,7 @@ import (
 	v1alpha12 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1"
 	"github.com/devtron-labs/devtron/client/pubsub"
 	"github.com/devtron-labs/devtron/pkg/app"
-	"github.com/devtron-labs/devtron/pkg/appStore"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/service"
 	"github.com/devtron-labs/devtron/pkg/pipeline"
 	"github.com/go-pg/pg"
 	"github.com/nats-io/stan.go"
@@ -39,7 +39,7 @@ type ApplicationStatusUpdateHandlerImpl struct {
 	pubsubClient        *pubsub.PubSubClient
 	appService          app.AppService
 	workflowDagExecutor pipeline.WorkflowDagExecutor
-	installedAppService appStore.InstalledAppService
+	installedAppService service.InstalledAppService
 }
 
 const applicationStatusUpdate = "APPLICATION_STATUS_UPDATE"
@@ -47,7 +47,7 @@ const applicationStatusUpdateGroup = "APPLICATION_STATUS_UPDATE_GROUP-1"
 const applicationStatusUpdateDurable = "APPLICATION_STATUS_UPDATE_DURABLE-1"
 
 func NewApplicationStatusUpdateHandlerImpl(logger *zap.SugaredLogger, pubsubClient *pubsub.PubSubClient, appService app.AppService,
-	workflowDagExecutor pipeline.WorkflowDagExecutor, installedAppService appStore.InstalledAppService) *ApplicationStatusUpdateHandlerImpl {
+	workflowDagExecutor pipeline.WorkflowDagExecutor, installedAppService service.InstalledAppService) *ApplicationStatusUpdateHandlerImpl {
 	appStatusUpdateHandlerImpl := &ApplicationStatusUpdateHandlerImpl{
 		logger:              logger,
 		pubsubClient:        pubsubClient,
diff --git a/api/router/router.go b/api/router/router.go
index d12c3f34e..3353f1c86 100644
--- a/api/router/router.go
+++ b/api/router/router.go
@@ -20,6 +20,7 @@ package router
 import (
 	"encoding/json"
 	appStore "github.com/devtron-labs/devtron/api/appStore"
+	appStoreDeployment "github.com/devtron-labs/devtron/api/appStore/deployment"
 	chartRepo "github.com/devtron-labs/devtron/api/chartRepo"
 	"github.com/devtron-labs/devtron/api/cluster"
 	"github.com/devtron-labs/devtron/api/dashboardEvent"
@@ -96,6 +97,7 @@ type MuxRouter struct {
 	pProfRouter                      PProfRouter
 	deploymentConfigRouter           deployment.DeploymentConfigRouter
 	dashboardTelemetryRouter         dashboardEvent.DashboardTelemetryRouter
+	commonDeploymentRouter           appStoreDeployment.CommonDeploymentRouter
 }
 
 func NewMuxRouter(logger *zap.SugaredLogger, HelmRouter HelmRouter, PipelineConfigRouter PipelineConfigRouter,
@@ -117,7 +119,8 @@ func NewMuxRouter(logger *zap.SugaredLogger, HelmRouter HelmRouter, PipelineConf
 	policyRouter PolicyRouter, gitOpsConfigRouter GitOpsConfigRouter, dashboardRouter dashboard.DashboardRouter, attributesRouter AttributesRouter,
 	commonRouter CommonRouter, grafanaRouter GrafanaRouter, ssoLoginRouter sso.SsoLoginRouter, telemetryRouter TelemetryRouter, telemetryWatcher telemetry.TelemetryEventClient, bulkUpdateRouter BulkUpdateRouter, webhookListenerRouter WebhookListenerRouter, appLabelsRouter AppLabelRouter,
 	coreAppRouter CoreAppRouter, helmAppRouter client.HelmAppRouter, k8sApplicationRouter k8s.K8sApplicationRouter,
-	pProfRouter PProfRouter, deploymentConfigRouter deployment.DeploymentConfigRouter, dashboardTelemetryRouter dashboardEvent.DashboardTelemetryRouter) *MuxRouter {
+	pProfRouter PProfRouter, deploymentConfigRouter deployment.DeploymentConfigRouter, dashboardTelemetryRouter dashboardEvent.DashboardTelemetryRouter,
+	commonDeploymentRouter appStoreDeployment.CommonDeploymentRouter) *MuxRouter {
 	r := &MuxRouter{
 		Router:                           mux.NewRouter(),
 		HelmRouter:                       HelmRouter,
@@ -172,6 +175,7 @@ func NewMuxRouter(logger *zap.SugaredLogger, HelmRouter HelmRouter, PipelineConf
 		pProfRouter:                      pProfRouter,
 		deploymentConfigRouter:           deploymentConfigRouter,
 		dashboardTelemetryRouter:         dashboardTelemetryRouter,
+		commonDeploymentRouter:           commonDeploymentRouter,
 	}
 	return r
 }
@@ -320,9 +324,6 @@ func (r MuxRouter) Init() {
 	webhookListenerRouter := r.Router.PathPrefix("/orchestrator/webhook/git").Subrouter()
 	r.WebhookListenerRouter.InitWebhookListenerRouter(webhookListenerRouter)
 
-	helmApp := r.Router.PathPrefix("/orchestrator/application").Subrouter()
-	r.helmAppRouter.InitAppListRouter(helmApp)
-
 	k8sApp := r.Router.PathPrefix("/orchestrator/k8s").Subrouter()
 	r.k8sApplicationRouter.InitK8sApplicationRouter(k8sApp)
 
@@ -338,4 +339,10 @@ func (r MuxRouter) Init() {
 	dashboardTelemetryRouter := r.Router.PathPrefix("/orchestrator/dashboard-event").Subrouter()
 	r.dashboardTelemetryRouter.Init(dashboardTelemetryRouter)
 	// dashboard event router ends
+
+	//GitOps,Acd + HelmCLi both apps deployment related api's
+	applicationSubRouter := r.Router.PathPrefix("/orchestrator/application").Subrouter()
+	r.commonDeploymentRouter.Init(applicationSubRouter)
+	//this router must placed after commonDeploymentRouter
+	r.helmAppRouter.InitAppListRouter(applicationSubRouter)
 }
diff --git a/cmd/external-app/router.go b/cmd/external-app/router.go
index db0e2d126..693bc1cc6 100644
--- a/cmd/external-app/router.go
+++ b/cmd/external-app/router.go
@@ -38,6 +38,7 @@ type MuxRouter struct {
 	appStoreValuesRouter     appStoreValues.AppStoreValuesRouter
 	appStoreDeploymentRouter appStoreDeployment.AppStoreDeploymentRouter
 	dashboardTelemetryRouter dashboardEvent.DashboardTelemetryRouter
+	commonDeploymentRouter   appStoreDeployment.CommonDeploymentRouter
 }
 
 func NewMuxRouter(
@@ -56,6 +57,7 @@ func NewMuxRouter(
 	appStoreValuesRouter appStoreValues.AppStoreValuesRouter,
 	appStoreDeploymentRouter appStoreDeployment.AppStoreDeploymentRouter,
 	dashboardTelemetryRouter dashboardEvent.DashboardTelemetryRouter,
+	commonDeploymentRouter appStoreDeployment.CommonDeploymentRouter,
 ) *MuxRouter {
 	r := &MuxRouter{
 		Router:                   mux.NewRouter(),
@@ -74,6 +76,7 @@ func NewMuxRouter(
 		appStoreValuesRouter:     appStoreValuesRouter,
 		appStoreDeploymentRouter: appStoreDeploymentRouter,
 		dashboardTelemetryRouter: dashboardTelemetryRouter,
+		commonDeploymentRouter:   commonDeploymentRouter,
 	}
 	return r
 }
@@ -128,8 +131,10 @@ func (r *MuxRouter) Init() {
 	dashboardRouter := r.Router.PathPrefix("/dashboard").Subrouter()
 	r.dashboardRouter.InitDashboardRouter(dashboardRouter)
 
-	helmApp := r.Router.PathPrefix("/orchestrator/application").Subrouter()
-	r.helmAppRouter.InitAppListRouter(helmApp)
+	applicationSubRouter := r.Router.PathPrefix("/orchestrator/application").Subrouter()
+	r.helmAppRouter.InitAppListRouter(applicationSubRouter)
+	r.commonDeploymentRouter.Init(applicationSubRouter)
+
 	k8sApp := r.Router.PathPrefix("/orchestrator/k8s").Subrouter()
 	r.k8sApplicationRouter.InitK8sApplicationRouter(k8sApp)
 
diff --git a/cmd/external-app/wire_gen.go b/cmd/external-app/wire_gen.go
index 32af25dc6..db6180fef 100644
--- a/cmd/external-app/wire_gen.go
+++ b/cmd/external-app/wire_gen.go
@@ -14,7 +14,6 @@ import (
 	chartRepo2 "github.com/devtron-labs/devtron/api/chartRepo"
 	cluster2 "github.com/devtron-labs/devtron/api/cluster"
 	"github.com/devtron-labs/devtron/api/connector"
-	"github.com/devtron-labs/devtron/api/dashboardEvent"
 	client2 "github.com/devtron-labs/devtron/api/helm-app"
 	sso2 "github.com/devtron-labs/devtron/api/sso"
 	team2 "github.com/devtron-labs/devtron/api/team"
@@ -26,14 +25,17 @@ import (
 	"github.com/devtron-labs/devtron/internal/sql/repository/app"
 	"github.com/devtron-labs/devtron/internal/sql/repository/pipelineConfig"
 	"github.com/devtron-labs/devtron/internal/util"
-	"github.com/devtron-labs/devtron/pkg/appStore/deployment"
 	"github.com/devtron-labs/devtron/pkg/appStore/deployment/common"
+	repository4 "github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
+	service3 "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/discover"
 	"github.com/devtron-labs/devtron/pkg/appStore/discover/repository"
+	"github.com/devtron-labs/devtron/pkg/appStore/discover/service"
+	"github.com/devtron-labs/devtron/pkg/appStore/history"
+	repository3 "github.com/devtron-labs/devtron/pkg/appStore/history/repository"
 	"github.com/devtron-labs/devtron/pkg/appStore/repository"
-	"github.com/devtron-labs/devtron/pkg/appStore/values"
 	"github.com/devtron-labs/devtron/pkg/appStore/values/repository"
+	service2 "github.com/devtron-labs/devtron/pkg/appStore/values/service"
 	"github.com/devtron-labs/devtron/pkg/chartRepo"
 	"github.com/devtron-labs/devtron/pkg/chartRepo/repository"
 	"github.com/devtron-labs/devtron/pkg/cluster"
@@ -106,7 +108,7 @@ func InitializeApp() (*App, error) {
 	teamServiceImpl := team.NewTeamServiceImpl(sugaredLogger, teamRepositoryImpl, userAuthServiceImpl)
 	clusterRepositoryImpl := repository2.NewClusterRepositoryImpl(db, sugaredLogger)
 	v := informer.NewGlobalMapClusterNamespace()
-	k8sInformerFactoryImpl := informer.NewK8sInformerFactoryImpl(sugaredLogger, v, runtimeConfig)
+	k8sInformerFactoryImpl := informer.NewK8sInformerFactoryImpl(sugaredLogger, v)
 	clusterServiceImpl := cluster.NewClusterServiceImpl(clusterRepositoryImpl, sugaredLogger, k8sUtil, k8sInformerFactoryImpl)
 	environmentRepositoryImpl := repository2.NewEnvironmentRepositoryImpl(db)
 	environmentServiceImpl := cluster.NewEnvironmentServiceImpl(environmentRepositoryImpl, clusterServiceImpl, sugaredLogger, k8sUtil, k8sInformerFactoryImpl, userAuthServiceImpl)
@@ -143,7 +145,7 @@ func InitializeApp() (*App, error) {
 	pumpImpl := connector.NewPumpImpl(sugaredLogger)
 	enforcerUtilHelmImpl := rbac.NewEnforcerUtilHelmImpl(sugaredLogger, clusterRepositoryImpl)
 	helmAppServiceImpl := client2.NewHelmAppServiceImpl(sugaredLogger, clusterServiceImpl, helmAppClientImpl, pumpImpl, enforcerUtilHelmImpl)
-	installedAppRepositoryImpl := appStoreRepository.NewInstalledAppRepositoryImpl(sugaredLogger, db)
+	installedAppRepositoryImpl := repository4.NewInstalledAppRepositoryImpl(sugaredLogger, db)
 	appStoreDeploymentCommonServiceImpl := appStoreDeploymentCommon.NewAppStoreDeploymentCommonServiceImpl(sugaredLogger, installedAppRepositoryImpl)
 	helmAppRestHandlerImpl := client2.NewHelmAppRestHandlerImpl(sugaredLogger, helmAppServiceImpl, enforcerImpl, clusterServiceImpl, enforcerUtilHelmImpl, appStoreDeploymentCommonServiceImpl)
 	helmAppRouterImpl := client2.NewHelmAppRouterImpl(helmAppRestHandlerImpl)
@@ -159,27 +161,29 @@ func InitializeApp() (*App, error) {
 	chartRepositoryRestHandlerImpl := chartRepo2.NewChartRepositoryRestHandlerImpl(sugaredLogger, userServiceImpl, chartRepositoryServiceImpl, enforcerImpl, validate, deleteServiceImpl, chartRefRepositoryImpl, refChartDir)
 	chartRepositoryRouterImpl := chartRepo2.NewChartRepositoryRouterImpl(chartRepositoryRestHandlerImpl)
 	appStoreApplicationVersionRepositoryImpl := appStoreDiscoverRepository.NewAppStoreApplicationVersionRepositoryImpl(sugaredLogger, db)
-	appStoreServiceImpl := appStoreDiscover.NewAppStoreServiceImpl(sugaredLogger, appStoreApplicationVersionRepositoryImpl)
+	appStoreServiceImpl := service.NewAppStoreServiceImpl(sugaredLogger, appStoreApplicationVersionRepositoryImpl)
 	appStoreRestHandlerImpl := appStoreDiscover2.NewAppStoreRestHandlerImpl(sugaredLogger, userServiceImpl, appStoreServiceImpl, enforcerImpl)
 	appStoreDiscoverRouterImpl := appStoreDiscover2.NewAppStoreDiscoverRouterImpl(appStoreRestHandlerImpl)
 	appStoreVersionValuesRepositoryImpl := appStoreValuesRepository.NewAppStoreVersionValuesRepositoryImpl(sugaredLogger, db)
-	appStoreValuesServiceImpl := appStoreValues.NewAppStoreValuesServiceImpl(sugaredLogger, appStoreApplicationVersionRepositoryImpl, installedAppRepositoryImpl, appStoreVersionValuesRepositoryImpl)
+	appStoreValuesServiceImpl := service2.NewAppStoreValuesServiceImpl(sugaredLogger, appStoreApplicationVersionRepositoryImpl, installedAppRepositoryImpl, appStoreVersionValuesRepositoryImpl)
 	appStoreValuesRestHandlerImpl := appStoreValues2.NewAppStoreValuesRestHandlerImpl(sugaredLogger, userServiceImpl, appStoreValuesServiceImpl)
 	appStoreValuesRouterImpl := appStoreValues2.NewAppStoreValuesRouterImpl(appStoreValuesRestHandlerImpl)
 	appRepositoryImpl := app.NewAppRepositoryImpl(db)
 	pipelineRepositoryImpl := pipelineConfig.NewPipelineRepositoryImpl(db, sugaredLogger)
 	ciPipelineRepositoryImpl := pipelineConfig.NewCiPipelineRepositoryImpl(db, sugaredLogger)
 	enforcerUtilImpl := rbac.NewEnforcerUtilImpl(sugaredLogger, teamRepositoryImpl, appRepositoryImpl, environmentRepositoryImpl, pipelineRepositoryImpl, ciPipelineRepositoryImpl, clusterRepositoryImpl)
-	clusterInstalledAppsRepositoryImpl := appStoreRepository.NewClusterInstalledAppsRepositoryImpl(db, sugaredLogger)
+	clusterInstalledAppsRepositoryImpl := repository4.appStoreRepository.NewClusterInstalledAppsRepositoryImpl(db, sugaredLogger)
 	appStoreDeploymentHelmServiceImpl := appStoreDeploymentTool.NewAppStoreDeploymentHelmServiceImpl(sugaredLogger, helmAppServiceImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl)
 	globalEnvVariables, err := util3.GetGlobalEnvVariables()
 	if err != nil {
 		return nil, err
 	}
-	installedAppVersionHistoryRepositoryImpl := appStoreRepository.NewInstalledAppVersionHistoryRepositoryImpl(sugaredLogger, db)
-	appStoreDeploymentServiceImpl := appStoreDeployment.NewAppStoreDeploymentServiceImpl(sugaredLogger, installedAppRepositoryImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl, clusterInstalledAppsRepositoryImpl, appRepositoryImpl, appStoreDeploymentHelmServiceImpl, appStoreDeploymentHelmServiceImpl, environmentServiceImpl, clusterServiceImpl, helmAppServiceImpl, appStoreDeploymentCommonServiceImpl, globalEnvVariables, installedAppVersionHistoryRepositoryImpl)
-	appStoreDeploymentRestHandlerImpl := appStoreDeployment2.NewAppStoreDeploymentRestHandlerImpl(sugaredLogger, userServiceImpl, enforcerImpl, enforcerUtilImpl, enforcerUtilHelmImpl, appStoreDeploymentServiceImpl, validate, helmAppServiceImpl, appStoreDeploymentCommonServiceImpl)
+	appStoreChartsHistoryRepositoryImpl := repository3.NewAppStoreChartsHistoryRepositoryImpl(sugaredLogger, db)
+	appStoreChartsHistoryServiceImpl := history.NewAppStoreChartsHistoryServiceImpl(sugaredLogger, appStoreChartsHistoryRepositoryImpl)
+	appStoreDeploymentServiceImpl := service3.appStoreDeployment.NewAppStoreDeploymentServiceImpl(sugaredLogger, installedAppRepositoryImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl, clusterInstalledAppsRepositoryImpl, appRepositoryImpl, appStoreDeploymentHelmServiceImpl, appStoreDeploymentHelmServiceImpl, environmentServiceImpl, clusterServiceImpl, helmAppServiceImpl, appStoreDeploymentCommonServiceImpl, globalEnvVariables, appStoreChartsHistoryServiceImpl)
+	appStoreDeploymentRestHandlerImpl := appStoreDeployment2.NewAppStoreDeploymentRestHandlerImpl(sugaredLogger, userServiceImpl, enforcerImpl, enforcerUtilImpl, enforcerUtilHelmImpl, appStoreDeploymentServiceImpl, validate, helmAppServiceImpl)
 	appStoreDeploymentRouterImpl := appStoreDeployment2.NewAppStoreDeploymentRouterImpl(appStoreDeploymentRestHandlerImpl)
+	muxRouter := NewMuxRouter(sugaredLogger, ssoLoginRouterImpl, teamRouterImpl, userAuthRouterImpl, userRouterImpl, clusterRouterImpl, dashboardRouterImpl, helmAppRouterImpl, environmentRouterImpl, k8sApplicationRouterImpl, chartRepositoryRouterImpl, appStoreDiscoverRouterImpl, appStoreValuesRouterImpl, appStoreDeploymentRouterImpl)
 	posthogClient, err := telemetry.NewPosthogClient(sugaredLogger)
 	if err != nil {
 		return nil, err
@@ -188,9 +192,6 @@ func InitializeApp() (*App, error) {
 	if err != nil {
 		return nil, err
 	}
-	dashboardTelemetryRestHandlerImpl := dashboardEvent.NewDashboardTelemetryRestHandlerImpl(sugaredLogger, telemetryEventClientImpl)
-	dashboardTelemetryRouterImpl := dashboardEvent.NewDashboardTelemetryRouterImpl(dashboardTelemetryRestHandlerImpl)
-	muxRouter := NewMuxRouter(sugaredLogger, ssoLoginRouterImpl, teamRouterImpl, userAuthRouterImpl, userRouterImpl, clusterRouterImpl, dashboardRouterImpl, helmAppRouterImpl, environmentRouterImpl, k8sApplicationRouterImpl, chartRepositoryRouterImpl, appStoreDiscoverRouterImpl, appStoreValuesRouterImpl, appStoreDeploymentRouterImpl, dashboardTelemetryRouterImpl)
 	mainApp := NewApp(db, sessionManager, muxRouter, telemetryEventClientImpl, sugaredLogger)
 	return mainApp, nil
 }
diff --git a/pkg/appStore/deployment/common/AppStoreDeploymentCommonService.go b/pkg/appStore/deployment/common/AppStoreDeploymentCommonService.go
index f134e56fd..255932f24 100644
--- a/pkg/appStore/deployment/common/AppStoreDeploymentCommonService.go
+++ b/pkg/appStore/deployment/common/AppStoreDeploymentCommonService.go
@@ -19,21 +19,22 @@ package appStoreDeploymentCommon
 
 import (
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
-	appStoreRepository "github.com/devtron-labs/devtron/pkg/appStore/repository"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
 	"github.com/go-pg/pg"
 	"go.uber.org/zap"
 )
 
 type AppStoreDeploymentCommonService interface {
 	GetInstalledAppByClusterNamespaceAndName(clusterId int, namespace string, appName string) (*appStoreBean.InstallAppVersionDTO, error)
+	GetInstalledAppByInstalledAppId(installedAppId int) (*appStoreBean.InstallAppVersionDTO, error)
 }
 
 type AppStoreDeploymentCommonServiceImpl struct {
 	logger                 *zap.SugaredLogger
-	installedAppRepository appStoreRepository.InstalledAppRepository
+	installedAppRepository repository.InstalledAppRepository
 }
 
-func NewAppStoreDeploymentCommonServiceImpl(logger *zap.SugaredLogger, installedAppRepository appStoreRepository.InstalledAppRepository) *AppStoreDeploymentCommonServiceImpl {
+func NewAppStoreDeploymentCommonServiceImpl(logger *zap.SugaredLogger, installedAppRepository repository.InstalledAppRepository) *AppStoreDeploymentCommonServiceImpl {
 	return &AppStoreDeploymentCommonServiceImpl{
 		logger:                 logger,
 		installedAppRepository: installedAppRepository,
@@ -42,7 +43,6 @@ func NewAppStoreDeploymentCommonServiceImpl(logger *zap.SugaredLogger, installed
 
 func (impl AppStoreDeploymentCommonServiceImpl) GetInstalledAppByClusterNamespaceAndName(clusterId int, namespace string, appName string) (*appStoreBean.InstallAppVersionDTO, error) {
 	installedApp, err := impl.installedAppRepository.GetInstalledApplicationByClusterIdAndNamespaceAndAppName(clusterId, namespace, appName)
-
 	if err != nil {
 		if err == pg.ErrNoRows {
 			impl.logger.Warnw("no installed apps found", "clusterId", clusterId)
@@ -64,20 +64,31 @@ func (impl AppStoreDeploymentCommonServiceImpl) GetInstalledAppByClusterNamespac
 	return nil, nil
 }
 
+func (impl AppStoreDeploymentCommonServiceImpl) GetInstalledAppByInstalledAppId(installedAppId int) (*appStoreBean.InstallAppVersionDTO, error) {
+	installedAppVersion, err := impl.installedAppRepository.GetActiveInstalledAppVersionByInstalledAppId(installedAppId)
+	if err != nil {
+		return nil, err
+	}
+	installedApp := &installedAppVersion.InstalledApp
+	return impl.convert(installedApp, installedAppVersion), nil
+
+	return nil, nil
+}
+
 //converts db object to bean
-func (impl AppStoreDeploymentCommonServiceImpl) convert(chart *appStoreRepository.InstalledApps, installedAppVersion *appStoreRepository.InstalledAppVersions) *appStoreBean.InstallAppVersionDTO {
+func (impl AppStoreDeploymentCommonServiceImpl) convert(chart *repository.InstalledApps, installedAppVersion *repository.InstalledAppVersions) *appStoreBean.InstallAppVersionDTO {
 	chartVersionApp := installedAppVersion.AppStoreApplicationVersion
 	chartRepo := installedAppVersion.AppStoreApplicationVersion.AppStore.ChartRepo
 	return &appStoreBean.InstallAppVersionDTO{
-		EnvironmentId:   chart.EnvironmentId,
-		Id:              chart.Id,
-		AppId:           chart.AppId,
-		AppOfferingMode: chart.App.AppOfferingMode,
-		ClusterId:       chart.Environment.ClusterId,
-		Namespace:       chart.Environment.Namespace,
-		AppName:         chart.App.AppName,
-		EnvironmentName: chart.Environment.Name,
-		InstalledAppId:  chart.Id,
+		EnvironmentId:         chart.EnvironmentId,
+		Id:                    chart.Id,
+		AppId:                 chart.AppId,
+		AppOfferingMode:       chart.App.AppOfferingMode,
+		ClusterId:             chart.Environment.ClusterId,
+		Namespace:             chart.Environment.Namespace,
+		AppName:               chart.App.AppName,
+		EnvironmentName:       chart.Environment.Name,
+		InstalledAppId:        chart.Id,
 		InstalledAppVersionId: installedAppVersion.Id,
 		InstallAppVersionChartDTO: &appStoreBean.InstallAppVersionChartDTO{
 			AppStoreChartId: chartVersionApp.AppStore.Id,
diff --git a/pkg/appStore/deployment/fullMode/AppStoreDeploymentFullModeService.go b/pkg/appStore/deployment/fullMode/AppStoreDeploymentFullModeService.go
index 8e925f043..3d506ea07 100644
--- a/pkg/appStore/deployment/fullMode/AppStoreDeploymentFullModeService.go
+++ b/pkg/appStore/deployment/fullMode/AppStoreDeploymentFullModeService.go
@@ -21,8 +21,8 @@ import (
 	"context"
 	"github.com/devtron-labs/devtron/client/argocdServer"
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
+	repository4 "github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
 	appStoreDiscoverRepository "github.com/devtron-labs/devtron/pkg/appStore/discover/repository"
-	appStoreRepository "github.com/devtron-labs/devtron/pkg/appStore/repository"
 	repository5 "github.com/devtron-labs/devtron/pkg/cluster/repository"
 	util2 "github.com/devtron-labs/devtron/pkg/util"
 	util3 "github.com/devtron-labs/devtron/util"
@@ -75,7 +75,7 @@ type AppStoreDeploymentFullModeServiceImpl struct {
 	aCDAuthConfig                        *util2.ACDAuthConfig
 	gitOpsRepository                     repository3.GitOpsConfigRepository
 	globalEnvVariables                   *util3.GlobalEnvVariables
-	installedAppRepository               appStoreRepository.InstalledAppRepository
+	installedAppRepository               repository4.InstalledAppRepository
 	tokenCache                           *util2.TokenCache
 }
 
@@ -88,7 +88,7 @@ func NewAppStoreDeploymentFullModeServiceImpl(logger *zap.SugaredLogger,
 	argoK8sClient argocdServer.ArgoK8sClient,
 	gitFactory *util.GitFactory, aCDAuthConfig *util2.ACDAuthConfig,
 	gitOpsRepository repository3.GitOpsConfigRepository, globalEnvVariables *util3.GlobalEnvVariables,
-	installedAppRepository appStoreRepository.InstalledAppRepository, tokenCache *util2.TokenCache) *AppStoreDeploymentFullModeServiceImpl {
+	installedAppRepository repository4.InstalledAppRepository, tokenCache *util2.TokenCache) *AppStoreDeploymentFullModeServiceImpl {
 	return &AppStoreDeploymentFullModeServiceImpl{
 		logger:                               logger,
 		chartTemplateService:                 chartTemplateService,
diff --git a/pkg/appStore/repository/ChartGroup.go b/pkg/appStore/deployment/repository/ChartGroup.go
similarity index 99%
rename from pkg/appStore/repository/ChartGroup.go
rename to pkg/appStore/deployment/repository/ChartGroup.go
index 802c7ac09..057b252fa 100644
--- a/pkg/appStore/repository/ChartGroup.go
+++ b/pkg/appStore/deployment/repository/ChartGroup.go
@@ -15,7 +15,7 @@
  *
  */
 
-package appStoreRepository
+package repository
 
 import (
 	"github.com/devtron-labs/devtron/pkg/sql"
diff --git a/pkg/appStore/repository/ChartGroupDeployment.go b/pkg/appStore/deployment/repository/ChartGroupDeployment.go
similarity index 99%
rename from pkg/appStore/repository/ChartGroupDeployment.go
rename to pkg/appStore/deployment/repository/ChartGroupDeployment.go
index a3ad4c7b7..e54dfe901 100644
--- a/pkg/appStore/repository/ChartGroupDeployment.go
+++ b/pkg/appStore/deployment/repository/ChartGroupDeployment.go
@@ -15,7 +15,7 @@
  *
  */
 
-package appStoreRepository
+package repository
 
 import (
 	"github.com/devtron-labs/devtron/pkg/sql"
diff --git a/pkg/appStore/repository/ChartGroupEntry.go b/pkg/appStore/deployment/repository/ChartGroupEntry.go
similarity index 99%
rename from pkg/appStore/repository/ChartGroupEntry.go
rename to pkg/appStore/deployment/repository/ChartGroupEntry.go
index 6ef2c6514..de71ac004 100644
--- a/pkg/appStore/repository/ChartGroupEntry.go
+++ b/pkg/appStore/deployment/repository/ChartGroupEntry.go
@@ -15,7 +15,7 @@
  *
  */
 
-package appStoreRepository
+package repository
 
 import (
 	appStoreDiscoverRepository "github.com/devtron-labs/devtron/pkg/appStore/discover/repository"
diff --git a/pkg/appStore/repository/ClusterInstalledAppsRepository.go b/pkg/appStore/deployment/repository/ClusterInstalledAppsRepository.go
similarity index 99%
rename from pkg/appStore/repository/ClusterInstalledAppsRepository.go
rename to pkg/appStore/deployment/repository/ClusterInstalledAppsRepository.go
index 4f1b3b200..c8e5c7a7e 100644
--- a/pkg/appStore/repository/ClusterInstalledAppsRepository.go
+++ b/pkg/appStore/deployment/repository/ClusterInstalledAppsRepository.go
@@ -15,7 +15,7 @@
  *
  */
 
-package appStoreRepository
+package repository
 
 import (
 	"github.com/devtron-labs/devtron/pkg/sql"
diff --git a/pkg/appStore/repository/AppStoreDeploymentRepository.go b/pkg/appStore/deployment/repository/InstalledAppRepository.go
similarity index 99%
rename from pkg/appStore/repository/AppStoreDeploymentRepository.go
rename to pkg/appStore/deployment/repository/InstalledAppRepository.go
index 8ce47c18f..bee6275ed 100644
--- a/pkg/appStore/repository/AppStoreDeploymentRepository.go
+++ b/pkg/appStore/deployment/repository/InstalledAppRepository.go
@@ -15,7 +15,7 @@
  *
  */
 
-package appStoreRepository
+package repository
 
 import (
 	"github.com/devtron-labs/devtron/internal/sql/repository/app"
diff --git a/pkg/appStore/repository/InstalledAppVersionHistory.go b/pkg/appStore/deployment/repository/InstalledAppVersionHistory.go
similarity index 99%
rename from pkg/appStore/repository/InstalledAppVersionHistory.go
rename to pkg/appStore/deployment/repository/InstalledAppVersionHistory.go
index 097224572..15345058d 100644
--- a/pkg/appStore/repository/InstalledAppVersionHistory.go
+++ b/pkg/appStore/deployment/repository/InstalledAppVersionHistory.go
@@ -1,4 +1,4 @@
-package appStoreRepository
+package repository
 
 import (
 	"github.com/devtron-labs/devtron/pkg/sql"
diff --git a/pkg/appStore/deployment/AppStoreDeploymentService.go b/pkg/appStore/deployment/service/AppStoreDeploymentService.go
similarity index 86%
rename from pkg/appStore/deployment/AppStoreDeploymentService.go
rename to pkg/appStore/deployment/service/AppStoreDeploymentService.go
index e1d7408e0..7d3a72b24 100644
--- a/pkg/appStore/deployment/AppStoreDeploymentService.go
+++ b/pkg/appStore/deployment/service/AppStoreDeploymentService.go
@@ -15,7 +15,7 @@
  *
  */
 
-package appStoreDeployment
+package service
 
 import (
 	"context"
@@ -29,10 +29,10 @@ import (
 	"github.com/devtron-labs/devtron/internal/util"
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
 	appStoreDeploymentCommon "github.com/devtron-labs/devtron/pkg/appStore/deployment/common"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
 	appStoreDeploymentTool "github.com/devtron-labs/devtron/pkg/appStore/deployment/tool"
 	appStoreDeploymentGitopsTool "github.com/devtron-labs/devtron/pkg/appStore/deployment/tool/gitops"
 	appStoreDiscoverRepository "github.com/devtron-labs/devtron/pkg/appStore/discover/repository"
-	appStoreRepository "github.com/devtron-labs/devtron/pkg/appStore/repository"
 	"github.com/devtron-labs/devtron/pkg/bean"
 	"github.com/devtron-labs/devtron/pkg/cluster"
 	cluster2 "github.com/devtron-labs/devtron/pkg/cluster"
@@ -56,14 +56,16 @@ type AppStoreDeploymentService interface {
 	LinkHelmApplicationToChartStore(ctx context.Context, request *openapi.UpdateReleaseWithChartLinkingRequest, appIdentifier *client.AppIdentifier, userId int32) (*openapi.UpdateReleaseResponse, bool, error)
 	RollbackApplication(ctx context.Context, request *openapi2.RollbackReleaseRequest, installedApp *appStoreBean.InstallAppVersionDTO, userId int32) (bool, error)
 	UpdateInstallAppVersionHistory(installAppVersionRequest *appStoreBean.InstallAppVersionDTO) error
+	GetDeploymentHistory(ctx context.Context, installedApp *appStoreBean.InstallAppVersionDTO) (*client.DeploymentHistoryAndInstalledAppInfo, error)
+	GetDeploymentHistoryInfo(ctx context.Context, installedApp *appStoreBean.InstallAppVersionDTO, installedAppVersionHistoryId int) (*openapi.HelmAppDeploymentManifestDetail, error)
 }
 
 type AppStoreDeploymentServiceImpl struct {
 	logger                               *zap.SugaredLogger
-	installedAppRepository               appStoreRepository.InstalledAppRepository
+	installedAppRepository               repository.InstalledAppRepository
 	appStoreApplicationVersionRepository appStoreDiscoverRepository.AppStoreApplicationVersionRepository
 	environmentRepository                clusterRepository.EnvironmentRepository
-	clusterInstalledAppsRepository       appStoreRepository.ClusterInstalledAppsRepository
+	clusterInstalledAppsRepository       repository.ClusterInstalledAppsRepository
 	appRepository                        app.AppRepository
 	appStoreDeploymentHelmService        appStoreDeploymentTool.AppStoreDeploymentHelmService
 	appStoreDeploymentArgoCdService      appStoreDeploymentGitopsTool.AppStoreDeploymentArgoCdService
@@ -72,17 +74,17 @@ type AppStoreDeploymentServiceImpl struct {
 	helmAppService                       client.HelmAppService
 	appStoreDeploymentCommonService      appStoreDeploymentCommon.AppStoreDeploymentCommonService
 	globalEnvVariables                   *util2.GlobalEnvVariables
-	installedAppRepositoryHistory        appStoreRepository.InstalledAppVersionHistoryRepository
+	installedAppRepositoryHistory        repository.InstalledAppVersionHistoryRepository
 }
 
-func NewAppStoreDeploymentServiceImpl(logger *zap.SugaredLogger, installedAppRepository appStoreRepository.InstalledAppRepository,
+func NewAppStoreDeploymentServiceImpl(logger *zap.SugaredLogger, installedAppRepository repository.InstalledAppRepository,
 	appStoreApplicationVersionRepository appStoreDiscoverRepository.AppStoreApplicationVersionRepository, environmentRepository clusterRepository.EnvironmentRepository,
-	clusterInstalledAppsRepository appStoreRepository.ClusterInstalledAppsRepository, appRepository app.AppRepository,
+	clusterInstalledAppsRepository repository.ClusterInstalledAppsRepository, appRepository app.AppRepository,
 	appStoreDeploymentHelmService appStoreDeploymentTool.AppStoreDeploymentHelmService,
 	appStoreDeploymentArgoCdService appStoreDeploymentGitopsTool.AppStoreDeploymentArgoCdService, environmentService cluster.EnvironmentService,
 	clusterService cluster.ClusterService, helmAppService client.HelmAppService, appStoreDeploymentCommonService appStoreDeploymentCommon.AppStoreDeploymentCommonService,
 	globalEnvVariables *util2.GlobalEnvVariables,
-	installedAppRepositoryHistory appStoreRepository.InstalledAppVersionHistoryRepository) *AppStoreDeploymentServiceImpl {
+	installedAppRepositoryHistory repository.InstalledAppVersionHistoryRepository) *AppStoreDeploymentServiceImpl {
 	return &AppStoreDeploymentServiceImpl{
 		logger:                               logger,
 		installedAppRepository:               installedAppRepository,
@@ -144,7 +146,7 @@ func (impl AppStoreDeploymentServiceImpl) AppStoreDeployOperationDB(installAppVe
 	}
 	installAppVersionRequest.AppId = appCreateRequest.Id
 
-	installedAppModel := &appStoreRepository.InstalledApps{
+	installedAppModel := &repository.InstalledApps{
 		AppId:         appCreateRequest.Id,
 		EnvironmentId: environment.Id,
 		Status:        appStoreBean.DEPLOY_INIT,
@@ -165,7 +167,7 @@ func (impl AppStoreDeploymentServiceImpl) AppStoreDeployOperationDB(installAppVe
 	}
 	installAppVersionRequest.InstalledAppId = installedApp.Id
 
-	installedAppVersions := &appStoreRepository.InstalledAppVersions{
+	installedAppVersions := &repository.InstalledAppVersions{
 		InstalledAppId:               installAppVersionRequest.InstalledAppId,
 		AppStoreApplicationVersionId: appStoreAppVersion.Id,
 		ValuesYaml:                   installAppVersionRequest.ValuesOverrideYaml,
@@ -186,7 +188,7 @@ func (impl AppStoreDeploymentServiceImpl) AppStoreDeployOperationDB(installAppVe
 	installAppVersionRequest.InstalledAppVersionId = installedAppVersions.Id
 	installAppVersionRequest.Id = installedAppVersions.Id
 	if installAppVersionRequest.DefaultClusterComponent {
-		clusterInstalledAppsModel := &appStoreRepository.ClusterInstalledApps{
+		clusterInstalledAppsModel := &repository.ClusterInstalledApps{
 			ClusterId:      environment.ClusterId,
 			InstalledAppId: installAppVersionRequest.InstalledAppId,
 		}
@@ -298,7 +300,7 @@ func (impl AppStoreDeploymentServiceImpl) UpdateInstallAppVersionHistory(install
 	}
 	// Rollback tx on error.
 	defer tx.Rollback()
-	installedAppVersionHistory := &appStoreRepository.InstalledAppVersionHistory{
+	installedAppVersionHistory := &repository.InstalledAppVersionHistory{
 		InstalledAppVersionId: installAppVersionRequest.Id,
 	}
 	installedAppVersionHistory.ValuesYamlRaw = installAppVersionRequest.ValuesOverrideYaml
@@ -388,7 +390,7 @@ func (impl AppStoreDeploymentServiceImpl) GetInstalledApp(id int) (*appStoreBean
 }
 
 //converts db object to bean
-func (impl AppStoreDeploymentServiceImpl) chartAdaptor2(chart *appStoreRepository.InstalledApps) *appStoreBean.InstallAppVersionDTO {
+func (impl AppStoreDeploymentServiceImpl) chartAdaptor2(chart *repository.InstalledApps) *appStoreBean.InstallAppVersionDTO {
 	return &appStoreBean.InstallAppVersionDTO{
 		EnvironmentId:   chart.EnvironmentId,
 		InstalledAppId:  chart.Id,
@@ -628,12 +630,6 @@ func (impl AppStoreDeploymentServiceImpl) RollbackApplication(ctx context.Contex
 	defer tx.Rollback()
 
 	// Rollback starts
-	installedAppVersion, err := impl.installedAppRepository.GetInstalledAppVersionAny(int(request.GetInstalledAppVersionId()))
-	if err != nil {
-		impl.logger.Errorw("error while fetching chart installed version", "error", err)
-		return false, err
-	}
-	installedApp.Id = installedAppVersion.Id
 	var success bool
 	if installedApp.AppOfferingMode == util2.SERVER_MODE_HYPERION {
 		installedApp, success, err = impl.appStoreDeploymentHelmService.RollbackRelease(ctx, installedApp, request.GetVersion())
@@ -652,16 +648,23 @@ func (impl AppStoreDeploymentServiceImpl) RollbackApplication(ctx context.Contex
 		return false, fmt.Errorf("rollback request failed")
 	}
 	//DB operation
-	installedAppVersion.Active = true
-	installedAppVersion.ValuesYaml = installedApp.ValuesOverrideYaml
-	installedAppVersion.UpdatedOn = time.Now()
-	installedAppVersion.UpdatedBy = userId
-	_, err = impl.installedAppRepository.UpdateInstalledAppVersion(installedAppVersion, tx)
-	if err != nil {
-		impl.logger.Errorw("error while updating db", "error", err)
-		return false, err
+	if installedApp.InstalledAppId > 0 && installedApp.InstalledAppVersionId > 0 {
+		installedAppVersion, err := impl.installedAppRepository.GetInstalledAppVersionAny(installedApp.InstalledAppVersionId)
+		if err != nil {
+			impl.logger.Errorw("error while fetching chart installed version", "error", err)
+			return false, err
+		}
+		installedApp.Id = installedAppVersion.Id
+		installedAppVersion.Active = true
+		installedAppVersion.ValuesYaml = installedApp.ValuesOverrideYaml
+		installedAppVersion.UpdatedOn = time.Now()
+		installedAppVersion.UpdatedBy = userId
+		_, err = impl.installedAppRepository.UpdateInstalledAppVersion(installedAppVersion, tx)
+		if err != nil {
+			impl.logger.Errorw("error while updating db", "error", err)
+			return false, err
+		}
 	}
-
 	//STEP 8: finish with return response
 	err = tx.Commit()
 	if err != nil {
@@ -743,7 +746,6 @@ func (impl AppStoreDeploymentServiceImpl) linkHelmApplicationToChartStore(instal
 	return res, nil
 }
 
-
 func (impl AppStoreDeploymentServiceImpl) installAppPostDbOperation(installAppVersionRequest *appStoreBean.InstallAppVersionDTO) error {
 	//step 4 db operation status update to deploy success
 	_, err := impl.AppStoreDeployOperationStatusUpdate(installAppVersionRequest.InstalledAppId, appStoreBean.DEPLOY_SUCCESS)
@@ -763,3 +765,58 @@ func (impl AppStoreDeploymentServiceImpl) installAppPostDbOperation(installAppVe
 
 	return nil
 }
+
+func (impl AppStoreDeploymentServiceImpl) GetDeploymentHistory(ctx context.Context, installedApp *appStoreBean.InstallAppVersionDTO) (*client.DeploymentHistoryAndInstalledAppInfo, error) {
+	result := &client.DeploymentHistoryAndInstalledAppInfo{}
+	var err error
+	if installedApp.AppOfferingMode == util2.SERVER_MODE_HYPERION {
+		deploymentHistory, err := impl.appStoreDeploymentHelmService.GetDeploymentHistory(ctx, installedApp)
+		if err != nil {
+			impl.logger.Errorw("error while getting deployment history", "error", err)
+			return nil, err
+		}
+		result.DeploymentHistory = deploymentHistory.GetDeploymentHistory()
+	} else {
+		deploymentHistory, err := impl.appStoreDeploymentArgoCdService.GetDeploymentHistory(ctx, installedApp)
+		if err != nil {
+			impl.logger.Errorw("error while getting deployment history", "error", err)
+			return nil, err
+		}
+		result.DeploymentHistory = deploymentHistory.GetDeploymentHistory()
+	}
+
+	if installedApp.InstalledAppId > 0 {
+		result.InstalledAppInfo = &client.InstalledAppInfo{
+			AppId:                 installedApp.AppId,
+			EnvironmentName:       installedApp.EnvironmentName,
+			AppOfferingMode:       installedApp.AppOfferingMode,
+			InstalledAppId:        installedApp.InstalledAppId,
+			InstalledAppVersionId: installedApp.InstalledAppVersionId,
+			AppStoreChartId:       installedApp.InstallAppVersionChartDTO.AppStoreChartId,
+			ClusterId:             installedApp.ClusterId,
+			EnvironmentId:         installedApp.EnvironmentId,
+		}
+	}
+
+	return result, err
+}
+
+func (impl AppStoreDeploymentServiceImpl) GetDeploymentHistoryInfo(ctx context.Context, installedApp *appStoreBean.InstallAppVersionDTO, version int) (*openapi.HelmAppDeploymentManifestDetail, error) {
+	//var result interface{}
+	result := &openapi.HelmAppDeploymentManifestDetail{}
+	var err error
+	if installedApp.AppOfferingMode == util2.SERVER_MODE_HYPERION {
+		result, err = impl.appStoreDeploymentHelmService.GetDeploymentHistoryInfo(ctx, installedApp, int32(version))
+		if err != nil {
+			impl.logger.Errorw("error while getting deployment history info", "error", err)
+			return nil, err
+		}
+	} else {
+		result, err = impl.appStoreDeploymentArgoCdService.GetDeploymentHistoryInfo(ctx, installedApp, int32(version))
+		if err != nil {
+			impl.logger.Errorw("error while getting deployment history info", "error", err)
+			return nil, err
+		}
+	}
+	return result, err
+}
diff --git a/pkg/appStore/ChartGroupService.go b/pkg/appStore/deployment/service/ChartGroupService.go
similarity index 92%
rename from pkg/appStore/ChartGroupService.go
rename to pkg/appStore/deployment/service/ChartGroupService.go
index 11a6a580d..4e0fac407 100644
--- a/pkg/appStore/ChartGroupService.go
+++ b/pkg/appStore/deployment/service/ChartGroupService.go
@@ -15,11 +15,11 @@
  *
  */
 
-package appStore
+package service
 
 import (
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
-	appStoreRepository "github.com/devtron-labs/devtron/pkg/appStore/repository"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
 	appStoreValuesRepository "github.com/devtron-labs/devtron/pkg/appStore/values/repository"
 	"github.com/devtron-labs/devtron/pkg/sql"
 	"github.com/devtron-labs/devtron/pkg/user"
@@ -30,19 +30,19 @@ import (
 )
 
 type ChartGroupServiceImpl struct {
-	chartGroupEntriesRepository     appStoreRepository.ChartGroupEntriesRepository
-	chartGroupRepository            appStoreRepository.ChartGroupReposotory
+	chartGroupEntriesRepository     repository.ChartGroupEntriesRepository
+	chartGroupRepository            repository.ChartGroupReposotory
 	Logger                          *zap.SugaredLogger
-	chartGroupDeploymentRepository  appStoreRepository.ChartGroupDeploymentRepository
-	installedAppRepository          appStoreRepository.InstalledAppRepository
+	chartGroupDeploymentRepository  repository.ChartGroupDeploymentRepository
+	installedAppRepository          repository.InstalledAppRepository
 	appStoreVersionValuesRepository appStoreValuesRepository.AppStoreVersionValuesRepository
 	userAuthService                 user.UserAuthService
 }
 
-func NewChartGroupServiceImpl(chartGroupEntriesRepository appStoreRepository.ChartGroupEntriesRepository,
-	chartGroupRepository appStoreRepository.ChartGroupReposotory,
-	Logger *zap.SugaredLogger, chartGroupDeploymentRepository appStoreRepository.ChartGroupDeploymentRepository,
-	installedAppRepository appStoreRepository.InstalledAppRepository, appStoreVersionValuesRepository appStoreValuesRepository.AppStoreVersionValuesRepository, userAuthService user.UserAuthService) *ChartGroupServiceImpl {
+func NewChartGroupServiceImpl(chartGroupEntriesRepository repository.ChartGroupEntriesRepository,
+	chartGroupRepository repository.ChartGroupReposotory,
+	Logger *zap.SugaredLogger, chartGroupDeploymentRepository repository.ChartGroupDeploymentRepository,
+	installedAppRepository repository.InstalledAppRepository, appStoreVersionValuesRepository appStoreValuesRepository.AppStoreVersionValuesRepository, userAuthService user.UserAuthService) *ChartGroupServiceImpl {
 	return &ChartGroupServiceImpl{
 		chartGroupEntriesRepository:     chartGroupEntriesRepository,
 		chartGroupRepository:            chartGroupRepository,
@@ -110,7 +110,7 @@ type InstalledChart struct {
 
 func (impl *ChartGroupServiceImpl) CreateChartGroup(req *ChartGroupBean) (*ChartGroupBean, error) {
 	impl.Logger.Debugw("chart group create request", "req", req)
-	chartGrouModel := &appStoreRepository.ChartGroup{
+	chartGrouModel := &repository.ChartGroup{
 		Name:        req.Name,
 		Description: req.Description,
 		AuditLog: sql.AuditLog{
@@ -131,7 +131,7 @@ func (impl *ChartGroupServiceImpl) CreateChartGroup(req *ChartGroupBean) (*Chart
 
 func (impl *ChartGroupServiceImpl) UpdateChartGroup(req *ChartGroupBean) (*ChartGroupBean, error) {
 	impl.Logger.Debugw("chart group update request", "req", req)
-	chartGrouModel := &appStoreRepository.ChartGroup{
+	chartGrouModel := &repository.ChartGroup{
 		Name:        req.Name,
 		Description: req.Description,
 		Id:          req.Id,
@@ -167,7 +167,7 @@ func (impl *ChartGroupServiceImpl) SaveChartGroupEntries(req *ChartGroupBean) (*
 			newEntries = append(newEntries, entryBean)
 		}
 	}
-	var updateEntries []*appStoreRepository.ChartGroupEntry
+	var updateEntries []*repository.ChartGroupEntry
 	for _, existingEntry := range group.ChartGroupEntries {
 		if entry, ok := oldEntriesMap[existingEntry.Id]; ok {
 			//update
@@ -182,9 +182,9 @@ func (impl *ChartGroupServiceImpl) SaveChartGroupEntries(req *ChartGroupBean) (*
 		updateEntries = append(updateEntries, existingEntry)
 	}
 
-	var createEntries []*appStoreRepository.ChartGroupEntry
+	var createEntries []*repository.ChartGroupEntry
 	for _, entryBean := range newEntries {
-		entry := &appStoreRepository.ChartGroupEntry{
+		entry := &repository.ChartGroupEntry{
 			AppStoreValuesVersionId:      entryBean.AppStoreValuesVersionId,
 			AppStoreApplicationVersionId: entryBean.AppStoreApplicationVersionId,
 			ChartGroupId:                 group.Id,
@@ -228,7 +228,7 @@ func (impl *ChartGroupServiceImpl) GetChartGroupWithChartMetaData(chartGroupId i
 	return chartGroupRes, err
 }
 
-func (impl *ChartGroupServiceImpl) charterEntryAdopter(chartGroupEntry *appStoreRepository.ChartGroupEntry) *ChartGroupEntryBean {
+func (impl *ChartGroupServiceImpl) charterEntryAdopter(chartGroupEntry *repository.ChartGroupEntry) *ChartGroupEntryBean {
 
 	var referenceType string
 	var valueVersionName string
@@ -317,7 +317,7 @@ func (impl *ChartGroupServiceImpl) GetChartGroupWithInstallationDetail(chartGrou
 		impl.Logger.Errorw("error in finding deployment", "chartGroupId", chartGroupId, "err", err)
 		return nil, err
 	}
-	groupDeploymentMap := make(map[string][]*appStoreRepository.ChartGroupDeployment)
+	groupDeploymentMap := make(map[string][]*repository.ChartGroupDeployment)
 	for _, deployment := range deployments {
 		groupDeploymentMap[deployment.GroupInstallationId] = append(groupDeploymentMap[deployment.GroupInstallationId], deployment)
 	}
diff --git a/pkg/appStore/AppStoreDeploymentService.go b/pkg/appStore/deployment/service/InstalledAppService.go
similarity index 94%
rename from pkg/appStore/AppStoreDeploymentService.go
rename to pkg/appStore/deployment/service/InstalledAppService.go
index a357694ec..893b28efa 100644
--- a/pkg/appStore/AppStoreDeploymentService.go
+++ b/pkg/appStore/deployment/service/InstalledAppService.go
@@ -15,7 +15,7 @@
  *
  */
 
-package appStore
+package service
 
 import (
 	"bytes"
@@ -24,11 +24,10 @@ import (
 	"github.com/devtron-labs/devtron/client/argocdServer"
 	"github.com/devtron-labs/devtron/internal/sql/repository/app"
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
-	appStoreDeployment "github.com/devtron-labs/devtron/pkg/appStore/deployment"
 	appStoreDeploymentFullMode "github.com/devtron-labs/devtron/pkg/appStore/deployment/fullMode"
+	repository2 "github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
 	appStoreDiscoverRepository "github.com/devtron-labs/devtron/pkg/appStore/discover/repository"
-	appStoreRepository "github.com/devtron-labs/devtron/pkg/appStore/repository"
-	appStoreValues "github.com/devtron-labs/devtron/pkg/appStore/values"
+	"github.com/devtron-labs/devtron/pkg/appStore/values/service"
 	repository5 "github.com/devtron-labs/devtron/pkg/cluster/repository"
 	"github.com/devtron-labs/devtron/pkg/sql"
 	repository4 "github.com/devtron-labs/devtron/pkg/team"
@@ -76,14 +75,12 @@ type InstalledAppService interface {
 	CheckAppExists(appNames []*appStoreBean.AppNames) ([]*appStoreBean.AppNames, error)
 	DeployDefaultChartOnCluster(bean *cluster2.ClusterBean, userId int32) (bool, error)
 	FindAppDetailsForAppstoreApplication(installedAppId, envId int) (bean2.AppDetailContainer, error)
-	GetInstalledAppVersionHistory(installedAppId int) (*appStoreBean.InstallAppVersionHistoryDto, error)
 	UpdateInstalledAppVersionStatus(application v1alpha1.Application) (bool, error)
-	GetInstalledAppVersionHistoryValues(installedAppVersionHistoryId int) (*appStoreBean.IAVHistoryValues, error)
 }
 
 type InstalledAppServiceImpl struct {
 	logger                               *zap.SugaredLogger
-	installedAppRepository               appStoreRepository.InstalledAppRepository
+	installedAppRepository               repository2.InstalledAppRepository
 	chartTemplateService                 util.ChartTemplateService
 	refChartDir                          appStoreBean.RefChartProxyDir
 	repositoryService                    repository.ServiceClient
@@ -92,38 +89,38 @@ type InstalledAppServiceImpl struct {
 	teamRepository                       repository4.TeamRepository
 	appRepository                        app.AppRepository
 	acdClient                            application2.ServiceClient
-	appStoreValuesService                appStoreValues.AppStoreValuesService
-	pubsubClient                         *pubsub.PubSubClient
-	tokenCache                           *util2.TokenCache
-	chartGroupDeploymentRepository       appStoreRepository.ChartGroupDeploymentRepository
-	envService                           cluster2.EnvironmentService
-	ArgoK8sClient                        argocdServer.ArgoK8sClient
-	gitFactory                           *util.GitFactory
-	aCDAuthConfig                        *util2.ACDAuthConfig
-	gitOpsRepository                     repository3.GitOpsConfigRepository
-	userService                          user.UserService
-	appStoreDeploymentService            appStoreDeployment.AppStoreDeploymentService
-	appStoreDeploymentFullModeService    appStoreDeploymentFullMode.AppStoreDeploymentFullModeService
-	installedAppRepositoryHistory        appStoreRepository.InstalledAppVersionHistoryRepository
+	appStoreValuesService             service.AppStoreValuesService
+	pubsubClient                      *pubsub.PubSubClient
+	tokenCache                        *util2.TokenCache
+	chartGroupDeploymentRepository    repository2.ChartGroupDeploymentRepository
+	envService                        cluster2.EnvironmentService
+	ArgoK8sClient                     argocdServer.ArgoK8sClient
+	gitFactory                        *util.GitFactory
+	aCDAuthConfig                     *util2.ACDAuthConfig
+	gitOpsRepository                  repository3.GitOpsConfigRepository
+	userService                       user.UserService
+	appStoreDeploymentService         AppStoreDeploymentService
+	appStoreDeploymentFullModeService appStoreDeploymentFullMode.AppStoreDeploymentFullModeService
+	installedAppRepositoryHistory     repository2.InstalledAppVersionHistoryRepository
 }
 
 func NewInstalledAppServiceImpl(logger *zap.SugaredLogger,
-	installedAppRepository appStoreRepository.InstalledAppRepository,
+	installedAppRepository repository2.InstalledAppRepository,
 	chartTemplateService util.ChartTemplateService, refChartDir appStoreBean.RefChartProxyDir,
 	repositoryService repository.ServiceClient,
 	appStoreApplicationVersionRepository appStoreDiscoverRepository.AppStoreApplicationVersionRepository,
 	environmentRepository repository5.EnvironmentRepository, teamRepository repository4.TeamRepository,
 	appRepository app.AppRepository,
 	acdClient application2.ServiceClient,
-	appStoreValuesService appStoreValues.AppStoreValuesService,
+	appStoreValuesService service.AppStoreValuesService,
 	pubsubClient *pubsub.PubSubClient,
 	tokenCache *util2.TokenCache,
-	chartGroupDeploymentRepository appStoreRepository.ChartGroupDeploymentRepository,
+	chartGroupDeploymentRepository repository2.ChartGroupDeploymentRepository,
 	envService cluster2.EnvironmentService, argoK8sClient argocdServer.ArgoK8sClient,
 	gitFactory *util.GitFactory, aCDAuthConfig *util2.ACDAuthConfig, gitOpsRepository repository3.GitOpsConfigRepository, userService user.UserService,
 	appStoreDeploymentFullModeService appStoreDeploymentFullMode.AppStoreDeploymentFullModeService,
-	appStoreDeploymentService appStoreDeployment.AppStoreDeploymentService,
-	installedAppRepositoryHistory appStoreRepository.InstalledAppVersionHistoryRepository) (*InstalledAppServiceImpl, error) {
+	appStoreDeploymentService AppStoreDeploymentService,
+	installedAppRepositoryHistory repository2.InstalledAppVersionHistoryRepository) (*InstalledAppServiceImpl, error) {
 	impl := &InstalledAppServiceImpl{
 		logger:                               logger,
 		installedAppRepository:               installedAppRepository,
@@ -183,7 +180,7 @@ func (impl InstalledAppServiceImpl) UpdateInstalledApp(ctx context.Context, inst
 		gitOpsRepoName = impl.appStoreDeploymentFullModeService.GetGitOpsRepoName(installAppVersionRequest)
 	}
 	installAppVersionRequest.GitOpsRepoName = gitOpsRepoName
-	var installedAppVersion *appStoreRepository.InstalledAppVersions
+	var installedAppVersion *repository2.InstalledAppVersions
 	if installAppVersionRequest.Id == 0 {
 		// upgrade chart to other repo
 		_, installedAppVersion, err = impl.upgradeInstalledApp(ctx, installAppVersionRequest, installedApp, tx)
@@ -213,7 +210,7 @@ func (impl InstalledAppServiceImpl) UpdateInstalledApp(ctx context.Context, inst
 				impl.logger.Errorw("fetching error", "err", err)
 				return nil, err
 			}
-			installedAppVersion = &appStoreRepository.InstalledAppVersions{
+			installedAppVersion = &repository2.InstalledAppVersions{
 				InstalledAppId:               installAppVersionRequest.InstalledAppId,
 				AppStoreApplicationVersionId: installAppVersionRequest.AppStoreVersion,
 				ValuesYaml:                   installAppVersionRequest.ValuesOverrideYaml,
@@ -283,7 +280,7 @@ func (impl InstalledAppServiceImpl) UpdateInstalledApp(ctx context.Context, inst
 	return installAppVersionRequest, nil
 }
 
-func (impl InstalledAppServiceImpl) updateRequirementDependencies(environment *repository5.Environment, installedAppVersion *appStoreRepository.InstalledAppVersions,
+func (impl InstalledAppServiceImpl) updateRequirementDependencies(environment *repository5.Environment, installedAppVersion *repository2.InstalledAppVersions,
 	installAppVersionRequest *appStoreBean.InstallAppVersionDTO, appStoreAppVersion *appStoreDiscoverRepository.AppStoreApplicationVersion) error {
 
 	argocdAppName := installAppVersionRequest.AppName + "-" + environment.Name
@@ -330,7 +327,7 @@ func (impl InstalledAppServiceImpl) updateRequirementDependencies(environment *r
 	return nil
 }
 
-func (impl InstalledAppServiceImpl) updateValuesYaml(environment *repository5.Environment, installedAppVersion *appStoreRepository.InstalledAppVersions,
+func (impl InstalledAppServiceImpl) updateValuesYaml(environment *repository5.Environment, installedAppVersion *repository2.InstalledAppVersions,
 	installAppVersionRequest *appStoreBean.InstallAppVersionDTO) (*appStoreBean.InstallAppVersionDTO, error) {
 
 	argocdAppName := installAppVersionRequest.AppName + "-" + environment.Name
@@ -378,8 +375,8 @@ func (impl InstalledAppServiceImpl) updateValuesYaml(environment *repository5.En
 	return installAppVersionRequest, nil
 }
 
-func (impl InstalledAppServiceImpl) upgradeInstalledApp(ctx context.Context, installAppVersionRequest *appStoreBean.InstallAppVersionDTO, installedApp *appStoreRepository.InstalledApps, tx *pg.Tx) (*appStoreBean.InstallAppVersionDTO, *appStoreRepository.InstalledAppVersions, error) {
-	var installedAppVersion *appStoreRepository.InstalledAppVersions
+func (impl InstalledAppServiceImpl) upgradeInstalledApp(ctx context.Context, installAppVersionRequest *appStoreBean.InstallAppVersionDTO, installedApp *repository2.InstalledApps, tx *pg.Tx) (*appStoreBean.InstallAppVersionDTO, *repository2.InstalledAppVersions, error) {
+	var installedAppVersion *repository2.InstalledAppVersions
 	installedAppVersions, err := impl.installedAppRepository.GetInstalledAppVersionByInstalledAppId(installAppVersionRequest.InstalledAppId)
 	if err != nil {
 		impl.logger.Errorw("error while fetching installed version", "error", err)
@@ -401,7 +398,7 @@ func (impl InstalledAppServiceImpl) upgradeInstalledApp(ctx context.Context, ins
 		impl.logger.Errorw("fetching error", "err", err)
 		return installAppVersionRequest, installedAppVersion, err
 	}
-	installedAppVersion = &appStoreRepository.InstalledAppVersions{
+	installedAppVersion = &repository2.InstalledAppVersions{
 		InstalledAppId:               installAppVersionRequest.InstalledAppId,
 		AppStoreApplicationVersionId: installAppVersionRequest.AppStoreVersion,
 		ValuesYaml:                   installAppVersionRequest.ValuesOverrideYaml,
@@ -521,7 +518,7 @@ func (impl InstalledAppServiceImpl) GetAll(filter *appStoreBean.AppStoreFilter)
 }
 
 //converts db object to bean
-func (impl InstalledAppServiceImpl) chartAdaptor(chart *appStoreRepository.InstalledAppVersions) (*appStoreBean.InstallAppVersionDTO, error) {
+func (impl InstalledAppServiceImpl) chartAdaptor(chart *repository2.InstalledAppVersions) (*appStoreBean.InstallAppVersionDTO, error) {
 
 	return &appStoreBean.InstallAppVersionDTO{
 		InstalledAppId:     chart.InstalledAppId,
@@ -632,8 +629,8 @@ func (impl InstalledAppServiceImpl) getInstallationId(installAppVersions []*appS
 	return fmt.Sprintf("%x", bs), nil
 }
 
-func (impl InstalledAppServiceImpl) createChartGroupEntryObject(installAppVersionDTO *appStoreBean.InstallAppVersionDTO, chartGroupId int, groupINstallationId string) *appStoreRepository.ChartGroupDeployment {
-	return &appStoreRepository.ChartGroupDeployment{
+func (impl InstalledAppServiceImpl) createChartGroupEntryObject(installAppVersionDTO *appStoreBean.InstallAppVersionDTO, chartGroupId int, groupINstallationId string) *repository2.ChartGroupDeployment {
+	return &repository2.ChartGroupDeployment{
 		ChartGroupId:        chartGroupId,
 		ChartGroupEntryId:   installAppVersionDTO.ChartGroupEntryId,
 		InstalledAppId:      installAppVersionDTO.InstalledAppId,
diff --git a/pkg/appStore/deployment/tool/AppStoreDeploymentHelmService.go b/pkg/appStore/deployment/tool/AppStoreDeploymentHelmService.go
index 92f74c583..93ea017a9 100644
--- a/pkg/appStore/deployment/tool/AppStoreDeploymentHelmService.go
+++ b/pkg/appStore/deployment/tool/AppStoreDeploymentHelmService.go
@@ -4,11 +4,12 @@ import (
 	"context"
 	"errors"
 	client "github.com/devtron-labs/devtron/api/helm-app"
+	openapi "github.com/devtron-labs/devtron/api/helm-app/openapiClient"
 	"github.com/devtron-labs/devtron/internal/constants"
 	"github.com/devtron-labs/devtron/internal/util"
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
 	appStoreDiscoverRepository "github.com/devtron-labs/devtron/pkg/appStore/discover/repository"
-	appStoreRepository "github.com/devtron-labs/devtron/pkg/appStore/repository"
 	clusterRepository "github.com/devtron-labs/devtron/pkg/cluster/repository"
 	"github.com/ghodss/yaml"
 	"github.com/go-pg/pg"
@@ -19,9 +20,11 @@ import (
 
 type AppStoreDeploymentHelmService interface {
 	InstallApp(installAppVersionRequest *appStoreBean.InstallAppVersionDTO, ctx context.Context) (*appStoreBean.InstallAppVersionDTO, error)
-	GetAppStatus(installedAppAndEnvDetails appStoreRepository.InstalledAppAndEnvDetails, w http.ResponseWriter, r *http.Request, token string) (string, error)
-	DeleteInstalledApp(ctx context.Context, appName string, environmentName string, installAppVersionRequest *appStoreBean.InstallAppVersionDTO, installedApps *appStoreRepository.InstalledApps, dbTransaction *pg.Tx) error
+	GetAppStatus(installedAppAndEnvDetails repository.InstalledAppAndEnvDetails, w http.ResponseWriter, r *http.Request, token string) (string, error)
+	DeleteInstalledApp(ctx context.Context, appName string, environmentName string, installAppVersionRequest *appStoreBean.InstallAppVersionDTO, installedApps *repository.InstalledApps, dbTransaction *pg.Tx) error
 	RollbackRelease(ctx context.Context, installedApp *appStoreBean.InstallAppVersionDTO, deploymentVersion int32) (*appStoreBean.InstallAppVersionDTO, bool, error)
+	GetDeploymentHistory(ctx context.Context, installedApp *appStoreBean.InstallAppVersionDTO) (*client.HelmAppDeploymentHistory, error)
+	GetDeploymentHistoryInfo(ctx context.Context, installedApp *appStoreBean.InstallAppVersionDTO, version int32) (*openapi.HelmAppDeploymentManifestDetail, error)
 }
 
 type AppStoreDeploymentHelmServiceImpl struct {
@@ -29,15 +32,17 @@ type AppStoreDeploymentHelmServiceImpl struct {
 	helmAppService                       client.HelmAppService
 	appStoreApplicationVersionRepository appStoreDiscoverRepository.AppStoreApplicationVersionRepository
 	environmentRepository                clusterRepository.EnvironmentRepository
+	helmAppClient                        client.HelmAppClient
 }
 
 func NewAppStoreDeploymentHelmServiceImpl(logger *zap.SugaredLogger, helmAppService client.HelmAppService, appStoreApplicationVersionRepository appStoreDiscoverRepository.AppStoreApplicationVersionRepository,
-	environmentRepository clusterRepository.EnvironmentRepository) *AppStoreDeploymentHelmServiceImpl {
+	environmentRepository clusterRepository.EnvironmentRepository, helmAppClient client.HelmAppClient) *AppStoreDeploymentHelmServiceImpl {
 	return &AppStoreDeploymentHelmServiceImpl{
 		Logger:                               logger,
 		helmAppService:                       helmAppService,
 		appStoreApplicationVersionRepository: appStoreApplicationVersionRepository,
 		environmentRepository:                environmentRepository,
+		helmAppClient:                        helmAppClient,
 	}
 }
 
@@ -72,7 +77,7 @@ func (impl AppStoreDeploymentHelmServiceImpl) InstallApp(installAppVersionReques
 	return installAppVersionRequest, nil
 }
 
-func (impl AppStoreDeploymentHelmServiceImpl) GetAppStatus(installedAppAndEnvDetails appStoreRepository.InstalledAppAndEnvDetails, w http.ResponseWriter, r *http.Request, token string) (string, error) {
+func (impl AppStoreDeploymentHelmServiceImpl) GetAppStatus(installedAppAndEnvDetails repository.InstalledAppAndEnvDetails, w http.ResponseWriter, r *http.Request, token string) (string, error) {
 
 	environment, err := impl.environmentRepository.FindById(installedAppAndEnvDetails.EnvironmentId)
 	if err != nil {
@@ -104,7 +109,7 @@ func (impl AppStoreDeploymentHelmServiceImpl) GetAppStatus(installedAppAndEnvDet
 	return appDetail.ApplicationStatus, nil
 }
 
-func (impl AppStoreDeploymentHelmServiceImpl) DeleteInstalledApp(ctx context.Context, appName string, environmentName string, installAppVersionRequest *appStoreBean.InstallAppVersionDTO, installedApps *appStoreRepository.InstalledApps, dbTransaction *pg.Tx) error {
+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,
@@ -165,3 +170,58 @@ func (impl AppStoreDeploymentHelmServiceImpl) RollbackRelease(ctx context.Contex
 	installedApp.ValuesOverrideYaml = string(valuesYamlByteArr)
 	return installedApp, success, nil
 }
+
+func (impl *AppStoreDeploymentHelmServiceImpl) GetDeploymentHistory(ctx context.Context, installedApp *appStoreBean.InstallAppVersionDTO) (*client.HelmAppDeploymentHistory, error) {
+	helmAppIdeltifier := &client.AppIdentifier{
+		ClusterId:   installedApp.ClusterId,
+		Namespace:   installedApp.Namespace,
+		ReleaseName: installedApp.AppName,
+	}
+	config, err := impl.helmAppService.GetClusterConf(helmAppIdeltifier.ClusterId)
+	if err != nil {
+		impl.Logger.Errorw("error in fetching cluster detail", "err", err)
+		return nil, err
+	}
+	req := &client.AppDetailRequest{
+		ClusterConfig: config,
+		Namespace:     helmAppIdeltifier.Namespace,
+		ReleaseName:   helmAppIdeltifier.ReleaseName,
+	}
+	history, err := impl.helmAppClient.GetDeploymentHistory(ctx, req)
+	return history, err
+}
+
+func (impl *AppStoreDeploymentHelmServiceImpl) GetDeploymentHistoryInfo(ctx context.Context, installedApp *appStoreBean.InstallAppVersionDTO, version int32) (*openapi.HelmAppDeploymentManifestDetail, error) {
+	helmAppIdeltifier := &client.AppIdentifier{
+		ClusterId:   installedApp.ClusterId,
+		Namespace:   installedApp.Namespace,
+		ReleaseName: installedApp.AppName,
+	}
+	config, err := impl.helmAppService.GetClusterConf(helmAppIdeltifier.ClusterId)
+	if err != nil {
+		impl.Logger.Errorw("error in fetching cluster detail", "clusterId", helmAppIdeltifier.ClusterId, "err", err)
+		return nil, err
+	}
+
+	req := &client.DeploymentDetailRequest{
+		ReleaseIdentifier: &client.ReleaseIdentifier{
+			ClusterConfig:    config,
+			ReleaseName:      helmAppIdeltifier.ReleaseName,
+			ReleaseNamespace: helmAppIdeltifier.Namespace,
+		},
+		DeploymentVersion: version,
+	}
+
+	deploymentDetail, err := impl.helmAppClient.GetDeploymentDetail(ctx, req)
+	if err != nil {
+		impl.Logger.Errorw("error in getting deployment detail", "err", err)
+		return nil, err
+	}
+
+	response := &openapi.HelmAppDeploymentManifestDetail{
+		Manifest:   &deploymentDetail.Manifest,
+		ValuesYaml: &deploymentDetail.ValuesYaml,
+	}
+
+	return response, nil
+}
diff --git a/pkg/appStore/deployment/tool/gitops/AppStoreDeploymentArgoCdService.go b/pkg/appStore/deployment/tool/gitops/AppStoreDeploymentArgoCdService.go
index 4cc1dccf4..ec6ae6998 100644
--- a/pkg/appStore/deployment/tool/gitops/AppStoreDeploymentArgoCdService.go
+++ b/pkg/appStore/deployment/tool/gitops/AppStoreDeploymentArgoCdService.go
@@ -5,13 +5,16 @@ import (
 	"errors"
 	"fmt"
 	"github.com/argoproj/argo-cd/pkg/apiclient/application"
+	client "github.com/devtron-labs/devtron/api/helm-app"
+	openapi "github.com/devtron-labs/devtron/api/helm-app/openapiClient"
 	application2 "github.com/devtron-labs/devtron/client/argocdServer/application"
 	"github.com/devtron-labs/devtron/internal/constants"
 	"github.com/devtron-labs/devtron/internal/util"
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
 	appStoreDeploymentFullMode "github.com/devtron-labs/devtron/pkg/appStore/deployment/fullMode"
-	appStoreRepository "github.com/devtron-labs/devtron/pkg/appStore/repository"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
 	"github.com/go-pg/pg"
+	"github.com/golang/protobuf/ptypes/timestamp"
 	"go.uber.org/zap"
 	"net/http"
 	"strings"
@@ -20,23 +23,25 @@ import (
 
 type AppStoreDeploymentArgoCdService interface {
 	InstallApp(installAppVersionRequest *appStoreBean.InstallAppVersionDTO, ctx context.Context) (*appStoreBean.InstallAppVersionDTO, error)
-	GetAppStatus(installedAppAndEnvDetails appStoreRepository.InstalledAppAndEnvDetails, w http.ResponseWriter, r *http.Request, token string) (string, error)
-	DeleteInstalledApp(ctx context.Context, appName string, environmentName string, installAppVersionRequest *appStoreBean.InstallAppVersionDTO, installedApps *appStoreRepository.InstalledApps, dbTransaction *pg.Tx) error
+	GetAppStatus(installedAppAndEnvDetails repository.InstalledAppAndEnvDetails, w http.ResponseWriter, r *http.Request, token string) (string, error)
+	DeleteInstalledApp(ctx context.Context, appName string, environmentName string, installAppVersionRequest *appStoreBean.InstallAppVersionDTO, installedApps *repository.InstalledApps, dbTransaction *pg.Tx) error
 	RollbackRelease(ctx context.Context, installedApp *appStoreBean.InstallAppVersionDTO, deploymentVersion int32) (*appStoreBean.InstallAppVersionDTO, bool, error)
+	GetDeploymentHistory(ctx context.Context, installedApp *appStoreBean.InstallAppVersionDTO) (*client.HelmAppDeploymentHistory, error)
+	GetDeploymentHistoryInfo(ctx context.Context, installedApp *appStoreBean.InstallAppVersionDTO, version int32) (*openapi.HelmAppDeploymentManifestDetail, error)
 }
 
 type AppStoreDeploymentArgoCdServiceImpl struct {
 	Logger                            *zap.SugaredLogger
 	appStoreDeploymentFullModeService appStoreDeploymentFullMode.AppStoreDeploymentFullModeService
 	acdClient                         application2.ServiceClient
-	chartGroupDeploymentRepository    appStoreRepository.ChartGroupDeploymentRepository
-	installedAppRepository            appStoreRepository.InstalledAppRepository
-	installedAppRepositoryHistory     appStoreRepository.InstalledAppVersionHistoryRepository
+	chartGroupDeploymentRepository    repository.ChartGroupDeploymentRepository
+	installedAppRepository            repository.InstalledAppRepository
+	installedAppRepositoryHistory     repository.InstalledAppVersionHistoryRepository
 }
 
 func NewAppStoreDeploymentArgoCdServiceImpl(logger *zap.SugaredLogger, appStoreDeploymentFullModeService appStoreDeploymentFullMode.AppStoreDeploymentFullModeService,
-	acdClient application2.ServiceClient, chartGroupDeploymentRepository appStoreRepository.ChartGroupDeploymentRepository,
-	installedAppRepository appStoreRepository.InstalledAppRepository, installedAppRepositoryHistory appStoreRepository.InstalledAppVersionHistoryRepository) *AppStoreDeploymentArgoCdServiceImpl {
+	acdClient application2.ServiceClient, chartGroupDeploymentRepository repository.ChartGroupDeploymentRepository,
+	installedAppRepository repository.InstalledAppRepository, installedAppRepositoryHistory repository.InstalledAppVersionHistoryRepository) *AppStoreDeploymentArgoCdServiceImpl {
 	return &AppStoreDeploymentArgoCdServiceImpl{
 		Logger:                            logger,
 		appStoreDeploymentFullModeService: appStoreDeploymentFullModeService,
@@ -66,7 +71,7 @@ func (impl AppStoreDeploymentArgoCdServiceImpl) InstallApp(installAppVersionRequ
 }
 
 // TODO: Test ACD to get status
-func (impl AppStoreDeploymentArgoCdServiceImpl) GetAppStatus(installedAppAndEnvDetails appStoreRepository.InstalledAppAndEnvDetails, w http.ResponseWriter, r *http.Request, token string) (string, error) {
+func (impl AppStoreDeploymentArgoCdServiceImpl) GetAppStatus(installedAppAndEnvDetails repository.InstalledAppAndEnvDetails, w http.ResponseWriter, r *http.Request, token string) (string, error) {
 	if len(installedAppAndEnvDetails.AppName) > 0 && len(installedAppAndEnvDetails.EnvironmentName) > 0 {
 		acdAppName := installedAppAndEnvDetails.AppName + "-" + installedAppAndEnvDetails.EnvironmentName
 		query := &application.ResourcesQuery{
@@ -104,7 +109,7 @@ func (impl AppStoreDeploymentArgoCdServiceImpl) GetAppStatus(installedAppAndEnvD
 	return "", errors.New("invalid app name or env name")
 }
 
-func (impl AppStoreDeploymentArgoCdServiceImpl) DeleteInstalledApp(ctx context.Context, appName string, environmentName string, installAppVersionRequest *appStoreBean.InstallAppVersionDTO, installedApps *appStoreRepository.InstalledApps, dbTransaction *pg.Tx) error {
+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 {
@@ -169,7 +174,7 @@ func (impl AppStoreDeploymentArgoCdServiceImpl) RollbackRelease(ctx context.Cont
 	}
 
 	//validate relations
-	if versionHistory.InstalledAppVersionId != installedApp.Id || installedApp.InstalledAppId != installedAppVersion.InstalledAppId {
+	if installedApp.InstalledAppId != installedAppVersion.InstalledAppId {
 		err = &util.ApiError{Code: "400", HttpStatusCode: 400, UserMessage: "bad request, requested version are not belongs to each other", InternalMessage: ""}
 		return installedApp, false, err
 	}
@@ -220,3 +225,57 @@ func (impl AppStoreDeploymentArgoCdServiceImpl) deleteACD(acdAppName string, ctx
 	}
 	return nil
 }
+
+func (impl AppStoreDeploymentArgoCdServiceImpl) GetDeploymentHistory(ctx context.Context, installedAppDto *appStoreBean.InstallAppVersionDTO) (*client.HelmAppDeploymentHistory, error) {
+	result := &client.HelmAppDeploymentHistory{}
+	var history []*client.HelmAppDeploymentDetail
+	//TODO - response setup
+
+	installedAppVersions, err := impl.installedAppRepository.GetInstalledAppVersionByInstalledAppIdMeta(installedAppDto.InstalledAppId)
+	if err != nil {
+		impl.Logger.Errorw("error while fetching installed version", "error", err)
+		return result, err
+	}
+	for _, installedAppVersionModel := range installedAppVersions {
+		versionHistory, err := impl.installedAppRepositoryHistory.GetInstalledAppVersionHistoryByVersionId(installedAppVersionModel.Id)
+		if err != nil && err != pg.ErrNoRows {
+			impl.Logger.Errorw("error while fetching installed version history", "error", err)
+			return result, err
+		}
+		for _, updateHistory := range versionHistory {
+			history = append(history, &client.HelmAppDeploymentDetail{
+				ChartMetadata: &client.ChartMetadata{
+					ChartName:    installedAppVersionModel.AppStoreApplicationVersion.AppStore.Name,
+					ChartVersion: installedAppVersionModel.AppStoreApplicationVersion.Version,
+					Description:  installedAppVersionModel.AppStoreApplicationVersion.Description,
+					Home:         installedAppVersionModel.AppStoreApplicationVersion.Home,
+					Sources:      []string{installedAppVersionModel.AppStoreApplicationVersion.Source},
+				},
+				DockerImages: []string{installedAppVersionModel.AppStoreApplicationVersion.AppVersion},
+				DeployedAt: &timestamp.Timestamp{
+					Seconds: updateHistory.UpdatedOn.Unix(),
+					Nanos:   int32(updateHistory.UpdatedOn.Nanosecond()),
+				},
+				Version: int32(updateHistory.Id),
+				//InstalledAppVersionId: installedAppVersionModel.Id,
+			})
+		}
+	}
+
+	if len(history) == 0 {
+		history = make([]*client.HelmAppDeploymentDetail, 0)
+	}
+	result.DeploymentHistory = history
+	return result, err
+}
+
+func (impl AppStoreDeploymentArgoCdServiceImpl) GetDeploymentHistoryInfo(ctx context.Context, installedApp *appStoreBean.InstallAppVersionDTO, version int32) (*openapi.HelmAppDeploymentManifestDetail, error) {
+	values := &openapi.HelmAppDeploymentManifestDetail{}
+	versionHistory, err := impl.installedAppRepositoryHistory.GetInstalledAppVersionHistory(int(version))
+	if err != nil {
+		impl.Logger.Errorw("error while fetching installed version history", "error", err)
+		return nil, err
+	}
+	values.ValuesYaml = &versionHistory.ValuesYamlRaw
+	return values, err
+}
diff --git a/pkg/appStore/discover/AppStoreService.go b/pkg/appStore/discover/service/AppStoreService.go
similarity index 99%
rename from pkg/appStore/discover/AppStoreService.go
rename to pkg/appStore/discover/service/AppStoreService.go
index 4e2b18222..f66966cc7 100644
--- a/pkg/appStore/discover/AppStoreService.go
+++ b/pkg/appStore/discover/service/AppStoreService.go
@@ -15,7 +15,7 @@
  *
  */
 
-package appStoreDiscover
+package service
 
 import (
 	"github.com/devtron-labs/devtron/internal/util"
diff --git a/pkg/appStore/values/AppStoreValuesService.go b/pkg/appStore/values/service/AppStoreValuesService.go
similarity index 98%
rename from pkg/appStore/values/AppStoreValuesService.go
rename to pkg/appStore/values/service/AppStoreValuesService.go
index 88c06a331..da9377852 100644
--- a/pkg/appStore/values/AppStoreValuesService.go
+++ b/pkg/appStore/values/service/AppStoreValuesService.go
@@ -15,14 +15,14 @@
  *
  */
 
-package appStoreValues
+package service
 
 import (
 	"fmt"
 	"github.com/devtron-labs/devtron/internal/util"
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
+	"github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
 	appStoreDiscoverRepository "github.com/devtron-labs/devtron/pkg/appStore/discover/repository"
-	appStoreRepository "github.com/devtron-labs/devtron/pkg/appStore/repository"
 	appStoreValuesRepository "github.com/devtron-labs/devtron/pkg/appStore/values/repository"
 	"go.uber.org/zap"
 	"time"
@@ -42,12 +42,12 @@ type AppStoreValuesService interface {
 type AppStoreValuesServiceImpl struct {
 	logger                          *zap.SugaredLogger
 	appStoreApplicationRepository   appStoreDiscoverRepository.AppStoreApplicationVersionRepository
-	installedAppRepository          appStoreRepository.InstalledAppRepository
+	installedAppRepository          repository.InstalledAppRepository
 	appStoreVersionValuesRepository appStoreValuesRepository.AppStoreVersionValuesRepository
 }
 
 func NewAppStoreValuesServiceImpl(logger *zap.SugaredLogger,
-	appStoreApplicationRepository appStoreDiscoverRepository.AppStoreApplicationVersionRepository, installedAppRepository appStoreRepository.InstalledAppRepository,
+	appStoreApplicationRepository appStoreDiscoverRepository.AppStoreApplicationVersionRepository, installedAppRepository repository.InstalledAppRepository,
 	appStoreVersionValuesRepository appStoreValuesRepository.AppStoreVersionValuesRepository) *AppStoreValuesServiceImpl {
 	return &AppStoreValuesServiceImpl{
 		logger:                          logger,
diff --git a/pkg/cluster/ClusterServiceExtended.go b/pkg/cluster/ClusterServiceExtended.go
index 34bf4d0c3..ee4392cce 100644
--- a/pkg/cluster/ClusterServiceExtended.go
+++ b/pkg/cluster/ClusterServiceExtended.go
@@ -11,7 +11,7 @@ import (
 	"github.com/devtron-labs/devtron/internal/constants"
 	"github.com/devtron-labs/devtron/internal/util"
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
-	appStoreRepository "github.com/devtron-labs/devtron/pkg/appStore/repository"
+	repository2 "github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
 	"github.com/devtron-labs/devtron/pkg/cluster/repository"
 	"go.uber.org/zap"
 	"net/http"
@@ -23,14 +23,14 @@ import (
 type ClusterServiceImplExtended struct {
 	environmentRepository  repository.EnvironmentRepository
 	grafanaClient          grafana.GrafanaClient
-	installedAppRepository appStoreRepository.InstalledAppRepository
+	installedAppRepository repository2.InstalledAppRepository
 	clusterServiceCD       cluster2.ServiceClient
 	K8sInformerFactory     informer.K8sInformerFactory
 	*ClusterServiceImpl
 }
 
 func NewClusterServiceImplExtended(repository repository.ClusterRepository, environmentRepository repository.EnvironmentRepository,
-	grafanaClient grafana.GrafanaClient, logger *zap.SugaredLogger, installedAppRepository appStoreRepository.InstalledAppRepository,
+	grafanaClient grafana.GrafanaClient, logger *zap.SugaredLogger, installedAppRepository repository2.InstalledAppRepository,
 	K8sUtil *util.K8sUtil,
 	clusterServiceCD cluster2.ServiceClient, K8sInformerFactory informer.K8sInformerFactory) *ClusterServiceImplExtended {
 	clusterServiceExt := &ClusterServiceImplExtended{
@@ -59,7 +59,7 @@ func (impl *ClusterServiceImplExtended) FindAll() ([]*ClusterBean, error) {
 	for _, cluster := range beans {
 		clusterIds = append(clusterIds, cluster.Id)
 	}
-	clusterComponentsMap := make(map[int][]*appStoreRepository.InstalledAppVersions)
+	clusterComponentsMap := make(map[int][]*repository2.InstalledAppVersions)
 	charts, err := impl.installedAppRepository.GetInstalledAppVersionByClusterIdsV2(clusterIds)
 	if err != nil {
 		impl.logger.Errorw("error on fetching installed apps for cluster ids", "err", err, "clusterIds", clusterIds)
@@ -67,7 +67,7 @@ func (impl *ClusterServiceImplExtended) FindAll() ([]*ClusterBean, error) {
 	}
 	for _, item := range charts {
 		if _, ok := clusterComponentsMap[item.InstalledApp.Environment.ClusterId]; !ok {
-			var charts []*appStoreRepository.InstalledAppVersions
+			var charts []*repository2.InstalledAppVersions
 			charts = append(charts, item)
 			clusterComponentsMap[item.InstalledApp.Environment.ClusterId] = charts
 		} else {
diff --git a/pkg/delete/DeleteServiceExtended.go b/pkg/delete/DeleteServiceExtended.go
index 61315a7a5..33b2cabd4 100644
--- a/pkg/delete/DeleteServiceExtended.go
+++ b/pkg/delete/DeleteServiceExtended.go
@@ -4,7 +4,7 @@ import (
 	"fmt"
 	"github.com/devtron-labs/devtron/internal/sql/repository/app"
 	"github.com/devtron-labs/devtron/internal/sql/repository/pipelineConfig"
-	appStoreRepository "github.com/devtron-labs/devtron/pkg/appStore/repository"
+	repository2 "github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
 	"github.com/devtron-labs/devtron/pkg/chartRepo"
 	"github.com/devtron-labs/devtron/pkg/cluster"
 	"github.com/devtron-labs/devtron/pkg/cluster/repository"
@@ -17,7 +17,7 @@ type DeleteServiceExtendedImpl struct {
 	appRepository          app.AppRepository
 	environmentRepository  repository.EnvironmentRepository
 	pipelineRepository     pipelineConfig.PipelineRepository
-	installedAppRepository appStoreRepository.InstalledAppRepository
+	installedAppRepository repository2.InstalledAppRepository
 	*DeleteServiceImpl
 }
 
@@ -27,7 +27,7 @@ func NewDeleteServiceExtendedImpl(logger *zap.SugaredLogger,
 	environmentService cluster.EnvironmentService,
 	appRepository app.AppRepository,
 	environmentRepository repository.EnvironmentRepository,
-	pipelineRepository pipelineConfig.PipelineRepository, chartRepositoryService chartRepo.ChartRepositoryService, installedAppRepository appStoreRepository.InstalledAppRepository,
+	pipelineRepository pipelineConfig.PipelineRepository, chartRepositoryService chartRepo.ChartRepositoryService, installedAppRepository repository2.InstalledAppRepository,
 ) *DeleteServiceExtendedImpl {
 	return &DeleteServiceExtendedImpl{
 		appRepository:          appRepository,
diff --git a/specs/api-spec.yaml b/specs/api-spec.yaml
index f1b09b855..345644147 100644
--- a/specs/api-spec.yaml
+++ b/specs/api-spec.yaml
@@ -3,25 +3,9 @@ info:
   version: 1.0.0
   title: Devtron Labs
 paths:
-  /orchestrator/app-store/deployment/application/rollback:
-    put:
-      description: Rollback application if the application is installed from the chartStore
-      requestBody:
-        required: true
-        content:
-          application/json:
-            schema:
-              $ref: '#/components/schemas/RollbackReleaseRequest'
-      responses:
-        "200":
-          description: application rollback response
-          content:
-            application/json:
-              schema:
-                $ref: "#/components/schemas/RollbackReleaseResponse"
   /orchestrator/application/rollback:
     put:
-      description: Rollback application if the application is installed externally using helm (external-app)
+      description: Rollback application if the application is installed from the chartStore
       requestBody:
         required: true
         content:
diff --git a/specs/external-app/applist.yaml b/specs/external-app/applist.yaml
index dcb2e935a..a191bc75f 100644
--- a/specs/external-app/applist.yaml
+++ b/specs/external-app/applist.yaml
@@ -20,25 +20,6 @@ paths:
             text/event-stream:
               schema:
                 $ref: "#/components/schemas/AppList"
-  /orchestrator/application/deployment-history:
-    get:
-      description: deployment history of helm app
-      parameters:
-        - in: query
-          name: appId
-          example: "12|helm-app|cluster1-ns1"
-          description: project ids
-          required: true
-          allowEmptyValue: false
-          schema:
-            type: string
-      responses:
-        "200":
-          description: deployment history
-          content:
-            application/json:
-              schema:
-                $ref: "#/components/schemas/DeploymentHistoryAndInstalledAppInfo"
   /orchestrator/application/release-info:
     get:
       description: deployment values.yaml/release-info
@@ -332,43 +313,23 @@ paths:
             application/json:
               schema:
                 $ref: "#/components/schemas/UpdateReleaseResponse"
-  /orchestrator/application/deployment-detail:
+  /orchestrator/application/deployment-history:
     get:
-      description: deployment details of helm app
+      description: deployment history of helm app
       parameters:
         - in: query
           name: appId
           example: "12|helm-app|cluster1-ns1"
           description: project ids
-          required: true
+          required: false
           allowEmptyValue: false
           schema:
             type: string
-        - in: query
-          name: version
-          example: 1
-          description: deployment version
-          required: true
-          allowEmptyValue: false
-          schema:
-            type: integer
-            format: int32
-      responses:
-        "200":
-          description: deployment detail response
-          content:
-            application/json:
-              schema:
-                $ref: "#/components/schemas/HelmAppDeploymentManifestDetail"
-  /orchestrator/app-store/installed-app/deployment-history:
-    get:
-      description: deployment history of helm app
-      parameters:
         - in: query
           name: installedAppId
           example: "100"
           description: devtron charts installed instance id
-          required: true
+          required: false
           allowEmptyValue: false
           schema:
             type: number
@@ -379,15 +340,23 @@ paths:
             application/json:
               schema:
                 $ref: "#/components/schemas/DeploymentHistoryAndInstalledAppInfo"
-  /orchestrator/app-store/installed-app/deployment-history/info:
+  /orchestrator/application/deployment-history/info:
     get:
       description: deployment history detail info, values
       parameters:
+        - in: query
+          name: appId
+          example: "12|helm-app|cluster1-ns1"
+          description: project ids
+          required: false
+          allowEmptyValue: false
+          schema:
+            type: string
         - in: query
           name: installedAppId
           example: "100"
           description: devtron charts installed instance id
-          required: true
+          required: false
           allowEmptyValue: false
           schema:
             type: string
diff --git a/wire_gen.go b/wire_gen.go
index 3576c78fd..55cebb07c 100644
--- a/wire_gen.go
+++ b/wire_gen.go
@@ -8,10 +8,10 @@ package main
 import (
 	client2 "github.com/devtron-labs/authenticator/client"
 	"github.com/devtron-labs/authenticator/middleware"
-	appStore2 "github.com/devtron-labs/devtron/api/appStore"
-	appStoreDeployment2 "github.com/devtron-labs/devtron/api/appStore/deployment"
-	appStoreDiscover2 "github.com/devtron-labs/devtron/api/appStore/discover"
-	appStoreValues2 "github.com/devtron-labs/devtron/api/appStore/values"
+	"github.com/devtron-labs/devtron/api/appStore"
+	"github.com/devtron-labs/devtron/api/appStore/deployment"
+	"github.com/devtron-labs/devtron/api/appStore/discover"
+	"github.com/devtron-labs/devtron/api/appStore/values"
 	chartRepo2 "github.com/devtron-labs/devtron/api/chartRepo"
 	cluster3 "github.com/devtron-labs/devtron/api/cluster"
 	"github.com/devtron-labs/devtron/api/connector"
@@ -54,18 +54,17 @@ import (
 	app2 "github.com/devtron-labs/devtron/pkg/app"
 	"github.com/devtron-labs/devtron/pkg/appClone"
 	"github.com/devtron-labs/devtron/pkg/appClone/batch"
-	"github.com/devtron-labs/devtron/pkg/appStore"
 	"github.com/devtron-labs/devtron/pkg/appStore/bean"
-	"github.com/devtron-labs/devtron/pkg/appStore/deployment"
 	"github.com/devtron-labs/devtron/pkg/appStore/deployment/common"
 	"github.com/devtron-labs/devtron/pkg/appStore/deployment/fullMode"
+	repository6 "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/tool"
 	"github.com/devtron-labs/devtron/pkg/appStore/deployment/tool/gitops"
-	"github.com/devtron-labs/devtron/pkg/appStore/discover"
 	"github.com/devtron-labs/devtron/pkg/appStore/discover/repository"
-	"github.com/devtron-labs/devtron/pkg/appStore/repository"
-	"github.com/devtron-labs/devtron/pkg/appStore/values"
+	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"
 	appWorkflow2 "github.com/devtron-labs/devtron/pkg/appWorkflow"
 	"github.com/devtron-labs/devtron/pkg/attributes"
 	"github.com/devtron-labs/devtron/pkg/chartRepo"
@@ -295,7 +294,7 @@ func InitializeApp() (*App, error) {
 		return nil, err
 	}
 	grafanaClientImpl := grafana.NewGrafanaClientImpl(sugaredLogger, httpClient, grafanaClientConfig, attributesServiceImpl)
-	installedAppRepositoryImpl := appStoreRepository.NewInstalledAppRepositoryImpl(sugaredLogger, db)
+	installedAppRepositoryImpl := repository6.NewInstalledAppRepositoryImpl(sugaredLogger, db)
 	k8sUtil := util.NewK8sUtil(sugaredLogger, runtimeConfig)
 	clusterServiceClientImpl := cluster.NewServiceClientImpl(argoCDSettings, sugaredLogger)
 	v := informer.NewGlobalMapClusterNamespace()
@@ -394,10 +393,10 @@ func InitializeApp() (*App, error) {
 	refChartProxyDir := _wireRefChartProxyDirValue
 	appStoreApplicationVersionRepositoryImpl := appStoreDiscoverRepository.NewAppStoreApplicationVersionRepositoryImpl(sugaredLogger, db)
 	appStoreVersionValuesRepositoryImpl := appStoreValuesRepository.NewAppStoreVersionValuesRepositoryImpl(sugaredLogger, db)
-	appStoreValuesServiceImpl := appStoreValues.NewAppStoreValuesServiceImpl(sugaredLogger, appStoreApplicationVersionRepositoryImpl, installedAppRepositoryImpl, appStoreVersionValuesRepositoryImpl)
-	chartGroupDeploymentRepositoryImpl := appStoreRepository.NewChartGroupDeploymentRepositoryImpl(db, sugaredLogger)
+	appStoreValuesServiceImpl := service.NewAppStoreValuesServiceImpl(sugaredLogger, appStoreApplicationVersionRepositoryImpl, installedAppRepositoryImpl, appStoreVersionValuesRepositoryImpl)
+	chartGroupDeploymentRepositoryImpl := repository6.NewChartGroupDeploymentRepositoryImpl(db, sugaredLogger)
 	appStoreDeploymentFullModeServiceImpl := appStoreDeploymentFullMode.NewAppStoreDeploymentFullModeServiceImpl(sugaredLogger, chartTemplateServiceImpl, refChartProxyDir, repositoryServiceClientImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl, serviceClientImpl, argoK8sClientImpl, gitFactory, acdAuthConfig, gitOpsConfigRepositoryImpl, globalEnvVariables, installedAppRepositoryImpl, tokenCache)
-	clusterInstalledAppsRepositoryImpl := appStoreRepository.NewClusterInstalledAppsRepositoryImpl(db, sugaredLogger)
+	clusterInstalledAppsRepositoryImpl := repository6.NewClusterInstalledAppsRepositoryImpl(db, sugaredLogger)
 	helmClientConfig, err := client4.GetConfig()
 	if err != nil {
 		return nil, err
@@ -405,12 +404,12 @@ func InitializeApp() (*App, error) {
 	helmAppClientImpl := client4.NewHelmAppClientImpl(sugaredLogger, helmClientConfig)
 	enforcerUtilHelmImpl := rbac.NewEnforcerUtilHelmImpl(sugaredLogger, clusterRepositoryImpl)
 	helmAppServiceImpl := client4.NewHelmAppServiceImpl(sugaredLogger, clusterServiceImplExtended, helmAppClientImpl, pumpImpl, enforcerUtilHelmImpl)
-	appStoreDeploymentHelmServiceImpl := appStoreDeploymentTool.NewAppStoreDeploymentHelmServiceImpl(sugaredLogger, helmAppServiceImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl)
-	installedAppVersionHistoryRepositoryImpl := appStoreRepository.NewInstalledAppVersionHistoryRepositoryImpl(sugaredLogger, db)
+	appStoreDeploymentHelmServiceImpl := appStoreDeploymentTool.NewAppStoreDeploymentHelmServiceImpl(sugaredLogger, helmAppServiceImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl, helmAppClientImpl)
+	installedAppVersionHistoryRepositoryImpl := repository6.NewInstalledAppVersionHistoryRepositoryImpl(sugaredLogger, db)
 	appStoreDeploymentArgoCdServiceImpl := appStoreDeploymentGitopsTool.NewAppStoreDeploymentArgoCdServiceImpl(sugaredLogger, appStoreDeploymentFullModeServiceImpl, serviceClientImpl, chartGroupDeploymentRepositoryImpl, installedAppRepositoryImpl, installedAppVersionHistoryRepositoryImpl)
 	appStoreDeploymentCommonServiceImpl := appStoreDeploymentCommon.NewAppStoreDeploymentCommonServiceImpl(sugaredLogger, installedAppRepositoryImpl)
-	appStoreDeploymentServiceImpl := appStoreDeployment.NewAppStoreDeploymentServiceImpl(sugaredLogger, installedAppRepositoryImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl, clusterInstalledAppsRepositoryImpl, appRepositoryImpl, appStoreDeploymentHelmServiceImpl, appStoreDeploymentArgoCdServiceImpl, environmentServiceImpl, clusterServiceImplExtended, helmAppServiceImpl, appStoreDeploymentCommonServiceImpl, globalEnvVariables, installedAppVersionHistoryRepositoryImpl)
-	installedAppServiceImpl, err := appStore.NewInstalledAppServiceImpl(sugaredLogger, installedAppRepositoryImpl, chartTemplateServiceImpl, refChartProxyDir, repositoryServiceClientImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl, teamRepositoryImpl, appRepositoryImpl, serviceClientImpl, appStoreValuesServiceImpl, pubSubClient, tokenCache, chartGroupDeploymentRepositoryImpl, environmentServiceImpl, argoK8sClientImpl, gitFactory, acdAuthConfig, gitOpsConfigRepositoryImpl, userServiceImpl, appStoreDeploymentFullModeServiceImpl, appStoreDeploymentServiceImpl, installedAppVersionHistoryRepositoryImpl)
+	appStoreDeploymentServiceImpl := service2.NewAppStoreDeploymentServiceImpl(sugaredLogger, installedAppRepositoryImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl, clusterInstalledAppsRepositoryImpl, appRepositoryImpl, appStoreDeploymentHelmServiceImpl, appStoreDeploymentArgoCdServiceImpl, environmentServiceImpl, clusterServiceImplExtended, helmAppServiceImpl, appStoreDeploymentCommonServiceImpl, globalEnvVariables, installedAppVersionHistoryRepositoryImpl)
+	installedAppServiceImpl, err := service2.NewInstalledAppServiceImpl(sugaredLogger, installedAppRepositoryImpl, chartTemplateServiceImpl, refChartProxyDir, repositoryServiceClientImpl, appStoreApplicationVersionRepositoryImpl, environmentRepositoryImpl, teamRepositoryImpl, appRepositoryImpl, serviceClientImpl, appStoreValuesServiceImpl, pubSubClient, tokenCache, chartGroupDeploymentRepositoryImpl, environmentServiceImpl, argoK8sClientImpl, gitFactory, acdAuthConfig, gitOpsConfigRepositoryImpl, userServiceImpl, appStoreDeploymentFullModeServiceImpl, appStoreDeploymentServiceImpl, installedAppVersionHistoryRepositoryImpl)
 	if err != nil {
 		return nil, err
 	}
@@ -426,15 +425,15 @@ func InitializeApp() (*App, error) {
 	chartRefRouterImpl := router.NewChartRefRouterImpl(chartRefRestHandlerImpl)
 	configMapRestHandlerImpl := restHandler.NewConfigMapRestHandlerImpl(pipelineBuilderImpl, sugaredLogger, chartServiceImpl, userServiceImpl, teamServiceImpl, enforcerImpl, pipelineRepositoryImpl, enforcerUtilImpl, configMapServiceImpl)
 	configMapRouterImpl := router.NewConfigMapRouterImpl(configMapRestHandlerImpl)
-	installedAppRestHandlerImpl := appStore2.NewInstalledAppRestHandlerImpl(sugaredLogger, userServiceImpl, enforcerImpl, enforcerUtilImpl, installedAppServiceImpl, validate, clusterServiceImplExtended, serviceClientImpl, appStoreDeploymentServiceImpl)
-	appStoreValuesRestHandlerImpl := appStoreValues2.NewAppStoreValuesRestHandlerImpl(sugaredLogger, userServiceImpl, appStoreValuesServiceImpl)
-	appStoreValuesRouterImpl := appStoreValues2.NewAppStoreValuesRouterImpl(appStoreValuesRestHandlerImpl)
-	appStoreServiceImpl := appStoreDiscover.NewAppStoreServiceImpl(sugaredLogger, appStoreApplicationVersionRepositoryImpl)
-	appStoreRestHandlerImpl := appStoreDiscover2.NewAppStoreRestHandlerImpl(sugaredLogger, userServiceImpl, appStoreServiceImpl, enforcerImpl)
-	appStoreDiscoverRouterImpl := appStoreDiscover2.NewAppStoreDiscoverRouterImpl(appStoreRestHandlerImpl)
-	appStoreDeploymentRestHandlerImpl := appStoreDeployment2.NewAppStoreDeploymentRestHandlerImpl(sugaredLogger, userServiceImpl, enforcerImpl, enforcerUtilImpl, enforcerUtilHelmImpl, appStoreDeploymentServiceImpl, validate, helmAppServiceImpl, appStoreDeploymentCommonServiceImpl)
-	appStoreDeploymentRouterImpl := appStoreDeployment2.NewAppStoreDeploymentRouterImpl(appStoreDeploymentRestHandlerImpl)
-	appStoreRouterImpl := appStore2.NewAppStoreRouterImpl(installedAppRestHandlerImpl, appStoreValuesRouterImpl, appStoreDiscoverRouterImpl, appStoreDeploymentRouterImpl)
+	installedAppRestHandlerImpl := appStore.NewInstalledAppRestHandlerImpl(sugaredLogger, userServiceImpl, enforcerImpl, enforcerUtilImpl, installedAppServiceImpl, validate, clusterServiceImplExtended, serviceClientImpl, appStoreDeploymentServiceImpl)
+	appStoreValuesRestHandlerImpl := appStoreValues.NewAppStoreValuesRestHandlerImpl(sugaredLogger, userServiceImpl, appStoreValuesServiceImpl)
+	appStoreValuesRouterImpl := appStoreValues.NewAppStoreValuesRouterImpl(appStoreValuesRestHandlerImpl)
+	appStoreServiceImpl := service3.NewAppStoreServiceImpl(sugaredLogger, appStoreApplicationVersionRepositoryImpl)
+	appStoreRestHandlerImpl := appStoreDiscover.NewAppStoreRestHandlerImpl(sugaredLogger, userServiceImpl, appStoreServiceImpl, enforcerImpl)
+	appStoreDiscoverRouterImpl := appStoreDiscover.NewAppStoreDiscoverRouterImpl(appStoreRestHandlerImpl)
+	appStoreDeploymentRestHandlerImpl := appStoreDeployment.NewAppStoreDeploymentRestHandlerImpl(sugaredLogger, userServiceImpl, enforcerImpl, enforcerUtilImpl, enforcerUtilHelmImpl, appStoreDeploymentServiceImpl, validate, helmAppServiceImpl, appStoreDeploymentCommonServiceImpl)
+	appStoreDeploymentRouterImpl := appStoreDeployment.NewAppStoreDeploymentRouterImpl(appStoreDeploymentRestHandlerImpl)
+	appStoreRouterImpl := appStore.NewAppStoreRouterImpl(installedAppRestHandlerImpl, appStoreValuesRouterImpl, appStoreDiscoverRouterImpl, appStoreDeploymentRouterImpl)
 	chartRepositoryRestHandlerImpl := chartRepo2.NewChartRepositoryRestHandlerImpl(sugaredLogger, userServiceImpl, chartRepositoryServiceImpl, enforcerImpl, validate, deleteServiceExtendedImpl, chartRefRepositoryImpl, refChartDir)
 	chartRepositoryRouterImpl := chartRepo2.NewChartRepositoryRouterImpl(chartRepositoryRestHandlerImpl)
 	lensConfig, err := lens.GetLensConfig()
@@ -457,9 +456,9 @@ func InitializeApp() (*App, error) {
 	workflowActionImpl := batch.NewWorkflowActionImpl(sugaredLogger, appRepositoryImpl, appWorkflowServiceImpl, buildActionImpl, deploymentActionImpl)
 	batchOperationRestHandlerImpl := restHandler.NewBatchOperationRestHandlerImpl(userServiceImpl, enforcerImpl, workflowActionImpl, teamServiceImpl, sugaredLogger, enforcerUtilImpl)
 	batchOperationRouterImpl := router.NewBatchOperationRouterImpl(batchOperationRestHandlerImpl, sugaredLogger)
-	chartGroupEntriesRepositoryImpl := appStoreRepository.NewChartGroupEntriesRepositoryImpl(db, sugaredLogger)
-	chartGroupReposotoryImpl := appStoreRepository.NewChartGroupReposotoryImpl(db, sugaredLogger)
-	chartGroupServiceImpl := appStore.NewChartGroupServiceImpl(chartGroupEntriesRepositoryImpl, chartGroupReposotoryImpl, sugaredLogger, chartGroupDeploymentRepositoryImpl, installedAppRepositoryImpl, appStoreVersionValuesRepositoryImpl, userAuthServiceImpl)
+	chartGroupEntriesRepositoryImpl := repository6.NewChartGroupEntriesRepositoryImpl(db, sugaredLogger)
+	chartGroupReposotoryImpl := repository6.NewChartGroupReposotoryImpl(db, sugaredLogger)
+	chartGroupServiceImpl := service2.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)
@@ -524,7 +523,9 @@ func InitializeApp() (*App, error) {
 	deploymentConfigRouterImpl := deployment.NewDeploymentRouterImpl(deploymentConfigRestHandlerImpl)
 	dashboardTelemetryRestHandlerImpl := dashboardEvent.NewDashboardTelemetryRestHandlerImpl(sugaredLogger, telemetryEventClientImpl)
 	dashboardTelemetryRouterImpl := dashboardEvent.NewDashboardTelemetryRouterImpl(dashboardTelemetryRestHandlerImpl)
-	muxRouter := router.NewMuxRouter(sugaredLogger, helmRouterImpl, pipelineConfigRouterImpl, migrateDbRouterImpl, appListingRouterImpl, environmentRouterImpl, clusterRouterImpl, webhookRouterImpl, userAuthRouterImpl, applicationRouterImpl, cdRouterImpl, projectManagementRouterImpl, gitProviderRouterImpl, gitHostRouterImpl, dockerRegRouterImpl, notificationRouterImpl, teamRouterImpl, gitWebhookHandlerImpl, workflowStatusUpdateHandlerImpl, applicationStatusUpdateHandlerImpl, ciEventHandlerImpl, pubSubClient, userRouterImpl, cronBasedEventReceiverImpl, chartRefRouterImpl, configMapRouterImpl, appStoreRouterImpl, chartRepositoryRouterImpl, releaseMetricsRouterImpl, deploymentGroupRouterImpl, batchOperationRouterImpl, chartGroupRouterImpl, testSuitRouterImpl, imageScanRouterImpl, policyRouterImpl, gitOpsConfigRouterImpl, dashboardRouterImpl, attributesRouterImpl, commonRouterImpl, grafanaRouterImpl, ssoLoginRouterImpl, telemetryRouterImpl, telemetryEventClientImpl, bulkUpdateRouterImpl, webhookListenerRouterImpl, appLabelRouterImpl, coreAppRouterImpl, helmAppRouterImpl, k8sApplicationRouterImpl, pProfRouterImpl, deploymentConfigRouterImpl, dashboardTelemetryRouterImpl)
+	commonDeploymentRestHandlerImpl := appStoreDeployment.NewCommonDeploymentRestHandlerImpl(sugaredLogger, userServiceImpl, enforcerImpl, enforcerUtilImpl, enforcerUtilHelmImpl, appStoreDeploymentServiceImpl, validate, helmAppServiceImpl, appStoreDeploymentCommonServiceImpl, helmAppRestHandlerImpl)
+	commonDeploymentRouterImpl := appStoreDeployment.NewCommonDeploymentRouterImpl(commonDeploymentRestHandlerImpl)
+	muxRouter := router.NewMuxRouter(sugaredLogger, helmRouterImpl, pipelineConfigRouterImpl, migrateDbRouterImpl, appListingRouterImpl, environmentRouterImpl, clusterRouterImpl, webhookRouterImpl, userAuthRouterImpl, applicationRouterImpl, cdRouterImpl, projectManagementRouterImpl, gitProviderRouterImpl, gitHostRouterImpl, dockerRegRouterImpl, notificationRouterImpl, teamRouterImpl, gitWebhookHandlerImpl, workflowStatusUpdateHandlerImpl, applicationStatusUpdateHandlerImpl, ciEventHandlerImpl, pubSubClient, userRouterImpl, cronBasedEventReceiverImpl, chartRefRouterImpl, configMapRouterImpl, appStoreRouterImpl, chartRepositoryRouterImpl, releaseMetricsRouterImpl, deploymentGroupRouterImpl, batchOperationRouterImpl, chartGroupRouterImpl, testSuitRouterImpl, imageScanRouterImpl, policyRouterImpl, gitOpsConfigRouterImpl, dashboardRouterImpl, attributesRouterImpl, commonRouterImpl, grafanaRouterImpl, ssoLoginRouterImpl, telemetryRouterImpl, telemetryEventClientImpl, bulkUpdateRouterImpl, webhookListenerRouterImpl, appLabelRouterImpl, coreAppRouterImpl, helmAppRouterImpl, k8sApplicationRouterImpl, pProfRouterImpl, deploymentConfigRouterImpl, dashboardTelemetryRouterImpl, commonDeploymentRouterImpl)
 	mainApp := NewApp(muxRouter, sugaredLogger, sseSSE, versionServiceImpl, enforcer, db, pubSubClient, sessionManager)
 	return mainApp, nil
 }


Test patch:
diff --git a/pkg/appStore/AppStoreDeploymentService_test.go b/pkg/appStore/deployment/service/InstalledAppService_test.go
similarity index 77%
rename from pkg/appStore/AppStoreDeploymentService_test.go
rename to pkg/appStore/deployment/service/InstalledAppService_test.go
index 811e590ae..270268f69 100644
--- a/pkg/appStore/AppStoreDeploymentService_test.go
+++ b/pkg/appStore/deployment/service/InstalledAppService_test.go
@@ -1,4 +1,4 @@
-package appStore
+package service
 
 import (
 	"github.com/devtron-labs/devtron/client/argocdServer"
@@ -9,11 +9,10 @@ import (
 	"github.com/devtron-labs/devtron/internal/sql/repository/app"
 	"github.com/devtron-labs/devtron/internal/util"
 	appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
-	appStoreDeployment "github.com/devtron-labs/devtron/pkg/appStore/deployment"
 	appStoreDeploymentFullMode "github.com/devtron-labs/devtron/pkg/appStore/deployment/fullMode"
+	repository4 "github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
 	appStoreDiscoverRepository "github.com/devtron-labs/devtron/pkg/appStore/discover/repository"
-	appStoreRepository "github.com/devtron-labs/devtron/pkg/appStore/repository"
-	appStoreValues "github.com/devtron-labs/devtron/pkg/appStore/values"
+	"github.com/devtron-labs/devtron/pkg/appStore/values/service"
 	"github.com/devtron-labs/devtron/pkg/cluster"
 	"github.com/devtron-labs/devtron/pkg/cluster/repository"
 	"github.com/devtron-labs/devtron/pkg/team"
@@ -26,7 +25,7 @@ import (
 func TestInstalledAppServiceImpl_DeployDefaultChartOnCluster(t *testing.T) {
 	type fields struct {
 		logger                               *zap.SugaredLogger
-		installedAppRepository               appStoreRepository.InstalledAppRepository
+		installedAppRepository               repository4.InstalledAppRepository
 		chartTemplateService                 util.ChartTemplateService
 		refChartDir                          appStoreBean.RefChartProxyDir
 		repositoryService                    repository2.ServiceClient
@@ -35,18 +34,18 @@ func TestInstalledAppServiceImpl_DeployDefaultChartOnCluster(t *testing.T) {
 		teamRepository                       team.TeamRepository
 		appRepository                        app.AppRepository
 		acdClient                            application.ServiceClient
-		appStoreValuesService                appStoreValues.AppStoreValuesService
-		pubsubClient                         *pubsub.PubSubClient
-		tokenCache                           *util2.TokenCache
-		chartGroupDeploymentRepository       appStoreRepository.ChartGroupDeploymentRepository
-		envService                           cluster.EnvironmentService
-		ArgoK8sClient                        argocdServer.ArgoK8sClient
-		gitFactory                           *util.GitFactory
-		aCDAuthConfig                        *util2.ACDAuthConfig
-		gitOpsRepository                     repository3.GitOpsConfigRepository
-		userService                          user.UserService
-		appStoreDeploymentService            appStoreDeployment.AppStoreDeploymentService
-		appStoreDeploymentFullModeService    appStoreDeploymentFullMode.AppStoreDeploymentFullModeService
+		appStoreValuesService             service.AppStoreValuesService
+		pubsubClient                      *pubsub.PubSubClient
+		tokenCache                        *util2.TokenCache
+		chartGroupDeploymentRepository    repository4.ChartGroupDeploymentRepository
+		envService                        cluster.EnvironmentService
+		ArgoK8sClient                     argocdServer.ArgoK8sClient
+		gitFactory                        *util.GitFactory
+		aCDAuthConfig                     *util2.ACDAuthConfig
+		gitOpsRepository                  repository3.GitOpsConfigRepository
+		userService                       user.UserService
+		appStoreDeploymentService         AppStoreDeploymentService
+		appStoreDeploymentFullModeService appStoreDeploymentFullMode.AppStoreDeploymentFullModeService
 	}
 	type args struct {
 		bean   *cluster.ClusterBean