From 985201c39b90b973e7f216b2c8aa00942d9df99c Mon Sep 17 00:00:00 2001 From: loganlipscomb Date: Mon, 21 Sep 2026 16:19:26 -0600 Subject: [PATCH 1/2] Restore Mattermost alerts on nightly build failures The drift alert step was disabled months ago, blamed on a crash in the Mattermost action. That crash only ever affected push-triggered runs, and the schedule guard that already fixed it was dropped when the step was commented out, so re-enabling it as written would have brought the crash back. Re-enable the step with the guard restored, and key the generic alert on whether the drift alert was actually sent rather than on whether the failure was drift-related, so a broken alert step no longer leaves a nightly failure silent. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/publish.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5c813cd..8837651 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -53,7 +53,7 @@ jobs: ZITI_HOTJAR_APPID: ${{ secrets.ZITI_HOTJAR_APPID }} environment: ${{ github.event.inputs.environment || (github.ref_name == 'main' && 'main' || 'stg') }} outputs: - has_drift: ${{ steps.drift-ctx.outputs.has_drift }} + drift_alert_sent: ${{ steps.drift-alert.outcome == 'success' }} steps: - name: Checkout Workspace uses: actions/checkout@v4 @@ -177,16 +177,17 @@ jobs: if: failure() run: unified-doc/scripts/build-drift-alert-context.sh "$GITHUB_REPOSITORY" "$GITHUB_RUN_ID" "$GITHUB_OUTPUT" - # Send drift alert disabled pending fix to openziti/ziti-mattermost-action-py - # (addPushDetails crashes with KeyError: 'forced' on non-push event JSON) - # - name: Send drift alert - # if: failure() && steps.drift-ctx.outputs.has_drift == 'true' - # uses: openziti/ziti-mattermost-action-py@v1 - # with: - # zitiId: ${{ secrets.ZITI_MATTERMOST_IDENTITY }} - # webhookUrl: ${{ secrets.ZHOOK_URL_DOC_NOTIFICATIONS }} - # eventJson: ${{ steps.drift-ctx.outputs.event-json }} - # senderUsername: "GitHubZ" + # The schedule guard is load-bearing: the action's push path + # expects payload keys the drift JSON lacks, and crashes without it. + - name: Send drift alert + id: drift-alert + if: failure() && steps.drift-ctx.outputs.has_drift == 'true' && github.event_name == 'schedule' + uses: openziti/ziti-mattermost-action-py@v1 + with: + zitiId: ${{ secrets.ZITI_MATTERMOST_IDENTITY }} + webhookUrl: ${{ secrets.ZHOOK_URL_DOC_NOTIFICATIONS }} + eventJson: ${{ steps.drift-ctx.outputs.event-json }} + senderUsername: "GitHubZ" # Notify the doc-alerts Mattermost channel only when the nightly scheduled # run fails. Push/workflow_dispatch runs are watched live by whoever triggered @@ -194,7 +195,7 @@ jobs: notify-mattermost: name: Notify doc-alerts of nightly build failure needs: publish-docs-from-container - if: always() && github.event_name == 'schedule' && github.repository_owner == 'netfoundry' && needs.publish-docs-from-container.result != 'success' && needs.publish-docs-from-container.outputs.has_drift != 'true' + if: always() && github.event_name == 'schedule' && github.repository_owner == 'netfoundry' && needs.publish-docs-from-container.result != 'success' && needs.publish-docs-from-container.outputs.drift_alert_sent != 'true' runs-on: ubuntu-latest steps: - name: Build schedule event context From da504f7eb5cd8db825939a7a7383e514656f884b Mon Sep 17 00:00:00 2001 From: loganlipscomb Date: Tue, 22 Sep 2026 09:35:34 -0600 Subject: [PATCH 2/2] Revert the has_drift output rename Keeps the drift alert re-enablement as the only change under review. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/publish.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8837651..e0ad601 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -53,7 +53,7 @@ jobs: ZITI_HOTJAR_APPID: ${{ secrets.ZITI_HOTJAR_APPID }} environment: ${{ github.event.inputs.environment || (github.ref_name == 'main' && 'main' || 'stg') }} outputs: - drift_alert_sent: ${{ steps.drift-alert.outcome == 'success' }} + has_drift: ${{ steps.drift-ctx.outputs.has_drift }} steps: - name: Checkout Workspace uses: actions/checkout@v4 @@ -180,7 +180,6 @@ jobs: # The schedule guard is load-bearing: the action's push path # expects payload keys the drift JSON lacks, and crashes without it. - name: Send drift alert - id: drift-alert if: failure() && steps.drift-ctx.outputs.has_drift == 'true' && github.event_name == 'schedule' uses: openziti/ziti-mattermost-action-py@v1 with: @@ -195,7 +194,7 @@ jobs: notify-mattermost: name: Notify doc-alerts of nightly build failure needs: publish-docs-from-container - if: always() && github.event_name == 'schedule' && github.repository_owner == 'netfoundry' && needs.publish-docs-from-container.result != 'success' && needs.publish-docs-from-container.outputs.drift_alert_sent != 'true' + if: always() && github.event_name == 'schedule' && github.repository_owner == 'netfoundry' && needs.publish-docs-from-container.result != 'success' && needs.publish-docs-from-container.outputs.has_drift != 'true' runs-on: ubuntu-latest steps: - name: Build schedule event context