rototo 0.1.0-alpha.2

Control plane for runtime configuration in application code.
Documentation

rototo

rototo is a Git-backed control plane for runtime configuration.

Configuration lives in a workspace: reviewable files in a Git repository. Applications load a workspace source, then resolve named variables for an environment and request-time context. rototo validates the workspace before it is used, evaluates qualifiers, selects the configured value, and validates schema-backed values before returning them to the application.

This keeps operational configuration changes out of application binaries while keeping review, history, and rollback in Git.

Install

cargo install rototo

Check the CLI:

rototo --help
rototo docs
rototo docs -p quickstart

CLI

A workspace is rooted at rototo-workspace.toml and contains variables, qualifiers, and optional JSON Schemas. The repository includes a broad example workspace under examples/basic.

Inspect and lint a workspace:

rototo inspect examples/basic
rototo lint examples/basic

Resolve a variable for an environment and runtime context:

rototo resolve examples/basic \
  -v checkout-redesign \
  --env prod \
  -c @examples/basic/contexts/premium-enterprise.json

Resolve a named condition directly:

rototo resolve examples/basic \
  -q premium-users \
  -c user.tier=premium

Workspace sources can be local paths, file://, git+file://, git+https://, git+ssh://, or HTTPS archive URLs. Git sources support #ref:subdir, and archive URLs support #:subdir.

Rust SDK

Applications use the SDK when configuration needs to be resolved in process:

use std::error::Error;

use rototo::{Environment, ResolveContext, Workspace};

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    let workspace =
        Workspace::load("git+https://github.com/acme/config.git#main:rototo").await?;
    let env = Environment::new("prod");
    let context = ResolveContext::from_json(serde_json::json!({
        "user": { "tier": "premium" },
        "account": { "plan": "enterprise", "seats": 250 }
    }))?;

    let resolution = workspace
        .resolve_variable("checkout-redesign", &env, &context)
        .await?;

    println!("selected value: {}", resolution.value);
    Ok(())
}

Long-running services can use RefreshingWorkspace to refresh from the same workspace source while continuing to serve the last successfully loaded workspace when a refresh fails.

Documentation

The CLI bundles the same documentation that is published on the project site:

rototo docs
rototo docs -s 'refresh|last-known-good'

Useful entry points:

  • rototo docs -p quickstart
  • rototo docs -p production-workflow
  • rototo docs -p rust-sdk-reference
  • rototo docs -p cli-reference

Public documentation is also hosted at https://docs.rototo.pirogram.com.

Status

This is an alpha release. Public interfaces may change before a stability commitment.

License

Licensed under either of:

  • Apache License, Version 2.0
  • MIT license

at your option.