Files
Jordi Enric 88440f087b feat(studio): add test connection button for project log drains (#46720)
## Problem

Project log drains had no way for users to verify a destination
connection before relying on it. Audit log drains already have a "Test
connection" action, and the management API exposes the equivalent
endpoint for project log drains (`POST
/platform/projects/{ref}/analytics/log-drains/{token}/test`).

## Fix

- Add `useTestLogDrainMutation`
(`apps/studio/data/log-drains/test-log-drain-mutation.ts`), mirroring
`useTestAuditLogDrainMutation`.
- Wire the already-present `onTestDrain` action in `LogDrains` to the
new mutation, so the "Test connection" item now appears in the project
log drains row menu.
- On success it shows a confirmation toast; failures surface the API
error message.

## Testing

- Added `apps/studio/data/log-drains/log-drains.test.tsx` covering the
test mutation hitting the project-scoped path.
- Manual: open Project Settings -> Log Drains, open a drain's menu,
click "Test connection".

Closes DEBUG-132


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added a test capability for log drain connections. Users can now
validate that their log drain configurations are functioning correctly
before deployment to ensure proper log collection and data integrity.
The system provides immediate confirmation when tests succeed and
detailed error messages when issues occur, enabling users to quickly
troubleshoot and resolve connectivity problems.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 12:18:52 +02:00
..