Skip to content

apollo_node: add new CLI arg to parse config#14606

Open
nimrod-starkware wants to merge 1 commit into
nimrod/jsonnet/applicative-defaults-parityfrom
nimrod/jsonnet/add-cli-arg
Open

apollo_node: add new CLI arg to parse config#14606
nimrod-starkware wants to merge 1 commit into
nimrod/jsonnet/applicative-defaults-parityfrom
nimrod/jsonnet/add-cli-arg

Conversation

@nimrod-starkware

Copy link
Copy Markdown
Contributor

No description provided.

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

nimrod-starkware commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@cursor

cursor Bot commented Jun 25, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Config loading is on the critical path for every node; native mode changes how secrets merge into nested JSON, though production paths still opt into explicit preset.

Overview
Introduces --config_format on the config CLI so --config_file can be interpreted in two ways. preset (default) keeps the existing flat dotted-key pipeline (layered files, pointers, env/CLI, #is_none). native loads a nested JSON base with serde, then merges flat dotted-key secret files into that tree before deserialization—skipping the preset pipeline.

Native loading requires exactly two config paths (base + secrets). set_nested_value applies secret keys at nested leaves, preserves siblings, can add missing leaves under existing parents, and ignores overrides whose path runs through null or missing intermediates (disabled optional components).

apollo_config gains ConfigFormat, clap derive, and NativeModeRequiresTwoConfigFiles, plus broad native-mode tests (deep secrets, optional None, single-file cases). Deployments and tests now pass --config_format preset explicitly (docker-compose sequencer nodes, K8s pod_builder, node_runner) so behavior stays on the legacy loader until native is adopted.

Reviewed by Cursor Bugbot for commit 135115a. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread crates/apollo_config/src/loading.rs
@nimrod-starkware nimrod-starkware force-pushed the nimrod/jsonnet/add-cli-arg branch from 43ac4b5 to eadf272 Compare June 28, 2026 08:19
@nimrod-starkware nimrod-starkware force-pushed the nimrod/jsonnet/applicative-defaults-parity branch from 19f89f8 to 7a52c90 Compare June 28, 2026 08:19
@nimrod-starkware nimrod-starkware force-pushed the nimrod/jsonnet/applicative-defaults-parity branch from 7a52c90 to df3b806 Compare June 28, 2026 10:30
@nimrod-starkware nimrod-starkware force-pushed the nimrod/jsonnet/add-cli-arg branch from eadf272 to 5b34cc3 Compare June 28, 2026 10:30
@nimrod-starkware nimrod-starkware force-pushed the nimrod/jsonnet/applicative-defaults-parity branch from df3b806 to 5ef42b9 Compare June 28, 2026 14:04
@nimrod-starkware nimrod-starkware force-pushed the nimrod/jsonnet/add-cli-arg branch from 5b34cc3 to 135115a Compare June 28, 2026 14:04

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 135115a. Configure here.

serde_json::from_reader(File::open(secret_config_path)?)?;
for (param_path, value) in secret_config {
set_nested_value(&mut nested_map, &param_path, value);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Native mode rejects one config file

High Severity

load_native accepts only exactly two --config_file paths via slice destructuring, yet ConfigFormat::Native, the CLI help, and test_native_config_single_file treat a lone base file as valid native loading without a secret file.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 135115a. Configure here.

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.

2 participants