Skip to content

Commit

Permalink
generate Slack notfication if any of the 3 verify fleetd-base steps f…
Browse files Browse the repository at this point in the history
…ail (#25049)

## #24531 

These changes were approved by @lucasmrod
[here](#25019)

"<test - ignore me>" will not be present in real notifications 
<img width="652" alt="398807048-d208c9f8-999e-4c0a-a818-5e72570481ab"
src="https://github.com/user-attachments/assets/a06f63a8-e5b7-4b5a-881d-606b3e66c6d9"
/>

- [x] Manual QA for all new/changed functionality

Co-authored-by: Jacob Shandling <[email protected]>
  • Loading branch information
jacobshandling and Jacob Shandling authored Dec 30, 2024
1 parent f0f6172 commit ca37183
Showing 1 changed file with 84 additions and 6 deletions.
90 changes: 84 additions & 6 deletions .github/workflows/verify-fleetd-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ on:
workflow_dispatch: # Manual
inputs:
base-url:
description: 'The base URL to download the files from'
description: "The base URL to download the files from"
required: false
default: 'https://download.fleetdm.com'
default: "https://download.fleetdm.com"
type: string
workflow_call:
inputs:
base-url:
description: 'The base URL to download the files from'
description: "The base URL to download the files from"
required: false
default: 'https://download.fleetdm.com'
default: "https://download.fleetdm.com"
type: string
schedule:
- cron: '0 5 * * *' # Nightly 5AM UTC, not at the same time as release-fleetd-base workflow
- cron: "0 5 * * *" # Nightly 5AM UTC, not at the same time as release-fleetd-base workflow

# This workflow is called by release-fleetd-base workflow, so it does not have its own concurrency group.

Expand Down Expand Up @@ -63,6 +63,31 @@ jobs:
diff fleetd-base.msi fleetd-base-permalink.msi
curl -o fleetd-base-permalink.pkg "$(jq --raw-output '.fleetd_base_pkg_url' meta.json)"
diff fleetd-base.pkg fleetd-base-permalink.pkg
- name: Slack Notification
if: failure()
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0
with:
payload: |
{
"text": "${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head.html_url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Verify fleetd-base files > ${{ github.job}} result: ${{ job.status }}\nhttps://github.com/fleetdm/fleet/actions/runs/${{
github.run_id }}\n${{ github.event.pull_request.html_url ||
github.event.head.html_url }}"
}
}
]
}
env:
JOB_STATUS: ${{ job.status }}
EVENT_URL: ${{ github.event.pull_request.html_url || github.event.head.html_url }}
RUN_URL: https://github.com/fleetdm/fleet/actions/runs/${{ github.run_id }}\n${{ github.event.pull_request.html_url || github.event.head.html_url }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_G_HELP_ENGINEERING_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

verify-fleetd-base-msi:
runs-on: windows-latest
Expand All @@ -89,7 +114,34 @@ jobs:
Start-Sleep -Seconds 5
cd "C:\Windows\System32\config\systemprofile\AppData\Local\FleetDM\Orbit\Logs"
Get-ChildItem
if (!(Test-Path "C:\Windows\System32\config\systemprofile\AppData\Local\FleetDM\Orbit\Logs\orbit-osquery.log" -PathType Leaf)) { exit 1 }
if (!(Test-Path
"C:\Windows\System32\config\systemprofile\AppData\Local\FleetDM\Orbit\Logs\orbit-osquery.log"
-PathType Leaf)) { exit 1 }
- name: Slack Notification
if: failure()
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0
with:
payload: |
{
"text": "${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head.html_url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Verify fleetd-base files > ${{ github.job}} result: ${{ job.status }}\nhttps://github.com/fleetdm/fleet/actions/runs/${{
github.run_id }}\n${{ github.event.pull_request.html_url ||
github.event.head.html_url }}"
}
}
]
}
env:
JOB_STATUS: ${{ job.status }}
EVENT_URL: ${{ github.event.pull_request.html_url || github.event.head.html_url }}
RUN_URL: https://github.com/fleetdm/fleet/actions/runs/${{ github.run_id }}\n${{ github.event.pull_request.html_url || github.event.head.html_url }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_G_HELP_ENGINEERING_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

verify-fleetd-base-pkg:
runs-on: macos-latest
Expand All @@ -108,3 +160,29 @@ jobs:
- name: Install fleetd-base.pkg
run: |
sudo installer -pkg fleetd-base.pkg -target /
- name: Slack Notification
if: failure()
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0
with:
payload: |
{
"text": "${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head.html_url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Verify fleetd-base files > ${{ github.job}} result: ${{ job.status }}\nhttps://github.com/fleetdm/fleet/actions/runs/${{
github.run_id }}\n${{ github.event.pull_request.html_url ||
github.event.head.html_url }}"
}
}
]
}
env:
JOB_STATUS: ${{ job.status }}
EVENT_URL: ${{ github.event.pull_request.html_url || github.event.head.html_url }}
RUN_URL: https://github.com/fleetdm/fleet/actions/runs/${{ github.run_id }}\n${{ github.event.pull_request.html_url || github.event.head.html_url }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_G_HELP_ENGINEERING_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

0 comments on commit ca37183

Please sign in to comment.