fix step yml parsing error log
@@ -572,14 +572,14 @@ func activateAndRunSteps(
break
case models.StepRunStatusCodeFailed:
if !isExitStatusError {
- log.Errorf("Step (%s) failed, error: %s", pointers.StringWithDefault(stepInfoCopy.Step.Title, "missing title"), err)
+ log.Errorf("Step (%s) failed: %s", pointers.StringWithDefault(stepInfoCopy.Step.Title, "missing title"), err)
}
buildRunResults.FailedSteps = append(buildRunResults.FailedSteps, stepResults)
break
case models.StepRunStatusCodeFailedSkippable:
if !isExitStatusError {
- log.Warnf("Step (%s) failed, but was marked as skippable, error: %s", pointers.StringWithDefault(stepInfoCopy.Step.Title, "missing title"), err)
+ log.Warnf("Step (%s) failed, but was marked as skippable: %s", pointers.StringWithDefault(stepInfoCopy.Step.Title, "missing title"), err)
} else {
log.Warnf("Step (%s) failed, but was marked as skippable", pointers.StringWithDefault(stepInfoCopy.Step.Title, "missing title"))
}
@@ -672,6 +672,7 @@ func activateAndRunSteps(
// Activating the step
stepDir := configs.BitriseWorkStepsDirPath
stepYMLPth := filepath.Join(configs.BitriseWorkDirPath, "current_step.yml")
+ var origStepYMLPth string
if stepIDData.SteplibSource == "path" {
log.Debugf("[BITRISE_CLI] - Local step found: (path:%s)", stepIDData.IDorURI)
@@ -684,7 +685,8 @@ func activateAndRunSteps(
log.Debugln("stepAbsLocalPth:", stepAbsLocalPth, "|stepDir:", stepDir)
- if err := command.CopyFile(filepath.Join(stepAbsLocalPth, "step.yml"), stepYMLPth); err != nil {
+ origStepYMLPth = filepath.Join(stepAbsLocalPth, "step.yml")
+ if err := command.CopyFile(origStepYMLPth, stepYMLPth); err != nil {
registerStepRunResults(stepmanModels.StepModel{}, stepInfoPtr, stepIdxPtr,
"", models.StepRunStatusCodeFailed, 1, err, isLastStep, true)
continue
@@ -816,8 +818,14 @@ func activateAndRunSteps(
specStep, err := bitrise.ReadSpecStep(stepYMLPth)
log.Debugf("Spec read from YML: %#v\n", specStep)
if err != nil {
+ ymlPth := stepYMLPth
+ if origStepYMLPth != "" {
+ // in case of local step (path:./) we use the original step definition path,
+ // instead of the activated step's one.
+ ymlPth = origStepYMLPth
+ }
registerStepRunResults(stepmanModels.StepModel{}, stepInfoPtr, stepIdxPtr,
- "", models.StepRunStatusCodeFailed, 1, err, isLastStep, true)
+ "", models.StepRunStatusCodeFailed, 1, fmt.Errorf("failed to parse step definition (%s): %s", ymlPth, err), isLastStep, true)
continue
}
