Skip to content

Commit

Permalink
errorcause and remove telemetry warnings (#4951)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiloKo authored Jun 20, 2024
1 parent 1b728cc commit bf9c743
Show file tree
Hide file tree
Showing 23 changed files with 182 additions and 101 deletions.
6 changes: 4 additions & 2 deletions cmd/abapAddonAssemblyKitCheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ import (

func abapAddonAssemblyKitCheck(config abapAddonAssemblyKitCheckOptions, telemetryData *telemetry.CustomData, commonPipelineEnvironment *abapAddonAssemblyKitCheckCommonPipelineEnvironment) {
utils := aakaas.NewAakBundle()
telemetryData.BuildTool = "AAKaaS"

err := runAbapAddonAssemblyKitCheck(&config, telemetryData, utils, commonPipelineEnvironment)
err := runAbapAddonAssemblyKitCheck(&config, utils, commonPipelineEnvironment)
if err != nil {
telemetryData.ErrorCode = err.Error()
log.Entry().WithError(err).Fatal("step execution failed")
}
}

func runAbapAddonAssemblyKitCheck(config *abapAddonAssemblyKitCheckOptions, telemetryData *telemetry.CustomData, utils aakaas.AakUtils, commonPipelineEnvironment *abapAddonAssemblyKitCheckCommonPipelineEnvironment) error {
func runAbapAddonAssemblyKitCheck(config *abapAddonAssemblyKitCheckOptions, utils aakaas.AakUtils, commonPipelineEnvironment *abapAddonAssemblyKitCheckCommonPipelineEnvironment) error {

log.Entry().Info("╔═══════════════════════════╗")
log.Entry().Info("║ abapAddonAssemblyKitCheck ║")
Expand Down
6 changes: 4 additions & 2 deletions cmd/abapAddonAssemblyKitCheckCVs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import (

func abapAddonAssemblyKitCheckCVs(config abapAddonAssemblyKitCheckCVsOptions, telemetryData *telemetry.CustomData, cpe *abapAddonAssemblyKitCheckCVsCommonPipelineEnvironment) {
utils := aakaas.NewAakBundle()
if err := runAbapAddonAssemblyKitCheckCVs(&config, telemetryData, &utils, cpe); err != nil {
telemetryData.BuildTool = "AAKaaS"
if err := runAbapAddonAssemblyKitCheckCVs(&config, &utils, cpe); err != nil {
telemetryData.ErrorCode = err.Error()
log.Entry().WithError(err).Fatal("step execution failed")
}
}

func runAbapAddonAssemblyKitCheckCVs(config *abapAddonAssemblyKitCheckCVsOptions, telemetryData *telemetry.CustomData, utils *aakaas.AakUtils, cpe *abapAddonAssemblyKitCheckCVsCommonPipelineEnvironment) error {
func runAbapAddonAssemblyKitCheckCVs(config *abapAddonAssemblyKitCheckCVsOptions, utils *aakaas.AakUtils, cpe *abapAddonAssemblyKitCheckCVsCommonPipelineEnvironment) error {

log.Entry().Info("╔══════════════════════════════╗")
log.Entry().Info("║ abapAddonAssemblyKitCheckCVs ║")
Expand Down
8 changes: 4 additions & 4 deletions cmd/abapAddonAssemblyKitCheckCVs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestCheckCVsStep(t *testing.T) {
config.Password = "dummyPassword"
t.Run("step success", func(t *testing.T) {
config.AddonDescriptorFileName = "success"
err := runAbapAddonAssemblyKitCheckCVs(&config, nil, &utils, &cpe)
err := runAbapAddonAssemblyKitCheckCVs(&config, &utils, &cpe)
assert.NoError(t, err, "Did not expect error")
var addonDescriptorFinal abaputils.AddonDescriptor
err = json.Unmarshal([]byte(cpe.abap.addonDescriptor), &addonDescriptorFinal)
Expand All @@ -34,21 +34,21 @@ func TestCheckCVsStep(t *testing.T) {
})
t.Run("step error - in validate(no CommitID)", func(t *testing.T) {
config.AddonDescriptorFileName = "noCommitID"
err := runAbapAddonAssemblyKitCheckCVs(&config, nil, &utils, &cpe)
err := runAbapAddonAssemblyKitCheckCVs(&config, &utils, &cpe)
assert.Error(t, err, "Must end with error")
assert.Contains(t, err.Error(), "CommitID missing in repo")
})
t.Run("step error - in ReadAddonDescriptor", func(t *testing.T) {
config.AddonDescriptorFileName = "failing"
err := runAbapAddonAssemblyKitCheckCVs(&config, nil, &utils, &cpe)
err := runAbapAddonAssemblyKitCheckCVs(&config, &utils, &cpe)
assert.Error(t, err, "Must end with error")
assert.Contains(t, "error in ReadAddonDescriptor", err.Error())
})
t.Run("step error - in validate", func(t *testing.T) {
config.AddonDescriptorFileName = "success"
bundle.SetBody("ErrorBody")
bundle.SetError("error during validation")
err := runAbapAddonAssemblyKitCheckCVs(&config, nil, &utils, &cpe)
err := runAbapAddonAssemblyKitCheckCVs(&config, &utils, &cpe)
assert.Error(t, err, "Must end with error")
})
}
Expand Down
7 changes: 4 additions & 3 deletions cmd/abapAddonAssemblyKitCheckPV.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import (

func abapAddonAssemblyKitCheckPV(config abapAddonAssemblyKitCheckPVOptions, telemetryData *telemetry.CustomData, cpe *abapAddonAssemblyKitCheckPVCommonPipelineEnvironment) {
utils := aakaas.NewAakBundle()
// error situations should stop execution through log.Entry().Fatal() call which leads to an os.Exit(1) in the end
if err := runAbapAddonAssemblyKitCheckPV(&config, telemetryData, utils, cpe); err != nil {
telemetryData.BuildTool = "AAKaaS"
if err := runAbapAddonAssemblyKitCheckPV(&config, utils, cpe); err != nil {
telemetryData.ErrorCode = err.Error()
log.Entry().WithError(err).Fatal("step execution failed")
}
}
func runAbapAddonAssemblyKitCheckPV(config *abapAddonAssemblyKitCheckPVOptions, telemetryData *telemetry.CustomData, utils aakaas.AakUtils, cpe *abapAddonAssemblyKitCheckPVCommonPipelineEnvironment) error {
func runAbapAddonAssemblyKitCheckPV(config *abapAddonAssemblyKitCheckPVOptions, utils aakaas.AakUtils, cpe *abapAddonAssemblyKitCheckPVCommonPipelineEnvironment) error {

log.Entry().Info("╔═════════════════════════════╗")
log.Entry().Info("║ abapAddonAssemblyKitCheckPV ║")
Expand Down
6 changes: 3 additions & 3 deletions cmd/abapAddonAssemblyKitCheckPV_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestCheckPVStep(t *testing.T) {
config.Password = "dummyPassword"
t.Run("step success", func(t *testing.T) {
config.AddonDescriptorFileName = "success"
err := runAbapAddonAssemblyKitCheckPV(&config, nil, utils, &cpe)
err := runAbapAddonAssemblyKitCheckPV(&config, utils, &cpe)
assert.NoError(t, err, "Did not expect error")
var addonDescriptorFinal abaputils.AddonDescriptor
err = json.Unmarshal([]byte(cpe.abap.addonDescriptor), &addonDescriptorFinal)
Expand All @@ -33,15 +33,15 @@ func TestCheckPVStep(t *testing.T) {
})
t.Run("step error - in ReadAddonDescriptor", func(t *testing.T) {
config.AddonDescriptorFileName = "failing"
err := runAbapAddonAssemblyKitCheckPV(&config, nil, utils, &cpe)
err := runAbapAddonAssemblyKitCheckPV(&config, utils, &cpe)
assert.Error(t, err, "Did expect error")
assert.Equal(t, err.Error(), "error in ReadAddonDescriptor")
})
t.Run("step error - in validate", func(t *testing.T) {
config.AddonDescriptorFileName = "success"
bundle.SetBody("ErrorBody")
bundle.SetError("error during validation")
err := runAbapAddonAssemblyKitCheckPV(&config, nil, utils, &cpe)
err := runAbapAddonAssemblyKitCheckPV(&config, utils, &cpe)
assert.Error(t, err, "Did expect error")
})
}
4 changes: 2 additions & 2 deletions cmd/abapAddonAssemblyKitCheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestRunAbapAddonAssemblyKitCheck(t *testing.T) {
},
}

err := runAbapAddonAssemblyKitCheck(&config, nil, utils, &cpe)
err := runAbapAddonAssemblyKitCheck(&config, utils, &cpe)

assert.NoError(t, err)
})
Expand All @@ -53,7 +53,7 @@ func TestRunAbapAddonAssemblyKitCheck(t *testing.T) {
},
}

err := runAbapAddonAssemblyKitCheck(&config, nil, utils, &cpe)
err := runAbapAddonAssemblyKitCheck(&config, utils, &cpe)

assert.EqualError(t, err, "addonDescriptor must contain at least one software component repository")
})
Expand Down
6 changes: 4 additions & 2 deletions cmd/abapAddonAssemblyKitCreateTargetVector.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ func abapAddonAssemblyKitCreateTargetVector(config abapAddonAssemblyKitCreateTar
c.Stderr(log.Writer())

client := piperhttp.Client{}
telemetryData.BuildTool = "AAKaaS"

// error situations should stop execution through log.Entry().Fatal() call which leads to an os.Exit(1) in the end
err := runAbapAddonAssemblyKitCreateTargetVector(&config, telemetryData, &client, cpe)
err := runAbapAddonAssemblyKitCreateTargetVector(&config, &client, cpe)
if err != nil {
telemetryData.ErrorCode = err.Error()
log.Entry().WithError(err).Fatal("step execution failed")
}
}

func runAbapAddonAssemblyKitCreateTargetVector(config *abapAddonAssemblyKitCreateTargetVectorOptions, telemetryData *telemetry.CustomData, client piperhttp.Sender, cpe *abapAddonAssemblyKitCreateTargetVectorCommonPipelineEnvironment) error {
func runAbapAddonAssemblyKitCreateTargetVector(config *abapAddonAssemblyKitCreateTargetVectorOptions, client piperhttp.Sender, cpe *abapAddonAssemblyKitCreateTargetVectorCommonPipelineEnvironment) error {
conn := new(abapbuild.Connector)
if err := conn.InitAAKaaS(config.AbapAddonAssemblyKitEndpoint, config.Username, config.Password, client, config.AbapAddonAssemblyKitOriginHash, config.AbapAddonAssemblyKitCertificateFile, config.AbapAddonAssemblyKitCertificatePass); err != nil {
return err
Expand Down
8 changes: 4 additions & 4 deletions cmd/abapAddonAssemblyKitCreateTargetVector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestCreateTargetVectorStep(t *testing.T) {

t.Run("step success test", func(t *testing.T) {
//act
err := runAbapAddonAssemblyKitCreateTargetVector(&config, nil, client, &cpe)
err := runAbapAddonAssemblyKitCreateTargetVector(&config, client, &cpe)
//assert
assert.NoError(t, err, "Did not expect error")

Expand All @@ -62,7 +62,7 @@ func TestCreateTargetVectorStep(t *testing.T) {
Error: errors.New("dummy"),
}
//act
err := runAbapAddonAssemblyKitCreateTargetVector(&config, nil, client, &cpe)
err := runAbapAddonAssemblyKitCreateTargetVector(&config, client, &cpe)
//assert
assert.Error(t, err, "Must end with error")
})
Expand All @@ -77,7 +77,7 @@ func TestCreateTargetVectorStep(t *testing.T) {
adoDesc, _ := json.Marshal(addonDescriptor)
config.AddonDescriptor = string(adoDesc)
//act
err := runAbapAddonAssemblyKitCreateTargetVector(&config, nil, client, &cpe)
err := runAbapAddonAssemblyKitCreateTargetVector(&config, client, &cpe)
//assert
assert.Error(t, err, "Must end with error")
})
Expand All @@ -104,7 +104,7 @@ func TestCreateTargetVectorStep(t *testing.T) {
adoDesc, _ := json.Marshal(addonDescriptor)
config.AddonDescriptor = string(adoDesc)
//act
err := runAbapAddonAssemblyKitCreateTargetVector(&config, nil, client, &cpe)
err := runAbapAddonAssemblyKitCreateTargetVector(&config, client, &cpe)
//assert
assert.Error(t, err, "Must end with error")
})
Expand Down
7 changes: 4 additions & 3 deletions cmd/abapAddonAssemblyKitPublishTargetVector.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ import (

func abapAddonAssemblyKitPublishTargetVector(config abapAddonAssemblyKitPublishTargetVectorOptions, telemetryData *telemetry.CustomData) {
utils := aakaas.NewAakBundleWithTime(time.Duration(config.MaxRuntimeInMinutes), time.Duration(config.PollingIntervalInSeconds))
telemetryData.BuildTool = "AAKaaS"

// error situations should stop execution through log.Entry().Fatal() call which leads to an os.Exit(1) in the end
if err := runAbapAddonAssemblyKitPublishTargetVector(&config, telemetryData, &utils); err != nil {
if err := runAbapAddonAssemblyKitPublishTargetVector(&config, &utils); err != nil {
telemetryData.ErrorCode = err.Error()
log.Entry().WithError(err).Fatal("step execution failed")
}
}

func runAbapAddonAssemblyKitPublishTargetVector(config *abapAddonAssemblyKitPublishTargetVectorOptions, telemetryData *telemetry.CustomData, utils *aakaas.AakUtils) error {
func runAbapAddonAssemblyKitPublishTargetVector(config *abapAddonAssemblyKitPublishTargetVectorOptions, utils *aakaas.AakUtils) error {

conn := new(abapbuild.Connector)
if err := conn.InitAAKaaS(config.AbapAddonAssemblyKitEndpoint, config.Username, config.Password, *utils, config.AbapAddonAssemblyKitOriginHash, config.AbapAddonAssemblyKitCertificateFile, config.AbapAddonAssemblyKitCertificatePass); err != nil {
Expand Down
8 changes: 4 additions & 4 deletions cmd/abapAddonAssemblyKitPublishTargetVector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestPublishTargetVectorStep(t *testing.T) {
utils := bundle.GetUtils()

//act
err := runAbapAddonAssemblyKitPublishTargetVector(&config, nil, &utils)
err := runAbapAddonAssemblyKitPublishTargetVector(&config, &utils)
//assert
assert.NoError(t, err, "Did not expect error")
})
Expand All @@ -54,7 +54,7 @@ func TestPublishTargetVectorStep(t *testing.T) {
utils := bundle.GetUtils()

//act
err := runAbapAddonAssemblyKitPublishTargetVector(&config, nil, &utils)
err := runAbapAddonAssemblyKitPublishTargetVector(&config, &utils)
//assert
assert.NoError(t, err, "Did not expect error")
})
Expand All @@ -67,7 +67,7 @@ func TestPublishTargetVectorStep(t *testing.T) {
utils := bundle.GetUtils()

//act
err := runAbapAddonAssemblyKitPublishTargetVector(&config, nil, &utils)
err := runAbapAddonAssemblyKitPublishTargetVector(&config, &utils)
//assert
assert.Error(t, err, "Must end with error")
})
Expand All @@ -80,7 +80,7 @@ func TestPublishTargetVectorStep(t *testing.T) {
utils := bundle.GetUtils()

//act
err := runAbapAddonAssemblyKitPublishTargetVector(&config, nil, &utils)
err := runAbapAddonAssemblyKitPublishTargetVector(&config, &utils)
//assert
assert.Error(t, err, "Must end with error")
})
Expand Down
8 changes: 4 additions & 4 deletions cmd/abapAddonAssemblyKitRegisterPackages.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ func abapAddonAssemblyKitRegisterPackages(config abapAddonAssemblyKitRegisterPac
c.Stderr(log.Writer())

client := piperhttp.Client{}
telemetryData.BuildTool = "AAKaaS"

// error situations should stop execution through log.Entry().Fatal() call which leads to an os.Exit(1) in the end
err := runAbapAddonAssemblyKitRegisterPackages(&config, telemetryData, &client, cpe, reader)
if err != nil {
if err := runAbapAddonAssemblyKitRegisterPackages(&config, &client, cpe, reader); err != nil {
telemetryData.ErrorCode = err.Error()
log.Entry().WithError(err).Fatal("step execution failed")
}
}

func runAbapAddonAssemblyKitRegisterPackages(config *abapAddonAssemblyKitRegisterPackagesOptions, telemetryData *telemetry.CustomData, client piperhttp.Sender,
func runAbapAddonAssemblyKitRegisterPackages(config *abapAddonAssemblyKitRegisterPackagesOptions, client piperhttp.Sender,
cpe *abapAddonAssemblyKitRegisterPackagesCommonPipelineEnvironment, fileReader readFile) error {

var addonDescriptor abaputils.AddonDescriptor
Expand Down
8 changes: 4 additions & 4 deletions cmd/abapAddonAssemblyKitRegisterPackages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestRegisterPackagesStep(t *testing.T) {
}
adoDesc, _ := json.Marshal(addonDescriptor)
config.AddonDescriptor = string(adoDesc)
err := runAbapAddonAssemblyKitRegisterPackages(&config, nil, client, &cpe, mockReader)
err := runAbapAddonAssemblyKitRegisterPackages(&config, client, &cpe, mockReader)

assert.NoError(t, err, "Did not expect error")
var addonDescriptorFinal abaputils.AddonDescriptor
Expand All @@ -70,7 +70,7 @@ func TestRegisterPackagesStep(t *testing.T) {
}
adoDesc, _ := json.Marshal(addonDescriptor)
config.AddonDescriptor = string(adoDesc)
err := runAbapAddonAssemblyKitRegisterPackages(&config, nil, client, &cpe, mockReader)
err := runAbapAddonAssemblyKitRegisterPackages(&config, client, &cpe, mockReader)

assert.Error(t, err, "Did expect error")
})
Expand All @@ -90,7 +90,7 @@ func TestRegisterPackagesStep(t *testing.T) {
}
adoDesc, _ := json.Marshal(addonDescriptor)
config.AddonDescriptor = string(adoDesc)
err := runAbapAddonAssemblyKitRegisterPackages(&config, nil, client, &cpe, mockReader)
err := runAbapAddonAssemblyKitRegisterPackages(&config, client, &cpe, mockReader)
assert.Error(t, err, "Did expect error")
})
t.Run("step error - registerPackages - invalid input", func(t *testing.T) {
Expand All @@ -107,7 +107,7 @@ func TestRegisterPackagesStep(t *testing.T) {
}
adoDesc, _ := json.Marshal(addonDescriptor)
config.AddonDescriptor = string(adoDesc)
err := runAbapAddonAssemblyKitRegisterPackages(&config, nil, client, &cpe, mockReader)
err := runAbapAddonAssemblyKitRegisterPackages(&config, client, &cpe, mockReader)
assert.Error(t, err, "Did expect error")
})
}
Expand Down
7 changes: 4 additions & 3 deletions cmd/abapAddonAssemblyKitReleasePackages.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ import (

func abapAddonAssemblyKitReleasePackages(config abapAddonAssemblyKitReleasePackagesOptions, telemetryData *telemetry.CustomData, cpe *abapAddonAssemblyKitReleasePackagesCommonPipelineEnvironment) {
utils := aakaas.NewAakBundleWithTime(time.Duration(config.MaxRuntimeInMinutes), time.Duration(config.PollingIntervalInSeconds))
telemetryData.BuildTool = "AAKaaS"

// error situations should stop execution through log.Entry().Fatal() call which leads to an os.Exit(1) in the end
if err := runAbapAddonAssemblyKitReleasePackages(&config, telemetryData, &utils, cpe); err != nil {
if err := runAbapAddonAssemblyKitReleasePackages(&config, &utils, cpe); err != nil {
telemetryData.ErrorCode = err.Error()
log.Entry().WithError(err).Fatal("step execution failed")
}
}

func runAbapAddonAssemblyKitReleasePackages(config *abapAddonAssemblyKitReleasePackagesOptions, telemetryData *telemetry.CustomData, utils *aakaas.AakUtils,
func runAbapAddonAssemblyKitReleasePackages(config *abapAddonAssemblyKitReleasePackagesOptions, utils *aakaas.AakUtils,
cpe *abapAddonAssemblyKitReleasePackagesCommonPipelineEnvironment) error {
conn := new(abapbuild.Connector)
if err := conn.InitAAKaaS(config.AbapAddonAssemblyKitEndpoint, config.Username, config.Password, *utils, config.AbapAddonAssemblyKitOriginHash, config.AbapAddonAssemblyKitCertificateFile, config.AbapAddonAssemblyKitCertificatePass); err != nil {
Expand Down
8 changes: 4 additions & 4 deletions cmd/abapAddonAssemblyKitReleasePackages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestReleasePackagesStep(t *testing.T) {
adoDesc, _ := json.Marshal(addonDescriptor)
config.AddonDescriptor = string(adoDesc)
//act
err := runAbapAddonAssemblyKitReleasePackages(&config, nil, &utils, &cpe)
err := runAbapAddonAssemblyKitReleasePackages(&config, &utils, &cpe)
//assert
assert.NoError(t, err, "Did not expect error")
var addonDescriptorFinal abaputils.AddonDescriptor
Expand All @@ -60,7 +60,7 @@ func TestReleasePackagesStep(t *testing.T) {
adoDesc, _ := json.Marshal(addonDescriptor)
config.AddonDescriptor = string(adoDesc)
//act
err := runAbapAddonAssemblyKitReleasePackages(&config, nil, &utils, &cpe)
err := runAbapAddonAssemblyKitReleasePackages(&config, &utils, &cpe)
//assert
assert.Error(t, err, "Did expect error")
assert.Equal(t, err.Error(), "Parameter missing. Please provide the name of the package which should be released")
Expand All @@ -81,7 +81,7 @@ func TestReleasePackagesStep(t *testing.T) {
adoDesc, _ := json.Marshal(addonDescriptor)
config.AddonDescriptor = string(adoDesc)
//act
err := runAbapAddonAssemblyKitReleasePackages(&config, nil, &utils, &cpe)
err := runAbapAddonAssemblyKitReleasePackages(&config, &utils, &cpe)
//assert
assert.Error(t, err, "Did expect error")
assert.Equal(t, err.Error(), "Release of all packages failed/timed out - Aborting as abapEnvironmentAssembleConfirm step is not needed: Timed out")
Expand Down Expand Up @@ -116,7 +116,7 @@ func TestReleasePackagesStepMix(t *testing.T) {
adoDesc, _ := json.Marshal(addonDescriptor)
config.AddonDescriptor = string(adoDesc)
//act
err := runAbapAddonAssemblyKitReleasePackages(&config, nil, &utils, &cpe)
err := runAbapAddonAssemblyKitReleasePackages(&config, &utils, &cpe)
//assert
assert.NoError(t, err, "Did not expect error")
var addonDescriptorFinal abaputils.AddonDescriptor
Expand Down
8 changes: 5 additions & 3 deletions cmd/abapAddonAssemblyKitReserveNextPackages.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ import (

func abapAddonAssemblyKitReserveNextPackages(config abapAddonAssemblyKitReserveNextPackagesOptions, telemetryData *telemetry.CustomData, cpe *abapAddonAssemblyKitReserveNextPackagesCommonPipelineEnvironment) {
utils := aakaas.NewAakBundleWithTime(time.Duration(config.MaxRuntimeInMinutes), time.Duration(config.PollingIntervalInSeconds))
// error situations should stop execution through log.Entry().Fatal() call which leads to an os.Exit(1) in the end
if err := runAbapAddonAssemblyKitReserveNextPackages(&config, telemetryData, &utils, cpe); err != nil {
telemetryData.BuildTool = "AAKaaS"

if err := runAbapAddonAssemblyKitReserveNextPackages(&config, &utils, cpe); err != nil {
telemetryData.ErrorCode = err.Error()
log.Entry().WithError(err).Fatal("step execution failed")
}
}

func runAbapAddonAssemblyKitReserveNextPackages(config *abapAddonAssemblyKitReserveNextPackagesOptions, telemetryData *telemetry.CustomData, utils *aakaas.AakUtils,
func runAbapAddonAssemblyKitReserveNextPackages(config *abapAddonAssemblyKitReserveNextPackagesOptions, utils *aakaas.AakUtils,
cpe *abapAddonAssemblyKitReserveNextPackagesCommonPipelineEnvironment) error {

log.Entry().Info("╔═════════════════════════════════════════╗")
Expand Down
Loading

0 comments on commit bf9c743

Please sign in to comment.