You've already forked sap-jenkins-library
mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-09-16 09:26:22 +02:00
detectExecuteScan: fix toolrun data (#4366)
This commit is contained in:
@@ -849,10 +849,20 @@ func createToolRecordDetect(utils detectUtils, workspace string, config detectEx
|
||||
return "", err
|
||||
}
|
||||
projectVersionUrl := projectVersion.Href
|
||||
if projectVersionUrl == "" {
|
||||
return "", fmt.Errorf("TR_DETECT: no projectversion URL")
|
||||
}
|
||||
// projectVersion UUID comes as last part of the URL
|
||||
vparts := strings.Split(projectVersionUrl, "/")
|
||||
projectVersionId := vparts[len(vparts)-1]
|
||||
if projectVersionId == "" {
|
||||
return "", fmt.Errorf("TR_DETECT: no projectversion id in %v", projectVersionUrl)
|
||||
}
|
||||
|
||||
err = record.AddKeyData("version",
|
||||
projectVersionId,
|
||||
projectVersion.Name,
|
||||
projectVersionUrl,
|
||||
projectVersionUrl)
|
||||
projectVersion.Href)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
@@ -69,8 +69,10 @@ func New(fileUtils fileWriteUtils, workspace, toolName, toolInstance string) *To
|
||||
now.Format("20060102150405")+
|
||||
".json")
|
||||
tr.reportFileName = reportFileName
|
||||
|
||||
return &tr
|
||||
// keep the timestamp inside the object too
|
||||
var otr = &tr
|
||||
otr.AddContext("generatedOnUtc", now.Format("20060102150405"))
|
||||
return otr
|
||||
}
|
||||
|
||||
// AddKeyData - add one key to the current toolrecord
|
||||
|
Reference in New Issue
Block a user