Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
d328e2a
corrected security specs
prkhrkat Aug 28, 2025
bcdb415
added more specs
prkhrkat Aug 29, 2025
c37f741
added more specs
prkhrkat Sep 1, 2025
88c5a4b
Merge branch 'develop' into api-specs-post
prkhrkat Sep 4, 2025
e8c77be
Merge branch 'develop' into api-specs-post
prkhrkat Sep 5, 2025
ad540f4
Merge branch 'develop' into api-specs-post
prkhrkat Sep 5, 2025
2ad718a
Merge remote-tracking branch 'origin/api-specs-post' into api-specs-post
prkhrkat Sep 5, 2025
fb357a5
fix: dex scopes override default required scopes (#6816)
SATYAsasini Sep 5, 2025
3e46c4e
Merge branch 'develop' into api-specs-post
prkhrkat Sep 8, 2025
5689376
sepcs
prkhrkat Sep 9, 2025
11058b3
sepcs
prkhrkat Sep 9, 2025
3a8302c
fix: get deployment history minor validations
SATYAsasini Sep 9, 2025
bdc2575
error handler correction
prkhrkat Sep 9, 2025
c388558
fix: get pre post deployment logs minor validations
SATYAsasini Sep 9, 2025
634635b
fix: get cd workflow detail and download deployment artifact param va…
SATYAsasini Sep 9, 2025
d3cac07
fix: get deployment status params error handling and messaging enhance
SATYAsasini Sep 9, 2025
c8013c1
fix: Trigger and Statuses POST api
SATYAsasini Sep 9, 2025
f397703
error handler correction
prkhrkat Sep 9, 2025
1ae65fb
Merge pull request #6824 from devtron-labs/ea-fail-fix-main
prkhrkat Sep 10, 2025
68fd0ba
added sql scripts
kartik-579 Sep 11, 2025
d2e4913
Merge pull request #6825 from devtron-labs/poll-plugin-sql
kartik-579 Sep 11, 2025
8732a60
release: PR for v1.8.0 (#6726)
systemsdt Sep 11, 2025
f972d27
eks detection
prkhrkat Sep 11, 2025
e95b7a4
Merge pull request #6826 from devtron-labs/eks-fix-main
prkhrkat Sep 11, 2025
2263ace
Merge branch 'develop' into api-specs-post
prkhrkat Sep 12, 2025
4ed7847
spec added git-material
prkhrkat Sep 15, 2025
99b719a
sync: sync from fix-api-post
SATYAsasini Sep 15, 2025
adeccfa
validations
prkhrkat Sep 15, 2025
7af78d0
Merge branch 'refs/heads/main' into api-specs-post
prkhrkat Sep 15, 2025
e01cbd9
validations
prkhrkat Sep 15, 2025
bb16d29
fix: api responses and specs
SATYAsasini Sep 17, 2025
b62d526
chore: resolving review comments
SATYAsasini Sep 17, 2025
1808f06
chore: resolving review comments
SATYAsasini Sep 17, 2025
46167fa
chore: resolving review comments
SATYAsasini Sep 17, 2025
4e5406d
Merge branch 'api-specs-post' into fix-api-phase-2
prkhrkat Sep 17, 2025
e7539b0
Merge pull request #6821 from devtron-labs/fix-api-phase-2
prkhrkat Sep 17, 2025
075b680
docs: deployment template api spec fixes (#6833)
SATYAsasini Sep 18, 2025
854d1c7
fix: post api fixes iteration-1 (#6835)
SATYAsasini Sep 19, 2025
883e18d
fix: app name and description validation and ephimeral container delete
SATYAsasini Sep 22, 2025
080ce13
chore: using enums despite hardcoded strings
SATYAsasini Sep 24, 2025
32fcbf4
chore: using enums despite hardcoded strings for ephimeral container …
SATYAsasini Sep 24, 2025
5630e6b
chore: removing unsed utils
SATYAsasini Sep 24, 2025
082670c
chore: removing unsed utils
SATYAsasini Sep 24, 2025
be881db
added getDeploymentTemplate spec
prkhrkat Sep 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions CHANGELOG/release-notes-v1.8.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## v1.8.0

## Enhancements
- feat: added the plugin for aws ecr retagging (#6695)
- feat: Argo version update v2.13.3(#6817)
- feat: ArgoCD v2.13.3 support for private chart providers (#6766)
- feat: flux cd deployment (#6660)
- feat: add app name in labels list api (#6688)
- feat: Audit ci trigger, precd and post cd trigger so that retrigger can happen from last failed config snapshot (#6659)
- feat: optimize ci cd workflow (#6744)
- feat: automate API specs workflow and documentation (#6786)

## Bugs
- fix: argo sync (#6718)
- fix: cluster delete (#6706)
- fix: Notifier v1 removed (#6705)
- fix: app clone panic (#6696)
- fix: Spdy migration to websocket (#6682)
- fix: Fix scanning optimisation (#6683)
- fix: panic in logs api (#6684)
- fix: Empty migration seq (#6673)
- fix: Removing default value of idleReplicaCount (#6721)
- fix: send HideApiToken env var in api token create and update response (#6727)
- fix: removed timeout notification (#6760)
- fix: unify unit formatting and conversion for CPU and memory in cluster resources (#6768)
- fix: cron job suspend (#6771)
- fix: panic app group (#6785)
- fix: api responses enhancements (#6797)
- fix: post apis minor validations (#6811)
- fix: dex scopes override default required scopes (#6816)
- fix: error handler correction (#6824)

## Others
- chore: added sql file of 4.21 (#6716)
- misc: added support for service extraSpec (#6702)
- chore: when output dir path is /devtroncd in any pipeline stage step then the ci runner is stuck in recursive self-copy situation (#6686)
- misc: Removing default value of idleReplicaCount (#6730)
- chore: chart service crud and configProperties (#6642)
- misc: Added Github Actions for linting and building api specs (#6720)
- misc: open api spec addition (#6750)
- misc: Updated the build-docs.yaml (#6752)
- misc: fixing swagger openapi.yaml (#6751)
- misc: adding codeowner for swagger api spec (#6754)
- misc: swagger api spec fixes (#6755)
- misc: Update openapi spec (#6758)
- misc: updated the title of openapi specs (#6759)
- misc: Timeout main notification (#6761)
- misc: Api changes for env enhancement (#6769)
- misc: changes in description of api spec (#6767)
- chore: Update `authenticator` and `common-lib` dependencies to latest versions. (#6779)
- chore: added sql files for sync (#6780)
- chore: migration number chnage (#6783)
- chore: add resource recommendation APIs and update openapi.yaml (#6784)
- misc: added support for cronjob annotations and probes (#6787)
- misc: Validation on payload and Error handling, API Specs revised (#6790)
- misc: sql query param refacter (#6810)

4 changes: 2 additions & 2 deletions api/appStore/chartGroup/ChartGroupRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (impl *ChartGroupRestHandlerImpl) GetChartGroupWithChartMetaData(w http.Res
}

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

// Use enhanced parameter parsing with context
chartGroupId, err := common.ExtractIntPathParamWithContext(w, r, "chartGroupId", "chart group")
chartGroupId, err := common.ExtractIntPathParamWithContext(w, r, "chartGroupId")
if err != nil {
// Error already written by ExtractIntPathParamWithContext
return
Expand Down
6 changes: 3 additions & 3 deletions api/auth/user/UserRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (handler UserRestHandlerImpl) GetById(w http.ResponseWriter, r *http.Reques
}

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

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

func (handler UserRestHandlerImpl) FetchRoleGroupById(w http.ResponseWriter, r *http.Request) {
// Use enhanced parameter parsing with context
id, err := common.ExtractIntPathParamWithContext(w, r, "id", "role group")
id, err := common.ExtractIntPathParamWithContext(w, r, "id")
if err != nil {
// Error already written by ExtractIntPathParamWithContext
return
Expand Down
2 changes: 1 addition & 1 deletion api/chartRepo/ChartRepositoryRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (handler *ChartRepositoryRestHandlerImpl) GetChartRepoById(w http.ResponseW
}

// Use enhanced parameter parsing with context
id, err := common.ExtractIntPathParamWithContext(w, r, "id", "chart repository")
id, err := common.ExtractIntPathParamWithContext(w, r, "id")
if err != nil {
// Error already written by ExtractIntPathParamWithContext
return
Expand Down
4 changes: 2 additions & 2 deletions api/cluster/ClusterRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ func (impl ClusterRestHandlerImpl) FindByIds(w http.ResponseWriter, r *http.Requ

func (impl ClusterRestHandlerImpl) FindById(w http.ResponseWriter, r *http.Request) {
// Use enhanced parameter parsing with context
clusterId, err := common.ExtractIntPathParamWithContext(w, r, "id", "cluster")
clusterId, err := common.ExtractIntPathParamWithContext(w, r, "id")
if err != nil {
// Error already written by ExtractIntPathParamWithContext
return
Expand Down Expand Up @@ -734,7 +734,7 @@ func (impl ClusterRestHandlerImpl) GetClusterNamespaces(w http.ResponseWriter, r
isActionUserSuperAdmin = true
}
// extract cluster and handle response on error
clusterId, err := common.ExtractIntPathParamWithContext(w, r, "clusterId", "cluster")
clusterId, err := common.ExtractIntPathParamWithContext(w, r, "clusterId")
if err != nil {
impl.logger.Error("error in parsing clusterId", "clusterId", clusterId, "err", err)
return
Expand Down
2 changes: 1 addition & 1 deletion api/cluster/EnvironmentRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func (impl EnvironmentRestHandlerImpl) Update(w http.ResponseWriter, r *http.Req

func (impl EnvironmentRestHandlerImpl) FindById(w http.ResponseWriter, r *http.Request) {
// Use enhanced parameter parsing with context
envId, err := common.ExtractIntPathParamWithContext(w, r, "id", "environment")
envId, err := common.ExtractIntPathParamWithContext(w, r, "id")
if err != nil {
// Error already written by ExtractIntPathParamWithContext
return
Expand Down
22 changes: 17 additions & 5 deletions api/k8s/application/k8sApplicationRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1002,14 +1002,19 @@ func (handler *K8sApplicationRestHandlerImpl) CreateEphemeralContainer(w http.Re
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
}
if err = handler.validator.Struct(request); err != nil || (request.BasicData == nil && request.AdvancedData == nil) {
if err != nil {
err = errors.New("invalid request payload")
}
handler.logger.Errorw("invalid request payload", "err", err, "payload", request)
if request.BasicData == nil && request.AdvancedData == nil {
err = errors.New("invalid request payload, neither basic data nor advanced data provided")
handler.logger.Errorw("invalid request payload missing basic data and invalid data", "err", err, "payload", request)
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
}
err = handler.validator.Struct(request)
if err != nil {
handler.logger.Errorw("invalid request payload", "err", err, "payload", request)
//common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
common.HandleValidationErrors(w, r, err)
return
}
// check for super admin
restricted := handler.restrictTerminalAccessForNonSuperUsers(w, token)
if restricted {
Expand Down Expand Up @@ -1079,6 +1084,13 @@ func (handler *K8sApplicationRestHandlerImpl) DeleteEphemeralContainer(w http.Re
_, err = handler.k8sApplicationService.TerminatePodEphemeralContainer(request)
if err != nil {
handler.logger.Errorw("error occurred in terminating ephemeral container", "err", err, "requestPayload", request)
if err.Error() == bean4.EXTERNAL_EPHIMERAL_CONTAINER_ERR {
common.WriteJsonResp(w, err, nil, http.StatusForbidden)
return
} else if err.Error() == bean4.EPHEMERAL_CONTAINER_NOT_FOUND_ERR {
common.WriteJsonResp(w, err, nil, http.StatusNotFound)
return
}
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
return
}
Expand Down
51 changes: 3 additions & 48 deletions api/middleware/ErrorHandlingMiddleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ package middleware
import (
"context"
"fmt"
"github.com/devtron-labs/devtron/internal/util"
"github.com/gorilla/mux"
"go.uber.org/zap"
"net/http"
"strconv"
"time"

"github.com/gorilla/mux"
"go.uber.org/zap"
)

// ErrorHandlingMiddleware provides enhanced error handling and logging for REST handlers
Expand Down Expand Up @@ -156,47 +155,3 @@ func GetRequestContext(r *http.Request) *RequestContext {
}
return nil
}

// LogError logs an error with request context for better debugging
func (m *ErrorHandlingMiddleware) LogError(r *http.Request, err error, operation string) {
reqCtx := GetRequestContext(r)
if reqCtx != nil {
m.logger.Errorw("Request error",
"requestId", reqCtx.RequestID,
"operation", operation,
"error", err,
"method", reqCtx.Method,
"path", reqCtx.Path,
"resourceType", reqCtx.ResourceType,
"resourceId", reqCtx.ResourceID,
)
} else {
m.logger.Errorw("Request error",
"operation", operation,
"error", err,
"method", r.Method,
"path", r.URL.Path,
)
}
}

// ValidateIntPathParam validates and extracts an integer path parameter with enhanced error handling
func ValidateIntPathParam(r *http.Request, paramName string) (int, *util.ApiError) {
vars := mux.Vars(r)
paramValue := vars[paramName]

if paramValue == "" {
return 0, util.NewMissingRequiredFieldError(paramName)
}

id, err := strconv.Atoi(paramValue)
if err != nil {
return 0, util.NewInvalidPathParameterError(paramName, paramValue)
}

if id <= 0 {
return 0, util.NewValidationErrorForField(paramName, "must be a positive integer")
}

return id, nil
}
6 changes: 2 additions & 4 deletions api/restHandler/CoreAppRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,9 @@ func (handler CoreAppRestHandlerImpl) GetAppAllDetail(w http.ResponseWriter, r *
return
}

vars := mux.Vars(r)
appId, err := strconv.Atoi(vars["appId"])
appId, err := common.ExtractIntPathParamWithContext(w, r, "appId")
if err != nil {
handler.logger.Errorw("request err, GetAppAllDetail", "err", err, "appId", vars["appId"])
common.WriteInvalidAppIdError(w, vars["appId"])
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
}

Expand Down
8 changes: 4 additions & 4 deletions api/restHandler/NotificationRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,13 @@ func (impl NotificationRestHandlerImpl) DeleteNotificationSettings(w http.Respon

func (impl NotificationRestHandlerImpl) GetAllNotificationSettings(w http.ResponseWriter, r *http.Request) {
// Use enhanced parameter parsing with context
size, err := common.ExtractIntPathParamWithContext(w, r, "size", "pagination")
size, err := common.ExtractIntPathParamWithContext(w, r, "size")
if err != nil {
// Error already written by ExtractIntPathParamWithContext
return
}

offset, err := common.ExtractIntPathParamWithContext(w, r, "offset", "pagination")
offset, err := common.ExtractIntPathParamWithContext(w, r, "offset")
if err != nil {
// Error already written by ExtractIntPathParamWithContext
return
Expand Down Expand Up @@ -522,7 +522,7 @@ func (impl NotificationRestHandlerImpl) FindSESConfig(w http.ResponseWriter, r *
}

// Use enhanced parameter parsing with context
id, err := common.ExtractIntPathParamWithContext(w, r, "id", "SES config")
id, err := common.ExtractIntPathParamWithContext(w, r, "id")
if err != nil {
// Error already written by ExtractIntPathParamWithContext
return
Expand Down Expand Up @@ -551,7 +551,7 @@ func (impl NotificationRestHandlerImpl) FindSlackConfig(w http.ResponseWriter, r
}

// Use enhanced parameter parsing with context
id, err := common.ExtractIntPathParamWithContext(w, r, "id", "Slack config")
id, err := common.ExtractIntPathParamWithContext(w, r, "id")
if err != nil {
// Error already written by ExtractIntPathParamWithContext
return
Expand Down
Loading
Loading