Repository navigation
Expose resolved project configuration as JSON - #165
Merged
Merged
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
peterjaap
marked this pull request as ready for review
November 16, 2026 20:03
There was a problem hiding this comment.
🟡 Changes recommended
The derived search version can report a project's requested version instead of the shared container's resolved version, misleading integrations unless both search branches use the provisioning resolver.
1 open issue
What changed in this PR
Adds magebox config --json so integrations can read merged project settings and derived connection details without parsing YAML themselves, addressing the JSON-output portion of #164.
Changes:
- Adds JSON output containing merged configuration, service endpoints, and domain details.
- Bypasses startup and update messages for machine-readable output.
- Adds tests and documentation covering overrides, includes, missing configuration, and sensitive values.
| File | Description |
|---|---|
vitepress/reference/commands.md |
Documents JSON output, endpoint caveats, and sensitive values. |
cmd/magebox/root.go |
Skips pre/post-run messages for JSON mode. |
cmd/magebox/config_project.go |
Loads merged configuration and serializes derived values. |
cmd/magebox/config_project_test.go |
Tests merged settings, endpoints, domains, and missing configuration. |
cmd/magebox/config_cmd.go |
Registers the JSON flag and project configuration handler. |
Review effort: Balanced
Comment on lines
+84
to
+86
| result.Derived.Search = &projectEndpoint{Service: "opensearch", Version: cfg.Services.OpenSearch.Version, Host: "127.0.0.1", Port: docker.GetOpenSearchPort()} | ||
| } else if cfg.Services.HasElasticsearch() { | ||
| result.Derived.Search = &projectEndpoint{Service: "elasticsearch", Version: cfg.Services.Elasticsearch.Version, Host: "127.0.0.1", Port: docker.GetElasticsearchPort()} |
|
Wow thats fast, thanks @peterjaap 🙌 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Integrations currently need to parse project YAML and reproduce MageBox’s merge and service-resolution rules to obtain connection details.
magebox config --jsonwith the merged project configuration and derived database, cache, search, and domain values.