Skip to content

Fire power webhooks for dashboard power actions - #2663

Merged
lancepioch merged 1 commit into
mainfrom
fix/dashboard-power-webhooks
Oct 19, 2026
Merged

lancepioch merged 1 commit into
mainfrom
fix/dashboard-power-webhooks

Conversation

@lancepioch

@lancepioch lancepioch commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

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.power for all callers

Moves power-activity logging from the API PowerController.index handler 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.power now triggers power-activity logging, not just the API controller; the Activity facade usage in PowerController is removed.

Macroscope summarized 4cb5b3d.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 928c0460-bb57-4f08-bfc0-2dcdf4d373cc
📥 Commits

Reviewing files that changed from the base of the PR and between d025805 and 4cb5b3d.

📒 Files selected for processing: 3
  • app/Http/Controllers/Api/Client/Servers/PowerController.php
  • app/Repositories/Daemon/DaemonServerRepository.php
  • tests/Filament/App/ListServersTest.php
💤 Files with no reviewable changes: 1
  • app/Http/Controllers/Api/Client/Servers/PowerController.php

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

📝 Walkthrough

Power activity logging now occurs in the daemon repository instead of the API controller. A test verifies that a successful dashboard stop records a server:power.stop activity for the server and acting user.

Changes: Server power activity logging

Layer / File(s) Summary
Log power activity in the repository
app/Repositories/Daemon/DaemonServerRepository.php, app/Http/Controllers/Api/Client/Servers/PowerController.php, tests/Filament/App/ListServersTest.php
The repository logs a lowercase server:power.<action> activity for the server and returns the daemon response. The controller's activity log is removed. The test checks that a successful dashboard stop records server:power.stop for the acting user and server.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 4cb5b

Dashboard power actions now record server power activity, which allows the corresponding webhooks to fire. No merge-blocking risk was found.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the main change: firing power webhooks for dashboard power actions.
Description check Passed The description directly explains the activity logging change, affected power paths, duplicate-log prevention, and added test coverage.
Linked Issues check Passed Issue #2660 requires dashboard power actions to create server-scoped server:power.start and server:power.stop events. DaemonServerRepository::power() now logs server:power.<action> with the se…
Out of Scope Changes check Passed All reviewed changes support issue #2660. The repository logging change enables power events for dashboard actions. The controller change prevents duplicate logging. The added test verifies the dashbo…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
Full details: Linked Issues check

Explanation

Issue #2660 requires dashboard power actions to create server-scoped server:power.start and server:power.stop events. DaemonServerRepository::power() now logs server:power.&lt;action&gt; with the server as subject after the daemon request. The client controller no longer adds a second event. ListServersTest covers a dashboard stop action and asserts the activity for the user and server. The generic action handling also covers start.

Full details: Out of Scope Changes check

Explanation

All reviewed changes support issue #2660. The repository logging change enables power events for dashboard actions. The controller change prevents duplicate logging. The added test verifies the dashboard behavior. No unrelated change is present in the reviewed diff.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@macroscopeapp

macroscopeapp Bot commented Oct 19, 2026

Copy link
Copy Markdown

Approvability

Verdict: Approved at 4cb5b3d

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.

@lancepioch
lancepioch merged commit 10b27ba into main Oct 19, 2026
21 checks passed
@lancepioch
lancepioch deleted the fix/dashboard-power-webhooks branch October 19, 2026 15:28
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard power actions do not trigger server:power.start / server:power.stop webhook events

1 participant