Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DockerfileEA
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ COPY --from=build-env /go/src/github.com/devtron-labs/devtron/vendor/github.com
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/devtron-reference-helm-charts scripts/devtron-reference-helm-charts
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/sql scripts/sql
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/casbin scripts/casbin
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/argo-assets/APPLICATION_TEMPLATE.JSON scripts/argo-assets/APPLICATION_TEMPLATE.JSON
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/argo-assets/APPLICATION_TEMPLATE.tmpl scripts/argo-assets/APPLICATION_TEMPLATE.tmpl

RUN useradd -ms /bin/bash devtron
RUN chown -R devtron:devtron ./devtron-ea
Expand Down
60 changes: 11 additions & 49 deletions Wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
util4 "github.com/devtron-labs/common-lib/utils/k8s"
"github.com/devtron-labs/devtron/api/apiToken"
appStoreRestHandler "github.com/devtron-labs/devtron/api/appStore"
chartGroup2 "github.com/devtron-labs/devtron/api/appStore/chartGroup"
chartProvider "github.com/devtron-labs/devtron/api/appStore/chartProvider"
appStoreDeployment "github.com/devtron-labs/devtron/api/appStore/deployment"
appStoreDiscover "github.com/devtron-labs/devtron/api/appStore/discover"
Expand Down Expand Up @@ -64,7 +65,6 @@ import (
eClient "github.com/devtron-labs/devtron/client/events"
"github.com/devtron-labs/devtron/client/gitSensor"
"github.com/devtron-labs/devtron/client/grafana"
jClient "github.com/devtron-labs/devtron/client/jira"
"github.com/devtron-labs/devtron/client/lens"
"github.com/devtron-labs/devtron/client/proxy"
"github.com/devtron-labs/devtron/client/telemetry"
Expand All @@ -88,10 +88,11 @@ import (
"github.com/devtron-labs/devtron/pkg/appClone/batch"
"github.com/devtron-labs/devtron/pkg/appStatus"
appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
"github.com/devtron-labs/devtron/pkg/appStore/chartGroup"
repository4 "github.com/devtron-labs/devtron/pkg/appStore/chartGroup/repository"
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"
appStoreDeploymentGitopsTool "github.com/devtron-labs/devtron/pkg/appStore/deployment/tool"
"github.com/devtron-labs/devtron/pkg/appWorkflow"
"github.com/devtron-labs/devtron/pkg/attributes"
"github.com/devtron-labs/devtron/pkg/bulkAction"
Expand All @@ -106,7 +107,6 @@ import (
"github.com/devtron-labs/devtron/pkg/generateManifest"
"github.com/devtron-labs/devtron/pkg/git"
"github.com/devtron-labs/devtron/pkg/gitops"
jira2 "github.com/devtron-labs/devtron/pkg/jira"
"github.com/devtron-labs/devtron/pkg/kubernetesResourceAuditLogs"
repository7 "github.com/devtron-labs/devtron/pkg/kubernetesResourceAuditLogs/repository"
"github.com/devtron-labs/devtron/pkg/notifier"
Expand All @@ -118,7 +118,6 @@ import (
"github.com/devtron-labs/devtron/pkg/pipeline/types"
"github.com/devtron-labs/devtron/pkg/plugin"
repository6 "github.com/devtron-labs/devtron/pkg/plugin/repository"
"github.com/devtron-labs/devtron/pkg/projectManagementService/jira"
resourceGroup2 "github.com/devtron-labs/devtron/pkg/resourceGroup"
"github.com/devtron-labs/devtron/pkg/resourceQualifiers"
"github.com/devtron-labs/devtron/pkg/security"
Expand Down Expand Up @@ -261,10 +260,7 @@ func InitializeApp() (*App, error) {
wire.Bind(new(pipeline.CiCdPipelineOrchestrator), new(*pipeline.CiCdPipelineOrchestratorImpl)),
pipelineConfig.NewMaterialRepositoryImpl,
wire.Bind(new(pipelineConfig.MaterialRepository), new(*pipelineConfig.MaterialRepositoryImpl)),
router.NewMigrateDbRouterImpl,
wire.Bind(new(router.MigrateDbRouter), new(*router.MigrateDbRouterImpl)),
restHandler.NewMigrateDbRestHandlerImpl,
wire.Bind(new(restHandler.MigrateDbRestHandler), new(*restHandler.MigrateDbRestHandlerImpl)),

util.NewChartTemplateServiceImpl,
wire.Bind(new(util.ChartTemplateService), new(*util.ChartTemplateServiceImpl)),
util.NewChartDeploymentServiceImpl,
Expand Down Expand Up @@ -332,23 +328,8 @@ func InitializeApp() (*App, error) {
pipeline.NewPropertiesConfigServiceImpl,
wire.Bind(new(pipeline.PropertiesConfigService), new(*pipeline.PropertiesConfigServiceImpl)),

router.NewProjectManagementRouterImpl,
wire.Bind(new(router.ProjectManagementRouter), new(*router.ProjectManagementRouterImpl)),

restHandler.NewJiraRestHandlerImpl,
wire.Bind(new(restHandler.JiraRestHandler), new(*restHandler.JiraRestHandlerImpl)),

jira2.NewProjectManagementServiceImpl,
wire.Bind(new(jira2.ProjectManagementService), new(*jira2.ProjectManagementServiceImpl)),

jira.NewAccountServiceImpl,
wire.Bind(new(jira.AccountService), new(*jira.AccountServiceImpl)),

util.NewHttpClient,

jClient.NewJiraClientImpl,
wire.Bind(new(jClient.JiraClient), new(*jClient.JiraClientImpl)),

eClient.NewEventRESTClientImpl,
wire.Bind(new(eClient.EventClient), new(*eClient.EventRESTClientImpl)),

Expand All @@ -357,11 +338,6 @@ func InitializeApp() (*App, error) {
eClient.NewEventSimpleFactoryImpl,
wire.Bind(new(eClient.EventFactory), new(*eClient.EventSimpleFactoryImpl)),

repository.NewJiraAccountRepositoryImpl,
wire.Bind(new(repository.JiraAccountRepository), new(*repository.JiraAccountRepositoryImpl)),
jira.NewAccountValidatorImpl,
wire.Bind(new(jira.AccountValidator), new(*jira.AccountValidatorImpl)),

repository.NewCiArtifactRepositoryImpl,
wire.Bind(new(repository.CiArtifactRepository), new(*repository.CiArtifactRepositoryImpl)),
pipeline.NewWebhookServiceImpl,
Expand Down Expand Up @@ -405,15 +381,6 @@ func InitializeApp() (*App, error) {
//ArgoUtil.NewRepositoryService,
//wire.Bind(new(ArgoUtil.RepositoryService), new(ArgoUtil.RepositoryServiceImpl)),

pipelineConfig.NewDbMigrationConfigRepositoryImpl,
wire.Bind(new(pipelineConfig.DbMigrationConfigRepository), new(*pipelineConfig.DbMigrationConfigRepositoryImpl)),
pipeline.NewDbConfigService,
wire.Bind(new(pipeline.DbConfigService), new(*pipeline.DbConfigServiceImpl)),

repository.NewDbConfigRepositoryImpl,
wire.Bind(new(repository.DbConfigRepository), new(*repository.DbConfigRepositoryImpl)),
pipeline.NewDbMogrationService,
wire.Bind(new(pipeline.DbMigrationService), new(*pipeline.DbMigrationServiceImpl)),
//ArgoUtil.NewClusterServiceImpl,
//wire.Bind(new(ArgoUtil.ClusterService), new(ArgoUtil.ClusterServiceImpl)),
pipeline.GetEcrConfig,
Expand Down Expand Up @@ -626,23 +593,18 @@ func InitializeApp() (*App, error) {
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)),
chartGroup.NewChartGroupServiceImpl,
wire.Bind(new(chartGroup.ChartGroupService), new(*chartGroup.ChartGroupServiceImpl)),
chartGroup2.NewChartGroupRestHandlerImpl,
wire.Bind(new(chartGroup2.ChartGroupRestHandler), new(*chartGroup2.ChartGroupRestHandlerImpl)),
chartGroup2.NewChartGroupRouterImpl,
wire.Bind(new(chartGroup2.ChartGroupRouter), new(*chartGroup2.ChartGroupRouterImpl)),
repository4.NewChartGroupDeploymentRepositoryImpl,
wire.Bind(new(repository4.ChartGroupDeploymentRepository), new(*repository4.ChartGroupDeploymentRepositoryImpl)),

commonService.NewCommonServiceImpl,
wire.Bind(new(commonService.CommonService), new(*commonService.CommonServiceImpl)),

router.NewTestSuitRouterImpl,
wire.Bind(new(router.TestSuitRouter), new(*router.TestSuitRouterImpl)),
restHandler.NewTestSuitRestHandlerImpl,
wire.Bind(new(restHandler.TestSuitRestHandler), new(*restHandler.TestSuitRestHandlerImpl)),

router.NewImageScanRouterImpl,
wire.Bind(new(router.ImageScanRouter), new(*router.ImageScanRouterImpl)),
restHandler.NewImageScanRestHandlerImpl,
Expand Down
3 changes: 2 additions & 1 deletion api/appStore/InstalledAppRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
util2 "github.com/devtron-labs/devtron/internal/util"
app2 "github.com/devtron-labs/devtron/pkg/app"
appStoreBean "github.com/devtron-labs/devtron/pkg/appStore/bean"
"github.com/devtron-labs/devtron/pkg/appStore/chartGroup"
"github.com/devtron-labs/devtron/pkg/appStore/deployment/repository"
"github.com/devtron-labs/devtron/pkg/appStore/deployment/service"
"github.com/devtron-labs/devtron/pkg/auth/authorisation/casbin"
Expand Down Expand Up @@ -325,7 +326,7 @@ func (handler *InstalledAppRestHandlerImpl) DeployBulk(w http.ResponseWriter, r
return
}
decoder := json.NewDecoder(r.Body)
var request appStoreBean.ChartGroupInstallRequest
var request chartGroup.ChartGroupInstallRequest
err = decoder.Decode(&request)
if err != nil {
handler.Logger.Errorw("request err, DeployBulk", "err", err, "payload", request)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/

package restHandler
package chartGroup

import (
"encoding/json"
Expand All @@ -24,7 +24,7 @@ import (
"strconv"

"github.com/devtron-labs/devtron/api/restHandler/common"
"github.com/devtron-labs/devtron/pkg/appStore/deployment/service"
"github.com/devtron-labs/devtron/pkg/appStore/chartGroup"
"github.com/devtron-labs/devtron/pkg/auth/authorisation/casbin"
"github.com/devtron-labs/devtron/pkg/auth/user"
"github.com/gorilla/mux"
Expand All @@ -35,14 +35,14 @@ import (
const CHART_GROUP_DELETE_SUCCESS_RESP = "Chart group deleted successfully."

type ChartGroupRestHandlerImpl struct {
ChartGroupService service.ChartGroupService
ChartGroupService chartGroup.ChartGroupService
Logger *zap.SugaredLogger
userAuthService user.UserService
enforcer casbin.Enforcer
validator *validator.Validate
}

func NewChartGroupRestHandlerImpl(ChartGroupService service.ChartGroupService,
func NewChartGroupRestHandlerImpl(ChartGroupService chartGroup.ChartGroupService,
Logger *zap.SugaredLogger, userAuthService user.UserService,
enforcer casbin.Enforcer, validator *validator.Validate) *ChartGroupRestHandlerImpl {
return &ChartGroupRestHandlerImpl{
Expand Down Expand Up @@ -72,7 +72,7 @@ func (impl *ChartGroupRestHandlerImpl) CreateChartGroup(w http.ResponseWriter, r
return
}
decoder := json.NewDecoder(r.Body)
var request service.ChartGroupBean
var request chartGroup.ChartGroupBean
err = decoder.Decode(&request)
if err != nil {
impl.Logger.Errorw("request err, CreateChartGroup", "err", err, "payload", request)
Expand Down Expand Up @@ -101,7 +101,7 @@ func (impl *ChartGroupRestHandlerImpl) CreateChartGroup(w http.ResponseWriter, r
if err != nil {
impl.Logger.Errorw("service err, CreateChartGroup", "err", err, "payload", request)
statusCode := http.StatusInternalServerError
if service.AppNameAlreadyExistsError == err.Error() {
if chartGroup.AppNameAlreadyExistsError == err.Error() {
statusCode = http.StatusBadRequest
}
common.WriteJsonResp(w, err, nil, statusCode)
Expand All @@ -117,7 +117,7 @@ func (impl *ChartGroupRestHandlerImpl) UpdateChartGroup(w http.ResponseWriter, r
return
}
decoder := json.NewDecoder(r.Body)
var request service.ChartGroupBean
var request chartGroup.ChartGroupBean
err = decoder.Decode(&request)
if err != nil {
impl.Logger.Errorw("request err, UpdateChartGroup", "err", err, "payload", request)
Expand Down Expand Up @@ -158,7 +158,7 @@ func (impl *ChartGroupRestHandlerImpl) SaveChartGroupEntries(w http.ResponseWrit
return
}
decoder := json.NewDecoder(r.Body)
var request service.ChartGroupBean
var request chartGroup.ChartGroupBean
err = decoder.Decode(&request)
if err != nil {
impl.Logger.Errorw("request err, SaveChartGroupEntries", "err", err, "payload", request)
Expand Down Expand Up @@ -326,7 +326,7 @@ func (impl *ChartGroupRestHandlerImpl) DeleteChartGroup(w http.ResponseWriter, r
return
}
decoder := json.NewDecoder(r.Body)
var request service.ChartGroupBean
var request chartGroup.ChartGroupBean
err = decoder.Decode(&request)
if err != nil {
impl.Logger.Errorw("request err, DeleteChartGroup", "err", err, "payload", request)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,25 @@
*
*/

package router
package chartGroup

import (
"github.com/devtron-labs/devtron/api/restHandler"
"github.com/gorilla/mux"
)

type ChartGroupRouterImpl struct {
ChartGroupRestHandler restHandler.ChartGroupRestHandler
ChartGroupRestHandler ChartGroupRestHandler
}
type ChartGroupRouter interface {
initChartGroupRouter(helmRouter *mux.Router)
InitChartGroupRouter(helmRouter *mux.Router)
}

func NewChartGroupRouterImpl(ChartGroupRestHandler restHandler.ChartGroupRestHandler) *ChartGroupRouterImpl {
func NewChartGroupRouterImpl(ChartGroupRestHandler ChartGroupRestHandler) *ChartGroupRouterImpl {
return &ChartGroupRouterImpl{ChartGroupRestHandler: ChartGroupRestHandler}

}

func (impl *ChartGroupRouterImpl) initChartGroupRouter(chartGroupRouter *mux.Router) {
func (impl *ChartGroupRouterImpl) InitChartGroupRouter(chartGroupRouter *mux.Router) {
chartGroupRouter.Path("/").
HandlerFunc(impl.ChartGroupRestHandler.CreateChartGroup).Methods("POST")
chartGroupRouter.Path("/").
Expand Down
3 changes: 0 additions & 3 deletions api/restHandler/BulkUpdateRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ type BulkUpdateRestHandlerImpl struct {
bulkUpdateService bulkAction.BulkUpdateService
chartService chart.ChartService
propertiesConfigService pipeline.PropertiesConfigService
dbMigrationService pipeline.DbMigrationService
application application.ServiceClient
userAuthService user.UserService
validator *validator.Validate
Expand All @@ -76,7 +75,6 @@ func NewBulkUpdateRestHandlerImpl(pipelineBuilder pipeline.PipelineBuilder, logg
bulkUpdateService bulkAction.BulkUpdateService,
chartService chart.ChartService,
propertiesConfigService pipeline.PropertiesConfigService,
dbMigrationService pipeline.DbMigrationService,
application application.ServiceClient,
userAuthService user.UserService,
teamService team.TeamService,
Expand All @@ -99,7 +97,6 @@ func NewBulkUpdateRestHandlerImpl(pipelineBuilder pipeline.PipelineBuilder, logg
bulkUpdateService: bulkUpdateService,
chartService: chartService,
propertiesConfigService: propertiesConfigService,
dbMigrationService: dbMigrationService,
application: application,
userAuthService: userAuthService,
validator: validator,
Expand Down
4 changes: 1 addition & 3 deletions api/restHandler/GitProviderRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ type GitProviderRestHandlerImpl struct {
dockerRegistryConfig pipeline.DockerRegistryConfig
logger *zap.SugaredLogger
gitRegistryConfig pipeline.GitRegistryConfig
dbConfigService pipeline.DbConfigService
userAuthService user.UserService
validator *validator.Validate
enforcer casbin.Enforcer
Expand All @@ -59,14 +58,13 @@ type GitProviderRestHandlerImpl struct {
func NewGitProviderRestHandlerImpl(dockerRegistryConfig pipeline.DockerRegistryConfig,
logger *zap.SugaredLogger,
gitRegistryConfig pipeline.GitRegistryConfig,
dbConfigService pipeline.DbConfigService, userAuthService user.UserService,
userAuthService user.UserService,
validator *validator.Validate, enforcer casbin.Enforcer, teamService team.TeamService,
deleteServiceFullMode delete2.DeleteServiceFullMode) *GitProviderRestHandlerImpl {
return &GitProviderRestHandlerImpl{
dockerRegistryConfig: dockerRegistryConfig,
logger: logger,
gitRegistryConfig: gitRegistryConfig,
dbConfigService: dbConfigService,
userAuthService: userAuthService,
validator: validator,
enforcer: enforcer,
Expand Down
Loading