Migrating from earlier versions

Version 0.6.0 Updated Nov 12, 2025

Projects using a pre‑0.5 release can upgrade with the following steps:

  • #[derive(OrthoConfig)] remains the correct way to annotate configuration structs. No additional derives are required.
  • Remove any load_with_reference_fallback helpers. The merge logic inside load_and_merge_subcommand_for supersedes this workaround.
  • Replace calls to deprecated helpers such as load_subcommand_config_for with ortho_config::subcommand::load_and_merge_subcommand_for or import ortho_config::SubcmdConfigMerge to call load_and_merge directly.

Import it with:

use ortho_config::SubcmdConfigMerge;

Subcommand structs can leverage the SubcmdConfigMerge trait to expose a load_and_merge method automatically:

use ortho_config::{OrthoConfig, OrthoResult};
use ortho_config::SubcmdConfigMerge;
use serde::Deserialize;

#[derive(Deserialize, OrthoConfig)]
struct PrArgs {
    reference: String,
}

# fn demo(pr_args: &PrArgs) -> OrthoResult<()> {
let merged = pr_args.load_and_merge()?;
# let _ = merged;
# Ok(())
# }

After parsing the relevant subcommand struct, call load_and_merge()? on that value (for example, pr_args.load_and_merge()?) to obtain the merged configuration for that subcommand.