Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

---

## [0.4.0] - 2026-03-15

### Added
- **`scaffold unittest` subcommand** — new `devopsos scaffold unittest` command that generates
unit testing configuration files and sample test stubs for multiple tech stacks:
- **Python** → `pytest.ini` (with pytest-cov options), `conftest.py` with shared fixtures,
`tests/__init__.py`, and `tests/test_sample.py` with parametrized examples.
- **JavaScript** → Jest (`jest.config.js`), Vitest (`vitest.config.js`), or Mocha (`.mocharc.js`)
configuration plus a matching `tests/sample.test.js`.
- **TypeScript** → same as JavaScript with TypeScript-specific Jest transform (`ts-jest`)
and `tests/sample.test.ts`.
- **Go** → table-driven `<name>_test.go` sample and `Makefile.test` with `test`, `test-race`,
`test-cov`, and `lint` targets.
- Coverage configuration is included by default and can be disabled with `--no-coverage`.
- Supports comma-separated `--languages` to scaffold multiple stacks at once.
- **`generate_unittest_config` MCP tool** — exposes the new unit-test scaffold as an MCP tool
so AI assistants can generate test configurations via conversation.
- **`cli/scaffold_unittest.py`** — the scaffold library backing the new command.
- **`docs/CLI-COMMANDS-REFERENCE.md`** — new section documenting all `unittest` options,
output files, and examples.

---

## [0.3.0] - 2026-03-10

