Skip to content

Conversation

@josh-tracey
Copy link
Contributor

No description provided.

google-labs-jules bot and others added 8 commits May 24, 2025 19:04
This commit introduces two main features:

1.  **`sailr add service <service_name> --type <app_type>` command:**
    *   Generates basic Kubernetes manifest templates (Deployment, Service, ConfigMap) in `k8s/templates/<service_name>/`.
    *   Adds a corresponding service entry to the `config.toml` of the "develop" environment (future improvement: make environment configurable).
    *   Supports different application archetypes via the `--type` flag (currently basic, can be expanded).

2.  **Enhanced `sailr init <env_name>` command:**
    *   Optionally creates a default "sample-app" service upon environment initialization.
    *   Generates templates for "sample-app" in `k8s/templates/sample-app/`.
    *   Adds an entry for "sample-app" to the new environment's `config.toml`.
    *   This makes the environment runnable and demonstratable immediately.

Includes:
*   New CLI arguments and command handling logic.
*   Template generation functions in `src/templates/scaffolding.rs`.
*   Modifications to `config.toml` management in `src/environment.rs`.
*   Integration tests for both `add service` and the enhanced `init` command, ensuring file creation and configuration updates are correct.
This commit updates the documentation to reflect the new `sailr add service`
command and the enhancements to the `sailr init` command.

Changes include:

*   **`docs/docs/cli-usage.md`**:
    *   Added a new section for `sailr add service`, detailing its usage,
        arguments (`<service_name>`, `--type`), and actions (template
        generation, config update).
    *   Updated the `sailr init` section to include information about the
        automatic creation of the "sample-app" service.

*   **`README.md`**:
    *   Briefly updated the `sailr init` description.
    *   Added a short description for the new `sailr add service` command
        in the CLI usage overview.
    *   Enhanced links to the more detailed CLI command reference in
        `docs/docs/cli-usage.md`.
This commit introduces service scaffolding capabilities and enhances the
`sailr init` command.

Features:
1.  **`sailr add service <service_name> --type <app_type>` command:**
    *   Generates Kubernetes manifest templates (Deployment, Service,
        ConfigMap) in `k8s/templates/<service_name>/`.
    *   Adds a corresponding service entry to the `config.toml` of
        the "develop" environment.
    *   The `--type` flag can be used for different application archetypes.

2.  **Enhanced `sailr init <env_name>` command:**
    *   Creates a default "sample-app" service upon environment
        initialization, including templates and `config.toml` entry.
    *   This makes the environment immediately runnable and demonstratable.

Fixes:
*   Corrects build errors related to `Service` struct instantiation in
    `src/main.rs` by aligning with the struct's actual definition in
    `src/environment.rs`. Non-existent fields are no longer referenced,
    and types for existing fields are now correct.

Documentation:
*   Updates `docs/docs/cli-usage.md` and `README.md` to reflect the new
    `add service` command and the enhancements to `init`.

Includes:
*   New CLI arguments and command handling logic.
*   Template generation functions in `src/templates/scaffolding.rs`.
*   Modifications to `config.toml` management.
*   Integration tests for `add service` and enhanced `init` commands.
This commit introduces service scaffolding capabilities, enhances the
`sailr init` command, and includes fixes for build and test errors.

Features:
1.  **`sailr add service <service_name> --type <app_type>` command:**
    *   Generates Kubernetes manifest templates (Deployment, Service,
        ConfigMap) in `k8s/templates/<service_name>/`.
    *   Adds a corresponding service entry to the `config.toml` of
        the "develop" environment.
    *   The `--type` flag can be used for different application archetypes.

2.  **Enhanced `sailr init <env_name>` command:**
    *   Creates a default "sample-app" service upon environment
        initialization, including templates and `config.toml` entry.

Fixes:
*   **`src/main.rs`**: Corrects build errors related to `Service` struct
    instantiation by aligning with the struct's actual definition.
*   **`tests/cli_integration_tests.rs`**:
    *   Corrects `Service` struct instantiations to align with definition.
    *   Fixes arguments for `Environment::load_from_file` calls to use
        `&String` instead of `&PathBuf`.
    *   Removes unused imports (`Cli` and `std::io::Write`).
    *   Ensures `AddServiceArgs` instantiation matches the current
        `src/cli.rs` (which does not include an `env_name` field).

Documentation:
*   Updates `docs/docs/cli-usage.md` and `README.md` to reflect the new
    `add service` command and the enhancements to `init`.

Includes:
*   New CLI arguments and command handling logic.
*   Template generation functions in `src/templates/scaffolding.rs`.
*   Modifications to `config.toml` management.
*   Integration tests for `add service` and enhanced `init` commands.
This commit updates the `sailr init` command to only provision
infrastructure when a provider is explicitly specified. It also
consolidates all previous features and fixes related to service
scaffolding.

Changes:
*   **`src/main.rs`**:
    *   Modified `Commands::Init` handler: Infrastructure provisioning
        (e.g., for LocalK8) is now skipped if no `--provider` or
        `--infra-template-path` is given. A log message is added to
        inform you.
    *   Corrected `Service` struct instantiation in `Commands::AddService`
        and `Commands::Init` (for sample-app) to align with its definition.

*   **`tests/cli_integration_tests.rs`**:
    *   Corrected `Service` struct instantiations.
    *   Fixed `Environment::load_from_file` arguments.
    *   Removed unused imports.
    *   Test for `init` implicitly verified against new behavior as it
        was already testing the no-provider scenario for infra.

*   **Features (from previous commits in this series)**:
    *   `sailr add service <name> --type <type>` command for scaffolding.
    *   `sailr init` now creates a "sample-app" by default.

*   **Documentation (from previous commits in this series)**:
    *   Updated `docs/docs/cli-usage.md` and `README.md` for new CLI
        features and behaviors.

This commit ensures the `init` command behaves as per recent feedback from you and integrates all developed functionalities and fixes into
a single, coherent state.
@vercel
Copy link

vercel bot commented May 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sailr ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 25, 2025 7:26am

@josh-tracey josh-tracey merged commit 7c2fb1e into main May 25, 2025
2 of 5 checks passed
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