config :: support multiple configuration directories and update related methods#1440
config :: support multiple configuration directories and update related methods#1440cfkoehler wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds command-line and runtime support for specifying multiple configuration directories, and propagates this multi-dir value through system properties and the /api/env endpoint.
Changes:
- Update
BaseCommand--config/-chandling to accept multiple directories and exposegetConfigDirs()/getConfigDirsProperty(). - Update server startup validation and
/api/envoutput to use the comma-joined config directory list. - Add/adjust tests to cover multi-config-dir parsing and propagation.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/emissary/command/BaseCommand.java | Parses --config as a list, adds multi-dir accessors, and sets emissary.config.dir to the comma-joined absolute paths. |
| src/main/java/emissary/server/EmissaryServer.java | Validates emissary.config.dir as a comma-separated list of existing paths during server init. |
| src/main/java/emissary/server/api/Env.java | Returns the multi-dir config string for CONFIG_DIR in the env API response. |
| src/test/java/emissary/command/ServerCommandIT.java | Adds integration tests for multi-config-dir parsing, property propagation, and rejection of missing dirs. |
| src/test/java/emissary/server/api/EmissaryApiTest.java | Updates mocks to support the new getConfigDirsProperty() usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
memny
left a comment
There was a problem hiding this comment.
Code looks good and tests pass but I think this breaks the @{CONFIG_DIR} directive. I setup an alternate config directory and got the following error on startup:
emissary.core.EmissaryException: Unable to configure Emissary Node services
Caused by: java.io.IOException: In node.cfg, cannot find IMPORT_FILE: /home/user/projects/emissary/target-idea/config,/home/user/.config/emissary/places.cfg on the specified path. Make sure IMPORT_FILE (places.cfg) exists, and the file path is correct.
My cli parameters were emissary.Emissary server -c /home/user/projects/emissary/target-idea/config,/home/user/.config/emissary -a 1 --flavor FLAVOR --outputRoot=/home/user/projects/emissary/target/localoutput
I did not test a startup like that. Will look into it. Thanks! |
No description provided.