Skip to content

Commit

Permalink
Fix: reduce “Waiting on concurrency group” (#8)
Browse files Browse the repository at this point in the history
When setting the attribute concurrency_group on deploy steps, set concurrency_method: eager. By default (ordered), a BuildKite build’s deploy steps will wait for all the smoke_test and build steps of a previous build. This is a problem in rollbacks, which run much faster than normal builds because they have no smoke_test or build steps, so they are likely to reach their deploy steps before the previous build does.
  • Loading branch information
yonran authored Sep 1, 2023
1 parent af48d2a commit dcdda65
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ func lowerStep(step Step, context *Context, stepContext *StepContext) (Step, err
step["concurrency"] == nil && step["concurrency_group"] == nil {
step["concurrency_group"] = fmt.Sprintf("%s/%s", stepContext.EnvironmentName, context.BuildkitePipelineSlug)
step["concurrency"] = 1
if step["concurrency_method"] == nil {
step["concurrency_method"] = "eager"
}
}

return step, nil
Expand Down
4 changes: 4 additions & 0 deletions testdata/basic_master.out.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ steps:
command: deploy
concurrency: 1
concurrency_group: dev/myrepo
concurrency_method: eager
env:
ENVIRONMENT: dev
JOBSWORTH_CAUTIOUS: "0"
Expand Down Expand Up @@ -60,6 +61,7 @@ steps:
command: integrationtest
concurrency: 1
concurrency_group: dev/myrepo
concurrency_method: eager
env:
JOBSWORTH_CAUTIOUS: "0"
JOBSWORTH_CODE_VERSION: ""
Expand All @@ -74,6 +76,7 @@ steps:
command: deploy
concurrency: 1
concurrency_group: prod/myrepo
concurrency_method: eager
env:
ENVIRONMENT: prod
JOBSWORTH_CAUTIOUS: "1"
Expand Down Expand Up @@ -104,6 +107,7 @@ steps:
command: integrationtest
concurrency: 1
concurrency_group: prod/myrepo
concurrency_method: eager
env:
JOBSWORTH_CAUTIOUS: "0"
JOBSWORTH_CODE_VERSION: ""
Expand Down

0 comments on commit dcdda65

Please sign in to comment.