Skip to content

feat: bundled Go service example and real Go toolchain vertical slice - #14

Merged
howlcipher merged 1 commit into
mainfrom
feat/go-service-vertical-slice
Aug 19, 2026
Merged

howlcipher merged 1 commit into
mainfrom
feat/go-service-vertical-slice

Conversation

@howlcipher

Copy link
Copy Markdown
Owner

Summary

Implements the roadmap item BUNDLED GO EXAMPLE PROJECT + REAL GO TOOLCHAIN VERTICAL SLICE for DevOps-Learn-by-Doing.

Key Deliverables

  1. Bundled Go Example Service (projects/go_service/):
    • Runnable Go HTTP service with /health and /info endpoints using Go standard library (net/http, log/slog).
    • Non-root, multi-stage Dockerfile (golang:1.22-alpine builder + alpine:3.20 runtime).
    • Package-level unit tests (health_test.go, info_test.go) asserting status codes, payload shapes, environment overrides, and secret-safety guarantees.
  2. Go Tool Implementation (src/devops_learn/tools/go_tool.py):
    • Concrete RealGoTool and SimulatedGoTool extending Tool with allow-listed operations: run_tests, run_vet, run_build, run_fmt_check, verify_modules, version.
    • Execution protected via _subprocess_safety.run_safely (argument arrays, timeouts, output sanitization, non-zero return code detection, shell=False).
  3. Language-Agnostic Project Analysis (src/devops_learn/analysis/project_analyzer.py):
    • Generalized _detect_language to detect LanguageKind.GO via go.mod and *.go sources without folder/path special-casing.
    • Generalized secret indicator and environment variable regexes for Go patterns (os.Getenv, os.LookupEnv).
    • Generalized observability detection for Go logging libraries (slog, log, zap, logrus).
  4. Stack-Aware Local Workflow Execution (src/devops_learn/workflows/local_flow.py):
    • Fail-closed execution sequence for Go services: gofmt format check -> go vet static analysis -> go test unit tests -> go build binary build -> docker build multi-stage container -> docker run -> endpoint health check -> docker logs -> docker stop.
    • Contextual learning moments teaching Go-specific concepts (static binary vs interpreted runtime, multi-stage Docker builds, static analysis vs unit testing).
  5. Planning & Deploy Integration (planning/service.py, workflows/deploy_flow.py, bootstrap.py, cli/main.py):
    • PlanningService and DeployFlow validation steps dynamically generate and validate language-specific tool steps based on assessment.language.
  6. Comprehensive Verification & Falsification Suites:
    • Added tests/tools/test_go_tool.py, tests/troubleshooting/test_go_falsification.py, and tests/workflows/test_local_flow.py.
    • Explicitly tested that Go test failures, go vet failures, compilation errors, malformed modules, and healthcheck failures fail closed.
    • Updated GitHub CI workflow with Go 1.22 toolchain setup, formatting, vet, test, build, and container build steps.

Evidence of Verification

  • ai verify: PASSED (flake8 exit 0, pytest exit 0: 199 passed, 1 skipped)
  • flake8: Clean (exit 0)
  • mypy + demo app mypy app --strict: Clean (exit 0, 147 + 4 source files)
  • Live Go toolchain (gofmt, go mod verify, go vet, go test, go build): All passed on projects/go_service/

- Add runnable Go HTTP service in projects/go_service/ with /health and /info endpoints, structured JSON logging, tests, and multi-stage Dockerfile
- Implement RealGoTool and SimulatedGoTool with safe subprocess execution (fmt, vet, test, build, mod verify)
- Generalize ProjectAnalyzer to detect Go projects and frameworks without path special-casing
- Extend local_flow, deploy_flow, and planning_service for multi-stack Go workflow execution and learning moments
- Add comprehensive unit, integration, and falsification test suites
- Update CI workflow with Go toolchain and container build checks
@howlcipher
howlcipher merged commit 378a317 into main Aug 19, 2026
3 checks passed
@howlcipher
howlcipher deleted the feat/go-service-vertical-slice branch August 19, 2026 18:15
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.

1 participant