Skip to content
This repository was archived by the owner on Jun 26, 2026. It is now read-only.

Feat: Better testing server setup for init.sh#25

Merged
matejvasek merged 1 commit into
masterfrom
improve-test-cluster
May 20, 2026
Merged

Feat: Better testing server setup for init.sh#25
matejvasek merged 1 commit into
masterfrom
improve-test-cluster

Conversation

@matejvasek

@matejvasek matejvasek commented May 15, 2026

Copy link
Copy Markdown
Collaborator

Changes

  • 🧹 Stop operations use PID files (.dev-pids/) with recursive kill_tree instead of pgrep/pkill
  • 🎁 --randomize-ports flag allocates unique random ports for backend, plugin, and console (default ports unchanged)
  • 🎁 Active ports written to .dev-env.json for agent and tooling discovery
  • 🎁 Go backend auto-recompiles on .go/.mod/.sum changes via inotifywait (build-then-swap, graceful degradation if not installed)
  • 🎁 On compilation failure, a lightweight error server returns HTTP 500 with the build error as JSON, so the UI shows the actual compiler output
  • 🧹 start-console.sh accepts --backend-port, --plugin-port, --console-port, --cidfile CLI args
  • 🧹 Dropped --network=host on Linux in favor of -p port mapping (enables console port randomization)
  • 🧹 webpack.config.ts reads PLUGIN_PORT env var with fallback to 9001
  • 🧹 Agent docs (AGENTS.md, WORKFLOW.md, init-session) reference .dev-env.json and .dev-logs/

@matejvasek
matejvasek requested a review from twoGiants May 15, 2026 15:46
@matejvasek
matejvasek force-pushed the improve-test-cluster branch 2 times, most recently from dbc8e9a to 258eb37 Compare May 18, 2026 16:00

@twoGiants twoGiants left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you @matejvasek ! This is very useful. I have only small comments. See below.

Comment thread docs/plans/completed/025-chore-better-init-sh.md
Comment thread docs/designs/2026-05-14-better-init-sh-design.md
Comment thread docs/features.json Outdated
Comment thread docs/designs/2026-05-14-better-init-sh-design.md
Comment thread init.sh
Comment thread init.sh
Comment thread init.sh
matejvasek added a commit that referenced this pull request May 20, 2026
- Move plan to docs/plans/completed/
- Move design spec to docs/designs/
- Mark init.sh feature as passes:true in features.json
- Document inotify-tools as optional dev prerequisite in README
- Handle errserver startup failure: log, stop_dev, exit watcher

Signed-off-by: Matej Vašek <matejvasek@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@matejvasek
matejvasek requested a review from twoGiants May 20, 2026 13:22
@matejvasek

Copy link
Copy Markdown
Collaborator Author

I addressed PR feedback in latest commit.

@twoGiants twoGiants left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I have a last one with the help of Claude.

Comment thread init.sh Outdated

@twoGiants twoGiants left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great! Thank you for the re-work.

You can merge after addressing the last comment.

- Stop operations use PID files (.dev-pids/) with recursive kill_tree
  instead of pgrep/pkill, handles deep process trees (e.g. yarn->webpack)
- Ports randomized via --randomize-ports flag (default ports unchanged)
- Active ports written to .dev-env.json for agent and tooling discovery
- Go backend auto-recompiles on .go/.mod/.sum changes via inotifywait
  with build-then-swap strategy (build to tmp, swap only on success)
- On compilation failure, errserver returns HTTP 500 with build error
  as JSON so the UI displays actual compiler output
- Watcher shuts down on inotifywait or errserver startup failure
- start-console.sh accepts --backend-port, --plugin-port,
  --console-port, --cidfile CLI args
- Dropped --network=host on Linux, uses -p port mapping everywhere
- webpack.config.ts reads PLUGIN_PORT env var with fallback to 9001
- Agent docs (AGENTS.md, WORKFLOW.md, init-session) reference
  .dev-env.json and .dev-logs/
- inotify-tools documented as optional dev prerequisite in README

Signed-off-by: Matej Vašek <matejvasek@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@matejvasek
matejvasek force-pushed the improve-test-cluster branch from 808f5d4 to c55181c Compare May 20, 2026 13:49
@matejvasek
matejvasek merged commit 5ca7a87 into master May 20, 2026
2 checks passed
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.

2 participants