Skip to content

Commit

Permalink
feat(CE): on_failure report error to AppSignal (#478)
Browse files Browse the repository at this point in the history
* feat(CE): on_failure report error to AppSignal

* feat(EE): added on_failure to deployment workflows

---------

Co-authored-by: developer-united <[email protected]>
  • Loading branch information
RafaelOAiSquared and developer-united authored Nov 18, 2024
1 parent 4d7d496 commit e42dbb8
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/deploy-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,22 @@ jobs:
--set multiwovenServer.multiwovenServer.image.tag=$IMAGE_TAG \
--set multiwovenWorker.multiwovenWorker.image.repository=$IMAGE_NAME \
--set multiwovenWorker.multiwovenWorker.image.tag=$IMAGE_TAG
on_failure:
environment: community
if: ${{ failure() }}
needs: [ build_and_push, deploy ]
runs-on: ubuntu-latest
steps:
- name: Report error to AppSignal
env:
ACTION: Release
APPSIGNAL_PUSH_API_KEY: ${{ secrets.APPSIGNAL_PUSH_API_KEY }}
MESSAGE: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
NAME: Deploy Server to Community failed
run: |
EPOCH=$(date +%s)
curl -verbose -H \"Content-Type: application/json\" \
-d "{ \"action\": \"$ACTION\", \"timestamp\": $EPOCH, \"namespace\": \"github\", \"error\": { \"name\": $NAME, \"message\": $MESSAGE } }" \
-X POST \
https://appsignal-endpoint.net/errors?api_key=$APPSIGNAL_PUSH_API_KEY
18 changes: 18 additions & 0 deletions .github/workflows/deploy-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,21 @@ jobs:
--set multiwovenUI.multiwovenUI.image.tag=$IMAGE_TAG
kubectl rollout restart deployment/multiwoven-server -n multiwoven
on_failure:
environment: community
if: ${{ failure() }}
needs: [ build_and_push, deploy ]
runs-on: ubuntu-latest
steps:
- name: Report error to AppSignal
env:
ACTION: Deployment
APPSIGNAL_PUSH_API_KEY: ${{ secrets.APPSIGNAL_PUSH_API_KEY }}
MESSAGE: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
NAME: Deploy UI to Community failed
run: |
EPOCH=$(date +%s)
curl -verbose -H \"Content-Type: application/json\" \
-d "{ \"action\": \"$ACTION\", \"timestamp\": $EPOCH, \"namespace\": \"github\", \"error\": { \"name\": $NAME, \"message\": $MESSAGE } }" \
-X POST \
https://appsignal-endpoint.net/errors?api_key=$APPSIGNAL_PUSH_API_KEY
19 changes: 19 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,22 @@ jobs:
source_branch: "release-changes-${{ steps.versioning.outputs.new_tag }}"
destination_branch: "main"
pr_label: "release,auto-pr"

on_failure:
environment: community
if: ${{ failure() }}
needs: [ prepare-changelog ]
runs-on: ubuntu-latest
steps:
- name: Report error to AppSignal
env:
ACTION: Release
APPSIGNAL_PUSH_API_KEY: ${{ secrets.APPSIGNAL_PUSH_API_KEY }}
MESSAGE: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
NAME: Community Release failed
run: |
EPOCH=$(date +%s)
curl -verbose -H \"Content-Type: application/json\" \
-d "{ \"action\": \"$ACTION\", \"timestamp\": $EPOCH, \"namespace\": \"github\", \"error\": { \"name\": $NAME, \"message\": $MESSAGE } }" \
-X POST \
https://appsignal-endpoint.net/errors?api_key=$APPSIGNAL_PUSH_API_KEY
19 changes: 19 additions & 0 deletions .github/workflows/sync-ce-commits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,22 @@ jobs:
git checkout main
git branch -D $BRANCH_NAME
done
on_failure:
environment: staging
if: ${{ failure() }}
needs: [ cherry-pick-ce-commits ]
runs-on: ubuntu-latest
steps:
- name: Report error to AppSignal
env:
ACTION: Sync Commits
APPSIGNAL_PUSH_API_KEY: ${{ secrets.APPSIGNAL_PUSH_API_KEY }}
MESSAGE: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
NAME: Sync Commits from EE to CE failed
run: |
EPOCH=$(date +%s)
curl -verbose -H \"Content-Type: application/json\" \
-d "{ \"action\": \"$ACTION\", \"timestamp\": $EPOCH, \"namespace\": \"github\", \"error\": { \"name\": $NAME, \"message\": $MESSAGE } }" \
-X POST \
https://appsignal-endpoint.net/errors?api_key=$APPSIGNAL_PUSH_API_KEY

0 comments on commit e42dbb8

Please sign in to comment.