Skip to content

fix: Gears vs Modules#13

Merged
Bechma merged 2 commits into
devfrom
fix/modules-vs-gears
Jun 24, 2026
Merged

fix: Gears vs Modules#13
Bechma merged 2 commits into
devfrom
fix/modules-vs-gears

Conversation

@maurolacy

@maurolacy maurolacy commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Fix: Support the runtime's gears name instead of modules.

Signed-off-by: Mauro Lacy <11656534+maurolacy@users.noreply.github.com>

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

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 --section handling and tests to use gears as the config section name.
  • Rename serialized config keys in AppConfig so YAML uses gears / gears_dir instead of modules / 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>,
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")]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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")]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

same, forget about the rename, change the name completely

Signed-off-by: Mauro Lacy <11656534+maurolacy@users.noreply.github.com>
@Bechma
Bechma merged commit e309745 into dev Jun 24, 2026
1 check passed
@maurolacy
maurolacy deleted the fix/modules-vs-gears branch June 24, 2026 11:43
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.

3 participants