Skip to content

Commit 836770b

Browse files
authored
Merge pull request #6954 from devtron-labs/rc-46-sync
release: Release candidate 46
2 parents cd37245 + 52c9280 commit 836770b

717 files changed

Lines changed: 73916 additions & 21751 deletions

File tree

Some content is hidden

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

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.24.6 AS build-env
1+
FROM golang:1.25.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.6 AS build-env
1+
FROM golang:1.25.6 AS build-env
22

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

api/restHandler/app/appList/AppListingRestHandler.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import (
5656
"github.com/gorilla/mux"
5757
"go.opentelemetry.io/otel"
5858
"go.uber.org/zap"
59+
"gopkg.in/go-playground/validator.v9"
5960
"net/http"
6061
"strconv"
6162
"time"
@@ -98,6 +99,7 @@ type AppListingRestHandlerImpl struct {
9899
k8sApplicationService k8sApplication.K8sApplicationService
99100
deploymentConfigService common2.DeploymentConfigService
100101
resourceTreeService resourceTree.Service
102+
validator *validator.Validate
101103
}
102104

103105
type AppStatus struct {
@@ -141,6 +143,7 @@ func NewAppListingRestHandlerImpl(appListingService app.AppListingService,
141143
k8sApplicationService: k8sApplicationService,
142144
deploymentConfigService: deploymentConfigService,
143145
resourceTreeService: resourceTreeService,
146+
validator: validator.New(),
144147
}
145148
return appListingHandler
146149
}
@@ -276,6 +279,28 @@ func (handler AppListingRestHandlerImpl) FetchJobOverviewCiPipelines(w http.Resp
276279
common.WriteJsonResp(w, err, jobCi, http.StatusOK)
277280
}
278281

282+
// validateFetchAppListingRequest performs request and business-rule validation.
283+
func (handler AppListingRestHandlerImpl) validateFetchAppListingRequest(w http.ResponseWriter, r *http.Request, fetchAppListingRequest *app.FetchAppListingRequest) bool {
284+
err := handler.validator.Struct(*fetchAppListingRequest)
285+
if err != nil {
286+
handler.logger.Errorw("validation err, FetchAppsByEnvironment", "err", err, "payload", fetchAppListingRequest)
287+
common.HandleValidationErrors(w, r, err)
288+
return false
289+
}
290+
err = handler.appListingService.ValidateTagFilters(fetchAppListingRequest.TagFilters)
291+
if err != nil {
292+
handler.logger.Errorw("request err, ValidateTagFilters", "err", err, "payload", fetchAppListingRequest.TagFilters)
293+
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
294+
return false
295+
}
296+
return true
297+
}
298+
299+
// normalizeFetchAppListingRequest applies request normalization after validation.
300+
func (handler AppListingRestHandlerImpl) normalizeFetchAppListingRequest(fetchAppListingRequest *app.FetchAppListingRequest) {
301+
fetchAppListingRequest.TagFilters = handler.appListingService.NormalizeTagFilters(fetchAppListingRequest.TagFilters)
302+
}
303+
279304
func (handler AppListingRestHandlerImpl) FetchAppsByEnvironmentV2(w http.ResponseWriter, r *http.Request) {
280305
//Allow CORS here By * or specific origin
281306
util3.SetupCorsOriginHeader(&w)
@@ -331,6 +356,10 @@ func (handler AppListingRestHandlerImpl) FetchAppsByEnvironmentV2(w http.Respons
331356
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
332357
return
333358
}
359+
if !handler.validateFetchAppListingRequest(w, r, &fetchAppListingRequest) {
360+
return
361+
}
362+
handler.normalizeFetchAppListingRequest(&fetchAppListingRequest)
334363
newCtx, span = otel.Tracer("fetchAppListingRequest").Start(newCtx, "GetNamespaceClusterMapping")
335364
_, _, err = fetchAppListingRequest.GetNamespaceClusterMapping()
336365
span.End()

go.mod

Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/devtron-labs/devtron
22

3-
go 1.24.6
4-
5-
toolchain go1.24.7
3+
go 1.25.0
64

75
require (
86
github.com/Masterminds/semver v1.5.0
@@ -59,7 +57,7 @@ require (
5957
github.com/prometheus/client_golang v1.22.0
6058
github.com/robfig/cron/v3 v3.0.1
6159
github.com/satori/go.uuid v1.2.0
62-
github.com/stretchr/testify v1.10.0
60+
github.com/stretchr/testify v1.11.1
6361
github.com/tidwall/gjson v1.14.4
6462
github.com/tidwall/sjson v1.2.4
6563
github.com/xanzy/go-gitlab v0.114.0
@@ -68,19 +66,19 @@ require (
6866
github.com/zclconf/go-cty v1.13.2
6967
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.44.0
7068
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0
71-
go.opentelemetry.io/otel v1.36.0
69+
go.opentelemetry.io/otel v1.43.0
7270
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0
7371
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0
74-
go.opentelemetry.io/otel/sdk v1.36.0
75-
go.opentelemetry.io/otel/trace v1.36.0
72+
go.opentelemetry.io/otel/sdk v1.43.0
73+
go.opentelemetry.io/otel/trace v1.43.0
7674
go.uber.org/zap v1.27.0
77-
golang.org/x/crypto v0.45.0
75+
golang.org/x/crypto v0.46.0
7876
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6
79-
golang.org/x/mod v0.29.0
80-
golang.org/x/oauth2 v0.30.0
81-
google.golang.org/genproto/googleapis/api v0.0.0-20250519155744-55703ea1f237
82-
google.golang.org/grpc v1.72.2
83-
google.golang.org/protobuf v1.36.6
77+
golang.org/x/mod v0.30.0
78+
golang.org/x/oauth2 v0.34.0
79+
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217
80+
google.golang.org/grpc v1.79.3
81+
google.golang.org/protobuf v1.36.10
8482
gopkg.in/go-playground/validator.v9 v9.31.0
8583
gopkg.in/igm/sockjs-go.v3 v3.0.0
8684
gopkg.in/yaml.v2 v2.4.0
@@ -98,7 +96,7 @@ require (
9896

9997
require (
10098
cloud.google.com/go v0.121.2 // indirect
101-
cloud.google.com/go/compute/metadata v0.7.0 // indirect
99+
cloud.google.com/go/compute/metadata v0.9.0 // indirect
102100
cloud.google.com/go/iam v1.5.2 // indirect
103101
cloud.google.com/go/storage v1.54.0 // indirect
104102
dario.cat/mergo v1.0.1 // indirect
@@ -133,7 +131,7 @@ require (
133131
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
134132
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
135133
github.com/distribution/reference v0.6.0 // indirect
136-
github.com/docker/cli v28.1.1+incompatible // indirect
134+
github.com/docker/cli v29.2.0+incompatible // indirect
137135
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
138136
github.com/emirpasic/gods v1.18.1 // indirect
139137
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
@@ -142,8 +140,8 @@ require (
142140
github.com/gammazero/deque v1.0.0 // indirect
143141
github.com/go-errors/errors v1.4.2 // indirect
144142
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
145-
github.com/go-jose/go-jose/v4 v4.1.0 // indirect
146-
github.com/go-logr/logr v1.4.2 // indirect
143+
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
144+
github.com/go-logr/logr v1.4.3 // indirect
147145
github.com/go-logr/stdr v1.2.2 // indirect
148146
github.com/go-openapi/jsonpointer v0.21.1 // indirect
149147
github.com/go-openapi/jsonreference v0.21.0 // indirect
@@ -166,7 +164,7 @@ require (
166164
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
167165
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
168166
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
169-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
167+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1 // indirect
170168
github.com/hashicorp/errwrap v1.1.0 // indirect
171169
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
172170
github.com/hashicorp/go-retryablehttp v0.7.7
@@ -228,18 +226,18 @@ require (
228226
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
229227
github.com/xlab/treeprint v1.2.0 // indirect
230228
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
231-
go.opentelemetry.io/otel/metric v1.36.0 // indirect
232-
go.opentelemetry.io/proto/otlp v1.6.0 // indirect
229+
go.opentelemetry.io/otel/metric v1.43.0 // indirect
230+
go.opentelemetry.io/proto/otlp v1.7.1 // indirect
233231
go.uber.org/multierr v1.11.0 // indirect
234-
golang.org/x/net v0.47.0 // indirect
235-
golang.org/x/sync v0.18.0 // indirect
236-
golang.org/x/sys v0.38.0 // indirect
237-
golang.org/x/term v0.37.0 // indirect
238-
golang.org/x/text v0.31.0 // indirect
232+
golang.org/x/net v0.48.0 // indirect
233+
golang.org/x/sync v0.19.0 // indirect
234+
golang.org/x/sys v0.42.0 // indirect
235+
golang.org/x/term v0.38.0 // indirect
236+
golang.org/x/text v0.32.0 // indirect
239237
golang.org/x/time v0.12.0 // indirect
240238
google.golang.org/api v0.234.0 // indirect
241239
google.golang.org/genproto v0.0.0-20250519155744-55703ea1f237 // indirect
242-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 // indirect
240+
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
243241
gopkg.in/inf.v0 v0.9.1 // indirect
244242
gopkg.in/warnings.v0 v0.1.2 // indirect
245243
gopkg.in/yaml.v3 v3.0.1 // indirect
@@ -273,11 +271,11 @@ require (
273271
)
274272

275273
require (
276-
cel.dev/expr v0.24.0 // indirect
274+
cel.dev/expr v0.25.1 // indirect
277275
cloud.google.com/go/auth v0.16.1 // indirect
278276
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
279277
cloud.google.com/go/monitoring v1.24.2 // indirect
280-
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0 // indirect
278+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 // indirect
281279
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0 // indirect
282280
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0 // indirect
283281
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
@@ -301,11 +299,11 @@ require (
301299
github.com/aws/aws-sdk-go-v2/service/sts v1.33.19 // indirect
302300
github.com/aws/smithy-go v1.22.3 // indirect
303301
github.com/cenkalti/backoff/v5 v5.0.2 // indirect
304-
github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443 // indirect
302+
github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 // indirect
305303
github.com/dlclark/regexp2 v1.11.4 // indirect
306304
github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect
307-
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
308-
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
305+
github.com/envoyproxy/go-control-plane/envoy v1.36.0 // indirect
306+
github.com/envoyproxy/protoc-gen-validate v1.3.0 // indirect
309307
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
310308
github.com/fluxcd/pkg/apis/acl v0.7.0 // indirect
311309
github.com/fluxcd/pkg/apis/kustomize v1.10.0 // indirect
@@ -320,16 +318,15 @@ require (
320318
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
321319
github.com/speakeasy-api/jsonpath v0.6.0 // indirect
322320
github.com/speakeasy-api/openapi-overlay v0.10.2 // indirect
323-
github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect
321+
github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect
324322
github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect
325323
github.com/x448/float16 v0.8.4 // indirect
326-
github.com/zeebo/errs v1.4.0 // indirect
327-
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
328-
go.opentelemetry.io/contrib/detectors/gcp v1.36.0 // indirect
329-
go.opentelemetry.io/otel/sdk/metric v1.36.0 // indirect
324+
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
325+
go.opentelemetry.io/contrib/detectors/gcp v1.39.0 // indirect
326+
go.opentelemetry.io/otel/sdk/metric v1.43.0 // indirect
330327
go.yaml.in/yaml/v2 v2.4.2 // indirect
331328
go.yaml.in/yaml/v3 v3.0.3 // indirect
332-
golang.org/x/tools v0.38.0 // indirect
329+
golang.org/x/tools v0.39.0 // indirect
333330
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
334331
k8s.io/controller-manager v0.33.0 // indirect
335332
sigs.k8s.io/randfill v1.0.0 // indirect
@@ -338,7 +335,7 @@ require (
338335
replace (
339336
github.com/argoproj/argo-workflows/v3 v3.5.13 => github.com/devtron-labs/argo-workflows/v3 v3.5.13
340337
github.com/cyphar/filepath-securejoin v0.4.1 => github.com/cyphar/filepath-securejoin v0.3.6 // indirect
341-
github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20260402084817-89c5193e2617
342-
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260402084817-89c5193e2617
338+
github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20260420122647-3b3d6d0e9a15
339+
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20260420122647-3b3d6d0e9a15
343340
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 => go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1
344341
)

0 commit comments

Comments
 (0)