Skip to content

Honor server.json webroot server discovery in coldbox watch-reinit#77

Merged
lmajano merged 3 commits into
developmentfrom
copilot/fix-watch-reinit-webroot-setting
May 28, 2026
Merged

Honor server.json webroot server discovery in coldbox watch-reinit#77
lmajano merged 3 commits into
developmentfrom
copilot/fix-watch-reinit-webroot-setting

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 28, 2026

coldbox watch-reinit could report a running server as stopped when the app was started from a project whose server.json sets web.webroot to a subdirectory such as test-harness. This left module/template workflows unable to watch the project root and reinit the actual running app.

  • Align watch-reinit server resolution with reinit

    • Read the default server name from the local server.json
    • Resolve server details using both the discovered name and the current project directory
    • Stop relying on unscoped resolveServerDetails( {} ), which can miss servers started with a non-root webroot
  • Scope of behavior change

    • Only affects how watch-reinit locates the running CommandBox server
    • Leaves watcher path/delay behavior unchanged
var defaultServer = serverService.getServerInfoByDiscovery( serverConfigFile = "server.json" );
var serverDetails = serverService.resolveServerDetails( {
	name      : defaultServer.keyExists( "name" ) ? defaultServer.name : "",
	directory : getCWD()
} );

Copilot AI changed the title [WIP] Fix Coldbox Watch-Reinit not recognizing webroot setting Honor server.json webroot server discovery in coldbox watch-reinit May 28, 2026
Copilot AI requested a review from lmajano May 28, 2026 08:00
@lmajano lmajano marked this pull request as ready for review May 28, 2026 08:05
Copilot AI review requested due to automatic review settings May 28, 2026 08:05
@lmajano
Copy link
Copy Markdown
Member

lmajano commented May 28, 2026

@copilot I need you to add this to the changelog.md
Also, update the AGENTS.md that every fix, update or addition, must be added to the changelog automatically.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates coldbox watch-reinit to locate the correct running CommandBox server when a project’s server.json uses a non-root web.webroot (e.g., test-harness), preventing false “server stopped” detection during watch-based reinit workflows.

Changes:

  • Discover the default server name from the local server.json.
  • Resolve server details using both the discovered name and the current project directory (via getCWD()), mirroring coldbox reinit.
  • Avoid relying on unscoped resolveServerDetails( {} ), which can miss the intended server in webroot-discovery scenarios.

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

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 28, 2026

@copilot I need you to add this to the changelog.md
Also, update the AGENTS.md that every fix, update or addition, must be added to the changelog automatically.

Implemented in commit 3eca856.

  • Added the coldbox watch-reinit fix entry under Unreleased > Fixed in changelog.md
  • Updated AGENTS.md to require updating changelog.md for every fix, update, or addition

@lmajano lmajano merged commit b6167a3 into development May 28, 2026
1 check passed
@lmajano lmajano deleted the copilot/fix-watch-reinit-webroot-setting branch May 28, 2026 08:12
@homestar9
Copy link
Copy Markdown
Contributor

@lmajano did the AI consider what happens if the server is started using the non-default server.json file? For example, when building a module, it's common to launch servers via run-script start:2023 which targets server-adobe@2023.json. I believe the prior fix for fwreinit was able to handle that situation.

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.

Coldbox Watch-Reinit Doesn't Recognize Webroot Setting in server.json

4 participants