fix(dev-server): reuse already-running dev server instead of port-colliding#266
Merged
Conversation
…l produced nothing The summary builder rendered ``❌ 0 judge(s) requested changes.`` when ``ran == 0`` — i.e. no judge produced a decision file at all. That message lies in two ways: 1. Zero judges actually rejected (none ran). 2. The gate body (``compute_review_event``) immediately below it says "INCONCLUSIVE: No judge decisions found. Re-run the panel." Two contradictory lines in the same review body. Fix: render an explicit "No judge decisions found" line when ran=0 so the summary and the gate body agree. The "❌ N judge(s) requested changes" wording stays for the genuine all-RC case (ran > 0 AND approvals == 0). 715/715 tests pass.
…liding If the operator already has the dev server running in another tab (very common during active development), the previous spawn-then- poll-for-ready path would collide on the port, the new process would exit, and cube reported the dev server as unavailable. Detect an already-running server via the same HEAD-poll the ready check uses. When the URL responds, return a handle pointing at it with ``process=None`` so ``stop()`` is a no-op — we don't tear down a server we didn't start. 716/716 tests pass. New test covers the reuse path.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThis pull request makes two independent changes: it adds explicit summary handling in peer review when no judge decision files are found (displaying an inconclusive verdict rather than zero requested changes), and it implements server reuse detection in the dev server startup—polling the configured URL before spawning a new process and returning a no-op handle when a server is already running. A corresponding test verifies the reuse path correctly returns a handle with no spawned process. Possibly related PRs
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If operator already has dev server running, the spawn would port-collide → exit → cube reports unavailable. Detect already-running via HEAD-poll and reuse.
Dev Server Reuse Detection
python/cube/core/dev_server.py: Implemented detection of an already-running dev server before spawning a new one. Thestart()function now calls_poll_url(config.url)early in its flow; if the URL responds with 2xx/3xx status, it logs the reuse and returns aDevServerHandlewithprocess=None,url=config.url,unavailable=False, and_stopped=True. This prevents port collisions when operators have the dev server running in another session and makesstop()a safe no-op for handles pointing to externally-managed servers.tests/core/test_dev_server.py: Addedtest_start_reuses_already_running_serverto verify the reuse path. The test monkeypatches_poll_urlto returnTrue, asserts the handle hasprocess=Noneandunavailable=False, and confirmsstop()is idempotent even when no subprocess exists.Peer Review Summary Rendering
python/cube/commands/peer_review.py: Fixed the summary message when no judge decisions are found (ran == 0). Previously this case fell through to the default "0 judge(s) requested changes" message, which contradicted the INCONCLUSIVE gate outcome. Now explicitly renders a clearer "No judge decisions found" message that better reflects the panel's inability to produce a verdict.