### Fixed
Expand Down
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[![CI](https://github.com/cloudengine-labs/devops_os/actions/workflows/ci.yml/badge.svg)](https://github.com/cloudengine-labs/devops_os/actions/workflows/ci.yml)
[![Sanity Tests](https://github.com/cloudengine-labs/devops_os/actions/workflows/sanity.yml/badge.svg)](https://github.com/cloudengine-labs/devops_os/actions/workflows/sanity.yml)
[![Version](https://img.shields.io/badge/version-0.2.0-blue)](CHANGELOG.md)
[![Version](https://img.shields.io/badge/version-0.4.0-blue)](CHANGELOG.md)
[![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue?logo=python&logoColor=white)](https://www.python.org/)
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
[![Open Source](https://img.shields.io/badge/open%20source-%E2%9D%A4-red)](https://github.com/cloudengine-labs/devops_os)
Expand All @@ -29,6 +29,7 @@ DevOps-OS is an open-source DevOps automation platform that scaffolds production
| 🚀 **CI/CD Generators** | One-command scaffolding for GitHub Actions, GitLab CI, and Jenkins pipelines |
| ☸️ **GitOps Config Generator** | Kubernetes manifests, ArgoCD Applications, and Flux CD Kustomizations |
| 📊 **SRE Config Generator** | Prometheus alert rules, Grafana dashboards, and SLO manifests |
| 🧪 **Unit Test Scaffold** | Generate pytest, Jest, Vitest, Mocha, or Go test configs with one command |
| 🤖 **MCP Server** | Plug DevOps-OS tools into Claude or ChatGPT as native AI skills |
| 🛠️ **Dev Container** | Pre-configured multi-language environment (Python · Java · Go · JavaScript) |
| 🔄 **Process-First** | Built-in education on the Process-First SDLC philosophy and how it maps to every DevOps-OS tool |
Expand Down Expand Up @@ -174,6 +175,13 @@ python -m cli.devopsos scaffold sre --name my-app --team platform --slo-target 9
# Dev container configuration → .devcontainer/devcontainer.json + .devcontainer/devcontainer.env.json
python -m cli.devopsos scaffold devcontainer --languages python,go --cicd-tools docker,terraform --kubernetes-tools k9s,flux

# Unit test configs + sample stubs (Python, JS, Go, TypeScript)
python -m cli.devopsos scaffold unittest --name my-app --languages python
python -m cli.devopsos scaffold unittest --name my-app --languages python,javascript,go

# Combined GitHub Actions + Jenkins in one step
python -m cli.devopsos scaffold cicd --name my-app --type build --languages python --github --jenkins

# Kubernetes manifests
python kubernetes/k8s-config-generator.py --name my-app --image ghcr.io/myorg/my-app:v1
```
Expand Down Expand Up @@ -218,7 +226,7 @@ git clone https://github.com/cloudengine-labs/devops_os.git && cd devops_os
pip install -r cli/requirements.txt

# ── Check version ──────────────────────────────────────────────────────────
python -m cli.devopsos --version # → devopsos version 0.2.0
python -m cli.devopsos --version # → devopsos version 0.4.0

# ── Interactive project wizard ─────────────────────────────────────────────
python -m cli.devopsos init # guided setup for any project
Expand Down Expand Up @@ -247,6 +255,10 @@ python -m cli.devopsos scaffold devcontainer --languages python,go --cicd-tools
# ── Combined CI/CD (GHA + Jenkins in one step) ────────────────────────────
python -m cli.devopsos scaffold cicd --name my-app --type build --languages python --github --jenkins

# ── Unit Tests ─────────────────────────────────────────────────────────────
python -m cli.devopsos scaffold unittest --name my-app --languages python
python -m cli.devopsos scaffold unittest --name my-app --languages python,javascript,go

# ── Process-First philosophy ───────────────────────────────────────────────
python -m cli.devopsos process-first # full overview
python -m cli.devopsos process-first --section mapping # which tool for which goal
Expand All @@ -268,7 +280,7 @@ python -m cli.devopsos scaffold gha --help
devops_os/
├── .devcontainer/ # Dev container config (Dockerfile, devcontainer.json, setup scripts)
├── .github/workflows/ # CI, Sanity Tests, and GitHub Pages workflows
├── cli/ # CLI scaffold tools (scaffold_gha, gitlab, jenkins, argocd, sre, devopsos)
├── cli/ # CLI scaffold tools (scaffold_gha, gitlab, jenkins, argocd, sre, unittest, devopsos)
├── kubernetes/ # Kubernetes manifest generator
├── mcp_server/ # MCP server for AI assistant integration (Claude, ChatGPT)
├── skills/ # Claude & OpenAI tool/function definitions
Expand All @@ -291,7 +303,7 @@ pip install -r cli/requirements.txt -r mcp_server/requirements.txt pytest pytest
python -m pytest cli/test_cli.py mcp_server/test_server.py tests/test_comprehensive.py -v
```

**Latest results:** ✅ 162 passed · ⚠️ 3 xfailed (known tracked bugs) · ❌ 0 failed
**Latest results:** ✅ 260 passed · ⚠️ 2 xfailed (known tracked bugs) · ❌ 0 failed

| Report | Description |
|--------|-------------|
Expand Down Expand Up @@ -346,7 +358,7 @@ You can also customize `.devcontainer/devcontainer.env.json` directly to enable
|-------|-------------|
| [🚀 Getting Started](docs/GETTING-STARTED.md) | Easy step-by-step guide — **start here** |
| [📖 CLI Commands Reference](docs/CLI-COMMANDS-REFERENCE.md) | **Complete reference** — every option, input file, and output location |
| [🖥️ CLI Test Report](docs/CLI-TEST-REPORT.md) | v0.2.0 CLI revamp test results — 52 tests, all passing |
| [🖥️ CLI Test Report](docs/CLI-TEST-REPORT.md) | v0.4.0 CLI test results — 62 tests, all passing |
| [🔄 Process-First Philosophy](docs/PROCESS-FIRST.md) | What Process-First means, how it maps to DevOps-OS, and AI learning tips |
| [📦 Dev Container Setup](docs/DEVOPS-OS-README.md) | Set up and customize the dev container |
| [⚡ Quick Start Reference](docs/DEVOPS-OS-QUICKSTART.md) | Essential CLI commands for all features |
Expand All @@ -355,6 +367,7 @@ You can also customize `.devcontainer/devcontainer.env.json` directly to enable
| [🔧 Jenkins Pipeline Generator](docs/JENKINS-PIPELINE-README.md) | Generate and customize Jenkins pipelines |
| [🔄 ArgoCD / Flux GitOps](docs/ARGOCD-README.md) | Generate ArgoCD Applications and Flux Kustomizations |
| [📊 SRE Configuration](docs/SRE-CONFIGURATION-README.md) | Prometheus rules, Grafana dashboards, SLO manifests |
| [🧪 Unit Test Scaffold](docs/CLI-COMMANDS-REFERENCE.md#devopsos-scaffold-unittest--unit-test-scaffold-generator) | Generate pytest, Jest, Vitest, Mocha, or Go test configs |
| [☸️ Kubernetes Deployments](docs/KUBERNETES-DEPLOYMENT-README.md) | Generate and manage Kubernetes deployment configs |
| [🤖 MCP Server](mcp_server/README.md) | Connect DevOps-OS tools to Claude or ChatGPT |
| [🧠 AI Skills](skills/README.md) | Use DevOps-OS with the Anthropic API or OpenAI function calling |
Expand Down
2 changes: 1 addition & 1 deletion cli/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Single source of truth for the devopsos package version."""

__version__ = "0.3.0"
__version__ = "0.4.0"
69 changes: 69 additions & 0 deletions cli/devopsos.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import cli.scaffold_argocd as scaffold_argocd
import cli.scaffold_sre as scaffold_sre
import cli.scaffold_devcontainer as scaffold_devcontainer
import cli.scaffold_unittest as scaffold_unittest
import cli.process_first as process_first
from cli import __version__

Expand Down Expand Up @@ -559,6 +560,74 @@ def scaffold_cicd_cmd(
flags += ["--custom-values", custom_values]
_run_scaffold(scaffold_cicd.main, flags)


# ── scaffold unittest ────────────────────────────────────────────────────────

@scaffold_app.command("unittest")
def scaffold_unittest_cmd(
ctx: typer.Context,
name: str = typer.Option("my-app", envvar="DEVOPS_OS_UNITTEST_NAME",
help="Project / application name"),
languages: str = typer.Option("python", envvar="DEVOPS_OS_UNITTEST_LANGUAGES",
help=(
"Comma-separated languages to generate tests for: "
"python, javascript, typescript, go"
)),
framework: str = typer.Option("", envvar="DEVOPS_OS_UNITTEST_FRAMEWORK",
help=(
"Testing framework override (auto-selected by default). "
"JS/TS: jest | mocha | vitest. Python: pytest. Go: go-test."
)),
coverage: bool = typer.Option(True, envvar="DEVOPS_OS_UNITTEST_COVERAGE",
help="Include coverage configuration (default: true)"),
output_dir: str = typer.Option("unittest", "--output-dir",
envvar="DEVOPS_OS_UNITTEST_OUTPUT_DIR",
help="Root output directory for generated files"),
):
"""Generate unit testing configuration and sample test files.

\b
Supported languages and their default frameworks:
python → pytest + pytest-cov
javascript → Jest (override with --framework mocha | vitest)
typescript → Jest (override with --framework mocha | vitest)
go → go test

\b
Output files (default: unittest/ directory):
unittest/pytest.ini Python pytest configuration
unittest/conftest.py Python shared fixtures
unittest/tests/__init__.py Python test-package marker
unittest/tests/test_sample.py Python sample unit tests
unittest/jest.config.js JavaScript/TypeScript Jest config
unittest/vitest.config.js JavaScript/TypeScript Vitest config
unittest/.mocharc.js JavaScript/TypeScript Mocha config
unittest/tests/sample.test.js JavaScript/TypeScript sample tests
unittest/<name>_test.go Go sample unit test file
unittest/Makefile.test Go Makefile test targets

\b
Examples:
devopsos scaffold unittest --name my-app --languages python
devopsos scaffold unittest --name my-app --languages javascript --framework jest
devopsos scaffold unittest --name my-app --languages typescript --framework vitest
devopsos scaffold unittest --name my-api --languages go
devopsos scaffold unittest --name my-app --languages python,javascript,go
"""
_show_help_if_no_opts(ctx)
flags = [
"--name", name,
"--languages", languages,
"--output-dir", output_dir,
]
if framework:
flags += ["--framework", framework]
if not coverage:
# coverage defaults to True; only pass flag when False
flags.append("--no-coverage")
_run_scaffold(scaffold_unittest.main, flags)


@app.command()
def init(
directory: str = typer.Option(".", "--dir", help="Target directory in which the .devcontainer folder will be created (defaults to the current directory)"),
Expand Down
Loading
Loading