notification/teams: add Microsoft Teams notification destination#4521
Open
mageru wants to merge 1 commit into
Open
notification/teams: add Microsoft Teams notification destination#4521mageru wants to merge 1 commit into
mageru wants to merge 1 commit into
Conversation
Adds a builtin-teams-workflow destination type that posts Adaptive Cards to Microsoft Teams channels via Power Automate Workflow webhooks (the supported replacement for retired Office 365 connectors). - New notification/teams package implementing nfydest.Provider and nfydest.MessageSender with state-colored Adaptive Cards for alerts, status updates, alert bundles, on-call notifications, signals, and test messages - Teams.Enable and Teams.AllowedWorkflowURLs config settings - Teams icon and /docs setup section in the web UI - Unit tests for card rendering, validation, and error classification, plus a smoke test for alert/ack/close card delivery Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Justin Miller <jmiller9@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make checkto catch common errors. Fixed any that came up.Description:
Adds Microsoft Teams as a first-party notification destination. Since Office 365 connectors were retired, the supported webhook-style path into Teams is a Power Automate Workflow webhook ("Post to a channel when a webhook request is received"). This PR adds a
builtin-teams-workflowdestination type that renders GoAlert notifications as Adaptive Cards and posts them to such a webhook.notification/teamspackage implementingnfydest.Providerandnfydest.MessageSender, following the existingnotification/webhookandnotification/slackpatterns./docsgains a "Microsoft Teams" section (shown when Teams is enabled) with setup steps for creating the workflow webhook.Which issue(s) this PR fixes:
N/A — no associated issue.
Out of Scope:
Interactive Ack/Close buttons inside Teams cards. Microsoft does not deliver card actions back to the sender for workflow-webhook posts; that requires a Bot Framework integration (bot registration, conversation reference storage, inbound activity endpoints, and identity linking). The card renderer is structured so a future bot-backed sender can reuse it and add
Action.Executebuttons.Screenshots:
N/A
Describe any introduced user-facing changes:
Teams.EnableandTeams.AllowedWorkflowURLs(optional domain allow-list, mirroringWebhook.AllowedURLs)./docspage.Describe any introduced API changes:
builtin-teams-workflowwith required fieldteams_webhook_urland dynamic parammessage, exposed automatically through the existingdestinationTypesGraphQL API.Teams.EnableandTeams.AllowedWorkflowURLsin the config GraphQL API.Additional Info:
Unit tests cover card rendering per message type, details truncation, URL validation, error classification, and display info. A smoke test (
test/smoke/teamsworkflow_test.go) verifies alert → ack → close card delivery end-to-end; it compiles cleanly but was authored on a Windows machine without a local Postgres, so it has not been executed locally — please let CI validate it.make checkwas likewise not run locally (Windows); Go vet, gofmt,go test ./notification/... ./graphql2/... ./config/... ./app/..., TypeScript typecheck, eslint, and prettier all pass.