Skip to content

Commit 00ffb21

Browse files
committed
ci: standardize SDK release failure telemetry
1 parent 112c5fc commit 00ffb21

1 file changed

Lines changed: 26 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
steps:
7474
- name: Notify Slack - Approved
7575
if: needs.notify-approval-needed.outputs.slack_ts != ''
76-
uses: posthog/.github/.github/actions/slack-thread-reply@5fc4680761e8ac29a61b212756230eba0e276d8c
76+
uses: posthog/.github/.github/actions/slack-thread-reply@cb0979b67dcd585828b61ac45927eef4da8f6287 # main
7777
with:
7878
slack_bot_token: ${{ secrets.SLACK_CLIENT_LIBRARIES_BOT_TOKEN }}
7979
slack_channel_id: ${{ vars.SLACK_APPROVALS_CLIENT_LIBRARIES_CHANNEL_ID }}
@@ -208,21 +208,29 @@ jobs:
208208
# Notify in case of a failure
209209
- name: Send failure event to PostHog
210210
if: ${{ failure() }}
211-
uses: PostHog/posthog-github-action@58dea254b598fb5d469c0699c98af8288a7f7650 # v1.2.0
211+
continue-on-error: true
212+
uses: PostHog/posthog-github-action@9a6a19d360820ab4d95ecc4a5a7564062c895f84 # v1.3.0
212213
with:
213214
posthog-token: "${{ secrets.POSTHOG_PROJECT_API_KEY }}"
214-
event: "posthog-python-github-release-workflow-failure"
215+
event: "posthog-sdk-github-release-workflow-failure"
215216
properties: >-
216217
{
217218
"commitSha": "${{ github.sha }}",
218219
"jobStatus": "${{ job.status }}",
219220
"ref": "${{ github.ref }}",
220-
"version": "${{ steps.sampo-release.outputs.new_version }}"
221+
"repository": "${{ github.repository }}",
222+
"sdk": "posthog-python",
223+
"jobName": "version-bump",
224+
"packageName": "posthog-python",
225+
"packageVersion": "${{ steps.sampo-release.outputs.new_version || 'unknown' }}",
226+
"actionUrl": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
227+
"alertText": ":rotating_light: Failed to prepare release posthog-python@${{ steps.sampo-release.outputs.new_version }} :rotating_light:",
228+
"alertContext": "The version bump/changelog step failed before packages were published."
221229
}
222230
223231
- name: Notify Slack - Failed
224232
if: ${{ failure() && needs.notify-approval-needed.outputs.slack_ts != '' }}
225-
uses: posthog/.github/.github/actions/slack-thread-reply@5fc4680761e8ac29a61b212756230eba0e276d8c
233+
uses: posthog/.github/.github/actions/slack-thread-reply@cb0979b67dcd585828b61ac45927eef4da8f6287 # main
226234
with:
227235
slack_bot_token: ${{ secrets.SLACK_CLIENT_LIBRARIES_BOT_TOKEN }}
228236
slack_channel_id: ${{ vars.SLACK_APPROVALS_CLIENT_LIBRARIES_CHANNEL_ID }}
@@ -388,22 +396,29 @@ jobs:
388396
# Notify in case of a failure
389397
- name: Send failure event to PostHog
390398
if: ${{ failure() }}
391-
uses: PostHog/posthog-github-action@58dea254b598fb5d469c0699c98af8288a7f7650 # v1.2.0
399+
continue-on-error: true
400+
uses: PostHog/posthog-github-action@9a6a19d360820ab4d95ecc4a5a7564062c895f84 # v1.3.0
392401
with:
393402
posthog-token: "${{ secrets.POSTHOG_PROJECT_API_KEY }}"
394-
event: "posthog-python-github-release-workflow-failure"
403+
event: "posthog-sdk-github-release-workflow-failure"
395404
properties: >-
396405
{
397406
"commitSha": "${{ github.sha }}",
398407
"jobStatus": "${{ job.status }}",
399408
"ref": "${{ github.ref }}",
400-
"package": "${{ matrix.package.name }}",
401-
"version": "${{ needs.version-bump.outputs.new_version }}"
409+
"repository": "${{ github.repository }}",
410+
"sdk": "posthog-python",
411+
"jobName": "publish",
412+
"packageName": "${{ matrix.package.name }}",
413+
"packageVersion": "${{ needs.version-bump.outputs.new_version || 'unknown' }}",
414+
"actionUrl": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
415+
"alertText": ":rotating_light: Failed to release ${{ matrix.package.name }}@${{ needs.version-bump.outputs.new_version }} :rotating_light:",
416+
"alertContext": "The package publish step failed."
402417
}
403418
404419
- name: Notify Slack - Failed
405420
if: ${{ failure() && needs.notify-approval-needed.outputs.slack_ts != '' }}
406-
uses: posthog/.github/.github/actions/slack-thread-reply@5fc4680761e8ac29a61b212756230eba0e276d8c
421+
uses: posthog/.github/.github/actions/slack-thread-reply@cb0979b67dcd585828b61ac45927eef4da8f6287 # main
407422
with:
408423
slack_bot_token: ${{ secrets.SLACK_CLIENT_LIBRARIES_BOT_TOKEN }}
409424
slack_channel_id: ${{ vars.SLACK_APPROVALS_CLIENT_LIBRARIES_CHANNEL_ID }}
@@ -484,7 +499,7 @@ jobs:
484499
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
485500

486501
- name: Notify Slack - Released
487-
uses: posthog/.github/.github/actions/slack-thread-reply@5fc4680761e8ac29a61b212756230eba0e276d8c
502+
uses: posthog/.github/.github/actions/slack-thread-reply@cb0979b67dcd585828b61ac45927eef4da8f6287 # main
488503
with:
489504
slack_bot_token: ${{ secrets.SLACK_CLIENT_LIBRARIES_BOT_TOKEN }}
490505
slack_channel_id: ${{ vars.SLACK_APPROVALS_CLIENT_LIBRARIES_CHANNEL_ID }}

0 commit comments

Comments
 (0)