Skip to content

Commit

Permalink
Notify about CircleCI build failures for master and rel branches only (
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldiamant authored Nov 16, 2022
1 parent 9f90fd1 commit bffd703
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: 2.1
orbs:
win: circleci/windows@2.3.0
go: circleci/go@1.7.0
slack: circleci/slack@4.4.2
slack: circleci/slack@4.10.1

parameters:
ubuntu_image:
Expand Down Expand Up @@ -64,6 +64,13 @@ executors:
mac_arm64_large:
<<: *executor-mac-arm64

slack-fail-stop-step: &slack-fail-post-step
post-steps:
- slack/notify:
branch_pattern: "master,rel/beta,rel/nightly,rel/stable"
event: fail
template: basic_fail_1

# ===== Workflow Definitions =====
workflows:
version: 2
Expand All @@ -80,6 +87,7 @@ workflows:
- /rel\/.*/
- << pipeline.parameters.valid_nightly_branch >>
context: slack-secrets
<<: *slack-fail-post-step

- test:
name: << matrix.platform >>_test
Expand All @@ -91,6 +99,8 @@ workflows:
ignore:
- /rel\/.*/
- << pipeline.parameters.valid_nightly_branch >>
context: slack-secrets
<<: *slack-fail-post-step

- test_nightly:
name: << matrix.platform >>_test_nightly
Expand All @@ -99,13 +109,16 @@ workflows:
requires:
- << matrix.platform >>_build_nightly
context: slack-secrets
<<: *slack-fail-post-step

- integration:
name: << matrix.platform >>_integration
matrix:
<<: *matrix-default
filters:
<<: *filters-default
context: slack-secrets
<<: *slack-fail-post-step

- integration_nightly:
name: << matrix.platform >>_integration_nightly
Expand All @@ -114,13 +127,16 @@ workflows:
requires:
- << matrix.platform >>_build_nightly
context: slack-secrets
<<: *slack-fail-post-step

- e2e_expect:
name: << matrix.platform >>_e2e_expect
matrix:
<<: *matrix-default
filters:
<<: *filters-default
context: slack-secrets
<<: *slack-fail-post-step

- e2e_expect_nightly:
name: << matrix.platform >>_e2e_expect_nightly
Expand All @@ -129,13 +145,16 @@ workflows:
requires:
- << matrix.platform >>_build_nightly
context: slack-secrets
<<: *slack-fail-post-step

- e2e_subs:
name: << matrix.platform >>_e2e_subs
matrix:
<<: *matrix-default
filters:
<<: *filters-default
context: slack-secrets
<<: *slack-fail-post-step

- e2e_subs_nightly:
name: << matrix.platform >>_e2e_subs_nightly
Expand All @@ -146,6 +165,7 @@ workflows:
context:
- slack-secrets
- aws-secrets
<<: *slack-fail-post-step

- tests_verification_job:
name: << matrix.platform >>_<< matrix.job_type >>_verification
Expand All @@ -155,6 +175,8 @@ workflows:
job_type: ["test", "integration", "e2e_expect"]
requires:
- << matrix.platform >>_<< matrix.job_type >>
context: slack-secrets
<<: *slack-fail-post-step

- tests_verification_job_nightly:
name: << matrix.platform >>_<< matrix.job_type >>_verification
Expand All @@ -165,6 +187,7 @@ workflows:
requires:
- << matrix.platform >>_<< matrix.job_type >>
context: slack-secrets
<<: *slack-fail-post-step

- upload_binaries:
name: << matrix.platform >>_upload_binaries
Expand All @@ -183,6 +206,7 @@ workflows:
context:
- slack-secrets
- aws-secrets
<<: *slack-fail-post-step

#- windows_x64_build

Expand All @@ -207,9 +231,6 @@ jobs:
- go
- gimme
- .gimme
- slack/notify: &slack-fail-event
event: fail
template: basic_fail_1

test:
parameters:
Expand Down Expand Up @@ -240,9 +261,6 @@ jobs:
result_subdir: << parameters.platform >>_test_nightly
no_output_timeout: 45m
- upload_coverage
- slack/notify: &slack-fail-event
event: fail
template: basic_fail_1

integration:
parameters:
Expand Down Expand Up @@ -275,8 +293,6 @@ jobs:
platform: << parameters.platform >>
result_subdir: << parameters.platform >>_integration_nightly
no_output_timeout: 45m
- slack/notify:
<<: *slack-fail-event

e2e_expect:
parameters:
Expand Down Expand Up @@ -309,8 +325,6 @@ jobs:
platform: << parameters.platform >>
result_subdir: << parameters.platform>>_e2e_expect_nightly
no_output_timeout: 45m
- slack/notify:
<<: *slack-fail-event

e2e_subs:
parameters:
Expand Down Expand Up @@ -345,8 +359,6 @@ jobs:
platform: << parameters.platform >>
result_subdir: << parameters.platform >>_e2e_subs_nightly
no_output_timeout: 45m
- slack/notify:
<<: *slack-fail-event

windows_x64_build:
executor:
Expand Down Expand Up @@ -396,8 +408,6 @@ jobs:
- checkout
- tests_verification_command:
result_subdir: << parameters.platform >>_<< parameters.job_type >>
- slack/notify:
<<: *slack-fail-event

upload_binaries:
working_directory: << pipeline.parameters.build_dir >>/project
Expand All @@ -410,8 +420,6 @@ jobs:
- prepare_go
- upload_binaries_command:
platform: << parameters.platform >>
- slack/notify:
<<: *slack-fail-event

# ===== Command Definitions =====
commands:
Expand Down

0 comments on commit bffd703

Please sign in to comment.