Skip to content

Commit

Permalink
Add slack notifications for image build failures
Browse files Browse the repository at this point in the history
The notifications should notify us when we fail to build the collector,
builder, test or any of the QA images.
  • Loading branch information
Molter73 committed Jan 27, 2025
1 parent aa20609 commit 11df4c6
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/collector-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,23 @@ jobs:
dst-image: quay.io/rhacs-eng/collector-builder:${{ env.COLLECTOR_BUILDER_TAG }}
username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }}
password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }}

notify:
runs-on: ubuntu-24.04
if: always() && contains(join(needs.*.result, ','), 'failure') && github.event_name != 'pull_request'
needs:
- build-builder-image
- create-multiarch-manifest
- retag-x86-image
steps:
- name: Slack notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_COLLECTOR_ONCALL_WEBHOOK }}
SLACK_CHANNEL: team-acs-collector-oncall
SLACK_COLOR: failure
SLACK_LINK_NAMES: true
SLACK_TITLE: "Builder image build has failed"
MSG_MINIMAL: actions url,commit
SLACK_MESSAGE: |
@acs-collector-oncall
21 changes: 21 additions & 0 deletions .github/workflows/collector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,24 @@ jobs:
dst-image: ${{ env.RHACS_ENG_IMAGE }}-latest
username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }}
password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }}

notify:
runs-on: ubuntu-24.04
if: always() && contains(join(needs.*.result, ','), 'failure') && github.event_name != 'pull_request'
needs:
- build-collector-image
- build-collector-image-remote-vm
- create-multiarch-manifest
- retag-x86-image
steps:
- name: Slack notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_COLLECTOR_ONCALL_WEBHOOK }}
SLACK_CHANNEL: team-acs-collector-oncall
SLACK_COLOR: failure
SLACK_LINK_NAMES: true
SLACK_TITLE: "Collector image build has failed"
MSG_MINIMAL: actions url,commit
SLACK_MESSAGE: |
@acs-collector-oncall
19 changes: 19 additions & 0 deletions .github/workflows/integration-test-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,22 @@ jobs:
- name: Build and Push containers
run: |
make -C "${{ matrix.directory }}" build-and-push
notify:
runs-on: ubuntu-24.04
if: always() && contains(join(needs.*.result, ','), 'failure') && github.event_name != 'pull_request'
needs:
- build-test-image
- rebuild-containers
steps:
- name: Slack notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_COLLECTOR_ONCALL_WEBHOOK }}
SLACK_CHANNEL: team-acs-collector-oncall
SLACK_COLOR: failure
SLACK_LINK_NAMES: true
SLACK_TITLE: "Failed to rebuild test containers"
MSG_MINIMAL: actions url,commit
SLACK_MESSAGE: |
@acs-collector-oncall

0 comments on commit 11df4c6

Please sign in to comment.