Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
5afa524
feat(ci): CI-01 added generate ci subcommand entrypoint
mitanuriel Mar 14, 2026
bee699b
refactor: rename submodule to ci_generation
mitanuriel Mar 14, 2026
2aba939
feat(ci): CI-02 CiContext struct and context collector
mitanuriel Mar 20, 2026
965a4de
feat(ci): CI-03 runtime version resolver with 8 unit tests
mitanuriel Mar 20, 2026
cc63af2
feat(ci): CI-04 dependency cache strategy module with 10 unit tests
mitanuriel Mar 20, 2026
7dce9ab
Merge remote-tracking branch 'origin/develop' into feature/ci-pipelin…
mitanuriel Mar 30, 2026
90a051f
chore: add .DS_Store to .gitignore
mitanuriel Mar 30, 2026
a2a8e4a
fix(ci): add Serialize derives to CiContext, RuntimeSetup, CacheConfi…
mitanuriel Mar 30, 2026
7f56576
refactor(ci): extract shared make_ctx test helper
mitanuriel Mar 30, 2026
4e0b72d
chore(ci): mark CI handler wiring gap for integration
mitanuriel Mar 30, 2026
1f539fe
feat(ci): CI-14 CiPipeline skeleton schema
mitanuriel Mar 30, 2026
e7a1675
feat(ci): CI-18 trigger configuration module
mitanuriel Mar 30, 2026
7210c2a
feat(ci): CI-15 placeholder token resolution engine
mitanuriel Mar 30, 2026
1d75373
feat(ci): CI-05 test step generator
mitanuriel Mar 30, 2026
469a66d
feat(ci): CI-06 lint step generator
mitanuriel Mar 30, 2026
a319b5d
feat(ci): CI-07 build step generator
mitanuriel Mar 30, 2026
12f92de
fix(ci): CI-18 scheduled placeholder, CI-06 Gradle Checkstyle variant
mitanuriel Mar 30, 2026
7535960
chore: ignore all .DS_Store files
mitanuriel Mar 30, 2026
d5034f3
feat(ci): CI-08 Docker build and tag step generator
mitanuriel Mar 30, 2026
883855c
feat(ci): CI-09 container image security scan step generator
mitanuriel Mar 30, 2026
2377872
feat(ci): CI-10 secret and credential leak scan step generator
mitanuriel Mar 30, 2026
a9612d9
fix(ci): expand schema fields for CI-08/09/10 spec gaps (buildx, SARI…
mitanuriel Mar 30, 2026
f150891
feat(ci): CI-11 GitHub Actions CI template builder
mitanuriel Mar 30, 2026
67bbd6f
feat(ci): CI-12 Azure Pipelines CI template builder
mitanuriel Mar 30, 2026
4a58bfc
feat(ci): CI-13 GCP Cloud Build CI template builder
mitanuriel Mar 30, 2026
0b69bb7
feat(ci): CI-22 .syncable.ci.toml config struct and merge
mitanuriel Mar 30, 2026
40aed8f
feat(ci): CI-19 secrets inventory generator
mitanuriel Mar 30, 2026
76b777a
feat(ci): CI-16 monorepo CI strategy generator
mitanuriel Mar 30, 2026
0b9fa69
feat(ci): CI-17 multi-version test matrix generator
mitanuriel Mar 30, 2026
08263d6
feat(ci): CI-20 CI file writer & conflict detection
mitanuriel Mar 30, 2026
fe18804
feat(ci): CI-20 close gaps — interactive prompt, merge, summary table
mitanuriel Mar 30, 2026
2609c2e
feat(ci): CI-21/23/24 dry-run renderer, coverage upload step, Slack n…
mitanuriel Mar 30, 2026
c844a44
fix(ci): CI-24 wire --notify flag and config key through handler (gap…
mitanuriel Mar 30, 2026
a07dd4c
test(ci): CI-25/26 unit and integration tests, language fixtures, ins…
mitanuriel Mar 31, 2026
4cd0756
feat(ci): CI-01/27/28 — wire full pipeline, telemetry, update docs
mitanuriel Mar 31, 2026
81de4b8
fix(ci): root-manifest language priority, platform SHA exprs, Azure/G…
mitanuriel Mar 31, 2026
7f35cf4
feat(ci): DEV-43 — secrets_doc scalar walker, platform-aware where_to…
mitanuriel Apr 8, 2026
71fdbda
feat(cd): CD generation foundation (CD-02, CD-17, CD-22)
mitanuriel Apr 14, 2026
fb0697f
feat(cd): Session 2 — Auth & Registry modules (CD-03, CD-04, CD-05, C…
mitanuriel Apr 14, 2026
c3b1ff1
feat(cd): Session 3 — Deploy steps, migration & health check (CD-07..…
mitanuriel Apr 14, 2026
e2c51ab
feat(cd): Templates, Writer, Pipeline Builder & CLI Entrypoint
mitanuriel Apr 14, 2026
2694691
feat(cd): Advanced features (CD-12..CD-16, CD-21, CD-29)
mitanuriel Apr 14, 2026
54706a2
feat(cd): combined CI+CD command, config, secrets doc & tests (CD-23/…
mitanuriel Apr 14, 2026
048fad1
docs(cd): add generate cd and generate ci-cd sections to command-over…
mitanuriel Apr 15, 2026
cd5e652
fix(CD-24): apply migration_command from .syncable.cd.toml to pipeline
mitanuriel Apr 15, 2026
89dd103
fix(cd): correct YAML step indentation in Azure/GCP/Hetzner templates
mitanuriel Apr 21, 2026
7a057f3
Merge remote-tracking branch 'origin/main' into feature/ci-pipeline-g…
mitanuriel Apr 24, 2026
5905719
Merge pull request #330 from syncable-dev/feature/ci-pipeline-generation
Alex793x May 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat(ci): CI-01 added generate ci subcommand entrypoint
- Restructure Commands::Generate from flat fields to GenerateCommand
  subcommand enum (Iac | Ci), following the existing Tools pattern
- Add CiPlatform (Azure, Gcp, Hetzner) and CiFormat (GithubActions,
  AzurePipelines, CloudBuild) value enums to cli.rs
- Add handle_generate_ci() to handlers/generate.rs: dry-run prints
  valid YAML skeleton with PLACEHOLDER tokens per platform format;
  non-dry-run is a stub pending CI-20 (file writer)
- Export handle_generate_ci through handlers/mod.rs public API
- Update run_command() in lib.rs and binary dispatch in main.rs to
  route GenerateCommand::Iac and GenerateCommand::Ci to their handlers
- Scaffold src/generator/ci_cd_generation/ module tree (context.rs,
  schema.rs, templates/) with TODO stubs for CI-02 through CI-14
- Preserves all existing generate iac behaviour unchanged

Acceptance: sync-ctl generate ci --platform gcp --dry-run prints
valid Cloud Build YAML to stdout. Verified with smoke test.
  • Loading branch information
mitanuriel committed Mar 14, 2026
commit 5afa52484038e67f2b7a2669d2f6badc9a4d7787
127 changes: 95 additions & 32 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,39 +66,10 @@ pub enum Commands {
color_scheme: Option<ColorScheme>,
},

/// Generate IaC files for a project
/// Generate files for a project (IaC, CI pipelines, and more)
Generate {
/// Path to the project directory to analyze
#[arg(value_name = "PROJECT_PATH")]
path: PathBuf,

/// Output directory for generated files
#[arg(short, long, value_name = "OUTPUT_DIR")]
output: Option<PathBuf>,

/// Generate Dockerfile
#[arg(long)]
dockerfile: bool,

/// Generate Docker Compose file
#[arg(long)]
compose: bool,

/// Generate Terraform configuration
#[arg(long)]
terraform: bool,

/// Generate all supported IaC files
#[arg(long, conflicts_with_all = ["dockerfile", "compose", "terraform"])]
all: bool,

/// Perform a dry run without creating files
#[arg(long)]
dry_run: bool,

/// Overwrite existing files
#[arg(long)]
force: bool,
#[command(subcommand)]
command: GenerateCommand,
},

/// Validate existing IaC files against best practices
Expand Down Expand Up @@ -637,6 +608,98 @@ pub enum ChatProvider {
Auto,
}

/// Generate subcommands
#[derive(Subcommand)]
pub enum GenerateCommand {
/// Generate IaC files (Dockerfile, Docker Compose, Terraform)
Iac {
/// Path to the project directory to analyze
#[arg(value_name = "PROJECT_PATH")]
path: PathBuf,

/// Output directory for generated files
#[arg(short, long, value_name = "OUTPUT_DIR")]
output: Option<PathBuf>,

/// Generate Dockerfile
#[arg(long)]
dockerfile: bool,

/// Generate Docker Compose file
#[arg(long)]
compose: bool,

/// Generate Terraform configuration
#[arg(long)]
terraform: bool,

/// Generate all supported IaC files
#[arg(long, conflicts_with_all = ["dockerfile", "compose", "terraform"])]
all: bool,

/// Perform a dry run without creating files
#[arg(long)]
dry_run: bool,

/// Overwrite existing files
#[arg(long)]
force: bool,
},

/// Generate a CI pipeline skeleton for your project
Ci {
/// Path to the project directory
#[arg(value_name = "PROJECT_PATH", default_value = ".")]
path: PathBuf,

/// Cloud platform target for the pipeline
#[arg(long, value_enum)]
platform: CiPlatform,

/// Pipeline file format (defaults to canonical format for the chosen platform)
#[arg(long, value_enum)]
format: Option<CiFormat>,

/// Print the generated pipeline to stdout instead of writing files
#[arg(long)]
dry_run: bool,

/// Output directory for generated pipeline files
#[arg(short, long, value_name = "OUTPUT_DIR")]
output: Option<PathBuf>,

/// Prefix applied to all environment variable and secret names
#[arg(long, value_name = "PREFIX")]
env_prefix: Option<String>,

/// Omit Docker build steps even when a Dockerfile is detected
#[arg(long)]
skip_docker: bool,
},
}

/// Cloud platform target for CI pipeline generation
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
pub enum CiPlatform {
/// Microsoft Azure (Azure Pipelines)
Azure,
/// Google Cloud Platform (Cloud Build)
Gcp,
/// Hetzner (GitHub Actions on Hetzner-hosted runners)
Hetzner,
}

/// CI pipeline file format
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
pub enum CiFormat {
/// GitHub Actions workflow (.github/workflows/ci.yml)
GithubActions,
/// Azure Pipelines (azure-pipelines.yml)
AzurePipelines,
/// Google Cloud Build (cloudbuild.yaml)
CloudBuild,
}

impl Cli {
/// Initialize logging based on verbosity level
pub fn init_logging(&self) {
Expand Down
7 changes: 7 additions & 0 deletions src/generator/ci_cd_generation/context.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//! CI Context — CI-02
//!
//! Defines `CiContext`, the enriched project data structure that all CI/CD
//! generators consume. It wraps the existing `ProjectAnalysis` and adds
//! CI-specific fields that the base analyzer does not capture.

// TODO CI-02: implement CiContext struct and collect_ci_context() function
15 changes: 15 additions & 0 deletions src/generator/ci_cd_generation/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//! CI/CD Pipeline Generation Module
//!
//! Generates CI and CD pipeline skeletons from project analysis.
//! Follows the same analyze → generate → write pattern as the existing
//! Dockerfile and Compose generators.
//!
//! ## Submodules
//!
//! - `context` — `CiContext` struct and context collector (CI-02)
//! - `schema` — Platform-agnostic `CiPipeline` data model (CI-14)
//! - `templates`— Per-platform YAML assemblers (CI-11, CI-12, CI-13)

pub mod context;
pub mod schema;
pub mod templates;
8 changes: 8 additions & 0 deletions src/generator/ci_cd_generation/schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//! CI Pipeline Schema — CI-14
//!
//! Defines the canonical, platform-agnostic `CiPipeline` intermediate
//! representation. All template builders render from this struct, not
//! directly from `CiContext`. This decouples context collection from
//! output formatting and allows future agent patching of individual steps.

// TODO CI-14: implement CiPipeline struct and all step types
6 changes: 6 additions & 0 deletions src/generator/ci_cd_generation/templates/azure_pipelines.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//! Azure Pipelines CI Template Builder — CI-12
//!
//! Generates `azure-pipelines.yml`. Maps GitHub Actions step equivalents
//! to Azure Pipelines tasks (NodeTool@0, Cache@2, PublishBuildArtifacts@1).

// TODO CI-12: implement AzurePipeline struct and render() function
6 changes: 6 additions & 0 deletions src/generator/ci_cd_generation/templates/cloud_build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//! GCP Cloud Build CI Template Builder — CI-13
//!
//! Generates `cloudbuild.yaml`. Maps each CI step to a Cloud Build step
//! with the correct container image `name`, `entrypoint`, and `args`.

// TODO CI-13: implement CloudBuildPipeline struct and render() function
6 changes: 6 additions & 0 deletions src/generator/ci_cd_generation/templates/github_actions.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//! GitHub Actions CI Template Builder — CI-11
//!
//! Assembles all generated steps into a valid `.github/workflows/ci.yml`
//! using a typed `GithubWorkflow` struct that serializes to YAML via serde_yaml.

// TODO CI-11: implement GithubWorkflow struct and render() function
12 changes: 12 additions & 0 deletions src/generator/ci_cd_generation/templates/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//! CI/CD Template Builders
//!
//! Each submodule assembles a final YAML file for a specific platform
//! by rendering a `CiPipeline` schema into the target format.
//!
//! - `github_actions` — `.github/workflows/ci.yml` (CI-11)
//! - `azure_pipelines` — `azure-pipelines.yml` (CI-12)
//! - `cloud_build` — `cloudbuild.yaml` (CI-13)

pub mod azure_pipelines;
pub mod cloud_build;
pub mod github_actions;
1 change: 1 addition & 0 deletions src/generator/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::analyzer::ProjectAnalysis;
use crate::error::Result;

pub mod ci_cd_generation;
pub mod compose_gen;
pub mod dockerfile_gen;
pub mod templates;
Expand Down
Loading