Skip to content

sync: Release candidate v0.36.0 #6595

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

Merged
merged 34 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7f7914f
wip
kartik-579 May 6, 2025
819743a
stack manager break fix (#6556)
Shivam-nagar23 May 7, 2025
ae85065
add response time in audit log
prakash100198 May 13, 2025
aeee946
Merge branch 'develop' into resp-time-audit-log
prakash100198 May 13, 2025
8598a40
main sync develop
vikramdevtron May 13, 2025
dd0ca94
Merge pull request #6566 from devtron-labs/resp-time-audit-log
prakash100198 May 13, 2025
ba2928e
vendor update develop
vikramdevtron May 13, 2025
0680b3b
vendor update develop
vikramdevtron May 13, 2025
3be5f94
Merge pull request #6565 from devtron-labs/main-sync-develop-13may
vikramdevtron May 13, 2025
31b1e79
chore: release target installations scripts (#6529)
Shivam-nagar23 May 13, 2025
0b76f83
fix: anomolies in deployment status timeline
Ash-exp May 14, 2025
da421d3
oss ent
kartik-579 May 15, 2025
19a3cf9
license add
kartik-579 May 15, 2025
b478c9c
fix: argocd sync start/ finish validation
Ash-exp May 15, 2025
00382ff
adding migration (#6575)
iamayushm May 15, 2025
ec50653
Merge branch 'develop' into scoped-var-patch-type-fix
kartik-579 May 16, 2025
8a76310
appid change
kartik-579 May 16, 2025
edbd5aa
chore: Remove dead dependencies from CI Runner
Ash-exp May 19, 2025
cf5cf97
Merge pull request #6582 from devtron-labs/chore-remove-aws-cli
Ash-exp May 19, 2025
6dd523d
Merge branch 'develop' into fix-argocd-update-event
Ash-exp May 19, 2025
4f40d19
Merge branch 'develop' into scoped-var-patch-type-fix
kartik-579 May 19, 2025
b9e94fd
Merge pull request #6572 from devtron-labs/scoped-var-patch-type-fix
kartik-579 May 19, 2025
2f9f5f5
Merge branch 'develop' into fix-argocd-update-event
Ash-exp May 19, 2025
87f37cb
Merge pull request #6569 from devtron-labs/fix-argocd-update-event
Ash-exp May 19, 2025
fc4aa57
main sync develop
vikramdevtron May 19, 2025
7229c14
vendor update in develop
vikramdevtron May 19, 2025
bcb1103
Merge pull request #6583 from devtron-labs/main-sync-develop-19may
vikramdevtron May 19, 2025
3872082
fix: deployment status is stuck is progressing for parallel deploymen…
Ash-exp May 21, 2025
fef9625
main sync rc
vikramdevtron May 21, 2025
d8634ad
Merge pull request #6593 from devtron-labs/main-sync-rc-21may
vikramdevtron May 21, 2025
2adc2f0
validation in node drain
prkhrkat May 21, 2025
aa128ae
validation in node drain
prkhrkat May 21, 2025
a7f40bd
Merge branch 'release-candidate-v0.36.0' into drain-node-fix
prkhrkat May 21, 2025
f790978
Merge pull request #6594 from devtron-labs/drain-node-fix
prkhrkat May 21, 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
14 changes: 13 additions & 1 deletion api/k8s/capacity/k8sCapacityRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/devtron-labs/devtron/pkg/cluster/rbac"
"github.com/devtron-labs/devtron/pkg/cluster/read"
bean3 "github.com/devtron-labs/devtron/pkg/k8s/bean"
"gopkg.in/go-playground/validator.v9"
"net/http"
"strconv"

Expand Down Expand Up @@ -60,6 +61,7 @@ type K8sCapacityRestHandlerImpl struct {
environmentService environment.EnvironmentService
clusterRbacService rbac.ClusterRbacService
clusterReadService read.ClusterReadService
validator *validator.Validate
}

func NewK8sCapacityRestHandlerImpl(logger *zap.SugaredLogger,
Expand All @@ -68,7 +70,7 @@ func NewK8sCapacityRestHandlerImpl(logger *zap.SugaredLogger,
clusterService cluster.ClusterService,
environmentService environment.EnvironmentService,
clusterRbacService rbac.ClusterRbacService,
clusterReadService read.ClusterReadService) *K8sCapacityRestHandlerImpl {
clusterReadService read.ClusterReadService, validator *validator.Validate) *K8sCapacityRestHandlerImpl {
return &K8sCapacityRestHandlerImpl{
logger: logger,
k8sCapacityService: k8sCapacityService,
Expand All @@ -78,6 +80,7 @@ func NewK8sCapacityRestHandlerImpl(logger *zap.SugaredLogger,
environmentService: environmentService,
clusterRbacService: clusterRbacService,
clusterReadService: clusterReadService,
validator: validator,
}
}

Expand Down Expand Up @@ -401,6 +404,15 @@ func (handler *K8sCapacityRestHandlerImpl) DrainNode(w http.ResponseWriter, r *h
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
}

// Validate the struct using the validator
err = handler.validator.Struct(nodeDrainReq)
if err != nil {
handler.logger.Errorw("validation error", "err", err, "payload", nodeDrainReq)
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
}

userId, err := handler.userService.GetLoggedInUser(r)
if userId == 0 || err != nil {
common.WriteJsonResp(w, err, "Unauthorized User", http.StatusUnauthorized)
Expand Down
24 changes: 15 additions & 9 deletions api/util/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ import (
)

type AuditLoggerDTO struct {
UrlPath string `json:"urlPath"`
UserEmail string `json:"userEmail"`
UpdatedOn time.Time `json:"updatedOn"`
QueryParams string `json:"queryParams"`
ApiResponseCode int `json:"apiResponseCode"`
RequestPayload []byte `json:"requestPayload"`
RequestMethod string `json:"requestMethod"`
UrlPath string `json:"urlPath"`
UserEmail string `json:"userEmail"`
UpdatedOn time.Time `json:"updatedOn"`
QueryParams string `json:"queryParams"`
ApiResponseCode int `json:"apiResponseCode"`
RequestPayload []byte `json:"requestPayload"`
RequestMethod string `json:"requestMethod"`
ResponseTime time.Duration `json:"responseTime"`
}

type LoggingMiddlewareImpl struct {
Expand Down Expand Up @@ -72,22 +73,27 @@ func (impl LoggingMiddlewareImpl) LoggingMiddleware(next http.Handler) http.Hand
// Restore the request body for downstream handlers
r.Body = io.NopCloser(&bodyBuffer)

// Record start time for calculating response time
startTime := time.Now()

auditLogDto := &AuditLoggerDTO{
UrlPath: r.URL.Path,
UserEmail: userEmail,
UpdatedOn: time.Now(),
UpdatedOn: startTime,
QueryParams: r.URL.Query().Encode(),
RequestPayload: bodyBuffer.Bytes(),
RequestMethod: r.Method,
}
// Call the next handler in the chain.
next.ServeHTTP(d, r)

// Calculate response time
auditLogDto.ResponseTime = time.Since(startTime)
auditLogDto.ApiResponseCode = d.Status()
LogRequest(auditLogDto)
})
}

func LogRequest(auditLogDto *AuditLoggerDTO) {
log.Printf("AUDIT_LOG: requestMethod: %s, urlPath: %s, queryParams: %s, updatedBy: %s, updatedOn: %s, apiResponseCode: %d, requestPayload: %s", auditLogDto.RequestMethod, auditLogDto.UrlPath, auditLogDto.QueryParams, auditLogDto.UserEmail, auditLogDto.UpdatedOn, auditLogDto.ApiResponseCode, auditLogDto.RequestPayload)
log.Printf("AUDIT_LOG: requestMethod: %s, urlPath: %s, queryParams: %s, updatedBy: %s, updatedOn: %s, apiResponseCode: %d, responseTime: %s, requestPayload: %s", auditLogDto.RequestMethod, auditLogDto.UrlPath, auditLogDto.QueryParams, auditLogDto.UserEmail, auditLogDto.UpdatedOn, auditLogDto.ApiResponseCode, auditLogDto.ResponseTime, auditLogDto.RequestPayload)
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ require (

replace (
github.com/argoproj/argo-workflows/v3 v3.5.13 => github.com/devtron-labs/argo-workflows/v3 v3.5.13
github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250516092913-a8cc2e4a33e5
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250516092913-a8cc2e4a33e5
github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250519113737-b060cea3a495
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250519113737-b060cea3a495
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
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -829,10 +829,10 @@ github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc h1:VRRKCwnzq
github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
github.com/devtron-labs/argo-workflows/v3 v3.5.13 h1:3pINq0gXOSeTw2z/vYe+j80lRpSN5Rp/8mfQORh8SmU=
github.com/devtron-labs/argo-workflows/v3 v3.5.13/go.mod h1:/vqxcovDPT4zqr4DjR5v7CF8ggpY1l3TSa2CIG3jmjA=
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250516092913-a8cc2e4a33e5 h1:RzH1TwejuyKys9pLooVRy+nDkI1vaBV+GTJK9zIhIEg=
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250516092913-a8cc2e4a33e5/go.mod h1:FfaLDXN1ZXxyRpnskBqVIYkpkWDCzBmDgIO9xqLnxdQ=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250516092913-a8cc2e4a33e5 h1:8/TvnOcams0ewKNBZcywwA/Ccr8ZIhFWBrK3k6di5Lo=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250516092913-a8cc2e4a33e5/go.mod h1:zkNShlkcHxsmnL0gKNbs0uyRL8lZonGKr5Km63uTLI0=
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250519113737-b060cea3a495 h1:GBe/yfpn5uU3Myv0TV4KBvSLfuwRRjTN7uXAupeUhbk=
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250519113737-b060cea3a495/go.mod h1:FfaLDXN1ZXxyRpnskBqVIYkpkWDCzBmDgIO9xqLnxdQ=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250519113737-b060cea3a495 h1:aEJw3HPicUqpwBIZos5lsiNIuL1c4w5bqadkHyj+dAA=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250519113737-b060cea3a495/go.mod h1:CXQGEo+kZc7JPX5hn4jJf1msal9q/ExSdAYGkHNPnQw=
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.20250323220609-ecf8a0f7305e h1:U6UdYbW8a7xn5IzFPd8cywjVVPfutGJCudjePAfL/Hs=
Expand Down
16 changes: 16 additions & 0 deletions internal/sql/repository/pipelineConfig/PipelineRepository.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ type PipelineRepository interface {
FindDeploymentAppTypeByIds(ids []int) (pipelines []*Pipeline, err error)
GetAllAppsByClusterAndDeploymentAppType(clusterIds []int, deploymentAppName string) ([]*PipelineDeploymentConfigObj, error)
GetAllArgoAppInfoByDeploymentAppNames(deploymentAppNames []string) ([]*PipelineDeploymentConfigObj, error)
FindEnvIdsByIdsInIncludingDeleted(ids []int) ([]int, error)
}

type CiArtifactDTO struct {
Expand Down Expand Up @@ -951,3 +952,18 @@ func (impl *PipelineRepositoryImpl) GetAllArgoAppInfoByDeploymentAppNames(deploy
Select(&result)
return result, err
}

func (impl *PipelineRepositoryImpl) FindEnvIdsByIdsInIncludingDeleted(ids []int) ([]int, error) {
var envIds []int
if len(ids) == 0 {
return envIds, nil
}
err := impl.dbConnection.Model(&Pipeline{}).
Column("pipeline.environment_id").
Where("pipeline.id in (?)", pg.In(ids)).
Select(&envIds)
if err != nil {
impl.logger.Errorw("error on fetching pipelines", "ids", ids, "err", err)
}
return envIds, err
}
28 changes: 17 additions & 11 deletions pkg/app/AppService.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ import (
type AppServiceConfig struct {
CdPipelineStatusCronTime string `env:"CD_PIPELINE_STATUS_CRON_TIME" envDefault:"*/2 * * * *" description:"Cron time for CD pipeline status"`
CdHelmPipelineStatusCronTime string `env:"CD_HELM_PIPELINE_STATUS_CRON_TIME" envDefault:"*/2 * * * *" description:"Cron time to check the pipeline status "`
CdPipelineStatusTimeoutDuration string `env:"CD_PIPELINE_STATUS_TIMEOUT_DURATION" envDefault:"20" description:"Timeout for CD pipeline to get healthy" ` // in minutes
PipelineDegradedTime string `env:"PIPELINE_DEGRADED_TIME" envDefault:"10" description:"Time to mark a pipeline degraded if not healthy in defined time"` // in minutes
GetPipelineDeployedWithinHours int `env:"DEPLOY_STATUS_CRON_GET_PIPELINE_DEPLOYED_WITHIN_HOURS" envDefault:"12" description:"This flag is used to fetch the deployment status of the application. It retrieves the status of deployments that occurred between 12 hours and 10 minutes prior to the current time. It fetches non-terminal statuses."` // in hours
HelmPipelineStatusCheckEligibleTime string `env:"HELM_PIPELINE_STATUS_CHECK_ELIGIBLE_TIME" envDefault:"120" description:"eligible time for checking helm app status periodically and update in db, value is in seconds., default is 120, if wfr is updated within configured time i.e. HELM_PIPELINE_STATUS_CHECK_ELIGIBLE_TIME then do not include for this cron cycle."` // in seconds
CdPipelineStatusTimeoutDuration string `env:"CD_PIPELINE_STATUS_TIMEOUT_DURATION" envDefault:"20" description:"Timeout for CD pipeline to get healthy" ` // in minutes
PipelineDegradedTime string `env:"PIPELINE_DEGRADED_TIME" envDefault:"10" description:"Time to mark a pipeline degraded if not healthy in defined time"` // in minutes
GetPipelineDeployedWithinHours int `env:"DEPLOY_STATUS_CRON_GET_PIPELINE_DEPLOYED_WITHIN_HOURS" envDefault:"12" description:"This flag is used to fetch the deployment status of the application. It retrieves the status of deployments that occurred between 12 hours and 10 minutes prior to the current time. It fetches non-terminal statuses."` // in hours
HelmPipelineStatusCheckEligibleTime string `env:"HELM_PIPELINE_STATUS_CHECK_ELIGIBLE_TIME" envDefault:"120" description:"eligible time for checking helm app status periodically and update in db, value is in seconds., default is 120, if wfr is updated within configured time i.e. HELM_PIPELINE_STATUS_CHECK_ELIGIBLE_TIME then do not include for this cron cycle."` // in seconds
ExposeCDMetrics bool `env:"EXPOSE_CD_METRICS" envDefault:"false"`
DevtronChartHelmInstallRequestTimeout int `env:"DEVTRON_CHART_INSTALL_REQUEST_TIMEOUT" envDefault:"6" description:"Context timeout for no gitops concurrent async deployments"` // in minutes
DevtronChartArgoCdInstallRequestTimeout int `env:"DEVTRON_CHART_ARGO_CD_INSTALL_REQUEST_TIMEOUT" envDefault:"1" description:"Context timeout for gitops concurrent async deployments"` // in minutes
ArgoCdManualSyncCronPipelineDeployedBefore int `env:"ARGO_APP_MANUAL_SYNC_TIME" envDefault:"3" description:"retry argocd app manual sync if the timeline is stuck in ARGOCD_SYNC_INITIATED state for more than this defined time (in mins)"` // in minutes
DevtronChartHelmInstallRequestTimeout int `env:"DEVTRON_CHART_INSTALL_REQUEST_TIMEOUT" envDefault:"6" description:"Context timeout for no gitops concurrent async deployments"` // in minutes
DevtronChartArgoCdInstallRequestTimeout int `env:"DEVTRON_CHART_ARGO_CD_INSTALL_REQUEST_TIMEOUT" envDefault:"1" description:"Context timeout for gitops concurrent async deployments"` // in minutes
ArgoCdManualSyncCronPipelineDeployedBefore int `env:"ARGO_APP_MANUAL_SYNC_TIME" envDefault:"3" description:"retry argocd app manual sync if the timeline is stuck in ARGOCD_SYNC_INITIATED state for more than this defined time (in mins)"` // in minutes
}

func GetAppServiceConfig() (*AppServiceConfig, error) {
Expand Down Expand Up @@ -555,10 +555,11 @@ func (impl *AppServiceImpl) UpdatePipelineStatusTimelineForApplicationChanges(ap
if err != nil {
impl.logger.Errorw("error in save/update pipeline status fetch detail", "err", err, "cdWfrId", runnerHistoryId)
}
syncStartTime := helper.GetSyncStartTime(app, statusTime)
// creating cd pipeline status timeline
timeline := &pipelineConfig.PipelineStatusTimeline{
CdWorkflowRunnerId: runnerHistoryId,
StatusTime: helper.GetSyncStartTime(app, statusTime),
StatusTime: syncStartTime,
AuditLog: sql.AuditLog{
CreatedBy: 1,
CreatedOn: time.Now(),
Expand Down Expand Up @@ -591,7 +592,8 @@ func (impl *AppServiceImpl) UpdatePipelineStatusTimelineForApplicationChanges(ap
timeline.Id = 0
timeline.Status = timelineStatus.TIMELINE_STATUS_KUBECTL_APPLY_SYNCED
timeline.StatusDetail = app.Status.OperationState.Message
timeline.StatusTime = helper.GetSyncFinishTime(app, statusTime)
syncFinishTime := helper.GetSyncFinishTime(app, statusTime)
timeline.StatusTime = syncFinishTime
// checking and saving if this timeline is present or not because kubewatch may stream same objects multiple times
err = impl.pipelineStatusTimelineService.SaveTimeline(timeline, nil)
if err != nil {
Expand All @@ -610,6 +612,7 @@ func (impl *AppServiceImpl) UpdatePipelineStatusTimelineForApplicationChanges(ap
haveNewTimeline = true
timeline.Status = timelineStatus.TIMELINE_STATUS_APP_HEALTHY
timeline.StatusDetail = "App status is Healthy."
timeline.StatusTime = statusTime
}
if haveNewTimeline {
// not checking if this status is already present or not because already checked for terminal status existence earlier
Expand Down Expand Up @@ -668,10 +671,11 @@ func (impl *AppServiceImpl) UpdatePipelineStatusTimelineForApplicationChanges(ap
if err != nil {
impl.logger.Errorw("error in save/update pipeline status fetch detail", "err", err, "installedAppVersionHistoryId", runnerHistoryId)
}
syncStartTime := helper.GetSyncStartTime(app, statusTime)
// creating installedAppVersionHistory status timeline
timeline := &pipelineConfig.PipelineStatusTimeline{
InstalledAppVersionHistoryId: runnerHistoryId,
StatusTime: helper.GetSyncStartTime(app, statusTime),
StatusTime: syncStartTime,
AuditLog: sql.AuditLog{
CreatedBy: 1,
CreatedOn: time.Now(),
Expand Down Expand Up @@ -704,7 +708,8 @@ func (impl *AppServiceImpl) UpdatePipelineStatusTimelineForApplicationChanges(ap
timeline.Id = 0
timeline.Status = timelineStatus.TIMELINE_STATUS_KUBECTL_APPLY_SYNCED
timeline.StatusDetail = app.Status.OperationState.Message
timeline.StatusTime = helper.GetSyncFinishTime(app, statusTime)
syncFinishTime := helper.GetSyncFinishTime(app, statusTime)
timeline.StatusTime = syncFinishTime
// checking and saving if this timeline is present or not because kubewatch may stream same objects multiple times
err = impl.pipelineStatusTimelineService.SaveTimeline(timeline, nil)
if err != nil {
Expand All @@ -723,6 +728,7 @@ func (impl *AppServiceImpl) UpdatePipelineStatusTimelineForApplicationChanges(ap
haveNewTimeline = true
timeline.Status = timelineStatus.TIMELINE_STATUS_APP_HEALTHY
timeline.StatusDetail = "App status is Healthy."
timeline.StatusTime = statusTime
}
if haveNewTimeline {
// not checking if this status is already present or not because already checked for terminal status existence earlier
Expand Down
10 changes: 8 additions & 2 deletions pkg/app/status/PipelineStatusTimelineResourcesService.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,24 @@ func (impl *PipelineStatusTimelineResourcesServiceImpl) SaveOrUpdatePipelineTime
if application != nil && application.Status.OperationState != nil && application.Status.OperationState.SyncResult != nil {
for _, resource := range application.Status.OperationState.SyncResult.Resources {
if resource != nil {
resourceStatus := string(resource.HookPhase)
if len(resourceStatus) == 0 {
resourceStatus = string(resource.Status)
}
//if resource is already present in the timelineResources, then update it
if index, ok := oldTimelineResourceMap[resource.Name]; ok {
timelineResources[index].ResourceStatus = string(resource.HookPhase)
timelineResources[index].ResourceStatus = resourceStatus
timelineResources[index].StatusMessage = resource.Message
timelineResources[index].UpdatedBy = userId
timelineResources[index].UpdatedOn = time.Now()
timelineResourcesToBeUpdated = append(timelineResourcesToBeUpdated, timelineResources[index])
} else {
//if resource is not present in the timelineResources, then create a new one
newTimelineResource := &pipelineConfig.PipelineStatusTimelineResources{
ResourceName: resource.Name,
ResourceKind: resource.Kind,
ResourceGroup: resource.Group,
ResourceStatus: string(resource.HookPhase),
ResourceStatus: resourceStatus,
StatusMessage: resource.Message,
AuditLog: sql.AuditLog{
CreatedBy: userId,
Expand Down
2 changes: 2 additions & 0 deletions pkg/argoApplication/helper/deploymentStatusHelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
// GetSyncStartTime assumes that it is always called for calculating start time of latest git hash
func GetSyncStartTime(app *v1alpha1.Application, defaultStartTime time.Time) time.Time {
startTime := metav1.NewTime(defaultStartTime)
// FIXME: this should be the git hash of the latest PCO
gitHash := app.Status.Sync.Revision
if app.Status.OperationState != nil {
startTime = app.Status.OperationState.StartedAt
Expand All @@ -25,6 +26,7 @@ func GetSyncStartTime(app *v1alpha1.Application, defaultStartTime time.Time) tim
// GetSyncFinishTime assumes that it is always called for calculating finish time of latest git hash
func GetSyncFinishTime(app *v1alpha1.Application, defaultEndTime time.Time) time.Time {
finishTime := metav1.NewTime(defaultEndTime)
// FIXME: this should be the git hash of the latest PCO
gitHash := app.Status.Sync.Revision
if app.Status.OperationState != nil && app.Status.OperationState.FinishedAt != nil {
finishTime = *app.Status.OperationState.FinishedAt
Expand Down
2 changes: 1 addition & 1 deletion pkg/build/trigger/HandlerService.go
Original file line number Diff line number Diff line change
Expand Up @@ -1910,7 +1910,7 @@ func (impl *HandlerServiceImpl) DownloadCiWorkflowArtifacts(pipelineId int, buil
impl.ciWorkflowRepository.MigrateCiArtifactLocation(ciWorkflow.Id, key)
}
baseLogLocationPathConfig := impl.config.BaseLogLocationPath
blobStorageService := blob_storage.NewBlobStorageServiceImpl(nil)
blobStorageService := blob_storage.NewBlobStorageServiceImpl(impl.Logger)
destinationKey := filepath.Clean(filepath.Join(baseLogLocationPathConfig, item))
request := &blob_storage.BlobStorageRequest{
StorageType: impl.config.CloudProvider,
Expand Down
Loading