Repository navigation
Fire power webhooks for dashboard power actions - #2663
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused correction that centralizes existing power activity logging so dashboard and other repository-based power actions can trigger already-supported webhooks. The API remains single-logged, the change adds no schema or new integration, and the dashboard behavior has regression coverage. You can add or adjust custom eligibility rules. Learn more. |
Fixes #2660
Power webhooks fire off the `server:power.*` activity log, but only the client API controller wrote it, so the dashboard power menu, scheduled power tasks, `p:server:bulk-power` and the EULA/GSL/Java feature restarts all sent the signal to Wings without logging anything. The log now lives in `DaemonServerRepository::power()` with the server as subject, and the controller's copy is removed so the API still logs once.
Console power buttons go through the Wings websocket and Wings reports that activity back itself, so they're unchanged.
Added a dashboard test that fails without the fix, and checked in Chrome against a mock Wings: a dashboard Start sent the power request but logged nothing before the change, and logged `server:power.start` for the user and server after.
Note
Record power activity in
DaemonServerRepository.powerfor all callersMoves power-activity logging from the API
PowerController.indexhandler into DaemonServerRepository.php. The repository now records a lowercased power activity with the affected server as its subject after each successful daemon power call. Adds a regression test in ListServersTest.php that fakes the daemon response and asserts the Livewire stop action records the expected server activity.Behavioral Change: any caller of
DaemonServerRepository.powernow triggers power-activity logging, not just the API controller; the Activity facade usage inPowerControlleris removed.Macroscope summarized 4cb5b3d.