Skip to content

Commit f48266b

Browse files
Merge branch 'main' into guided-onboarding-user-metadata
2 parents 54f9abb + 69a9661 commit f48266b

File tree

134 files changed

+11859
-2080
lines changed

Some content is hidden

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

134 files changed

+11859
-2080
lines changed

.gitbook.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,71 @@
11
root: ./docs/
22

3+
redirects:
4+
setup: README.md
5+
setup/install: setup/install/README.md
6+
setup/install/install-devtron-with-cicd: getting-started/install/install-devtron-with-cicd
7+
setup/install/install-devtron: getting-started/install/install-devtron
8+
setup/install/installation-configuration: getting-started/install/installation-configuration
9+
setup/install/override-default-devtron-installation-configs: getting-started/install/override-default-devtron-installation-configs
10+
setup/install/ingress-setup: getting-started/install/ingress-setup
11+
setup/upgrade: setup/upgrade/README.md
12+
setup/upgrade/upgrade-devtron-ui: getting-started/upgrade/upgrade-devtron-ui
13+
setup/upgrade/devtron-upgrade-0.4.x-0.4.x: getting-started/upgrade/devtron-upgrade-0.4.x-0.4.x
14+
setup/upgrade/devtron-upgrade-0.3.x-0.4.x: getting-started/upgrade/devtron-upgrade-0.3.x-0.4.x
15+
setup/upgrade/devtron-upgrade-0.3.x-0.3.x: getting-started/upgrade/devtron-upgrade-0.3.x-0.3.x
16+
setup/upgrade/devtron-upgrade-0.2.x-0.3.x: getting-started/upgrade/devtron-upgrade-0.2.x-0.3.x
17+
setup/global-configurations: user-guide/global-configurations/README.md
18+
setup/global-configurations/gitops: user-guide/global-configurations/gitops.md
19+
setup/global-configurations/custom-charts: user-guide/global-configurations/custom-charts.md
20+
setup/global-configurations/user-access: user-guide/global-configurations/authorization/user-access.md
21+
setup/global-configurations/external-links: user-guide/global-configurations/external-links.md
22+
setup/global-configurations/projects: user-guide/global-configurations/projects.md
23+
setup/global-configurations/manage-notification: user-guide/global-configurations/manage-notification.md
24+
setup/global-configurations/sso-login: user-guide/global-configurations/sso-login.md
25+
setup/global-configurations/git-accounts: user-guide/global-configurations/git-accounts.md
26+
setup/global-configurations/docker-registries: user-guide/global-configurations/docker-registries.md
27+
setup/global-configurations/chart-repo: user-guide/global-configurations/chart-repo.md
28+
setup/global-configurations/cluster-and-environments: user-guide/global-configurations/cluster-and-environments.md
29+
setup/global-configurations/authorization: user-guide/global-configurations/authorization/README.md
30+
setup/global-configurations/authorization/user-access: user-guide/global-configurations/authorization/user-access.md
31+
setup/global-configurations/authorization/permission-groups: user-guide/global-configurations/authorization/permission-groups.md
32+
setup/global-configurations/authorization/api-tokens: user-guide/global-configurations/authorization/api-tokens.md
33+
setup/global-configurations/nodejs_app: user-guide/Deploy-sample-app/nodejs_app.md
34+
user-guide/creating-application: user-guide/applications.md
35+
user-guide/creating-application/git-material: usage/applications/creating-application/git-material
36+
user-guide/creating-application/docker-build-configuration: usage/applications/creating-application/docker-build-configuration
37+
user-guide/creating-application/deployment-template: usage/applications/creating-application/deployment-template
38+
user-guide/creating-application/deployment-template/rollout-deployment: usage/applications/creating-application/deployment-template/rollout-deployment
39+
user-guide/creating-application/deployment-template/job-and-cronjob: usage/applications/creating-application/deployment-template/job-and-cronjob
40+
user-guide/creating-application/workflow: usage/applications/creating-application/workflow
41+
user-guide/creating-application/workflow/ci-pipeline: usage/applications/creating-application/ci-pipeline
42+
user-guide/creating-application/workflow/ci-pipeline/ci-build-pre-post-plugins: usage/applications/creating-application/ci-pipeline/ci-build-pre-post-plugins
43+
user-guide/creating-application/workflow/ci-pipeline-legacy: usage/applications/creating-application/ci-pipeline-legacy
44+
user-guide/creating-application/workflow/cd-pipeline: usage/applications/creating-application/cd-pipeline
45+
user-guide/creating-application/config-maps: usage/applications/creating-application/config-maps
46+
user-guide/creating-application/secrets: usage/applications/creating-application/secrets
47+
user-guide/creating-application/environment-overrides: usage/applications/creating-application/environment-overrides
48+
user-guide/creating-application/app-metrics: usage/applications/app-details/app-metrics
49+
user-guide/app-details: usage/applications/app-details
50+
user-guide/debugging-deployment-and-monitoring: usage/applications/app-details/debugging-deployment-and-monitoring
51+
user-guide/cloning-application: usage/applications/cloning-application
52+
user-guide/deploying-application: usage/applications/deploying-application
53+
user-guide/deploying-application/triggering-ci: usage/applications/deploying-application/triggering-ci
54+
user-guide/deploying-application/triggering-cd: usage/applications/deploying-application/triggering-cd
55+
user-guide/deploy-chart: user-guide/deploy-chart/README.md
56+
user-guide/deploy-chart/overview-of-charts: usage/deploy-chart/overview-of-charts
57+
user-guide/deploy-chart/deployment-of-charts: usage/deploy-chart/deployment-of-charts
58+
user-guide/deploy-chart/examples: usage/deploy-chart/examples
59+
user-guide/deploy-chart/examples/deploying-mysql-helm-chart: usage/deploy-chart/examples/deploying-mysql-helm-chart
60+
user-guide/deploy-chart/examples/deploying-mongodb-helm-chart: usage/deploy-chart/examples/deploying-mongodb-helm-chart
61+
user-guide/deploy-chart/chart-group: usage/deploy-chart/chart-group
62+
user-guide/namespaces-and-environments: getting-started/global-configurations/cluster-and-environments/namespaces-and-environments
63+
user-guide/security-features: usage/security-features
64+
user-guide/deleting-application: usage/applications/creating-application/deleting-application
65+
user-guide/bulk-update: usage/bulk-update
66+
user-guide/use-cases/devtron-generic-helm-chart-to-run-cron-job-or-one-time-job: resources/use-cases/devtron-generic-helm-chart-to-run-cron-job-or-one-time-job
67+
user-guide/use-cases: resources/use-cases
68+
user-guide/use-cases/connect-springboot-with-mysql-database: resources/use-cases/connect-springboot-with-mysql-database
69+
user-guide/use-cases/connect-expressjs-with-mongodb-database: resources/use-cases/connect-expressjs-with-mongodb-database
70+
user-guide/use-cases/connect-django-with-mysql-database: resources/use-cases/connect-django-with-mysql-database
71+
user-guide/telemetry: resources/telemetry

