Skip to content

Migrate alert commands from deprecated Alert API to Notification API#13

Merged
rohanraarora merged 2 commits into
release/v0.6.0from
fix/alert-api-migration
Apr 7, 2026
Merged

Migrate alert commands from deprecated Alert API to Notification API#13
rohanraarora merged 2 commits into
release/v0.6.0from
fix/alert-api-migration

Conversation

@rohanraarora

Copy link
Copy Markdown
Owner

Summary

  • Rewrite AlertApi to use /api/notification endpoints instead of deprecated /api/alert
  • Translate alert concepts (card, condition, channels) to notification concepts (payload, handlers)
  • delete now archives via PUT /api/notification/:id with active: false (no DELETE on notification API)
  • User-facing CLI interface (alert list/show/create/update/delete) remains identical
  • Added deprecation notice pointing users to metabase-cli notification for full control

The entire metabase.pulse.api.alert namespace is ^:deprecated in Metabase — POST and PUT for alerts go through notifications now.

Test plan

  • Run metabase-cli alert list — verify alerts are listed from notification API
  • Run metabase-cli alert create --card <id> --condition rows — verify notification is created
  • Run metabase-cli alert update <id> --condition goal — verify update works
  • Run metabase-cli alert delete <id> — verify notification is archived
  • Run metabase-cli alert show <id> — verify details are returned

🤖 Generated with Claude Code

rohanraarora and others added 2 commits April 7, 2026 19:06
The Metabase pulse.api.alert namespace is deprecated. This migrates
all alert CRUD operations to use /api/notification endpoints instead:

- list() filters by payload_type=notification/card
- get/create/update use /api/notification/{id} endpoints
- delete archives via PUT with active=false (no DELETE on notifications)
- Alert params translated to notification payload/handlers format
- User-facing CLI interface remains identical

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update test expectations to verify the migrated AlertApi correctly
translates calls to /api/notification endpoints with proper payload
and handler translation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rohanraarora rohanraarora merged commit 5233680 into release/v0.6.0 Apr 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant