Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: Release candidate v0.21.0 #6027

Merged
merged 89 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
a4bcbd6
support for CdRollback and DeploymentHistory in configData API
prakash100198 Sep 11, 2024
e2ee5a6
support for getConfigDataForDeploymentHistory and getConfigDataForCdR…
prakash100198 Sep 12, 2024
f379640
resolve cm cs data in published config code incorporated
prakash100198 Sep 12, 2024
cb1df7b
Merge branch 'develop' into config-diff-3-oss
prakash100198 Sep 12, 2024
01e7110
Merge branch 'develop' into config-diff-3-oss
prakash100198 Sep 13, 2024
17a5c6b
Merge branch 'develop' into config-diff-3-oss
prakash100198 Sep 13, 2024
aa565e0
wip: bug fixes
prakash100198 Sep 16, 2024
5ffb0f8
wip: new config area to resolve data for given values
prakash100198 Sep 17, 2024
6d95766
wip: fix
prakash100198 Sep 17, 2024
4aad54a
wip: marshal resolved template before sending back res p
prakash100198 Sep 17, 2024
711b682
convert to json raw message for resolved data
prakash100198 Sep 17, 2024
d883794
Merge branch 'develop' into config-diff-3-oss
prakash100198 Sep 17, 2024
d0714dd
wip: fix
prakash100198 Sep 17, 2024
a7033a1
wip: convert to json raw
prakash100198 Sep 18, 2024
a0fe976
Merge branch 'develop' into config-diff-3-oss
prakash100198 Sep 18, 2024
28dcbd4
wip: take values from path param values
prakash100198 Sep 18, 2024
425780f
decode values payload
prakash100198 Sep 18, 2024
fa52171
if content of post config data is >0 then only parse the payload else…
prakash100198 Sep 18, 2024
530301e
add template version and isAppMetrics enabled in case of deployment t…
prakash100198 Sep 22, 2024
6f7bc6e
Merge branch 'develop' into config-diff-3-oss
prakash100198 Sep 25, 2024
89656bf
pipeline strategy in published data req
prakash100198 Sep 25, 2024
53e102a
making config/data api backward compatible
prakash100198 Sep 26, 2024
060d5d7
handle for pg no rows
prakash100198 Sep 26, 2024
891d267
Merge branch 'develop' into config-diff-3-oss
prakash100198 Oct 7, 2024
7a7627e
merge develop here
prakash100198 Oct 7, 2024
a720200
fix for chart version
prakash100198 Oct 7, 2024
596b86b
remove getResolvedConfigDataForValues
prakash100198 Oct 7, 2024
9b7b568
initialise acd client (#5965)
ayu-devtron Oct 8, 2024
fba905e
handle nil pipeline strategy in case of custom chart
prakash100198 Oct 8, 2024
e1cc5d3
Merge branch 'develop' into config-diff-3-oss
prakash100198 Oct 8, 2024
ae9c3aa
revert defer cancel
prakash100198 Oct 8, 2024
f575c99
removed the field cia
RajeevRanjan27 Oct 8, 2024
c15c963
Merge pull request #5970 from devtron-labs/fix-oss-app-detail-issues-…
vikramdevtron Oct 8, 2024
a83f5cc
code review :- 1
prakash100198 Oct 8, 2024
03a18d9
Merge branch 'develop' into config-diff-3-oss
prakash100198 Oct 8, 2024
228e8e8
remove pipelineStrategy
prakash100198 Oct 9, 2024
03d93ec
Merge branch 'release-candidate-v0.20.0' into config-diff-3-oss
prakash100198 Oct 10, 2024
57eb6b6
wire fix
prakash100198 Oct 10, 2024
7f8b3d0
add wfr_id in template/list api
prakash100198 Oct 10, 2024
c632f2d
handle forceabort case:- terminate workflow in this case and then mar…
prakash100198 Oct 10, 2024
c56c4c9
code review changes
prakash100198 Oct 10, 2024
9ab0473
chore: Main sync develop (#5983)
vikramdevtron Oct 14, 2024
308394f
terminate workflow refactoring
prakash100198 Oct 14, 2024
22302c8
Merge branch 'develop' into force-abort-fix
prakash100198 Oct 14, 2024
4dd1831
Merge branch 'main' into main-sync-14-oct-2024
prakash100198 Oct 14, 2024
3b68b05
Merge pull request #5985 from devtron-labs/main-sync-14-oct-2024
prakash100198 Oct 14, 2024
e70db64
fix: deployment window FIXED type (#5986)
RajeevRanjan27 Oct 14, 2024
aa670f1
scope var fix
prakash100198 Oct 14, 2024
494d30b
edit resource
prakash100198 Oct 14, 2024
177520a
TerminateDanglingWorkflow func in systemworkflowexec and argoworkflow…
prakash100198 Oct 15, 2024
5ffb3dd
previous deployments stage added
prakash100198 Oct 15, 2024
5b6e9f8
TerminateDanglingWorkflows flow written for both argo and system exec…
prakash100198 Oct 15, 2024
a2bd369
Merge branch 'develop' into force-abort-fix
prakash100198 Oct 15, 2024
34bea34
fix
prakash100198 Oct 15, 2024
6080ec9
check put for force abort
prakash100198 Oct 15, 2024
168dd93
added a check in TerminateDanglingWorkflow for argo wf exec
prakash100198 Oct 15, 2024
43c779a
Merge branch 'develop' into config-diff-3-oss
prakash100198 Oct 15, 2024
bba878a
fix
prakash100198 Oct 16, 2024
2cff702
terminal role (#5991)
Shivam-nagar23 Oct 16, 2024
73ad83e
fix helm deployment status (#5996)
iamayushm Oct 16, 2024
813738b
Merge branch 'develop' into config-diff-3-oss
prakash100198 Oct 17, 2024
ebcfd49
code review incorporation :- kartik
prakash100198 Oct 17, 2024
0078d80
code review incorporation :- kartik 2
prakash100198 Oct 17, 2024
9a52a06
Merge pull request #5837 from devtron-labs/config-diff-3-oss
prakash100198 Oct 17, 2024
0f766a8
reverted changes
kartik-579 Oct 18, 2024
0107961
add label of generateName prefix in workfow template and cancel workf…
prakash100198 Oct 20, 2024
7e5be55
Merge branch 'develop' into force-abort-fix
prakash100198 Oct 20, 2024
7795000
default version support
prakash100198 Oct 21, 2024
0cc28c3
chore: Trigger clean (#6004)
iamayushm Oct 21, 2024
c8b3943
api error
prakash100198 Oct 21, 2024
4174f9c
fix
prakash100198 Oct 21, 2024
92b080b
fix: custom tag (#5999)
iamayushm Oct 21, 2024
507ea4f
fix
prakash100198 Oct 21, 2024
b465a9e
Merge branch 'develop' into force-abort-fix
prakash100198 Oct 21, 2024
f7b5e61
fix
prakash100198 Oct 21, 2024
4e07b50
Merge remote-tracking branch 'origin/force-abort-fix' into force-abor…
prakash100198 Oct 21, 2024
0bb4701
Merge pull request #5990 from devtron-labs/force-abort-fix
prakash100198 Oct 21, 2024
2201fdb
Merge branch 'develop' into config-deployment-history-fix
prakash100198 Oct 21, 2024
58fbe74
Merge pull request #6003 from devtron-labs/config-deployment-history-fix
prakash100198 Oct 21, 2024
df7f275
chore: Cluster terminal images migration (#6006)
vikramdevtron Oct 21, 2024
b6cf6e8
chore: adding refchart migration (#6007)
badal773 Oct 21, 2024
fba47c9
migration fix (#6010)
vikramdevtron Oct 22, 2024
d125a95
migration fix (#6015)
vikramdevtron Oct 22, 2024
dc012c0
Charts hotfix (#1992) (#6018)
kamal-devtron Oct 23, 2024
7778530
helm app list cluster filter fix (#6019)
kartik-579 Oct 23, 2024
5f3e842
migration seq rename (#6023)
vikramdevtron Oct 24, 2024
46e941a
fix: Rename migration seq (#6024)
vikramdevtron Oct 24, 2024
85279c8
delete unwanted files (#6025)
vikramdevtron Oct 24, 2024
6d7f925
chore: Common lib update (#6026)
vikramdevtron Oct 24, 2024
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
12 changes: 10 additions & 2 deletions api/restHandler/DeploymentConfigurationRestHandler.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
package restHandler

import (
"context"
"fmt"
"github.com/devtron-labs/devtron/api/restHandler/common"
"github.com/devtron-labs/devtron/pkg/auth/authorisation/casbin"
"github.com/devtron-labs/devtron/pkg/auth/user"
"github.com/devtron-labs/devtron/pkg/configDiff"
"github.com/devtron-labs/devtron/pkg/configDiff/bean"
util2 "github.com/devtron-labs/devtron/util"
"github.com/devtron-labs/devtron/util/rbac"
"github.com/gorilla/schema"
"go.uber.org/zap"
"gopkg.in/go-playground/validator.v9"
"net/http"
"time"
)

type DeploymentConfigurationRestHandler interface {
Expand Down Expand Up @@ -88,6 +91,7 @@ func (handler *DeploymentConfigurationRestHandlerImpl) GetConfigData(w http.Resp
return
}

configDataQueryParams.UserId = userId
//RBAC START
token := r.Header.Get(common.TokenHeaderKey)
object := handler.enforcerUtil.GetAppRBACName(configDataQueryParams.AppName)
Expand All @@ -97,8 +101,12 @@ func (handler *DeploymentConfigurationRestHandlerImpl) GetConfigData(w http.Resp
return
}
//RBAC END

res, err := handler.deploymentConfigurationService.GetAllConfigData(r.Context(), configDataQueryParams)
isSuperAdmin := handler.enforcer.Enforce(token, casbin.ResourceGlobal, casbin.ActionGet, "*")
userHasAdminAccess := handler.enforcer.Enforce(token, casbin.ResourceApplications, casbin.ActionUpdate, object)
ctx, cancel := context.WithTimeout(r.Context(), 60*time.Second)
defer cancel()
ctx = util2.SetSuperAdminInContext(ctx, isSuperAdmin)
res, err := handler.deploymentConfigurationService.GetAllConfigData(ctx, configDataQueryParams, userHasAdminAccess)
if err != nil {
handler.logger.Errorw("service err, GetAllConfigData ", "err", err)
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1562,12 +1562,16 @@ func (handler *PipelineConfigRestHandlerImpl) CancelWorkflow(w http.ResponseWrit
return
}
var forceAbort bool
forceAbort, err = strconv.ParseBool(queryVars.Get("forceAbort"))
if err != nil {
handler.Logger.Errorw("request err, CancelWorkflow", "err", err)
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
forceAbortQueryParam := queryVars.Get("forceAbort")
if len(forceAbortQueryParam) > 0 {
forceAbort, err = strconv.ParseBool(forceAbortQueryParam)
if err != nil {
handler.Logger.Errorw("request err, CancelWorkflow", "err", err)
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
}
}

handler.Logger.Infow("request payload, CancelWorkflow", "workflowId", workflowId, "pipelineId", pipelineId)

ciPipeline, err := handler.ciPipelineRepository.FindById(pipelineId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2071,6 +2071,16 @@ func (handler *PipelineConfigRestHandlerImpl) CancelStage(w http.ResponseWriter,
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
return
}
var forceAbort bool
forceAbortQueryParam := r.URL.Query().Get("forceAbort")
if len(forceAbortQueryParam) > 0 {
forceAbort, err = strconv.ParseBool(forceAbortQueryParam)
if err != nil {
handler.Logger.Errorw("request err, CancelWorkflow", "err", err)
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
}
}
handler.Logger.Infow("request payload, CancelStage", "pipelineId", pipelineId, "workflowRunnerId", workflowRunnerId)

//RBAC
Expand All @@ -2082,7 +2092,7 @@ func (handler *PipelineConfigRestHandlerImpl) CancelStage(w http.ResponseWriter,
}
//RBAC

resp, err := handler.cdHandler.CancelStage(workflowRunnerId, userId)
resp, err := handler.cdHandler.CancelStage(workflowRunnerId, forceAbort, userId)
if err != nil {
handler.Logger.Errorw("service err, CancelStage", "err", err, "pipelineId", pipelineId, "workflowRunnerId", workflowRunnerId)
if util.IsErrNoRows(err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ func (handler PipelineTriggerRestHandlerImpl) OverrideConfig(w http.ResponseWrit
triggerContext := bean3.TriggerContext{
Context: ctx,
}
mergeResp, err := handler.cdTriggerService.ManualCdTrigger(triggerContext, &overrideRequest)
mergeResp, helmPackageName, err := handler.cdTriggerService.ManualCdTrigger(triggerContext, &overrideRequest)
span.End()
if err != nil {
handler.logger.Errorw("request err, OverrideConfig", "err", err, "payload", overrideRequest)
common.WriteJsonResp(w, err, err.Error(), http.StatusInternalServerError)
return
}
res := map[string]interface{}{"releaseId": mergeResp}
res := map[string]interface{}{"releaseId": mergeResp, "helmPackageName": helmPackageName}
common.WriteJsonResp(w, err, res, http.StatusOK)
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ require gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect

replace (
github.com/argoproj/argo-workflows/v3 v3.5.10 => github.com/devtron-labs/argo-workflows/v3 v3.5.10
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241010131105-e2c23f9c80da
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241024135802-b4888f54a136
github.com/go-check/check => github.com/go-check/check v0.0.0-20180628173108-788fd7840127
github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.5.5
k8s.io/api => k8s.io/api v0.29.7
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,8 @@ github.com/devtron-labs/argo-workflows/v3 v3.5.10 h1:6rxQOesOzDz6SgQCMDQNHaehsKF
github.com/devtron-labs/argo-workflows/v3 v3.5.10/go.mod h1:/vqxcovDPT4zqr4DjR5v7CF8ggpY1l3TSa2CIG3jmjA=
github.com/devtron-labs/authenticator v0.4.35-0.20240809073103-6e11da8083f8 h1:2+Q7Jdhpo/uMiaQiZZzAh+ZX7wEJIFuMFG6DEiMuo64=
github.com/devtron-labs/authenticator v0.4.35-0.20240809073103-6e11da8083f8/go.mod h1:702R6WIf5y9UzKGoCGxQ+x3l5Ws+l0fXg2xlCpSGFZI=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241010131105-e2c23f9c80da h1:vC6SMz6BM1doN+ZBGiDGyERJ/LphFQi5+Ab/YQkNJVo=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241010131105-e2c23f9c80da/go.mod h1:KpKnF4OSpQNDJmb4wVZq3Za88ePBw4xec2GOAGRm5UQ=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241024135802-b4888f54a136 h1:rNGxjU5L6NvObxGMt0+vNFmjkqstm7zDASiS+pakrgQ=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20241024135802-b4888f54a136/go.mod h1:KpKnF4OSpQNDJmb4wVZq3Za88ePBw4xec2GOAGRm5UQ=
github.com/devtron-labs/go-bitbucket v0.9.60-beta h1:VEx1jvDgdtDPS6A1uUFoaEi0l1/oLhbr+90xOwr6sDU=
github.com/devtron-labs/go-bitbucket v0.9.60-beta/go.mod h1:GnuiCesvh8xyHeMCb+twm8lBR/kQzJYSKL28ZfObp1Y=
github.com/devtron-labs/protos v0.0.3-0.20240802105333-92ee9bb85d80 h1:xwbTeijNTf4/j1v+tSfwVqwLVnReas/NqEKeQHvSTys=
Expand Down
3 changes: 2 additions & 1 deletion internal/sql/repository/DeploymentTemplateRepository.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type DeploymentTemplateComparisonMetadata struct {
EnvironmentId int `json:"environmentId,omitempty"`
EnvironmentName string `json:"environmentName,omitempty"`
DeploymentTemplateHistoryId int `json:"deploymentTemplateHistoryId,omitempty"`
WfrId int `json:"wfrId,omitempty"`
StartedOn *time.Time `json:"startedOn,omitempty"`
FinishedOn *time.Time `json:"finishedOn,omitempty"`
Status string `json:"status,omitempty"`
Expand Down Expand Up @@ -69,7 +70,7 @@ func (impl DeploymentTemplateRepositoryImpl) FetchDeploymentHistoryWithChartRefs
limit := 15

query := "select p.id as pipeline_id, dth.id as deployment_template_history_id," +
" wfr.finished_on, wfr.status, c.chart_ref_id, c.chart_version FROM cd_workflow_runner wfr" +
" wfr.id as wfr_id, wfr.finished_on, wfr.status, c.chart_ref_id, c.chart_version FROM cd_workflow_runner wfr" +
" JOIN cd_workflow wf ON wf.id = wfr.cd_workflow_id JOIN pipeline p ON p.id = wf.pipeline_id" +
" JOIN deployment_template_history dth ON dth.deployed_on = wfr.started_on " +
"JOIN pipeline_config_override pco ON pco.cd_workflow_id = wf.id " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func (impl AppListingRepositoryQueryBuilder) buildAppListingWhereCondition(appLi
}
if isNotDeployedFilterApplied {
deploymentAppType := "manifest_download"
whereCondition += " and (p.deployment_app_created=? and (p.deployment_app_type != ? or dc.deployment_app_type != ? ) or a.id NOT IN (SELECT app_id from pipeline) "
whereCondition += " and (p.deployment_app_created=? and (p.deployment_app_type <> ? or dc.deployment_app_type <> ? ) or a.id NOT IN (SELECT app_id from pipeline) "
queryParams = append(queryParams, false, deploymentAppType, deploymentAppType)
if len(appStatusExcludingNotDeployed) > 0 {
whereCondition += " or aps.status IN (?) "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -693,9 +693,10 @@ func (impl *CdWorkflowRepositoryImpl) GetLatestTriggersOfHelmPipelinesStuckInNon
Where("cd_workflow_runner.cd_workflow_id in"+
" (SELECT max(cd_workflow.id) as id from cd_workflow"+
" INNER JOIN cd_workflow_runner on cd_workflow.id = cd_workflow_runner.cd_workflow_id"+
" WHERE cd_workflow_runner.status != ?"+
" WHERE cd_workflow_runner.workflow_type = ? "+
" AND cd_workflow_runner.status != ?"+
" GROUP BY cd_workflow.pipeline_id"+
" ORDER BY cd_workflow.pipeline_id desc)", cdWorkflow.WorkflowInQueue).
" ORDER BY cd_workflow.pipeline_id desc)", apiBean.CD_WORKFLOW_TYPE_DEPLOY, cdWorkflow.WorkflowInQueue).
Where("(cd_workflow__pipeline.deployment_app_type=? or dc.deployment_app_type=?)", util.PIPELINE_DEPLOYMENT_TYPE_HELM, util.PIPELINE_DEPLOYMENT_TYPE_HELM).
Where("cd_workflow_runner.started_on > NOW() - INTERVAL '? hours'", getPipelineDeployedWithinHours).
Where("cd_workflow__pipeline.deleted=?", false).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,15 +439,15 @@ func (impl *InstalledAppRepositoryImpl) GetAllInstalledApps(filter *appStoreBean
}
if len(filter.ChartRepoId) > 0 {
query = query + " AND ch.id IN (?) "
queryParams = append(queryParams, sqlIntSeq(filter.ChartRepoId))
queryParams = append(queryParams, pg.In(filter.ChartRepoId))
}
if len(filter.EnvIds) > 0 {
query = query + " AND env.id IN (?) "
queryParams = append(queryParams, sqlIntSeq(filter.EnvIds))
queryParams = append(queryParams, pg.In(filter.EnvIds))
}
if len(filter.ClusterIds) > 0 {
query = query + " AND cluster.id IN (?) "
queryParams = append(queryParams, sqlIntSeq(filter.ClusterIds))
queryParams = append(queryParams, pg.In(filter.ClusterIds))
}
if len(filter.AppStatuses) > 0 {
appStatuses := pg.In(filter.AppStatuses)
Expand Down
3 changes: 3 additions & 0 deletions pkg/bean/configSecretData.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ type SecretList struct {
ConfigData []*ConfigData `json:"secrets"`
}

// there is an adapter written in pkg/bean folder to convert below ConfigData struct to pipeline/bean's ConfigData

// TODO refactoring: duplicate struct of ConfigData in ConfigMapBean.go
type ConfigData struct {
Name string `json:"name"`
Expand All @@ -49,6 +51,7 @@ type ConfigData struct {
SubPath bool `json:"subPath"`
ESOSubPath []string `json:"esoSubPath"`
FilePermission string `json:"filePermission"`
Overridden bool `json:"overridden"`
}

func (c *ConfigData) IsESOExternalSecretType() bool {
Expand Down
12 changes: 12 additions & 0 deletions pkg/cluster/repository/EnvironmentRepository.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ type EnvironmentRepository interface {
FindAllActiveWithFilter() ([]*Environment, error)
FindEnvClusterInfosByIds([]int) ([]*EnvCluserInfo, error)
FindEnvLinkedWithCiPipelines(externalCi bool, ciPipelineIds []int) ([]*Environment, error)
FindEnvByNameWithClusterDetails(envName string) (*Environment, error)
}

func NewEnvironmentRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger, appStatusRepository appStatus.AppStatusRepository) *EnvironmentRepositoryImpl {
Expand Down Expand Up @@ -160,6 +161,17 @@ func (repositoryImpl EnvironmentRepositoryImpl) FindByName(name string) (*Enviro
return environment, err
}

func (repositoryImpl EnvironmentRepositoryImpl) FindEnvByNameWithClusterDetails(envName string) (*Environment, error) {
environment := &Environment{}
err := repositoryImpl.dbConnection.
Model(environment).
Column("environment.*", "Cluster").
Where("environment.environment_name = ?", envName).
Where("environment.active = ?", true).
Select()
return environment, err
}

func (repositoryImpl EnvironmentRepositoryImpl) FindIdByName(name string) (int, error) {
environment := &Environment{}
err := repositoryImpl.dbConnection.
Expand Down
Loading
Loading