Wire.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ import (
8484
"github.com/devtron-labs/devtron/pkg/commonService"
8585
delete2 "github.com/devtron-labs/devtron/pkg/delete"
8686
"github.com/devtron-labs/devtron/pkg/deploymentGroup"
87-
"github.com/devtron-labs/devtron/pkg/event"
8887
"github.com/devtron-labs/devtron/pkg/git"
8988
"github.com/devtron-labs/devtron/pkg/gitops"
9089
jira2 "github.com/devtron-labs/devtron/pkg/jira"
@@ -403,9 +402,6 @@ func InitializeApp() (*App, error) {
403402
rbac.NewEnforcerUtilImpl,
404403
wire.Bind(new(rbac.EnforcerUtil), new(*rbac.EnforcerUtilImpl)),
405404

406-
repository.NewEventRepositoryImpl,
407-
wire.Bind(new(repository.EventRepository), new(*repository.EventRepositoryImpl)),
408-
409405
app.NewDeploymentFailureHandlerImpl,
410406
wire.Bind(new(app.DeploymentFailureHandler), new(*app.DeploymentFailureHandlerImpl)),
411407
chartConfig.NewPipelineConfigRepository,
@@ -443,12 +439,6 @@ func InitializeApp() (*App, error) {
443439
notifier.NewNotificationConfigBuilderImpl,
444440
wire.Bind(new(notifier.NotificationConfigBuilder), new(*notifier.NotificationConfigBuilderImpl)),
445441

446-
pubsub.NewCronBasedEventReceiverImpl,
447-
wire.Bind(new(pubsub.CronBasedEventReceiver), new(*pubsub.CronBasedEventReceiverImpl)),
448-
449-
event.NewEventServiceImpl,
450-
wire.Bind(new(event.EventService), new(*event.EventServiceImpl)),
451-
452442
appStoreRestHandler.NewInstalledAppRestHandlerImpl,
453443
wire.Bind(new(appStoreRestHandler.InstalledAppRestHandler), new(*appStoreRestHandler.InstalledAppRestHandlerImpl)),
454444
service.NewInstalledAppServiceImpl,
@@ -729,8 +719,15 @@ func InitializeApp() (*App, error) {
729719
wire.Bind(new(argo.ArgoUserService), new(*argo.ArgoUserServiceImpl)),
730720
argo.GetDevtronSecretName,
731721
// AuthWireSet,
732-
cron.NewHelmApplicationStatusUpdateHandlerImpl,
733-
wire.Bind(new(cron.HelmApplicationStatusUpdateHandler), new(*cron.HelmApplicationStatusUpdateHandlerImpl)),
722+
cron.GetAppStatusConfig,
723+
cron.NewCdApplicationStatusUpdateHandlerImpl,
724+
wire.Bind(new(cron.CdApplicationStatusUpdateHandler), new(*cron.CdApplicationStatusUpdateHandlerImpl)),
725+
726+
restHandler.NewPipelineStatusTimelineRestHandlerImpl,
727+
wire.Bind(new(restHandler.PipelineStatusTimelineRestHandler), new(*restHandler.PipelineStatusTimelineRestHandlerImpl)),
728+
729+
app.NewPipelineStatusTimelineServiceImpl,
730+
wire.Bind(new(app.PipelineStatusTimelineService), new(*app.PipelineStatusTimelineServiceImpl)),
734731

735732
router.NewUserAttributesRouterImpl,
736733
wire.Bind(new(router.UserAttributesRouter), new(*router.UserAttributesRouterImpl)),

api/bean/ConfigMapAndSecret.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ type Map struct {
4848
External bool `json:"external"`
4949
MountPath string `json:"mountPath"`
5050
Data json.RawMessage `json:"data,omitempty"`
51+
ESOSecretData json.RawMessage `json:"esoSecretData,omitempty"`
5152
ExternalType string `json:"externalType"`
5253
RoleARN string `json:"roleARN"`
5354
SecretData json.RawMessage `json:"secretData,omitempty"`
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
package restHandler
2+
3+
import (
4+
"fmt"
5+
"github.com/devtron-labs/devtron/api/restHandler/common"
6+
"github.com/devtron-labs/devtron/pkg/app"
7+
"github.com/devtron-labs/devtron/pkg/user/casbin"
8+
"github.com/devtron-labs/devtron/util/rbac"
9+
"github.com/gorilla/mux"
10+
"go.uber.org/zap"
11+
"net/http"
12+
"strconv"
13+
)
14+
15+
type PipelineStatusTimelineRestHandler interface {
16+
FetchTimelines(w http.ResponseWriter, r *http.Request)
17+
}
18+
19+
type PipelineStatusTimelineRestHandlerImpl struct {
20+
logger *zap.SugaredLogger
21+
pipelineStatusTimelineService app.PipelineStatusTimelineService
22+
enforcerUtil rbac.EnforcerUtil
23+
enforcer casbin.Enforcer
24+
}
25+
26+
func NewPipelineStatusTimelineRestHandlerImpl(logger *zap.SugaredLogger,
27+
pipelineStatusTimelineService app.PipelineStatusTimelineService, enforcerUtil rbac.EnforcerUtil,
28+
enforcer casbin.Enforcer) *PipelineStatusTimelineRestHandlerImpl {
29+
return &PipelineStatusTimelineRestHandlerImpl{
30+
logger: logger,
31+
pipelineStatusTimelineService: pipelineStatusTimelineService,
32+
enforcerUtil: enforcerUtil,
33+
enforcer: enforcer,
34+
}
35+
}
36+
37+
func (handler *PipelineStatusTimelineRestHandlerImpl) FetchTimelines(w http.ResponseWriter, r *http.Request) {
38+
vars := mux.Vars(r)
39+
appId, err := strconv.Atoi(vars["appId"])
40+
if err != nil {
41+
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
42+
return
43+
}
44+
envId, err := strconv.Atoi(vars["envId"])
45+
if err != nil {
46+
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
47+
return
48+
}
49+
wfrId := 0
50+
wfrIdParam := r.URL.Query().Get("wfrId")
51+
if len(wfrIdParam) != 0 {
52+
wfrId, err = strconv.Atoi(wfrIdParam)
53+
if err != nil {
54+
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
55+
return
56+
}
57+
}
58+
resourceName := handler.enforcerUtil.GetAppRBACNameByAppId(appId)
59+
token := r.Header.Get("token")
60+
if ok := handler.enforcer.Enforce(token, casbin.ResourceApplications, casbin.ActionGet, resourceName); !ok {
61+
common.WriteJsonResp(w, fmt.Errorf("unauthorized user"), "Unauthorized User", http.StatusForbidden)
62+
return
63+
}
64+
65+
timelines, err := handler.pipelineStatusTimelineService.FetchTimelines(appId, envId, wfrId)
66+
if err != nil {
67+
handler.logger.Errorw("error in getting cd pipeline status timelines by wfrId", "err", err, "wfrId", wfrId)
68+
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
69+
return
70+
}
71+
common.WriteJsonResp(w, err, timelines, http.StatusOK)
72+
return
73+
}

api/router/PipelineConfigRouter.go

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,24 @@ type PipelineConfigRouter interface {
2727
initPipelineConfigRouter(configRouter *mux.Router)
2828
}
2929
type PipelineConfigRouterImpl struct {
30-
restHandler app.PipelineConfigRestHandler
31-
appWorkflowRestHandler restHandler.AppWorkflowRestHandler
32-
webhookDataRestHandler restHandler.WebhookDataRestHandler
33-
pipelineHistoryRestHandler restHandler.PipelineHistoryRestHandler
30+
restHandler app.PipelineConfigRestHandler
31+
appWorkflowRestHandler restHandler.AppWorkflowRestHandler
32+
webhookDataRestHandler restHandler.WebhookDataRestHandler
33+
pipelineHistoryRestHandler restHandler.PipelineHistoryRestHandler
34+
pipelineStatusTimelineRestHandler restHandler.PipelineStatusTimelineRestHandler
3435
}
3536

3637
func NewPipelineRouterImpl(restHandler app.PipelineConfigRestHandler,
3738
appWorkflowRestHandler restHandler.AppWorkflowRestHandler,
3839
webhookDataRestHandler restHandler.WebhookDataRestHandler,
39-
pipelineHistoryRestHandler restHandler.PipelineHistoryRestHandler) *PipelineConfigRouterImpl {
40+
pipelineHistoryRestHandler restHandler.PipelineHistoryRestHandler,
41+
pipelineStatusTimelineRestHandler restHandler.PipelineStatusTimelineRestHandler) *PipelineConfigRouterImpl {
4042
return &PipelineConfigRouterImpl{
41-
restHandler: restHandler,
42-
appWorkflowRestHandler: appWorkflowRestHandler,
43-
webhookDataRestHandler: webhookDataRestHandler,
44-
pipelineHistoryRestHandler: pipelineHistoryRestHandler,
43+
restHandler: restHandler,
44+
appWorkflowRestHandler: appWorkflowRestHandler,
45+
webhookDataRestHandler: webhookDataRestHandler,
46+
pipelineHistoryRestHandler: pipelineHistoryRestHandler,
47+
pipelineStatusTimelineRestHandler: pipelineStatusTimelineRestHandler,
4548
}
4649

4750
}
@@ -162,4 +165,7 @@ func (router PipelineConfigRouterImpl) initPipelineConfigRouter(configRouter *mu
162165
Methods("GET")
163166

164167
configRouter.Path("/commit-info/{ciPipelineMaterialId}/{gitHash}").HandlerFunc(router.restHandler.GetCommitMetadataForPipelineMaterial).Methods("GET")
168+
169+
configRouter.Path("/deployment-status/timeline/{appId}/{envId}").HandlerFunc(router.pipelineStatusTimelineRestHandler.FetchTimelines).Methods("GET")
170+
165171
}

api/router/pubsub/CronBasedEventReceiver.go

Lines changed: 0 additions & 82 deletions
This file was deleted.

api/router/router.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ type MuxRouter struct {
7474
workflowUpdateHandler pubsub.WorkflowStatusUpdateHandler
7575
appUpdateHandler pubsub.ApplicationStatusUpdateHandler
7676
ciEventHandler pubsub.CiEventHandler
77-
cronBasedEventReceiver pubsub.CronBasedEventReceiver
7877
ChartRefRouter ChartRefRouter
7978
ConfigMapRouter ConfigMapRouter
8079
AppStoreRouter appStore.AppStoreRouter
@@ -110,7 +109,7 @@ type MuxRouter struct {
110109
moduleRouter module.ModuleRouter
111110
serverRouter server.ServerRouter
112111
apiTokenRouter apiToken.ApiTokenRouter
113-
helmApplicationStatusUpdateHandler cron.HelmApplicationStatusUpdateHandler
112+
helmApplicationStatusUpdateHandler cron.CdApplicationStatusUpdateHandler
114113
k8sCapacityRouter k8s.K8sCapacityRouter
115114
webhookHelmRouter webhookHelm.WebhookHelmRouter
116115
}
@@ -127,7 +126,7 @@ func NewMuxRouter(logger *zap.SugaredLogger, HelmRouter HelmRouter, PipelineConf
127126
gitWebhookHandler pubsub.GitWebhookHandler,
128127
workflowUpdateHandler pubsub.WorkflowStatusUpdateHandler,
129128
appUpdateHandler pubsub.ApplicationStatusUpdateHandler,
130-
ciEventHandler pubsub.CiEventHandler, pubsubClient *pubsub2.PubSubClient, UserRouter user.UserRouter, cronBasedEventReceiver pubsub.CronBasedEventReceiver,
129+
ciEventHandler pubsub.CiEventHandler, pubsubClient *pubsub2.PubSubClient, UserRouter user.UserRouter,
131130
ChartRefRouter ChartRefRouter, ConfigMapRouter ConfigMapRouter, AppStoreRouter appStore.AppStoreRouter, chartRepositoryRouter chartRepo.ChartRepositoryRouter,
132131
ReleaseMetricsRouter ReleaseMetricsRouter, deploymentGroupRouter DeploymentGroupRouter, batchOperationRouter BatchOperationRouter,
133132
chartGroupRouter ChartGroupRouter, testSuitRouter TestSuitRouter, imageScanRouter ImageScanRouter,
@@ -138,7 +137,7 @@ func NewMuxRouter(logger *zap.SugaredLogger, HelmRouter HelmRouter, PipelineConf
138137
commonDeploymentRouter appStoreDeployment.CommonDeploymentRouter, externalLinkRouter externalLink.ExternalLinkRouter,
139138
globalPluginRouter GlobalPluginRouter, moduleRouter module.ModuleRouter,
140139
serverRouter server.ServerRouter, apiTokenRouter apiToken.ApiTokenRouter,
141-
helmApplicationStatusUpdateHandler cron.HelmApplicationStatusUpdateHandler, k8sCapacityRouter k8s.K8sCapacityRouter, webhookHelmRouter webhookHelm.WebhookHelmRouter) *MuxRouter {
140+
helmApplicationStatusUpdateHandler cron.CdApplicationStatusUpdateHandler, k8sCapacityRouter k8s.K8sCapacityRouter, webhookHelmRouter webhookHelm.WebhookHelmRouter) *MuxRouter {
142141
r := &MuxRouter{
143142
Router: mux.NewRouter(),
144143
HelmRouter: HelmRouter,
@@ -164,7 +163,6 @@ func NewMuxRouter(logger *zap.SugaredLogger, HelmRouter HelmRouter, PipelineConf
164163
ciEventHandler: ciEventHandler,
165164
pubsubClient: pubsubClient,
166165
UserRouter: UserRouter,
167-
cronBasedEventReceiver: cronBasedEventReceiver,
168166
ChartRefRouter: ChartRefRouter,
169167
ConfigMapRouter: ConfigMapRouter,
170168
AppStoreRouter: AppStoreRouter,

0 commit comments

Comments
 (0)