Skip to content

Report live reload build failures#64

Open
samdark wants to merge 1 commit into
masterfrom
report-live-reload-build-failures
Open

Report live reload build failures#64
samdark wants to merge 1 commit into
masterfrom
report-live-reload-build-failures

Conversation

@samdark

@samdark samdark commented Jun 13, 2026

Copy link
Copy Markdown
Member

Summary

  • return build exit code and captured output from live reload rebuilds
  • send reload only after successful rebuilds
  • send build-error SSE events with command output instead of reloading stale pages after failures

Tests

  • make test -- --filter SiteBuildRunnerTest
  • make test -- --filter DevHtmlInjectorTest
  • make test -- --filter DevHtmlMiddlewareTest
  • make psalm
  • make test

Copilot AI review requested due to automatic review settings June 13, 2026 08:49
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@samdark, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 53 minutes and 25 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: eecccea2-b981-4764-a0d8-2688aca73435

📥 Commits

Reviewing files that changed from the base of the PR and between 315ad8d and 894eb14.

📒 Files selected for processing (5)
  • src/Console/ServeCommand.php
  • src/Web/DevServer/assets/live-reload.js
  • src/Web/LiveReload/SiteBuildResult.php
  • src/Web/LiveReload/SiteBuildRunner.php
  • tests/Unit/Web/LiveReload/SiteBuildRunnerTest.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch report-live-reload-build-failures

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 and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the dev server live-reload flow by capturing rebuild exit status/output and emitting a dedicated SSE event for rebuild failures, so the browser doesn’t reload stale pages after failed rebuilds.

Changes:

  • Change SiteBuildRunner::build() to return a SiteBuildResult (exit code + captured output).
  • Update live reload server logic to send reload only on successful rebuilds, and send build-error SSE events (with build output) on failure.
  • Update unit tests to validate failure results include exit code and output.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Unit/Web/LiveReload/SiteBuildRunnerTest.php Updates tests for the new SiteBuildResult contract and output/exit-code assertions.
src/Web/LiveReload/SiteBuildRunner.php Returns a structured SiteBuildResult instead of a boolean.
src/Web/LiveReload/SiteBuildResult.php Adds a small value object representing build outcome and output.
src/Web/DevServer/assets/live-reload.js Adds a client-side handler for build-error SSE events.
src/Console/ServeCommand.php Emits reload only on successful rebuilds; emits build-error events with output on failure.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +22 to +23
es.addEventListener("build-error", function(event) {
es.close();
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.

2 participants