Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
changing continue to independent and linter work
  • Loading branch information
ecrupper committed Dec 9, 2022
commit 7b118d6516e4108bf337f15ba6e2b9a895ec6da6
5 changes: 4 additions & 1 deletion executor/linux/stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,17 @@ func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m *sync.Map)
}()

logger.Debug("starting execution of stage")

stop := false

// execute the steps for the stage
for _, _step := range s.Steps {
// check if the step should be skipped
//
// https://pkg.go.dev/github.com/go-vela/worker/internal/step#Skip
ruleset := _step.Ruleset

if !stop && s.Continue {
if !stop && s.Independent {
ruleset.If.Parallel = true
} else {
ruleset.If.Parallel = false
Expand All @@ -151,6 +153,7 @@ func (c *client) ExecStage(ctx context.Context, s *pipeline.Stage, m *sync.Map)
if err != nil {
return fmt.Errorf("unable to exec step %s: %w", _step.Name, err)
}

if _step.ExitCode != 0 && !_step.Ruleset.Continue {
stop = true
}
Expand Down
12 changes: 6 additions & 6 deletions executor/linux/stage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ func TestLinux_ExecStage(t *testing.T) {
name: "basic stage",
failure: false,
stage: &pipeline.Stage{
Continue: true,
Name: "echo",
Independent: true,
Name: "echo",
Steps: pipeline.ContainerSlice{
{
ID: "github_octocat_1_echo_echo",
Expand All @@ -336,8 +336,8 @@ func TestLinux_ExecStage(t *testing.T) {
name: "stage with step container with image not found",
failure: true,
stage: &pipeline.Stage{
Name: "echo",
Continue: true,
Name: "echo",
Independent: true,
Steps: pipeline.ContainerSlice{
{
ID: "github_octocat_1_echo_echo",
Expand All @@ -355,8 +355,8 @@ func TestLinux_ExecStage(t *testing.T) {
name: "stage with step container with bad number",
failure: true,
stage: &pipeline.Stage{
Name: "echo",
Continue: true,
Name: "echo",
Independent: true,
Steps: pipeline.ContainerSlice{
{
ID: "github_octocat_1_echo_echo",
Expand Down