Skip to content

Commit ade23df

Browse files
fsaminsguiheux
authored andcommitted
fix(sdk): do not export shared group name (#4046)
1 parent f576337 commit ade23df

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

sdk/exportentities/action.go

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ func newSteps(a sdk.Action) []Step {
284284
}
285285

286286
name := act.Name
287-
if act.Group != nil {
287+
// Do not export "shared.infra" group name
288+
if act.Group != nil && act.Group.Name != sdk.SharedInfraGroupName {
288289
name = fmt.Sprintf("%s/%s", act.Group.Name, act.Name)
289290
}
290291

@@ -300,7 +301,7 @@ func newSteps(a sdk.Action) []Step {
300301
//AsScript returns the step a sdk.Action
301302
func (s Step) AsScript() (*sdk.Action, bool, error) {
302303
if !s.IsValid() {
303-
return nil, false, fmt.Errorf("AsScript.Malformatted Step")
304+
return nil, false, fmt.Errorf("script: Malformatted Step")
304305
}
305306

306307
bI, ok := s["script"]
@@ -324,7 +325,7 @@ func (s Step) AsScript() (*sdk.Action, bool, error) {
324325
}
325326

326327
if !ok {
327-
return nil, true, fmt.Errorf("Malformatted Step : script must be a string or a string array")
328+
return nil, true, fmt.Errorf("malformatted Step : script must be a string or a string array")
328329
}
329330

330331
a := sdk.NewStepScript(bS)
@@ -353,7 +354,7 @@ func (s Step) AsScript() (*sdk.Action, bool, error) {
353354
//AsAction returns the step a sdk.Action
354355
func (s Step) AsAction() (*sdk.Action, bool, error) {
355356
if !s.IsValid() {
356-
return nil, false, fmt.Errorf("AsAction.Malformatted Step")
357+
return nil, false, fmt.Errorf("action: Malformatted Step")
357358
}
358359

359360
actionName := s.key()
@@ -399,7 +400,7 @@ func (s Step) AsAction() (*sdk.Action, bool, error) {
399400
//AsJUnitReport returns the step a sdk.Action
400401
func (s Step) AsJUnitReport() (*sdk.Action, bool, error) {
401402
if !s.IsValid() {
402-
return nil, false, fmt.Errorf("AsJUnitReport.Malformatted Step")
403+
return nil, false, fmt.Errorf("jUnitReport: Malformatted Step")
403404
}
404405

405406
bI, ok := s["jUnitReport"]
@@ -409,7 +410,7 @@ func (s Step) AsJUnitReport() (*sdk.Action, bool, error) {
409410

410411
bS, ok := bI.(string)
411412
if !ok {
412-
return nil, true, fmt.Errorf("Malformatted Step : jUnitReport must be a string")
413+
return nil, true, fmt.Errorf("malformatted Step : jUnitReport must be a string")
413414
}
414415

415416
a := sdk.NewStepJUnitReport(bS)
@@ -438,7 +439,7 @@ func (s Step) AsJUnitReport() (*sdk.Action, bool, error) {
438439
//AsGitClone returns the step a sdk.Action
439440
func (s Step) AsGitClone() (*sdk.Action, bool, error) {
440441
if !s.IsValid() {
441-
return nil, false, fmt.Errorf("AsGitClone.Malformatted Step")
442+
return nil, false, fmt.Errorf("gitClone: Malformatted Step")
442443
}
443444

444445
bI, ok := s["gitClone"]
@@ -481,7 +482,7 @@ func (s Step) AsGitClone() (*sdk.Action, bool, error) {
481482
//AsArtifactUpload returns the step a sdk.Action
482483
func (s Step) AsArtifactUpload() (*sdk.Action, bool, error) {
483484
if !s.IsValid() {
484-
return nil, false, fmt.Errorf("AsArtifactUpload.Malformatted Step")
485+
return nil, false, fmt.Errorf("artifactUpload Malformatted Step")
485486
}
486487

487488
bI, ok := s["artifactUpload"]
@@ -530,7 +531,7 @@ func (s Step) AsArtifactUpload() (*sdk.Action, bool, error) {
530531
//AsServeStaticFiles returns the step a sdk.Action
531532
func (s Step) AsServeStaticFiles() (*sdk.Action, bool, error) {
532533
if !s.IsValid() {
533-
return nil, false, fmt.Errorf("AsServeStaticFiles.Malformatted Step")
534+
return nil, false, fmt.Errorf("serveStaticFiles: Malformatted Step")
534535
}
535536

536537
bI, ok := s["serveStaticFiles"]
@@ -573,7 +574,7 @@ func (s Step) AsServeStaticFiles() (*sdk.Action, bool, error) {
573574
//AsArtifactDownload returns the step a sdk.Action
574575
func (s Step) AsArtifactDownload() (*sdk.Action, bool, error) {
575576
if !s.IsValid() {
576-
return nil, false, fmt.Errorf("AsArtifactDownload.Malformatted Step")
577+
return nil, false, fmt.Errorf("artifactDownload: Malformatted Step")
577578
}
578579

579580
bI, ok := s["artifactDownload"]
@@ -583,7 +584,7 @@ func (s Step) AsArtifactDownload() (*sdk.Action, bool, error) {
583584

584585
argss := map[string]string{}
585586
if err := mapstructure.Decode(bI, &argss); err != nil {
586-
return nil, true, sdk.WrapError(err, "Malformatted Step")
587+
return nil, true, sdk.WrapError(err, "malformatted Step")
587588
}
588589
a := sdk.NewStepArtifactDownload(argss)
589590

@@ -620,7 +621,7 @@ func (s Step) AsCheckoutApplication() (*sdk.Action, bool, error) {
620621

621622
bS, ok := bI.(string)
622623
if !ok {
623-
return nil, true, fmt.Errorf("Malformatted Step : checkout must be a string")
624+
return nil, true, fmt.Errorf("malformatted Step : checkout must be a string")
624625
}
625626
a := sdk.NewCheckoutApplication(bS)
626627

@@ -648,7 +649,7 @@ func (s Step) AsCheckoutApplication() (*sdk.Action, bool, error) {
648649
//AsCoverageAction returns the step as a sdk.Action
649650
func (s Step) AsCoverageAction() (*sdk.Action, bool, error) {
650651
if !s.IsValid() {
651-
return nil, false, fmt.Errorf("AsCoverageAction> Malformatted Step")
652+
return nil, false, fmt.Errorf("coverageAction: Malformatted Step")
652653
}
653654
bI, ok := s["coverage"]
654655
if !ok {
@@ -685,7 +686,7 @@ func (s Step) AsCoverageAction() (*sdk.Action, bool, error) {
685686
//AsDeployApplication returns the step as a sdk.Action
686687
func (s Step) AsDeployApplication() (*sdk.Action, bool, error) {
687688
if !s.IsValid() {
688-
return nil, false, fmt.Errorf("AsDeployApplication> Malformatted Step")
689+
return nil, false, fmt.Errorf("deployApplication: Malformatted Step")
689690
}
690691
bI, ok := s["deploy"]
691692
if !ok {
@@ -694,7 +695,7 @@ func (s Step) AsDeployApplication() (*sdk.Action, bool, error) {
694695

695696
bS, ok := bI.(string)
696697
if !ok {
697-
return nil, true, fmt.Errorf("Malformatted Step : deploy must be a string")
698+
return nil, true, fmt.Errorf("malformatted Step : deploy must be a string")
698699
}
699700
a := sdk.NewDeployApplication(bS)
700701

@@ -728,7 +729,7 @@ func (s Step) IsFlagged(flag string) (bool, error) {
728729
}
729730
bS, ok := bI.(bool)
730731
if !ok {
731-
return false, fmt.Errorf("Malformatted Step : %s attribute must be true|false", flag)
732+
return false, fmt.Errorf("malformatted Step : %s attribute must be true|false", flag)
732733
}
733734
return bS, nil
734735
}
@@ -739,7 +740,7 @@ func (s Step) Name() (string, error) {
739740
if stepName, okName := stepAttr.(string); okName {
740741
return stepName, nil
741742
}
742-
return "", fmt.Errorf("Malformatted Step : name must be a string")
743+
return "", fmt.Errorf("malformatted Step : name must be a string")
743744
}
744745
return "", nil
745746
}

0 commit comments

Comments
 (0)