fix: Gears vs Modules#13
Merged
Merged
Conversation
Signed-off-by: Mauro Lacy <11656534+maurolacy@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the runtime config schema/help surface to use gears terminology (instead of modules) so the CLI aligns with the runtime’s expected config keys/sections.
Changes:
- Update
help schema config --sectionhandling and tests to usegearsas the config section name. - Rename serialized config keys in
AppConfigso YAML usesgears/gears_dirinstead ofmodules/modules_dir.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| crates/cargo-gears-core/src/help/mod.rs | Switch schema config subsection name from modules to gears and update associated tests/error output. |
| crates/cargo-gears-core/src/app_config.rs | Change serde field names to serialize/deserialize config under gears and gears_dir. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+264
to
269
| Some("gears") => { | ||
| let mut out = ModuleConfig::help_text(); | ||
| out.push('\n'); | ||
| out.push_str(&ModuleRuntime::help_text()); | ||
| Ok(out) | ||
| } |
Comment on lines
270
to
272
| Some(other) => bail!( | ||
| "unknown config section '{other}'; available: server, database, logging, opentelemetry, modules" | ||
| "unknown config section '{other}'; available: server, database, logging, opentelemetry, gears" | ||
| ), |
| #[test] | ||
| fn schema_config_sections_resolve() { | ||
| for section in &["server", "database", "logging", "opentelemetry", "modules"] { | ||
| for section in &["server", "database", "logging", "opentelemetry", "gears"] { |
Comment on lines
270
to
272
| Some(other) => bail!( | ||
| "unknown config section '{other}'; available: server, database, logging, opentelemetry, modules" | ||
| "unknown config section '{other}'; available: server, database, logging, opentelemetry, gears" | ||
| ), |
Comment on lines
27
to
29
| /// Per-module configuration bag: `module_name` -> module config. | ||
| #[serde(default)] | ||
| #[serde(default, rename = "gears")] | ||
| pub modules: BTreeMap<String, ModuleConfig>, |
Comment on lines
24
to
26
| /// Directory containing per-module YAML files (optional). | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| #[serde(default, rename = "gears_dir", skip_serializing_if = "Option::is_none")] | ||
| pub modules_dir: Option<String>, |
Bechma
requested changes
Jun 24, 2026
| pub opentelemetry: OpenTelemetryConfig, | ||
| /// Directory containing per-module YAML files (optional). | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| #[serde(default, rename = "gears_dir", skip_serializing_if = "Option::is_none")] |
Owner
There was a problem hiding this comment.
do not do a rename, just replace the parameter
| pub modules_dir: Option<String>, | ||
| /// Per-module configuration bag: `module_name` -> module config. | ||
| #[serde(default)] | ||
| #[serde(default, rename = "gears")] |
Owner
There was a problem hiding this comment.
same, forget about the rename, change the name completely
Signed-off-by: Mauro Lacy <11656534+maurolacy@users.noreply.github.com>
Bechma
approved these changes
Jun 24, 2026
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.
Fix: Support the runtime's
gearsname instead ofmodules.