Skip to content

Commit d89f9ec

Browse files
ndbroadbentclaude
andcommitted
feat: delete all legacy code and migrate to plugin-only architecture
This is a massive cleanup that removes all legacy provider/loader/validation code and completes the migration to the new plugin-based architecture. ## Deleted (113 files): - src/providers/ - All legacy CircleCI and GitHub Actions generators - src/loader/ - Old config/template loading system - src/validation/ - Old validation system - src/models/ - Old job/config models - src/templating/ - Tera template engine - src/packages/ - Package manager templates - src/defaults/ - Default configs - src/graph/ - Dependency graph (replaced by orchestrator/dag.rs) - src/commands/{graph,init,inspect,list,validate,render}.rs - Unused commands ## Added/Modified: - src/loader.rs - New .cigen/ directory loader (supports split config format) - plugins/provider-github/src/main.rs - Container support for GitHub Actions - proto/plugin.proto - Added `image` field to JobDefinition - src/schema/job.rs - Added `image` field with default - src/orchestrator/convert.rs - Updated to include image field - Tests marked as #[ignore] for CircleCI (plugin not implemented yet) ## Key Changes: 1. **Plugin-only architecture**: All generation now goes through the plugin system 2. **Container support**: GitHub Actions plugin generates `container:` blocks for Docker images 3. **Split config support**: Both cigen.yml (single file) and .cigen/ (directory) formats work 4. **Unified generate command**: Single command handles all providers via plugins ## Testing: - All unit tests pass (36 passing) - Integration tests for GitHub Actions pass (2 passing) - CircleCI tests ignored until plugin is implemented (8 ignored) - Clippy clean with zero warnings 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 04fa748 commit d89f9ec

114 files changed

Lines changed: 346 additions & 16200 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cigen/workflows/ci/jobs/clippy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: rust:latest
1+
image: instrumentisto/rust
22
source_files: "@rust"
33

44
steps:

.cigen/workflows/ci/jobs/fmt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: rust:latest
1+
image: instrumentisto/rust
22
source_files: "@rust"
33

44
steps:

.cigen/workflows/ci/jobs/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: rust:latest
1+
image: instrumentisto/rust
22
source_files:
33
- "@rust"
44
- "@tests"

CLAUDE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,23 @@ Key notes files:
3131

3232
Using `--no-verify` is a sign of poor craftsmanship and will not be tolerated.
3333

34+
## CRITICAL: Self-Hosted CI Configuration
35+
36+
**The `.github/workflows/` directory is GENERATED by cigen itself. NEVER manually edit files in that directory.**
37+
38+
- CI configuration is defined in `.cigen/` directory
39+
- Workflows are generated by running: `cargo run -- generate --file .cigen/config.yml`
40+
- All changes to CI must be made in `.cigen/workflows/` YAML files
41+
- The generated files contain "DO NOT EDIT" warnings at the top
42+
- To test CI locally: `act -j <job-name> --container-architecture linux/amd64`
43+
44+
If you need to modify CI behavior:
45+
46+
1. Edit files in `.cigen/workflows/ci/jobs/`
47+
2. Regenerate with `cargo run -- generate --file .cigen/config.yml`
48+
3. Test with `act` before committing
49+
4. Commit both the source `.cigen/` files AND generated `.github/` files together
50+
3451
## Project Overview
3552

3653
`cigen` is a Rust CLI tool that generates CI pipeline configurations from templates. It integrates with Nx monorepo tooling and supports multiple CI providers starting with CircleCI.

cigen.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
providers:
2+
- github
3+
4+
jobs:
5+
fmt:
6+
image: instrumentisto/rust
7+
steps:
8+
- run: cargo fmt -- --check
9+
10+
clippy:
11+
image: instrumentisto/rust
12+
steps:
13+
- run: cargo clippy --all-targets --all-features -- -D warnings
14+
15+
test:
16+
image: instrumentisto/rust
17+
needs:
18+
- fmt
19+
- clippy
20+
steps:
21+
- run: cargo test --all-features

plugins/provider-github/src/converter.rs

Lines changed: 0 additions & 131 deletions
This file was deleted.

0 commit comments

Comments
 (0)