Skip to content

Commit e245b3d

Browse files
Merge pull request #6194 from devtron-labs/release-candidate-v0.25.0
misc: Release candidate v0.25.0
2 parents d04950d + 0ec3419 commit e245b3d

File tree

194 files changed

+5598
-1803
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+5598
-1803
lines changed

688

Whitespace-only changes.

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
all: fetch-all-env build
44

5+
TARGET_BRANCH?=main
56
TAG?=$(shell bash -c 'git log --pretty=format:'%h' -n 1')
67
FLAGS=
78
ENVVAR=
@@ -63,3 +64,9 @@ build-ea:
6364

6465
fetch-all-env:
6566
go run fetchAllEnv/fetchAllEnv.go
67+
68+
dep-update-oss:
69+
go mod edit -replace=github.com/devtron-labs/common-lib=github.com/devtron-labs/devtron-services/common-lib@$(TARGET_BRANCH) \
70+
-replace=github.com/devtron-labs/authenticator=github.com/devtron-labs/devtron-services/authenticator@$(TARGET_BRANCH)
71+
go mod tidy
72+
go mod vendor

Wire.go

Lines changed: 13 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import (
4949
"github.com/devtron-labs/devtron/api/restHandler"
5050
"github.com/devtron-labs/devtron/api/restHandler/app/appInfo"
5151
appList2 "github.com/devtron-labs/devtron/api/restHandler/app/appList"
52+
configDiff2 "github.com/devtron-labs/devtron/api/restHandler/app/configDiff"
5253
pipeline3 "github.com/devtron-labs/devtron/api/restHandler/app/pipeline"
5354
pipeline2 "github.com/devtron-labs/devtron/api/restHandler/app/pipeline/configure"
5455
"github.com/devtron-labs/devtron/api/restHandler/app/pipeline/history"
@@ -61,6 +62,7 @@ import (
6162
app3 "github.com/devtron-labs/devtron/api/router/app"
6263
appInfo2 "github.com/devtron-labs/devtron/api/router/app/appInfo"
6364
"github.com/devtron-labs/devtron/api/router/app/appList"
65+
configDiff3 "github.com/devtron-labs/devtron/api/router/app/configDiff"
6466
pipeline5 "github.com/devtron-labs/devtron/api/router/app/pipeline"
6567
pipeline4 "github.com/devtron-labs/devtron/api/router/app/pipeline/configure"
6668
history2 "github.com/devtron-labs/devtron/api/router/app/pipeline/history"
@@ -102,7 +104,6 @@ import (
102104
repository8 "github.com/devtron-labs/devtron/internal/sql/repository/imageTagging"
103105
"github.com/devtron-labs/devtron/internal/sql/repository/pipelineConfig"
104106
resourceGroup "github.com/devtron-labs/devtron/internal/sql/repository/resourceGroup"
105-
security2 "github.com/devtron-labs/devtron/internal/sql/repository/security"
106107
"github.com/devtron-labs/devtron/internal/util"
107108
"github.com/devtron-labs/devtron/pkg/app"
108109
"github.com/devtron-labs/devtron/pkg/app/dbMigration"
@@ -113,10 +114,7 @@ import (
113114
"github.com/devtron-labs/devtron/pkg/appStore/chartGroup"
114115
repository4 "github.com/devtron-labs/devtron/pkg/appStore/chartGroup/repository"
115116
repository9 "github.com/devtron-labs/devtron/pkg/appStore/installedApp/repository"
116-
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/FullMode"
117117
deployment3 "github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/FullMode/deployment"
118-
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/FullMode/deploymentTypeChange"
119-
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/FullMode/resource"
120118
"github.com/devtron-labs/devtron/pkg/appWorkflow"
121119
"github.com/devtron-labs/devtron/pkg/argoRepositoryCreds"
122120
"github.com/devtron-labs/devtron/pkg/asyncProvider"
@@ -156,10 +154,9 @@ import (
156154
repository5 "github.com/devtron-labs/devtron/pkg/pipeline/repository"
157155
"github.com/devtron-labs/devtron/pkg/pipeline/types"
158156
"github.com/devtron-labs/devtron/pkg/plugin"
159-
repository6 "github.com/devtron-labs/devtron/pkg/plugin/repository"
157+
"github.com/devtron-labs/devtron/pkg/policyGovernance"
160158
resourceGroup2 "github.com/devtron-labs/devtron/pkg/resourceGroup"
161159
"github.com/devtron-labs/devtron/pkg/resourceQualifiers"
162-
"github.com/devtron-labs/devtron/pkg/security"
163160
"github.com/devtron-labs/devtron/pkg/sql"
164161
util3 "github.com/devtron-labs/devtron/pkg/util"
165162
"github.com/devtron-labs/devtron/pkg/variables"
@@ -196,9 +193,9 @@ func InitializeApp() (*App, error) {
196193
chartRepo.ChartRepositoryWireSet,
197194
appStoreDiscover.AppStoreDiscoverWireSet,
198195
chartProvider.AppStoreChartProviderWireSet,
199-
appStoreValues.AppStoreValuesWireSet,
196+
appStoreValues.WireSet,
200197
util2.GetEnvironmentVariables,
201-
appStoreDeployment.AppStoreDeploymentWireSet,
198+
appStoreDeployment.FullModeWireSet,
202199
server.ServerWireSet,
203200
module.ModuleWireSet,
204201
apiToken.ApiTokenWireSet,
@@ -212,6 +209,8 @@ func InitializeApp() (*App, error) {
212209
workflow3.WorkflowWireSet,
213210
imageTagging.WireSet,
214211
devtronResource.DevtronResourceWireSet,
212+
policyGovernance.PolicyGovernanceWireSet,
213+
215214
// -------wireset end ----------
216215
// -------
217216
gitSensor.GetConfig,
@@ -538,19 +537,6 @@ func InitializeApp() (*App, error) {
538537

539538
notifier.NewNotificationConfigBuilderImpl,
540539
wire.Bind(new(notifier.NotificationConfigBuilder), new(*notifier.NotificationConfigBuilderImpl)),
541-
appStoreRestHandler.NewAppStoreStatusTimelineRestHandlerImpl,
542-
wire.Bind(new(appStoreRestHandler.AppStoreStatusTimelineRestHandler), new(*appStoreRestHandler.AppStoreStatusTimelineRestHandlerImpl)),
543-
appStoreRestHandler.NewInstalledAppRestHandlerImpl,
544-
wire.Bind(new(appStoreRestHandler.InstalledAppRestHandler), new(*appStoreRestHandler.InstalledAppRestHandlerImpl)),
545-
FullMode.NewInstalledAppDBExtendedServiceImpl,
546-
wire.Bind(new(FullMode.InstalledAppDBExtendedService), new(*FullMode.InstalledAppDBExtendedServiceImpl)),
547-
resource.NewInstalledAppResourceServiceImpl,
548-
wire.Bind(new(resource.InstalledAppResourceService), new(*resource.InstalledAppResourceServiceImpl)),
549-
deploymentTypeChange.NewInstalledAppDeploymentTypeChangeServiceImpl,
550-
wire.Bind(new(deploymentTypeChange.InstalledAppDeploymentTypeChangeService), new(*deploymentTypeChange.InstalledAppDeploymentTypeChangeServiceImpl)),
551-
552-
appStoreRestHandler.NewAppStoreRouterImpl,
553-
wire.Bind(new(appStoreRestHandler.AppStoreRouter), new(*appStoreRestHandler.AppStoreRouterImpl)),
554540

555541
workflow.NewAppWorkflowRestHandlerImpl,
556542
wire.Bind(new(workflow.AppWorkflowRestHandler), new(*workflow.AppWorkflowRestHandlerImpl)),
@@ -644,30 +630,10 @@ func InitializeApp() (*App, error) {
644630
wire.Bind(new(router.ImageScanRouter), new(*router.ImageScanRouterImpl)),
645631
restHandler.NewImageScanRestHandlerImpl,
646632
wire.Bind(new(restHandler.ImageScanRestHandler), new(*restHandler.ImageScanRestHandlerImpl)),
647-
security.NewImageScanServiceImpl,
648-
wire.Bind(new(security.ImageScanService), new(*security.ImageScanServiceImpl)),
649-
security2.NewImageScanHistoryRepositoryImpl,
650-
wire.Bind(new(security2.ImageScanHistoryRepository), new(*security2.ImageScanHistoryRepositoryImpl)),
651-
security2.NewImageScanResultRepositoryImpl,
652-
wire.Bind(new(security2.ImageScanResultRepository), new(*security2.ImageScanResultRepositoryImpl)),
653-
security2.NewImageScanObjectMetaRepositoryImpl,
654-
wire.Bind(new(security2.ImageScanObjectMetaRepository), new(*security2.ImageScanObjectMetaRepositoryImpl)),
655-
security2.NewCveStoreRepositoryImpl,
656-
wire.Bind(new(security2.CveStoreRepository), new(*security2.CveStoreRepositoryImpl)),
657-
security2.NewImageScanDeployInfoRepositoryImpl,
658-
wire.Bind(new(security2.ImageScanDeployInfoRepository), new(*security2.ImageScanDeployInfoRepositoryImpl)),
659-
security2.NewScanToolMetadataRepositoryImpl,
660-
wire.Bind(new(security2.ScanToolMetadataRepository), new(*security2.ScanToolMetadataRepositoryImpl)),
661633
router.NewPolicyRouterImpl,
662634
wire.Bind(new(router.PolicyRouter), new(*router.PolicyRouterImpl)),
663635
restHandler.NewPolicyRestHandlerImpl,
664636
wire.Bind(new(restHandler.PolicyRestHandler), new(*restHandler.PolicyRestHandlerImpl)),
665-
security.NewPolicyServiceImpl,
666-
wire.Bind(new(security.PolicyService), new(*security.PolicyServiceImpl)),
667-
security2.NewPolicyRepositoryImpl,
668-
wire.Bind(new(security2.CvePolicyRepository), new(*security2.CvePolicyRepositoryImpl)),
669-
security2.NewScanToolExecutionHistoryMappingRepositoryImpl,
670-
wire.Bind(new(security2.ScanToolExecutionHistoryMappingRepository), new(*security2.ScanToolExecutionHistoryMappingRepositoryImpl)),
671637

672638
argocdServer.NewArgoK8sClientImpl,
673639
wire.Bind(new(argocdServer.ArgoK8sClient), new(*argocdServer.ArgoK8sClientImpl)),
@@ -702,10 +668,10 @@ func InitializeApp() (*App, error) {
702668
scopedVariable.NewScopedVariableRestHandlerImpl,
703669
wire.Bind(new(scopedVariable.ScopedVariableRestHandler), new(*scopedVariable.ScopedVariableRestHandlerImpl)),
704670

705-
router.NewDeploymentConfigurationRouter,
706-
wire.Bind(new(router.DeploymentConfigurationRouter), new(*router.DeploymentConfigurationRouterImpl)),
707-
restHandler.NewDeploymentConfigurationRestHandlerImpl,
708-
wire.Bind(new(restHandler.DeploymentConfigurationRestHandler), new(*restHandler.DeploymentConfigurationRestHandlerImpl)),
671+
configDiff3.NewDeploymentConfigurationRouter,
672+
wire.Bind(new(configDiff3.DeploymentConfigurationRouter), new(*configDiff3.DeploymentConfigurationRouterImpl)),
673+
configDiff2.NewDeploymentConfigurationRestHandlerImpl,
674+
wire.Bind(new(configDiff2.DeploymentConfigurationRestHandler), new(*configDiff2.DeploymentConfigurationRestHandlerImpl)),
709675
configDiff.NewDeploymentConfigurationServiceImpl,
710676
wire.Bind(new(configDiff.DeploymentConfigurationService), new(*configDiff.DeploymentConfigurationServiceImpl)),
711677

@@ -816,12 +782,7 @@ func InitializeApp() (*App, error) {
816782
// history ends
817783

818784
// plugin starts
819-
repository6.NewGlobalPluginRepository,
820-
wire.Bind(new(repository6.GlobalPluginRepository), new(*repository6.GlobalPluginRepositoryImpl)),
821-
822-
plugin.NewGlobalPluginService,
823-
wire.Bind(new(plugin.GlobalPluginService), new(*plugin.GlobalPluginServiceImpl)),
824-
785+
plugin.WireSet,
825786
restHandler.NewGlobalPluginRestHandler,
826787
wire.Bind(new(restHandler.GlobalPluginRestHandler), new(*restHandler.GlobalPluginRestHandlerImpl)),
827788

@@ -975,7 +936,7 @@ func InitializeApp() (*App, error) {
975936
certificate.NewServiceClientImpl,
976937
wire.Bind(new(certificate.Client), new(*certificate.ServiceClientImpl)),
977938

978-
appStoreRestHandler.AppStoreWireSet,
939+
appStoreRestHandler.FullModeWireSet,
979940

980941
cel.NewCELServiceImpl,
981942
wire.Bind(new(cel.EvaluatorService), new(*cel.EvaluatorServiceImpl)),

api/appStore/deployment/wire_appStoreDeployment.go

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,19 @@ package appStoreDeployment
1919
import (
2020
"github.com/devtron-labs/devtron/client/argocdServer"
2121
"github.com/devtron-labs/devtron/internal/util"
22+
installedAppReader "github.com/devtron-labs/devtron/pkg/appStore/installedApp/read"
2223
repository3 "github.com/devtron-labs/devtron/pkg/appStore/installedApp/repository"
2324
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/service"
2425
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/EAMode"
2526
deployment2 "github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/EAMode/deployment"
27+
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/FullMode"
28+
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/FullMode/deploymentTypeChange"
29+
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/FullMode/resource"
2630
appStoreDeploymentCommon "github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/common"
2731
"github.com/google/wire"
2832
)
2933

30-
var AppStoreDeploymentWireSet = wire.NewSet(
34+
var EAModeWireSet = wire.NewSet(
3135
//util.GetDeploymentServiceTypeConfig,
3236
util.NewChartTemplateServiceImpl,
3337
wire.Bind(new(util.ChartTemplateService), new(*util.ChartTemplateServiceImpl)),
@@ -54,4 +58,22 @@ var AppStoreDeploymentWireSet = wire.NewSet(
5458

5559
EAMode.NewInstalledAppDBServiceImpl,
5660
wire.Bind(new(EAMode.InstalledAppDBService), new(*EAMode.InstalledAppDBServiceImpl)),
61+
62+
installedAppReader.EAWireSet,
63+
)
64+
65+
var FullModeWireSet = wire.NewSet(
66+
67+
EAModeWireSet,
68+
69+
FullMode.NewInstalledAppDBExtendedServiceImpl,
70+
wire.Bind(new(FullMode.InstalledAppDBExtendedService), new(*FullMode.InstalledAppDBExtendedServiceImpl)),
71+
72+
resource.NewInstalledAppResourceServiceImpl,
73+
wire.Bind(new(resource.InstalledAppResourceService), new(*resource.InstalledAppResourceServiceImpl)),
74+
75+
deploymentTypeChange.NewInstalledAppDeploymentTypeChangeServiceImpl,
76+
wire.Bind(new(deploymentTypeChange.InstalledAppDeploymentTypeChangeService), new(*deploymentTypeChange.InstalledAppDeploymentTypeChangeServiceImpl)),
77+
78+
installedAppReader.WireSet,
5779
)

api/appStore/values/wire_appStoreValues.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/google/wire"
2424
)
2525

26-
var AppStoreValuesWireSet = wire.NewSet(
26+
var WireSet = wire.NewSet(
2727
NewAppStoreValuesRouterImpl,
2828
wire.Bind(new(AppStoreValuesRouter), new(*AppStoreValuesRouterImpl)),
2929
NewAppStoreValuesRestHandlerImpl,

api/appStore/wire_appStoreWireSet.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,24 @@ import (
2121
"github.com/google/wire"
2222
)
2323

24-
var AppStoreWireSet = wire.NewSet(
24+
var EAModeWireSet = wire.NewSet(
2525

2626
service.NewDeletePostProcessorImpl,
2727
wire.Bind(new(service.DeletePostProcessor), new(*service.DeletePostProcessorImpl)),
2828

2929
service.NewAppAppStoreValidatorImpl,
3030
wire.Bind(new(service.AppStoreValidator), new(*service.AppStoreValidatorImpl)),
3131
)
32+
33+
var FullModeWireSet = wire.NewSet(
34+
EAModeWireSet,
35+
36+
NewAppStoreStatusTimelineRestHandlerImpl,
37+
wire.Bind(new(AppStoreStatusTimelineRestHandler), new(*AppStoreStatusTimelineRestHandlerImpl)),
38+
39+
NewInstalledAppRestHandlerImpl,
40+
wire.Bind(new(InstalledAppRestHandler), new(*InstalledAppRestHandlerImpl)),
41+
42+
NewAppStoreRouterImpl,
43+
wire.Bind(new(AppStoreRouter), new(*AppStoreRouterImpl)),
44+
)

api/bean/ConfigMapAndSecret.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package bean
1919
import (
2020
"encoding/json"
2121
"github.com/devtron-labs/devtron/util"
22+
"github.com/devtron-labs/devtron/util/sliceUtil"
2223
)
2324

2425
type ConfigMapRootJson struct {
@@ -64,11 +65,11 @@ func (configSecret ConfigSecretMap) GetDataMap() (map[string]string, error) {
6465
return datamap, err
6566
}
6667
func (configSecretJson ConfigSecretJson) GetDereferencedSecrets() []ConfigSecretMap {
67-
return util.GetDeReferencedArray(configSecretJson.Secrets)
68+
return sliceUtil.GetDeReferencedSlice(configSecretJson.Secrets)
6869
}
6970

7071
func (configSecretJson *ConfigSecretJson) SetReferencedSecrets(secrets []ConfigSecretMap) {
71-
configSecretJson.Secrets = util.GetReferencedArray(secrets)
72+
configSecretJson.Secrets = sliceUtil.GetReferencedSlice(secrets)
7273
}
7374

7475
func GetTransformedDataForSecretRootJsonData(data string, mode util.SecretTransformMode) (string, error) {

api/bean/ValuesOverrideRequest.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ import (
2323
)
2424

2525
type WorkflowType string
26+
27+
func (workflowType WorkflowType) String() string {
28+
return string(workflowType)
29+
}
30+
31+
func NewWorkflowType(workflowType string) WorkflowType {
32+
return WorkflowType(workflowType)
33+
}
34+
2635
type DeploymentConfigurationType string
2736

2837
const (

api/restHandler/BulkUpdateRestHandler.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,13 @@ import (
3232
"github.com/devtron-labs/devtron/client/gitSensor"
3333
"github.com/devtron-labs/devtron/internal/sql/repository/helper"
3434
"github.com/devtron-labs/devtron/internal/sql/repository/pipelineConfig"
35-
"github.com/devtron-labs/devtron/internal/sql/repository/security"
3635
"github.com/devtron-labs/devtron/pkg/appClone"
3736
"github.com/devtron-labs/devtron/pkg/appWorkflow"
3837
"github.com/devtron-labs/devtron/pkg/auth/authorisation/casbin"
3938
"github.com/devtron-labs/devtron/pkg/auth/user"
4039
"github.com/devtron-labs/devtron/pkg/bulkAction"
4140
"github.com/devtron-labs/devtron/pkg/chart"
4241
"github.com/devtron-labs/devtron/pkg/pipeline"
43-
security2 "github.com/devtron-labs/devtron/pkg/security"
4442
"github.com/devtron-labs/devtron/pkg/team"
4543
"github.com/devtron-labs/devtron/util/argo"
4644
"github.com/devtron-labs/devtron/util/rbac"
@@ -84,8 +82,6 @@ type BulkUpdateRestHandlerImpl struct {
8482
cdHandelr pipeline.CdHandler
8583
appCloneService appClone.AppCloneService
8684
materialRepository repository.MaterialRepository
87-
policyService security2.PolicyService
88-
scanResultRepository security.ImageScanResultRepository
8985
argoUserService argo.ArgoUserService
9086
}
9187

@@ -106,8 +102,7 @@ func NewBulkUpdateRestHandlerImpl(pipelineBuilder pipeline.PipelineBuilder, logg
106102
cdHandelr pipeline.CdHandler,
107103
appCloneService appClone.AppCloneService,
108104
appWorkflowService appWorkflow.AppWorkflowService,
109-
materialRepository repository.MaterialRepository, policyService security2.PolicyService,
110-
scanResultRepository security.ImageScanResultRepository,
105+
materialRepository repository.MaterialRepository,
111106
argoUserService argo.ArgoUserService) *BulkUpdateRestHandlerImpl {
112107
return &BulkUpdateRestHandlerImpl{
113108
pipelineBuilder: pipelineBuilder,
@@ -132,8 +127,6 @@ func NewBulkUpdateRestHandlerImpl(pipelineBuilder pipeline.PipelineBuilder, logg
132127
appCloneService: appCloneService,
133128
appWorkflowService: appWorkflowService,
134129
materialRepository: materialRepository,
135-
policyService: policyService,
136-
scanResultRepository: scanResultRepository,
137130
argoUserService: argoUserService,
138131
}
139132
}

api/restHandler/CoreAppRestHandler.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,8 +1871,22 @@ func (handler CoreAppRestHandlerImpl) createEnvDeploymentTemplate(appId int, use
18711871
appMetrics = *envConfigProperties.AppMetrics
18721872
}
18731873
chartEntry.GlobalOverride = string(envConfigProperties.EnvOverrideValues)
1874-
_, updatedAppMetrics, err := handler.propertiesConfigService.CreateIfRequired(chartEntry, envId, userId, envConfigProperties.ManualReviewed, models.CHARTSTATUS_SUCCESS,
1875-
true, appMetrics, envConfigProperties.Namespace, envConfigProperties.IsBasicViewLocked, envConfigProperties.CurrentViewEditor, nil)
1874+
1875+
overrideCreateRequest := &bean2.EnvironmentOverrideCreateInternalDTO{
1876+
Chart: chartEntry,
1877+
EnvironmentId: envConfigProperties.EnvironmentId,
1878+
UserId: envConfigProperties.UserId,
1879+
ManualReviewed: envConfigProperties.ManualReviewed,
1880+
ChartStatus: models.CHARTSTATUS_SUCCESS,
1881+
IsOverride: true,
1882+
IsAppMetricsEnabled: appMetrics,
1883+
IsBasicViewLocked: envConfigProperties.IsBasicViewLocked,
1884+
Namespace: envConfigProperties.Namespace,
1885+
CurrentViewEditor: envConfigProperties.CurrentViewEditor,
1886+
MergeStrategy: envConfigProperties.MergeStrategy,
1887+
}
1888+
1889+
_, updatedAppMetrics, err := handler.propertiesConfigService.CreateIfRequired(overrideCreateRequest, nil)
18761890
if err != nil {
18771891
handler.logger.Errorw("service err, CreateIfRequired", "err", err, "appId", appId, "envId", envId, "chartRefId", chartRefId)
18781892
return err

0 commit comments

Comments
 (0)