Skip to content

Commit 90c6c1a

Browse files
Ash-expkartik-579nishant-dnishant
authored
chore: AppStore Refactoring v3 (#4621)
* removed registerInArgo multiple impls * extracted app metrics code * migrated envLevel app metrics code to new service * chore: Removed unused jira and migration integration (#4498) * removed unsued jira integration * removed test-suite-code * db migration conf removal * chore: removed unused injection * chore: removed dead code * added: migration script --------- Co-authored-by: Ash-exp <[email protected]> * chore: App store dead code cleanup and restructuring (#4497) * moved chart-group in seperate code * removed unused dependency * removed dead code * extracted resource tree * moved notes * resource movement * removed unused code * removed unused dependency * commit methods * extracted status update * chore: clean up unused dead code * updated: EA mode docker file * updated: migration number --------- Co-authored-by: Ash-exp <[email protected]> * chart ref refactoring * removed infra metrics db calls * moved app metrics repositories from /internal to /pkg * moved: const and types to bean * removed: unused const * review comments * migrated some methods from chartService to chartRefService * added dt validation service interface * minor refactoring * moved validation method - 1 * wip * removed redundant appMetrics req obj * moved app metrics bindings to wireset * removed multiple dead code * remove redundant dependency * moved ChartGroup router and rest handler to respective folder * stage 1 * gitOps refactoring * moved gitClient code to a common wrapper service * chore: AppStoreDeployment Install flow refactoring * review changes * wip * fix for unsupported charts * refactoring: App Store deployment services * minor cleanup * renamed remote package to git * renamed gitOpsRemoteOpService If and impl * migrated usages of gitService to gitOperationService * shifted git service and all gitOps clients to pkg * gitops repository usages refactor * refactored gitOpsRepository usages * gitlab client creation refactoring * renamed util/ChartService * reverted renaming changes * reverted renaming changes * reverted renaming changes * wip * wip * removed typo * changes * changes * chore: App store services refactoring (#4596) * chore: fixed test file * chore: app store deployment services refactoring * updated todo * chore: dead code removal and app router & rest handler restructuring (#4595) (#4608) * prom code removal * removed test suites * chore: removed support for unused Prometheus and ArgoCd APIs * chore: app router and rest handler restructuring * removed redundant routings * fixed: sub path * Updated alias and added queries to AppList group router --------- Co-authored-by: nishant <[email protected]> * chore: sanity after ent sync * added: todo comment * added: todo comment * chore: fixed gitops auto fix operations in upgrade helm charts * added: nit pointer issue for argocd resource tree * fixed: nil poniter issue for gitops in upgrade deployment * removed: comments --------- Co-authored-by: kartik-579 <[email protected]> Co-authored-by: Nishant <[email protected]> Co-authored-by: nishant <[email protected]>
1 parent 3fbf0f4 commit 90c6c1a

File tree

109 files changed

+3888
-6297
lines changed

Some content is hidden

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

109 files changed

+3888
-6297
lines changed

Wire.go

Lines changed: 69 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,26 @@ import (
4444
"github.com/devtron-labs/devtron/api/k8s"
4545
"github.com/devtron-labs/devtron/api/module"
4646
"github.com/devtron-labs/devtron/api/restHandler"
47-
pipeline2 "github.com/devtron-labs/devtron/api/restHandler/app"
47+
"github.com/devtron-labs/devtron/api/restHandler/app/appInfo"
48+
appList2 "github.com/devtron-labs/devtron/api/restHandler/app/appList"
49+
pipeline3 "github.com/devtron-labs/devtron/api/restHandler/app/pipeline"
50+
pipeline2 "github.com/devtron-labs/devtron/api/restHandler/app/pipeline/configure"
51+
"github.com/devtron-labs/devtron/api/restHandler/app/pipeline/history"
52+
status2 "github.com/devtron-labs/devtron/api/restHandler/app/pipeline/status"
53+
"github.com/devtron-labs/devtron/api/restHandler/app/pipeline/trigger"
54+
"github.com/devtron-labs/devtron/api/restHandler/app/pipeline/webhook"
55+
"github.com/devtron-labs/devtron/api/restHandler/app/workflow"
4856
"github.com/devtron-labs/devtron/api/restHandler/scopedVariable"
4957
"github.com/devtron-labs/devtron/api/router"
58+
app3 "github.com/devtron-labs/devtron/api/router/app"
59+
appInfo2 "github.com/devtron-labs/devtron/api/router/app/appInfo"
60+
"github.com/devtron-labs/devtron/api/router/app/appList"
61+
pipeline5 "github.com/devtron-labs/devtron/api/router/app/pipeline"
62+
pipeline4 "github.com/devtron-labs/devtron/api/router/app/pipeline/configure"
63+
history2 "github.com/devtron-labs/devtron/api/router/app/pipeline/history"
64+
status3 "github.com/devtron-labs/devtron/api/router/app/pipeline/status"
65+
trigger2 "github.com/devtron-labs/devtron/api/router/app/pipeline/trigger"
66+
workflow2 "github.com/devtron-labs/devtron/api/router/app/workflow"
5067
"github.com/devtron-labs/devtron/api/router/pubsub"
5168
"github.com/devtron-labs/devtron/api/server"
5269
"github.com/devtron-labs/devtron/api/sse"
@@ -81,16 +98,16 @@ import (
8198
resourceGroup "github.com/devtron-labs/devtron/internal/sql/repository/resourceGroup"
8299
security2 "github.com/devtron-labs/devtron/internal/sql/repository/security"
83100
"github.com/devtron-labs/devtron/internal/util"
84-
"github.com/devtron-labs/devtron/internal/util/ArgoUtil"
85101
"github.com/devtron-labs/devtron/pkg/app"
86102
"github.com/devtron-labs/devtron/pkg/app/status"
87103
"github.com/devtron-labs/devtron/pkg/appClone"
88104
"github.com/devtron-labs/devtron/pkg/appClone/batch"
89105
"github.com/devtron-labs/devtron/pkg/appStatus"
90106
"github.com/devtron-labs/devtron/pkg/appStore/chartGroup"
91107
repository4 "github.com/devtron-labs/devtron/pkg/appStore/chartGroup/repository"
92-
"github.com/devtron-labs/devtron/pkg/appStore/deployment/service"
93-
appStoreDeploymentGitopsTool "github.com/devtron-labs/devtron/pkg/appStore/deployment/tool"
108+
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/FullMode"
109+
deployment3 "github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/FullMode/deployment"
110+
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/FullMode/resource"
94111
"github.com/devtron-labs/devtron/pkg/appWorkflow"
95112
"github.com/devtron-labs/devtron/pkg/attributes"
96113
"github.com/devtron-labs/devtron/pkg/bulkAction"
@@ -183,8 +200,8 @@ func InitializeApp() (*App, error) {
183200
wire.Bind(new(session2.ServiceClient), new(*middleware.LoginService)),
184201

185202
sse.NewSSE,
186-
router.NewPipelineTriggerRouter,
187-
wire.Bind(new(router.PipelineTriggerRouter), new(*router.PipelineTriggerRouterImpl)),
203+
trigger2.NewPipelineTriggerRouter,
204+
wire.Bind(new(trigger2.PipelineTriggerRouter), new(*trigger2.PipelineTriggerRouterImpl)),
188205

189206
//---- pprof start ----
190207
restHandler.NewPProfRestHandler,
@@ -194,8 +211,8 @@ func InitializeApp() (*App, error) {
194211
wire.Bind(new(router.PProfRouter), new(*router.PProfRouterImpl)),
195212
//---- pprof end ----
196213

197-
restHandler.NewPipelineRestHandler,
198-
wire.Bind(new(restHandler.PipelineTriggerRestHandler), new(*restHandler.PipelineTriggerRestHandlerImpl)),
214+
trigger.NewPipelineRestHandler,
215+
wire.Bind(new(trigger.PipelineTriggerRestHandler), new(*trigger.PipelineTriggerRestHandlerImpl)),
199216
app.GetAppServiceConfig,
200217
app.NewAppService,
201218
wire.Bind(new(app.AppService), new(*app.AppServiceImpl)),
@@ -249,13 +266,25 @@ func InitializeApp() (*App, error) {
249266
wire.Bind(new(pipeline.CdPipelineConfigService), new(*pipeline.CdPipelineConfigServiceImpl)),
250267
pipeline.NewDevtronAppConfigServiceImpl,
251268
wire.Bind(new(pipeline.DevtronAppConfigService), new(*pipeline.DevtronAppConfigServiceImpl)),
269+
pipeline3.NewDevtronAppAutoCompleteRestHandlerImpl,
270+
wire.Bind(new(pipeline3.DevtronAppAutoCompleteRestHandler), new(*pipeline3.DevtronAppAutoCompleteRestHandlerImpl)),
252271

253272
util5.NewLoggingMiddlewareImpl,
254273
wire.Bind(new(util5.LoggingMiddleware), new(*util5.LoggingMiddlewareImpl)),
255274
pipeline2.NewPipelineRestHandlerImpl,
256275
wire.Bind(new(pipeline2.PipelineConfigRestHandler), new(*pipeline2.PipelineConfigRestHandlerImpl)),
257-
router.NewPipelineRouterImpl,
258-
wire.Bind(new(router.PipelineConfigRouter), new(*router.PipelineConfigRouterImpl)),
276+
277+
pipeline4.NewPipelineRouterImpl,
278+
wire.Bind(new(pipeline4.PipelineConfigRouter), new(*pipeline4.PipelineConfigRouterImpl)),
279+
history2.NewPipelineHistoryRouterImpl,
280+
wire.Bind(new(history2.PipelineHistoryRouter), new(*history2.PipelineHistoryRouterImpl)),
281+
status3.NewPipelineStatusRouterImpl,
282+
wire.Bind(new(status3.PipelineStatusRouter), new(*status3.PipelineStatusRouterImpl)),
283+
pipeline5.NewDevtronAppAutoCompleteRouterImpl,
284+
wire.Bind(new(pipeline5.DevtronAppAutoCompleteRouter), new(*pipeline5.DevtronAppAutoCompleteRouterImpl)),
285+
workflow2.NewAppWorkflowRouterImpl,
286+
wire.Bind(new(workflow2.AppWorkflowRouter), new(*workflow2.AppWorkflowRouterImpl)),
287+
259288
pipeline.NewCiCdPipelineOrchestrator,
260289
wire.Bind(new(pipeline.CiCdPipelineOrchestrator), new(*pipeline.CiCdPipelineOrchestratorImpl)),
261290
pipelineConfig.NewMaterialRepositoryImpl,
@@ -304,10 +333,15 @@ func InitializeApp() (*App, error) {
304333
pipeline.NewGitRegistryConfigImpl,
305334
wire.Bind(new(pipeline.GitRegistryConfig), new(*pipeline.GitRegistryConfigImpl)),
306335

307-
router.NewAppListingRouterImpl,
308-
wire.Bind(new(router.AppListingRouter), new(*router.AppListingRouterImpl)),
309-
restHandler.NewAppListingRestHandlerImpl,
310-
wire.Bind(new(restHandler.AppListingRestHandler), new(*restHandler.AppListingRestHandlerImpl)),
336+
appList.NewAppFilteringRouterImpl,
337+
wire.Bind(new(appList.AppFilteringRouter), new(*appList.AppFilteringRouterImpl)),
338+
appList2.NewAppFilteringRestHandlerImpl,
339+
wire.Bind(new(appList2.AppFilteringRestHandler), new(*appList2.AppFilteringRestHandlerImpl)),
340+
341+
appList.NewAppListingRouterImpl,
342+
wire.Bind(new(appList.AppListingRouter), new(*appList.AppListingRouterImpl)),
343+
appList2.NewAppListingRestHandlerImpl,
344+
wire.Bind(new(appList2.AppListingRestHandler), new(*appList2.AppListingRestHandlerImpl)),
311345
app.NewAppListingServiceImpl,
312346
wire.Bind(new(app.AppListingService), new(*app.AppListingServiceImpl)),
313347
repository.NewAppListingRepositoryImpl,
@@ -357,28 +391,9 @@ func InitializeApp() (*App, error) {
357391
repository2.NewServiceClientImpl,
358392
wire.Bind(new(repository2.ServiceClient), new(*repository2.ServiceClientImpl)),
359393
wire.Bind(new(connector.Pump), new(*connector.PumpImpl)),
360-
restHandler.NewArgoApplicationRestHandlerImpl,
361-
wire.Bind(new(restHandler.ArgoApplicationRestHandler), new(*restHandler.ArgoApplicationRestHandlerImpl)),
362-
router.NewApplicationRouterImpl,
363-
wire.Bind(new(router.ApplicationRouter), new(*router.ApplicationRouterImpl)),
394+
364395
//app.GetConfig,
365396

366-
router.NewCDRouterImpl,
367-
wire.Bind(new(router.CDRouter), new(*router.CDRouterImpl)),
368-
restHandler.NewCDRestHandlerImpl,
369-
wire.Bind(new(restHandler.CDRestHandler), new(*restHandler.CDRestHandlerImpl)),
370-
371-
ArgoUtil.GetArgoConfig,
372-
ArgoUtil.NewArgoSession,
373-
ArgoUtil.NewResourceServiceImpl,
374-
wire.Bind(new(ArgoUtil.ResourceService), new(*ArgoUtil.ResourceServiceImpl)),
375-
//ArgoUtil.NewApplicationServiceImpl,
376-
//wire.Bind(new(ArgoUtil.ApplicationService), new(ArgoUtil.ApplicationServiceImpl)),
377-
//ArgoUtil.NewRepositoryService,
378-
//wire.Bind(new(ArgoUtil.RepositoryService), new(ArgoUtil.RepositoryServiceImpl)),
379-
380-
//ArgoUtil.NewClusterServiceImpl,
381-
//wire.Bind(new(ArgoUtil.ClusterService), new(ArgoUtil.ClusterServiceImpl)),
382397
pipeline.GetEcrConfig,
383398
//otel.NewOtelTracingServiceImpl,
384399
//wire.Bind(new(otel.OtelTracingService), new(*otel.OtelTracingServiceImpl)),
@@ -504,14 +519,16 @@ func InitializeApp() (*App, error) {
504519
wire.Bind(new(appStoreRestHandler.AppStoreStatusTimelineRestHandler), new(*appStoreRestHandler.AppStoreStatusTimelineRestHandlerImpl)),
505520
appStoreRestHandler.NewInstalledAppRestHandlerImpl,
506521
wire.Bind(new(appStoreRestHandler.InstalledAppRestHandler), new(*appStoreRestHandler.InstalledAppRestHandlerImpl)),
507-
service.NewInstalledAppServiceImpl,
508-
wire.Bind(new(service.InstalledAppService), new(*service.InstalledAppServiceImpl)),
522+
FullMode.NewInstalledAppDBExtendedServiceImpl,
523+
wire.Bind(new(FullMode.InstalledAppDBExtendedService), new(*FullMode.InstalledAppDBExtendedServiceImpl)),
524+
resource.NewInstalledAppResourceServiceImpl,
525+
wire.Bind(new(resource.InstalledAppResourceService), new(*resource.InstalledAppResourceServiceImpl)),
509526

510527
appStoreRestHandler.NewAppStoreRouterImpl,
511528
wire.Bind(new(appStoreRestHandler.AppStoreRouter), new(*appStoreRestHandler.AppStoreRouterImpl)),
512529

513-
restHandler.NewAppWorkflowRestHandlerImpl,
514-
wire.Bind(new(restHandler.AppWorkflowRestHandler), new(*restHandler.AppWorkflowRestHandlerImpl)),
530+
workflow.NewAppWorkflowRestHandlerImpl,
531+
wire.Bind(new(workflow.AppWorkflowRestHandler), new(*workflow.AppWorkflowRestHandlerImpl)),
515532

516533
appWorkflow.NewAppWorkflowServiceImpl,
517534
wire.Bind(new(appWorkflow.AppWorkflowService), new(*appWorkflow.AppWorkflowServiceImpl)),
@@ -701,13 +718,15 @@ func InitializeApp() (*App, error) {
701718
wire.Bind(new(repository.WebhookEventDataRepository), new(*repository.WebhookEventDataRepositoryImpl)),
702719
pipeline.NewWebhookEventDataConfigImpl,
703720
wire.Bind(new(pipeline.WebhookEventDataConfig), new(*pipeline.WebhookEventDataConfigImpl)),
704-
restHandler.NewWebhookDataRestHandlerImpl,
705-
wire.Bind(new(restHandler.WebhookDataRestHandler), new(*restHandler.WebhookDataRestHandlerImpl)),
721+
webhook.NewWebhookDataRestHandlerImpl,
722+
wire.Bind(new(webhook.WebhookDataRestHandler), new(*webhook.WebhookDataRestHandlerImpl)),
706723

707-
router.NewAppRouterImpl,
708-
wire.Bind(new(router.AppRouter), new(*router.AppRouterImpl)),
709-
restHandler.NewAppRestHandlerImpl,
710-
wire.Bind(new(restHandler.AppRestHandler), new(*restHandler.AppRestHandlerImpl)),
724+
app3.NewAppRouterImpl,
725+
wire.Bind(new(app3.AppRouter), new(*app3.AppRouterImpl)),
726+
appInfo2.NewAppInfoRouterImpl,
727+
wire.Bind(new(appInfo2.AppInfoRouter), new(*appInfo2.AppInfoRouterImpl)),
728+
appInfo.NewAppInfoRestHandlerImpl,
729+
wire.Bind(new(appInfo.AppInfoRestHandler), new(*appInfo.AppInfoRestHandlerImpl)),
711730

712731
app.NewAppCrudOperationServiceImpl,
713732
wire.Bind(new(app.AppCrudOperationService), new(*app.AppCrudOperationServiceImpl)),
@@ -719,13 +738,13 @@ func InitializeApp() (*App, error) {
719738
delete2.NewDeleteServiceFullModeImpl,
720739
wire.Bind(new(delete2.DeleteServiceFullMode), new(*delete2.DeleteServiceFullModeImpl)),
721740

722-
appStoreDeploymentGitopsTool.NewAppStoreDeploymentArgoCdServiceImpl,
723-
wire.Bind(new(appStoreDeploymentGitopsTool.AppStoreDeploymentArgoCdService), new(*appStoreDeploymentGitopsTool.AppStoreDeploymentArgoCdServiceImpl)),
741+
deployment3.NewFullModeDeploymentServiceImpl,
742+
wire.Bind(new(deployment3.FullModeDeploymentService), new(*deployment3.FullModeDeploymentServiceImpl)),
724743
// util2.NewGoJsonSchemaCustomFormatChecker,
725744

726745
//history starts
727-
restHandler.NewPipelineHistoryRestHandlerImpl,
728-
wire.Bind(new(restHandler.PipelineHistoryRestHandler), new(*restHandler.PipelineHistoryRestHandlerImpl)),
746+
history.NewPipelineHistoryRestHandlerImpl,
747+
wire.Bind(new(history.PipelineHistoryRestHandler), new(*history.PipelineHistoryRestHandlerImpl)),
729748

730749
repository3.NewConfigMapHistoryRepositoryImpl,
731750
wire.Bind(new(repository3.ConfigMapHistoryRepository), new(*repository3.ConfigMapHistoryRepositoryImpl)),
@@ -814,8 +833,8 @@ func InitializeApp() (*App, error) {
814833
cron.NewCiTriggerCronImpl,
815834
wire.Bind(new(cron.CiTriggerCron), new(*cron.CiTriggerCronImpl)),
816835

817-
restHandler.NewPipelineStatusTimelineRestHandlerImpl,
818-
wire.Bind(new(restHandler.PipelineStatusTimelineRestHandler), new(*restHandler.PipelineStatusTimelineRestHandlerImpl)),
836+
status2.NewPipelineStatusTimelineRestHandlerImpl,
837+
wire.Bind(new(status2.PipelineStatusTimelineRestHandler), new(*status2.PipelineStatusTimelineRestHandlerImpl)),
819838

820839
status.NewPipelineStatusTimelineServiceImpl,
821840
wire.Bind(new(status.PipelineStatusTimelineService), new(*status.PipelineStatusTimelineServiceImpl)),

0 commit comments

Comments
 (0)