-
Notifications
You must be signed in to change notification settings - Fork 2
Fix remaining #470 console flash: hub server spawn, not just browser-open #475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,14 @@ | |
| * passes windowsHide on win32, and that non-win32 platforms are unaffected | ||
| * (the option is harmless there, but shell must stay false). | ||
| * | ||
| * The original #470/#471 fix covered the browser-open spawn (cmd.exe /c | ||
| * start) at each call site but missed the OTHER spawn each of those files | ||
| * makes: launching the Business Hub SERVER itself by spawning node.exe | ||
| * directly with detached: true. node.exe is a console-subsystem executable, | ||
| * so that spawn flashes a console too, independent of the shell:true case — | ||
| * it kept flashing after #471 merged. Covered below for both the Claude | ||
| * Code hook (auto-launch.js) and the Pi integration (rstack-sdlc.ts). | ||
| * | ||
|
Comment on lines
+9
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Regression test lacks attribution metadata The updated regression test comment block references #470/#471 but does not include the required found-date and QA report path metadata. This reduces traceability for why/when the regression coverage was added and where the original report lives. Agent Prompt
|
||
| * owner: RStack developed by Richardson Gunde | ||
| */ | ||
|
|
||
|
|
@@ -17,7 +25,7 @@ | |
| // call sites below instead of a direct import. | ||
| import test from 'node:test'; | ||
| import assert from 'node:assert/strict'; | ||
| import { openBrowser as openBrowserAutoLaunch } from '../src/hooks/auto-launch.js'; | ||
| import { openBrowser as openBrowserAutoLaunch, autoLaunchBusinessHub } from '../src/hooks/auto-launch.js'; | ||
| import { openUrl } from '../src/integrations/pi/rstack-sdlc.ts'; | ||
| import { startContainerRuntime } from '../src/core/harness/sandbox.js'; | ||
|
|
||
|
|
@@ -94,6 +102,26 @@ test('pi/rstack-sdlc.ts openUrl: no-ops under CI (never pops a browser during au | |
| assert.equal(calls.length, 0, 'openUrl must not spawn anything when CI is set'); | ||
| }); | ||
|
|
||
| test('auto-launch.js autoLaunchBusinessHub: windowsHide:true on the server-launch spawn (missed by #471)', async () => { | ||
| const calls = []; | ||
| // A high, effectively-never-bound port so isPortOpen() resolves false and | ||
| // the function takes the "spawn a fresh instance" branch under test. | ||
| const originalPort = process.env.RSTACK_BUSINESS_PORT; | ||
| const originalNoBrowser = process.env.RSTACK_NO_BROWSER; | ||
| process.env.RSTACK_BUSINESS_PORT = '58471'; | ||
| process.env.RSTACK_NO_BROWSER = '1'; | ||
|
Comment on lines
+109
to
+112
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 4. 58471 hardcoded test port The test hardcodes the port value 58471 instead of using a named constant. This reduces readability and makes future updates more error-prone. Agent Prompt
|
||
| try { | ||
| await autoLaunchBusinessHub('/tmp/project', { spawnImpl: recordingSpawn(calls) }); | ||
|
Comment on lines
+107
to
+114
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win Make the spawn branch deterministic.
🤖 Prompt for AI Agents |
||
| } finally { | ||
| if (originalPort === undefined) delete process.env.RSTACK_BUSINESS_PORT; else process.env.RSTACK_BUSINESS_PORT = originalPort; | ||
| if (originalNoBrowser === undefined) delete process.env.RSTACK_NO_BROWSER; else process.env.RSTACK_NO_BROWSER = originalNoBrowser; | ||
| } | ||
| assert.equal(calls.length, 1); | ||
| assert.equal(calls[0].cmd, process.execPath); | ||
| assert.equal(calls[0].options.detached, true); | ||
| assert.equal(calls[0].options.windowsHide, true); | ||
| }); | ||
|
Comment on lines
+107
to
+123
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 5. Flaky port-based test The new autoLaunchBusinessHub regression test assumes port 58471 is unused so isPortOpen() returns false; if any process is listening on 127.0.0.1:58471, autoLaunchBusinessHub() will early-return and never call the injected spawnImpl, causing a nondeterministic test failure. Agent Prompt
|
||
|
|
||
| test('sandbox.js startContainerRuntime: windowsHide:true on the engine auto-start spawn', async () => { | ||
| const calls = []; | ||
| const result = await startContainerRuntime({ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Duplicated slack fields parsing
📜 Skill insight⚙ MaintainabilityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools