Skip to content

Commit 61a1fed

Browse files
authored
Add slack notifications for image build failures (#2019)
The notifications should notify us when we fail to build the collector, builder, test or any of the QA images.
1 parent aa1a599 commit 61a1fed

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

.github/workflows/collector-builder.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,3 +237,23 @@ jobs:
237237
dst-image: quay.io/rhacs-eng/collector-builder:${{ env.COLLECTOR_BUILDER_TAG }}
238238
username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }}
239239
password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }}
240+
241+
notify:
242+
runs-on: ubuntu-24.04
243+
if: always() && contains(join(needs.*.result, ','), 'failure') && github.event_name != 'pull_request'
244+
needs:
245+
- build-builder-image
246+
- create-multiarch-manifest
247+
- retag-x86-image
248+
steps:
249+
- name: Slack notification
250+
uses: rtCamp/action-slack-notify@v2
251+
env:
252+
SLACK_WEBHOOK: ${{ secrets.SLACK_COLLECTOR_ONCALL_WEBHOOK }}
253+
SLACK_CHANNEL: team-acs-collector-oncall
254+
SLACK_COLOR: failure
255+
SLACK_LINK_NAMES: true
256+
SLACK_TITLE: "Builder image build has failed"
257+
MSG_MINIMAL: actions url,commit
258+
SLACK_MESSAGE: |
259+
@acs-collector-oncall

.github/workflows/collector.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,3 +319,24 @@ jobs:
319319
dst-image: ${{ env.RHACS_ENG_IMAGE }}-latest
320320
username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }}
321321
password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }}
322+
323+
notify:
324+
runs-on: ubuntu-24.04
325+
if: always() && contains(join(needs.*.result, ','), 'failure') && github.event_name != 'pull_request'
326+
needs:
327+
- build-collector-image
328+
- build-collector-image-remote-vm
329+
- create-multiarch-manifest
330+
- retag-x86-image
331+
steps:
332+
- name: Slack notification
333+
uses: rtCamp/action-slack-notify@v2
334+
env:
335+
SLACK_WEBHOOK: ${{ secrets.SLACK_COLLECTOR_ONCALL_WEBHOOK }}
336+
SLACK_CHANNEL: team-acs-collector-oncall
337+
SLACK_COLOR: failure
338+
SLACK_LINK_NAMES: true
339+
SLACK_TITLE: "Collector image build has failed"
340+
MSG_MINIMAL: actions url,commit
341+
SLACK_MESSAGE: |
342+
@acs-collector-oncall

.github/workflows/integration-test-containers.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,22 @@ jobs:
185185
- name: Build and Push containers
186186
run: |
187187
make -C "${{ matrix.directory }}" build-and-push
188+
189+
notify:
190+
runs-on: ubuntu-24.04
191+
if: always() && contains(join(needs.*.result, ','), 'failure') && github.event_name != 'pull_request'
192+
needs:
193+
- build-test-image
194+
- rebuild-containers
195+
steps:
196+
- name: Slack notification
197+
uses: rtCamp/action-slack-notify@v2
198+
env:
199+
SLACK_WEBHOOK: ${{ secrets.SLACK_COLLECTOR_ONCALL_WEBHOOK }}
200+
SLACK_CHANNEL: team-acs-collector-oncall
201+
SLACK_COLOR: failure
202+
SLACK_LINK_NAMES: true
203+
SLACK_TITLE: "Failed to rebuild test containers"
204+
MSG_MINIMAL: actions url,commit
205+
SLACK_MESSAGE: |
206+
@acs-collector-oncall

0 commit comments

Comments
 (0)