Skip to content
Merged
Show file tree
Hide file tree
Changes from 97 commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
95dfbd0
corrected api specs
prkhrkat May 30, 2025
02eacc9
specs enhance
prkhrkat Jul 25, 2025
d5b9a1c
Merge branch 'develop' into api-specs
prkhrkat Jul 25, 2025
15b2a4f
develop-merge
prkhrkat Jul 31, 2025
cdd8421
corrected specs
prkhrkat Aug 4, 2025
b35c605
corrected specs
prkhrkat Aug 4, 2025
de7ae84
vendor for spec-validator
prkhrkat Aug 4, 2025
8663138
spec-fixes as per cursor when ran on results file
prkhrkat Aug 4, 2025
51a4b66
Merge branch 'api-specs' into feat-api-spec-validator
prkhrkat Aug 4, 2025
c4883f4
spec-fixes manually for /orchestrator path
prkhrkat Aug 4, 2025
4338a20
script fix to run against server
prkhrkat Aug 4, 2025
172e69d
naming changed from devtron-lab
prkhrkat Aug 4, 2025
5cbb17c
removed extra code
prkhrkat Aug 5, 2025
d51bf31
framework.go update
prkhrkat Aug 5, 2025
67387e6
api-spec fix
prkhrkat Aug 5, 2025
0f04a1c
spec fix
prkhrkat Aug 5, 2025
2c92037
script fix
prkhrkat Aug 5, 2025
413fa68
devops specs included
prkhrkat Aug 7, 2025
e9e0752
script fix
prkhrkat Aug 7, 2025
fa1ded1
script fix
prkhrkat Aug 8, 2025
b6be5db
specs fix
prkhrkat Aug 13, 2025
abd5cce
redocly script to generate html
prkhrkat Aug 13, 2025
d759500
refact
prkhrkat Aug 13, 2025
62ee1a8
refact
prkhrkat Aug 13, 2025
d810f04
refact
prkhrkat Aug 13, 2025
52dfab2
doc: api spec merger
SATYAsasini Aug 13, 2025
603927d
chore: test commit
SATYAsasini Aug 13, 2025
790c574
misc: script name rectified in action file
SATYAsasini Aug 13, 2025
e752b44
misc: testing change in /spec
SATYAsasini Aug 13, 2025
a1ee5ca
misc: test commit
SATYAsasini Aug 13, 2025
2edbf16
misc: test commit
SATYAsasini Aug 13, 2025
e7ac045
refact
prkhrkat Aug 13, 2025
88eb2a2
refact
prkhrkat Aug 13, 2025
f578cd2
refact
prkhrkat Aug 13, 2025
436dfd9
refact
prkhrkat Aug 13, 2025
f5169ad
feat: action fix and resource recommender specs
SATYAsasini Aug 13, 2025
0e616bc
Merge branch 'feat-api-spec-validator' of https://github.com/devtron-…
SATYAsasini Aug 13, 2025
017f106
fix: action fixes
SATYAsasini Aug 13, 2025
1a13e85
chore: test trigger commit
SATYAsasini Aug 13, 2025
8a89675
chore: test run commit
SATYAsasini Aug 14, 2025
b6db917
chore: test commit
SATYAsasini Aug 14, 2025
3ae63e5
chore: test commit
SATYAsasini Aug 14, 2025
a6bfb94
feat: git push job in action file
SATYAsasini Aug 14, 2025
fd03bc1
feat: git push job in action file
SATYAsasini Aug 14, 2025
73124a9
chore: test commit
SATYAsasini Aug 14, 2025
4fc825c
chore: test commit
SATYAsasini Aug 14, 2025
041bf25
chore: test commit
SATYAsasini Aug 14, 2025
2da6a86
chore: test commit
SATYAsasini Aug 14, 2025
1e272f6
chore: test commit
SATYAsasini Aug 14, 2025
1145251
chore: test commit
SATYAsasini Aug 14, 2025
347138a
chore: test commit
SATYAsasini Aug 14, 2025
8398148
fix: script misc chore fixes and trigger commit
SATYAsasini Aug 14, 2025
f64222a
fix: script fixes
SATYAsasini Aug 14, 2025
9ad2dca
fix: script fixes
SATYAsasini Aug 14, 2025
b94d5a8
fix: script fixes
SATYAsasini Aug 14, 2025
32a9759
fix: script fixes
SATYAsasini Aug 14, 2025
fb17b6f
fix: script fixes
SATYAsasini Aug 14, 2025
9a66ab0
fix: script fixes
SATYAsasini Aug 14, 2025
6ab5ee2
fix: script fixes
SATYAsasini Aug 14, 2025
9c7d32b
Merge branch 'develop' into feat-api-spec-validator
prkhrkat Aug 17, 2025
92f52b3
create API token validation
prkhrkat Aug 18, 2025
dfc7ee6
Merge remote-tracking branch 'origin/feat-api-spec-validator' into fe…
prkhrkat Aug 18, 2025
696d440
refact
prkhrkat Aug 18, 2025
d18e91f
refact
prkhrkat Aug 18, 2025
cf3cdbe
security policy specs fixed
prkhrkat Aug 18, 2025
5401c63
refact
prkhrkat Aug 18, 2025
2bfb2b7
refact
prkhrkat Aug 19, 2025
50125b8
refact
prkhrkat Aug 19, 2025
e271a87
refact
prkhrkat Aug 19, 2025
47267c8
refact
prkhrkat Aug 19, 2025
66a85b1
refact
prkhrkat Aug 19, 2025
0667df9
fix: API token generation api responses refactoring
SATYAsasini Aug 19, 2025
3a5e199
fix: register custom validation against tag for api token name valida…
SATYAsasini Aug 20, 2025
7593c27
fix: register custom validation against tag for api token name valida…
SATYAsasini Aug 20, 2025
01df986
Revert "fix: register custom validation against tag for api token nam…
SATYAsasini Aug 20, 2025
1bcb953
fix: remove `required` validation from Description and expiryAtInMs
SATYAsasini Aug 20, 2025
a3da1fd
fix: adding resource conflict api response in WriteJsonResp utility
SATYAsasini Aug 20, 2025
8deb394
ent separation
prkhrkat Aug 20, 2025
6ebb767
ent separation
prkhrkat Aug 20, 2025
6e2d95d
driftSpec.yaml added
prkhrkat Aug 20, 2025
ffe67f0
fix: path params int validation updated to whole numbers only
SATYAsasini Aug 20, 2025
e695102
fix: handled resource not found response for update and delete api, t…
SATYAsasini Aug 20, 2025
bf09b2a
fix: API token generation api responses refactoring (#6788)
SATYAsasini Aug 20, 2025
f8a42bc
path corrected
prkhrkat Aug 21, 2025
6f86b87
fix: validation for SSO config name field
SATYAsasini Aug 21, 2025
40bb962
cmscs added
prkhrkat Aug 21, 2025
3ca0e87
corrected specs
prkhrkat Aug 21, 2025
0113b69
fix: enhanced query param validation for commit metadata for pipeline…
SATYAsasini Aug 21, 2025
59ea5e0
fix: disable updating clsutername and api name in update clsuter api
SATYAsasini Aug 21, 2025
eab5419
fix: enhanced api response in query param validation failure reeors i…
SATYAsasini Aug 21, 2025
62e1c62
fix: disable modifying cluster nae and env name in update env api
SATYAsasini Aug 21, 2025
e20bc6a
Merge branch 'feat-api-spec-validator' into fix-api-responses
SATYAsasini Aug 21, 2025
dd64802
fix: resolving review comments
SATYAsasini Aug 25, 2025
62ade03
fix: resolving review comments
SATYAsasini Aug 25, 2025
a8fd206
fix: enhanced api response
SATYAsasini Aug 28, 2025
934a7bc
fix: enhanced some error messaging and missing field informations
SATYAsasini Aug 28, 2025
9d2a49b
fix: develop sync
SATYAsasini Aug 28, 2025
be79d8a
fix: resolving review comment
SATYAsasini Aug 29, 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
2 changes: 1 addition & 1 deletion api/appStore/deployment/CommonDeploymentRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (handler *CommonDeploymentRestHandlerImpl) getAppOfferingMode(installedAppI
installedAppDto.AppOfferingMode = appOfferingMode
appIdentifier, err := handler.helmAppService.DecodeAppId(appId)
if err != nil {
err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "invalid app id"}
err = &util.ApiError{HttpStatusCode: http.StatusBadRequest, UserMessage: "invalid app id, expected format clusterId|namespace|releaseName"}
return appOfferingMode, installedAppDto, err
}
installedAppDto.ClusterId = appIdentifier.ClusterId
Expand Down
6 changes: 5 additions & 1 deletion api/cluster/EnvironmentRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,15 @@ func (impl EnvironmentRestHandlerImpl) GetCombinedEnvironmentListForDropDownByCl
id, err := strconv.Atoi(clusterId)
if err != nil {
impl.logger.Errorw("request err, GetCombinedEnvironmentListForDropDownByClusterIds", "err", err, "clusterIdString", clusterIdString)
common.WriteJsonResp(w, err, "please send valid cluster Ids", http.StatusBadRequest)
common.HandleParameterError(w, r, "ids", clusterIdString)
return
}
clusterIds = append(clusterIds, id)
}
} else {
impl.logger.Errorw("request err empty query param, GetCombinedEnvironmentListForDropDownByClusterIds", "err", err, "clusterIdString", clusterIdString)
common.HandleParameterError(w, r, "ids", clusterIdString)
return
}
token := r.Header.Get("token")
clusters, err := impl.environmentClusterMappingsService.GetCombinedEnvironmentListForDropDownByClusterIds(token, clusterIds, impl.rbacEnforcementUtil.CheckAuthorizationForGlobalEnvironment)
Expand Down
7 changes: 7 additions & 0 deletions api/devtronResource/DevtronResourceHistoryRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,16 @@ func (handler *HistoryRestHandlerImpl) GetDeploymentHistory(w http.ResponseWrite
queryParams := apiBean.GetHistoryQueryParams{}
err := decoder.Decode(&queryParams, v)
if err != nil {
handler.logger.Errorw("error in decoding query parameters", "queryParams", v, "err", err)
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
}
// Validating that filterCriteria is provided
if len(queryParams.FilterCriteria) == 0 {
handler.logger.Errorw("missing required filterCriteria parameter")
common.HandleParameterError(w, r, "filterCriteria", "")
return
}
decodedReqBean, err := handler.apiReqDecoderService.GetFilterCriteriaParamsForDeploymentHistory(queryParams.FilterCriteria)
if err != nil {
handler.logger.Errorw("error in getting filter criteria params", "err", err, "filterCriteria", queryParams.FilterCriteria)
Expand Down
2 changes: 1 addition & 1 deletion api/helm-app/service/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
func DecodeExternalAppAppId(appId string) (*bean.AppIdentifier, error) {
component := strings.Split(appId, "|")
if len(component) != 3 {
return nil, fmt.Errorf("malformed app id %s", appId)
return nil, fmt.Errorf("malformed appId, appId: %s", appId)
}
clusterId, err := strconv.Atoi(component[0])
if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion api/restHandler/app/pipeline/AutoCompleteRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ func (handler DevtronAppAutoCompleteRestHandlerImpl) GetAppListForAutocomplete(w
return
}
} else {
teamIdInt, err = strconv.Atoi(teamId)
teamIdInt, err = common.ExtractIntPathParamWithContext(w, r, "teamId", teamId+" team")
if err != nil {
// Error already written by ExtractIntPathParamWithContext
return
}
if err != nil {
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1209,15 +1209,21 @@ func (handler *PipelineConfigRestHandlerImpl) FetchMaterialInfo(w http.ResponseW

func (handler *PipelineConfigRestHandlerImpl) GetCIPipelineById(w http.ResponseWriter, r *http.Request) {
token := r.Header.Get("token")
vars := mux.Vars(r)
appId, err := strconv.Atoi(vars["appId"])
// vars := mux.Vars(r)
//appId, err := strconv.Atoi(vars["appId"])
appId, err := common.ExtractIntPathParamWithContext(w, r, "appId", "app")
if err != nil {
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
// response already written by ExtractIntPathParamWithContext
//common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
handler.Logger.Error("request err getting , GetCIPipelineById", "appId", appId, "err", err)
return
}
pipelineId, err := strconv.Atoi(vars["pipelineId"])
//pipelineId, err := strconv.Atoi(vars["pipelineId"])
pipelineId, err := common.ExtractIntPathParamWithContext(w, r, "pipelineId", "pipeline")
if err != nil {
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
// response already written by ExtractIntPathParamWithContext
// common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
handler.Logger.Error("request err getting , GetCIPipelineById", "pipelineId", pipelineId, "err", err)
return
}

Expand Down Expand Up @@ -1711,20 +1717,29 @@ func (handler *PipelineConfigRestHandlerImpl) FetchWorkflowDetails(w http.Respon
common.HandleUnauthorized(w, r)
return
}
vars := mux.Vars(r)
appId, err := strconv.Atoi(vars["appId"])
// vars := mux.Vars(r)
// appId, err = strconv.Atoi(vars["appId"])
appId, err := common.ExtractIntPathParamWithContext(w, r, "appId", "app")
if err != nil {
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
// response already written by ExtractIntPathParamWithContext
// common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
handler.Logger.Error("request err getting , FetchWorkflowDetails", "appId", appId, "err", err)
return
}
pipelineId, err := strconv.Atoi(vars["pipelineId"])
// pipelineId, err := strconv.Atoi(vars["pipelineId"])
pipelineId, err := common.ExtractIntPathParamWithContext(w, r, "pipelineId", "pipeline")
if err != nil {
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
// response already written by ExtractIntPathParamWithContext
// common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
handler.Logger.Error("request err getting , FetchWorkflowDetails", "pipelineId", pipelineId, "err", err)
return
}
buildId, err := strconv.Atoi(vars["workflowId"])
// buildId, err := strconv.Atoi(vars["workflowId"])
buildId, err := common.ExtractIntPathParamWithContext(w, r, "workflowId", "workflow")
if err != nil || buildId == 0 {
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
// response already written by ExtractIntPathParamWithContext
// common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
handler.Logger.Error("request err getting , FetchWorkflowDetails", "buildId", buildId, "err", err)
return
}
handler.Logger.Infow("request payload, FetchWorkflowDetails", "appId", appId, "pipelineId", pipelineId, "buildId", buildId, "buildId", buildId)
Expand Down
20 changes: 18 additions & 2 deletions pkg/devtronResource/APIReqDecoderService.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"go.uber.org/zap"
"net/http"
"strconv"
"strings"
)

// APIReqDecoderService is common service used for getting decoded devtronResource and history related api params.
Expand Down Expand Up @@ -52,11 +53,26 @@ func (impl *APIReqDecoderServiceImpl) GetFilterCriteriaParamsForDeploymentHistor
return nil, &util2.ApiError{
HttpStatusCode: http.StatusBadRequest,
Code: "400",
InternalMessage: "invalid format filter criteria!",
UserMessage: "invalid format filter criteria!",
InternalMessage: "missing required identifiers: either (appId and envId) or pipelineId must be provided to fetch history",
UserMessage: "Please provide either both App ID and Env ID, or a Pipeline ID to view history.",
}
}
if resp.PipelineId == 0 {
missingResources := []string{}
if resp.AppId == 0 {
missingResources = append(missingResources, "appId")
}
if resp.EnvId == 0 {
missingResources = append(missingResources, "EnvId")
}
if len(missingResources) > 0 {
return nil, &util2.ApiError{
HttpStatusCode: http.StatusBadRequest,
Code: "400",
InternalMessage: "missing required resources: " + strings.Join(missingResources, ", "),
UserMessage: "missing required resources: " + strings.Join(missingResources, ", "),
}
}
pipelineObj, err := impl.pipelineRepository.FindActiveByAppIdAndEnvId(resp.AppId, resp.EnvId)
if err != nil {
impl.logger.Errorw("error in getting pipeline", "appId", resp.AppId, "envId", resp.EnvId, "err", err)
Expand Down
Loading