[go: nahoru, domu]

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

fix: Source code data not displayed in linked CI pipeline #2956

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
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
19 changes: 17 additions & 2 deletions pkg/pipeline/CdHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,22 @@ func (impl *CdHandlerImpl) FetchCdWorkflowDetails(appId int, environmentId int,
if triggeredByUser == nil {
triggeredByUser = &bean.UserInfo{EmailId: "anonymous"}
}
ciArtifactId := workflow.CiArtifactId
if ciArtifactId > 0 {
ciArtifact, err := impl.ciArtifactRepository.Get(ciArtifactId)
if err != nil {
impl.Logger.Errorw("error fetching artifact data", "err", err)
return WorkflowResponse{}, err
}

ciMaterials, err := impl.ciPipelineMaterialRepository.GetByPipelineId(workflowR.CdWorkflow.Pipeline.CiPipelineId)
// handling linked ci pipeline
if ciArtifact.ParentCiArtifact > 0 && ciArtifact.WorkflowId == nil {
ciArtifactId = ciArtifact.ParentCiArtifact
}
}
ciWf, err := impl.ciWorkflowRepository.FindLastTriggeredWorkflowByArtifactId(ciArtifactId)

ciMaterials, err := impl.ciPipelineMaterialRepository.GetByPipelineId(ciWf.CiPipelineId)
if err != nil {
impl.Logger.Errorw("err", "err", err)
return WorkflowResponse{}, err
Expand All @@ -664,7 +678,7 @@ func (impl *CdHandlerImpl) FetchCdWorkflowDetails(appId int, environmentId int,
}
ciMaterialsArr = append(ciMaterialsArr, res)
}
ciWf, err := impl.ciWorkflowRepository.FindLastTriggeredWorkflowByArtifactId(workflow.CiArtifactId)

if err != nil && err != pg.ErrNoRows {
impl.Logger.Errorw("error in fetching ci wf", "artifactId", workflow.CiArtifactId, "err", err)
return WorkflowResponse{}, err
Expand Down Expand Up @@ -692,6 +706,7 @@ func (impl *CdHandlerImpl) FetchCdWorkflowDetails(appId int, environmentId int,
BlobStorageEnabled: workflow.BlobStorageEnabled,
}
return workflowResponse, nil

}

func (impl *CdHandlerImpl) DownloadCdWorkflowArtifacts(pipelineId int, buildId int) (*os.File, error) {
Expand Down