Skip to content

config :: support multiple configuration directories and update related methods#1440

Draft
cfkoehler wants to merge 2 commits into
NationalSecurityAgency:mainfrom
cfkoehler:multiple-config
Draft

config :: support multiple configuration directories and update related methods#1440
cfkoehler wants to merge 2 commits into
NationalSecurityAgency:mainfrom
cfkoehler:multiple-config

Conversation

@cfkoehler

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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/-c handling to accept multiple directories and expose getConfigDirs() / getConfigDirsProperty().
  • Update server startup validation and /api/env output 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.

Comment thread src/main/java/emissary/server/EmissaryServer.java
Comment thread src/main/java/emissary/command/BaseCommand.java

@memny memny 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.

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

@cfkoehler

Copy link
Copy Markdown
Collaborator Author

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!

@cfkoehler
cfkoehler marked this pull request as draft July 2, 2026 09:23
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.

4 participants