Repository navigation
feat(reports): add native Microsoft Teams alert notifications - #45508
Conversation
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #45508 +/- ##
==========================================
+ Coverage 85.97% 86.02% +0.04%
==========================================
Files 3128 3139 +11
Lines 217773 218537 +764
Branches 51629 51772 +143
==========================================
+ Hits 187230 187996 +766
+ Misses 27119 27110 -9
- Partials 3424 3431 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
29b3d9c to
66c544b
Compare
There was a problem hiding this comment.
Heya @KristiDodaj, appreciate you sticking with this one, and thanks again for working through my last round of questions! Couple of things before this goes in, though.
I don't think we need the ALERT_REPORT_TEAMS feature flag. We try not to add new flags where we can avoid it, since each one doubles the paths we have to test, and Slack has no enable flag at all: it's on when SLACK_API_TOKEN is set. Teams is already off unless ALERT_REPORTS_TEAMS is populated and the teams extra is installed, which configured_teams() checks anyway. Mind dropping the flag and gating on that config the same way Slack does?
Also, the events callback is public and runs SDK auth for every request inside one per-process with lock: in adapter.py, so a pile of junk requests could stack up behind it and tie up web workers. A bounded lock.acquire(timeout=...) that returns a 503 when it can't get the lock seems like it'd be enough.
KristiDodaj
left a comment
There was a problem hiding this comment.
Hey @rusackas, thanks for the callouts! Dropped feature flag as mentioned. The callback now returns 503 if it can’t acquire the lock within one second. Added tests for lock contention and recovery. Ready for another look :)
|
aminghadersohi
left a comment
There was a problem hiding this comment.
Unauthenticated requests can still hold the callback lock; details inline.
Nit: The PR description still names the removed ALERT_REPORT_TEAMS flag (summary, testing step 2, required flags); Teams turns on once ALERT_REPORTS_TEAMS is set and the teams extra is installed.
|
|
|
@rusackas should be good for another look whenever you have a chance 🙏 |
|
68c4745 to
e64af75
Compare
e64af75 to
1df57dd
Compare
rusackas
left a comment
There was a problem hiding this comment.
Heya @KristiDodaj, thanks for turning those around so quickly! Both look good, and the bounded lock covers what I was worried about, especially with the issuer check from @aminghadersohi's thread sitting ahead of it. LGTM!
The trino testcontainers failure looks like a container connection flake during setup, so it isn't on you. I've kicked off a rerun. The migration-conflict bot seems to be crying wolf too, since a7d29bc4e681 is still the head on master.
SUMMARY
Add Microsoft Teams as an optional notification destination for attachment-free alerts.
Administrators configure a single tenant, bot credentials, and approved standard channels. Users select a destination in the alert editor. Each notification creates a new channel post containing the alert name, optional description, and optional link to Superset.
The integration is available once
ALERT_REPORTS_TEAMSis configured and the optionalteamsextra is installed. Authenticated installation callbacks maintain routing information. Removing the bot disables delivery until it is reinstalled.Includes recipient validation, bounded retries, delivery error handling, setup documentation, and automated tests.
Initial scope excludes scheduled reports, private/shared channels, direct messages, file attachments, and interactive cards.
Related discussion: #45307
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: Microsoft Teams is not available as a notification destination.
After: Users can select an administrator-approved Teams destination and receive alert cards in its channel.
Teams destination selection
Delivered alerts, including successful delivery after bot reinstallation
Credentials are configured server-side, not through an administrator UI.
TESTING INSTRUCTIONS
teamsextra on the web server and Celery worker.ALERT_REPORTSand set the tenant, bot credentials, and approved destinations inALERT_REPORTS_TEAMS.Validation:
Browser creation/editing coverage is provided by an opt-in test against a locally configured Superset instance. It skips when Teams is unconfigured. The local browser flow passed during validation.
Live delivery was tested separately using a Microsoft test tenant: Celery delivery to a non-default standard channel, separate root posts, delivery after web and worker restarts, and fresh removal/reinstallation callbacks with delivery failure and recovery.
ADDITIONAL INFORMATION
Related discussion: Native Microsoft Teams notifications without Power Automate #45307
ALERT_REPORTS