Skip to content

Commit 8292e6f

Browse files
Merge pull request #6866 from devtron-labs/release-candidate-v0.43.0
sync: release candidate v0.43.0
2 parents 5b148d8 + ce66ccc commit 8292e6f

File tree

272 files changed

+20190
-1659
lines changed

Some content is hidden

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

272 files changed

+20190
-1659
lines changed

App.go

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package main
1818

1919
import (
2020
"context"
21-
"crypto/tls"
2221
"errors"
2322
"fmt"
2423
"github.com/devtron-labs/common-lib/middlewares"
@@ -68,7 +67,6 @@ type App struct {
6867
// eventProcessor.CentralEventProcessor is used to register event processors
6968
centralEventProcessor *eventProcessor.CentralEventProcessor // do not remove this.
7069
// used for local dev only
71-
serveTls bool
7270
sessionManager2 *authMiddleware.SessionManager
7371
OtelTracingService *otel.OtelTracingServiceImpl
7472
loggingMiddleware util.LoggingMiddleware
@@ -99,7 +97,6 @@ func NewApp(router *router.MuxRouter,
9997
Enforcer: enforcer,
10098
EnforcerV2: enforcerV2,
10199
db: db,
102-
serveTls: false,
103100
sessionManager2: sessionManager2,
104101
posthogClient: posthogClient,
105102
OtelTracingService: otel.NewOtelTracingServiceImpl(Logger),
@@ -132,22 +129,7 @@ func (app *App) Start() {
132129
app.MuxRouter.Router.Use(otelmux.Middleware(otel.OTEL_ORCHESTRASTOR_SERVICE_NAME))
133130
}
134131
app.server = server
135-
var err error
136-
if app.serveTls {
137-
cert, err := tls.LoadX509KeyPair(
138-
"localhost.crt",
139-
"localhost.key",
140-
)
141-
if err != nil {
142-
log.Fatal(err)
143-
}
144-
server.TLSConfig = &tls.Config{
145-
Certificates: []tls.Certificate{cert},
146-
}
147-
err = server.ListenAndServeTLS("", "")
148-
} else {
149-
err = server.ListenAndServe()
150-
}
132+
err := server.ListenAndServe()
151133
//err := http.ListenAndServe(fmt.Sprintf(":%d", port), auth.Authorizer(app.Enforcer, app.sessionManager)(app.MuxRouter.Router))
152134
if err != nil && !errors.Is(err, http.ErrServerClosed) {
153135
app.Logger.Errorw("error in startup", "err", err)

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.24.0 AS build-env
1+
FROM golang:1.24.6 AS build-env
22

33
RUN echo $GOPATH && \
44
apt update && \

DockerfileEA

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.24.0 AS build-env
1+
FROM golang:1.24.6 AS build-env
22

33
RUN echo $GOPATH && \
44
apt update && \

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
all: fetch-all-env build
44

5-
TARGET_BRANCH?=main
5+
TARGET_BRANCH?=develop
66
TAG?=$(shell bash -c 'git log --pretty=format:'%h' -n 1')
77
FLAGS=
88
ENVVAR=

api/appStore/chartGroup/ChartGroupRestHandler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func (impl *ChartGroupRestHandlerImpl) GetChartGroupWithChartMetaData(w http.Res
191191
}
192192

193193
// Use enhanced parameter parsing with context
194-
chartGroupId, err := common.ExtractIntPathParamWithContext(w, r, "chartGroupId", "chart group")
194+
chartGroupId, err := common.ExtractIntPathParamWithContext(w, r, "chartGroupId")
195195
if err != nil {
196196
// Error already written by ExtractIntPathParamWithContext
197197
return
@@ -223,7 +223,7 @@ func (impl *ChartGroupRestHandlerImpl) GetChartGroupInstallationDetail(w http.Re
223223
}
224224

225225
// Use enhanced parameter parsing with context
226-
chartGroupId, err := common.ExtractIntPathParamWithContext(w, r, "chartGroupId", "chart group")
226+
chartGroupId, err := common.ExtractIntPathParamWithContext(w, r, "chartGroupId")
227227
if err != nil {
228228
// Error already written by ExtractIntPathParamWithContext
229229
return

api/appStore/deployment/AppStoreDeploymentRestHandler.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,10 @@ func (handler AppStoreDeploymentRestHandlerImpl) UpdateInstalledApp(w http.Respo
415415
handler.Logger.Debugw("request payload, UpdateInstalledApp", "payload", request)
416416
installedApp, err := handler.appStoreDeploymentDBService.GetInstalledApp(request.InstalledAppId)
417417
if err != nil {
418+
if util.IsErrNoRows(err) {
419+
common.HandleResourceNotFound(w, r, "installedApp", strconv.Itoa(request.InstalledAppVersionId))
420+
return
421+
}
418422
handler.Logger.Errorw("service err, UpdateInstalledApp", "err", err, "payload", request)
419423
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
420424
return
@@ -461,6 +465,8 @@ func (handler AppStoreDeploymentRestHandlerImpl) UpdateInstalledApp(w http.Respo
461465
if err != nil {
462466
if strings.Contains(err.Error(), "application spec is invalid") {
463467
err = &util.ApiError{Code: "400", HttpStatusCode: 400, UserMessage: "application spec is invalid, please check provided chart values"}
468+
} else if util.IsErrNoRows(err) {
469+
handler.Logger.Errorw("installed app not found", "err", err, "payload", request)
464470
}
465471
handler.Logger.Errorw("service err, UpdateInstalledApp", "err", err, "payload", request)
466472
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)

api/appStore/deployment/CommonDeploymentRestHandler.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ func (handler *CommonDeploymentRestHandlerImpl) getAppOfferingMode(installedAppI
8787
if len(appId) > 0 {
8888
appIdentifier, err := handler.helmAppService.DecodeAppId(appId)
8989
if err != nil {
90-
err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "invalid app id"}
90+
// err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "invalid app id"}
9191
return appOfferingMode, installedAppDto, err
9292
}
9393
installedAppDto, err = handler.installedAppService.GetInstalledAppByClusterNamespaceAndName(appIdentifier)
9494
if err != nil {
95-
err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "unable to find app in database"}
95+
// err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "unable to find app in database"}
9696
return appOfferingMode, installedAppDto, err
9797
}
9898
// this is the case when hyperion apps does not linked yet
@@ -103,7 +103,7 @@ func (handler *CommonDeploymentRestHandlerImpl) getAppOfferingMode(installedAppI
103103
installedAppDto.AppOfferingMode = appOfferingMode
104104
appIdentifier, err := handler.helmAppService.DecodeAppId(appId)
105105
if err != nil {
106-
err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "invalid app id"}
106+
// err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "invalid app id, expected format clusterId|namespace|releaseName"}
107107
return appOfferingMode, installedAppDto, err
108108
}
109109
installedAppDto.ClusterId = appIdentifier.ClusterId
@@ -113,16 +113,17 @@ func (handler *CommonDeploymentRestHandlerImpl) getAppOfferingMode(installedAppI
113113
} else if len(installedAppId) > 0 {
114114
installedAppId, err := strconv.Atoi(installedAppId)
115115
if err != nil {
116-
err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "invalid installed app id"}
116+
handler.Logger.Errorw("Invalid installedAppId expected int value", "installedAppId", installedAppId, "err", err)
117117
return appOfferingMode, installedAppDto, err
118118
}
119119
installedAppDto, err = handler.installedAppService.GetInstalledAppByInstalledAppId(installedAppId)
120120
if err != nil {
121-
err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "unable to find app in database"}
121+
// err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "unable to find app in database"}
122122
return appOfferingMode, installedAppDto, err
123123
}
124124
} else {
125125
err := &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "app id missing in request"}
126+
handler.Logger.Errorw("appId is missing and is a required field", "appId", appId, "err", err)
126127
return appOfferingMode, installedAppDto, err
127128
}
128129
if installedAppDto != nil && installedAppDto.InstalledAppId > 0 {
@@ -188,6 +189,7 @@ func (handler *CommonDeploymentRestHandlerImpl) GetDeploymentHistoryValues(w htt
188189
v := r.URL.Query()
189190
installedAppId := v.Get("installedAppId")
190191
appId := v.Get("appId")
192+
191193
appOfferingMode, installedAppDto, err := handler.getAppOfferingMode(installedAppId, appId)
192194
if err != nil {
193195
common.WriteJsonResp(w, err, "bad request", http.StatusBadRequest)

api/auth/user/UserRestHandler.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func (handler UserRestHandlerImpl) GetById(w http.ResponseWriter, r *http.Reques
210210
}
211211

212212
// Use enhanced parameter parsing with context
213-
id, err := common.ExtractIntPathParamWithContext(w, r, "id", "user")
213+
id, err := common.ExtractIntPathParamWithContext(w, r, "id")
214214
if err != nil {
215215
// Error already written by ExtractIntPathParamWithContext
216216
return
@@ -334,7 +334,7 @@ func (handler UserRestHandlerImpl) DeleteUser(w http.ResponseWriter, r *http.Req
334334
}
335335

336336
// Use enhanced parameter parsing with context
337-
id, err := common.ExtractIntPathParamWithContext(w, r, "id", "user")
337+
id, err := common.ExtractIntPathParamWithContext(w, r, "id")
338338
if err != nil {
339339
// Error already written by ExtractIntPathParamWithContext
340340
return
@@ -427,7 +427,7 @@ func (handler UserRestHandlerImpl) BulkDeleteUsers(w http.ResponseWriter, r *htt
427427

428428
func (handler UserRestHandlerImpl) FetchRoleGroupById(w http.ResponseWriter, r *http.Request) {
429429
// Use enhanced parameter parsing with context
430-
id, err := common.ExtractIntPathParamWithContext(w, r, "id", "role group")
430+
id, err := common.ExtractIntPathParamWithContext(w, r, "id")
431431
if err != nil {
432432
// Error already written by ExtractIntPathParamWithContext
433433
return

api/chartRepo/ChartRepositoryRestHandler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (handler *ChartRepositoryRestHandlerImpl) GetChartRepoById(w http.ResponseW
8585
}
8686

8787
// Use enhanced parameter parsing with context
88-
id, err := common.ExtractIntPathParamWithContext(w, r, "id", "chart repository")
88+
id, err := common.ExtractIntPathParamWithContext(w, r, "id")
8989
if err != nil {
9090
// Error already written by ExtractIntPathParamWithContext
9191
return

api/cluster/ClusterRestHandler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ func (impl ClusterRestHandlerImpl) FindByIds(w http.ResponseWriter, r *http.Requ
356356

357357
func (impl ClusterRestHandlerImpl) FindById(w http.ResponseWriter, r *http.Request) {
358358
// Use enhanced parameter parsing with context
359-
clusterId, err := common.ExtractIntPathParamWithContext(w, r, "id", "cluster")
359+
clusterId, err := common.ExtractIntPathParamWithContext(w, r, "id")
360360
if err != nil {
361361
// Error already written by ExtractIntPathParamWithContext
362362
return
@@ -734,7 +734,7 @@ func (impl ClusterRestHandlerImpl) GetClusterNamespaces(w http.ResponseWriter, r
734734
isActionUserSuperAdmin = true
735735
}
736736
// extract cluster and handle response on error
737-
clusterId, err := common.ExtractIntPathParamWithContext(w, r, "clusterId", "cluster")
737+
clusterId, err := common.ExtractIntPathParamWithContext(w, r, "clusterId")
738738
if err != nil {
739739
impl.logger.Error("error in parsing clusterId", "clusterId", clusterId, "err", err)
740740
return

0 commit comments

Comments
 (0)