Skip to content

feat: warn in the compile response when the compile stops an active Play session - #2372

Merged
hatayama merged 2 commits into
v3-betafrom
feat/compile-playmode-stop-warning
Aug 23, 2026
Merged

feat: warn in the compile response when the compile stops an active Play session#2372
hatayama merged 2 commits into
v3-betafrom
feat/compile-playmode-stop-warning

Conversation

@hatayama

@hatayama hatayama commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • uloop compile now warns when the request arrives during Play Mode, even if no pause points are enabled.
  • The existing warning for Play Mode with enabled pause points is unchanged.

User Impact

  • Before: compiling during Play Mode without pause points returned no Warning, so the discarded Play session was silent.
  • After: the compile response Warning explains that compile stops Play Mode and the domain reload discards Play session state.

Changes

  • Generalized the compile Play-stop warning builder from a pause-point-only condition to three branches: not playing (no warning), playing with no pause points (new wording), playing with pause points (existing wording).
  • Renamed the builder to match the broader condition.

Verification

  • Red: filter CompilePausePointWarningBuilderTests — TestCount 3, PassedCount 2, FailedCount 1. The new Play-without-pause-points case expected the new literal and received null.
  • Green: dist/darwin-arm64/uloop compile — Success true, ErrorCount 0.
  • Filter CompilePlayModeStopWarningBuilderTests — TestCount 3, PassedCount 3, FailedCount 0.
  • Full EditMode dist/darwin-arm64/uloop run-tests (single run) — TestCount 3392, PassedCount 3384, FailedCount 0, SkippedCount 8. Suite Status was Skipped / Success false because of those skips; there were no failures.

Review in cubic

Compile already warned when pause points were active, but Play-only
compiles returned no Warning even though the session was discarded.
Keep the existing pause-point wording unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 89167875-b0a4-4f8d-ac34-58f8459ad589

📥 Commits

Reviewing files that changed from the base of the PR and between fdc04b4 and 897644d.

⛔ Files ignored due to path filters (1)
  • Assets/Tests/Editor/CompileControllerPlayModeStopWarningTests.cs.meta is excluded by none and included by none
📒 Files selected for processing (14)
  • Assets/Editor/CompileCheckWindow/CompileCheckerExample.cs
  • Assets/Editor/CompileCheckWindow/CompileEditorWindow.cs
  • Assets/Tests/Editor/CompileApiUpdaterConsentPropagationTests.cs
  • Assets/Tests/Editor/CompileControllerPlayModeStopWarningTests.cs
  • Assets/Tests/Editor/CompileErrorNextActionsComposerTests.cs
  • Assets/Tests/Editor/CompileResponseFactoryTests.cs
  • Assets/Tests/Editor/CompileSessionResultStoreTests.cs
  • Assets/Tests/Editor/CompileUseCaseTests.cs
  • Packages/src/Editor/FirstPartyTools/Compile/CompilationExecutionService.cs
  • Packages/src/Editor/FirstPartyTools/Compile/CompileController.cs
  • Packages/src/Editor/FirstPartyTools/Compile/CompileResponse.cs
  • Packages/src/Editor/FirstPartyTools/Compile/CompileResponseFactory.cs
  • Packages/src/Editor/FirstPartyTools/Compile/CompileResultSessionRecorder.cs
  • Packages/src/Editor/FirstPartyTools/Compile/CompileUseCase.cs

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The compile flow now builds a Play Mode stop warning before validation. The warning uses captured Play Mode state, propagates through compilation and response creation, and remains available in immediate and stored responses. Tests cover warning branches and persistence paths.

Changes

Compile warning flow

Layer / File(s) Summary
Play Mode stop warning behavior
Packages/src/Editor/FirstPartyTools/Compile/CompilePlayModeStopWarningBuilder.cs, Assets/Tests/Editor/CompilePlayModeStopWarningBuilderTests.cs
The new builder handles inactive Play Mode, active Play Mode without pause points, and active pause points. NUnit tests verify null results and exact warning text.
Compile use case integration
Packages/src/Editor/FirstPartyTools/Compile/CompileUseCase.cs, Assets/Tests/Editor/CompileUseCaseTests.cs
CompileAsync captures warning inputs through an injectable delegate, builds the warning before validation, and reuses it for execution and response creation. Tests verify warning content in immediate and stored validation-failure responses.
Warning propagation and storage
Packages/src/Editor/FirstPartyTools/Compile/CompilationExecutionService.cs, Packages/src/Editor/FirstPartyTools/Compile/CompileController.cs, Packages/src/Editor/FirstPartyTools/Compile/CompileResponse.cs, Packages/src/Editor/FirstPartyTools/Compile/CompileResponseFactory.cs, Packages/src/Editor/FirstPartyTools/Compile/CompileResultSessionRecorder.cs
Compilation, controller state, response creation, result recording, and cleanup now use playModeStopWarning. Response documentation describes Play session state loss during compilation.
Call sites and regression coverage
Assets/Editor/CompileCheckWindow/*, Assets/Tests/Editor/CompileApiUpdaterConsentPropagationTests.cs, Assets/Tests/Editor/CompileControllerPlayModeStopWarningTests.cs, Assets/Tests/Editor/CompileErrorNextActionsComposerTests.cs, Assets/Tests/Editor/CompileResponseFactoryTests.cs, Assets/Tests/Editor/CompileSessionResultStoreTests.cs
Editor call sites and tests use the renamed parameter. Controller tests verify that an external Scene-change failure stores the Play Mode stop warning.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 89764

The compile response now warns when compiling stops an active Play session and discards its state; no actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant CompileUseCase
  participant CompilationExecutionService
  participant CompileController
  participant CompileResponseFactory
  participant CompileSessionResultStore
  CompileUseCase->>CompileUseCase: Capture Play Mode state and pause-point count
  CompileUseCase->>CompileResponseFactory: Build response with playModeStopWarning
  CompileUseCase->>CompilationExecutionService: Execute compilation with warning
  CompilationExecutionService->>CompileController: TryCompileAsync with warning
  CompileController->>CompileResponseFactory: Record result with warning
  CompileResponseFactory->>CompileSessionResultStore: Store compile response
Loading

Possibly related PRs

  • hatayama/unity-cli-loop#1895: Refactors the pause-point compile warning implementation across the same compile pipeline, controller, response factory, and tests.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 47.37% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 57 functions across 16 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a warning when compilation stops an active Play session.
Description check ✅ Passed The description accurately explains the Play Mode warning changes, implementation scope, user impact, and verification results.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/compile-playmode-stop-warning

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.

A compile that actually discarded Play Mode still returned no Warning when
state validation failed or external Scene changes aborted before compile.
Rename the warning identifiers to match that broader Play-stop meaning.

Co-authored-by: Cursor <cursoragent@cursor.com>
@hatayama
hatayama merged commit 5b8d65e into v3-beta Aug 23, 2026
14 checks passed
@hatayama
hatayama deleted the feat/compile-playmode-stop-warning branch August 23, 2026 12:04
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