Skip to content

Commit

Permalink
fix: prefix execution group names properly (#6166)
Browse files Browse the repository at this point in the history
* feat: add better prefix for execution names when multiple scheduled in group

* fixup
  • Loading branch information
rangoo94 authored Feb 12, 2025
1 parent 1d414c3 commit e2fbabf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/testworkflows/testworkflowexecutor/prepared.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ func (e *IntermediateExecution) SetSequenceNumber(number int32) *IntermediateExe
return e
}

func (e *IntermediateExecution) SequenceNumber() int32 {
return e.execution.Number
}

func (e *IntermediateExecution) SetError(header string, err error) *IntermediateExecution {
// Keep only the 1st error
if !e.execution.Result.IsFinished() {
Expand Down
3 changes: 3 additions & 0 deletions pkg/testworkflows/testworkflowexecutor/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ func (s *scheduler) Schedule(ctx context.Context, sensitiveDataHandler Sensitive
// Generating the execution name
if intermediate[i].Name() == "" {
name := fmt.Sprintf("%s-%d", intermediate[i].WorkflowName(), number)
if len(intermediate) > 1 {
name = fmt.Sprintf("%s-%d-%d", intermediate[i].WorkflowName(), intermediate[0].SequenceNumber(), i+1)
}
intermediate[i].SetName(name)

// Edge case: Check for local duplicates, if there is no clash between static and auto-generated one
Expand Down

0 comments on commit e2fbabf

Please sign in to comment.