{"id":36474160,"url":"https://github.com/lex00/wetwire-gitlab-go","last_synced_at":"2026-01-21T06:46:53.332Z","repository":{"id":331541709,"uuid":"1128071296","full_name":"lex00/wetwire-gitlab-go","owner":"lex00","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-12T02:39:14.000Z","size":2364,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-12T02:44:45.767Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lex00.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-05T05:12:00.000Z","updated_at":"2026-01-12T02:39:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lex00/wetwire-gitlab-go","commit_stats":null,"previous_names":["lex00/wetwire-gitlab-go"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lex00/wetwire-gitlab-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lex00%2Fwetwire-gitlab-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lex00%2Fwetwire-gitlab-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lex00%2Fwetwire-gitlab-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lex00%2Fwetwire-gitlab-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lex00","download_url":"https://codeload.github.com/lex00/wetwire-gitlab-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lex00%2Fwetwire-gitlab-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-12T00:45:19.104Z","updated_at":"2026-01-16T18:29:13.144Z","avatar_url":"https://github.com/lex00.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wetwire-gitlab (Go)\n\n[![CI](https://github.com/lex00/wetwire-gitlab-go/actions/workflows/ci.yml/badge.svg)](https://github.com/lex00/wetwire-gitlab-go/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/lex00/wetwire-gitlab-go/branch/main/graph/badge.svg)](https://codecov.io/gh/lex00/wetwire-gitlab-go)\n[![Go Reference](https://pkg.go.dev/badge/github.com/lex00/wetwire-gitlab-go.svg)](https://pkg.go.dev/github.com/lex00/wetwire-gitlab-go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/lex00/wetwire-gitlab-go)](https://goreportcard.com/report/github.com/lex00/wetwire-gitlab-go)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nGenerate GitLab CI/CD configuration from Go pipeline declarations using a declarative, type-safe syntax.\n\n## Status\n\n**v0.0.0 - In Development**\n\nSee [Implementation Roadmap](https://github.com/lex00/wetwire-gitlab-go/issues/2) for progress.\n\nFor the wetwire pattern, see the [Wetwire Specification](https://github.com/lex00/wetwire/blob/main/docs/WETWIRE_SPEC.md).\n\n## The No-Parens Principle\n\nWetwire uses **flat struct declarations** with **direct variable references** — no wrapper functions, no registration calls, no constructors:\n\n```go\n// References are variable names, not function calls\nNeeds: []any{BuildJob}           // NOT: Needs(BuildJob)\n\n// Nested configs are separate variables\nArtifacts: BuildArtifacts        // NOT: Artifacts(\u0026Artifacts{...})\n\n// Predefined variables via field access\nIf: CI.DefaultBranch             // NOT: If(\"$CI_DEFAULT_BRANCH\")\n```\n\n## Quick Start\n\n```go\npackage ci\n\nimport (\n    . \"github.com/lex00/wetwire-gitlab-go/intrinsics\"  // Dot-import for helpers\n    \"github.com/lex00/wetwire-gitlab-go/pipeline\"       // Core types\n    \"github.com/lex00/wetwire-gitlab-go/components/sast\"\n)\n\n// Stages as flat declaration\nvar Stages = List(\"build\", \"test\", \"deploy\")\n\n// Nested config extracted to separate variable\nvar BuildArtifacts = pipeline.Artifacts{\n    Paths:    List(\"bin/\"),\n    ExpireIn: \"1 week\",\n}\n\n// Image config extracted\nvar GolangImage = pipeline.Image{\n    Name: \"golang:1.23\",\n}\n\n// Job with direct references — no function calls\nvar BuildJob = pipeline.Job{\n    Name:      \"build\",\n    Stage:     \"build\",\n    Image:     GolangImage,\n    Script:    List(\"go build -v ./...\"),\n    Artifacts: BuildArtifacts,\n}\n\n// Use pre-defined rules from intrinsics (dot-imported)\nvar TestJob = pipeline.Job{\n    Name:   \"test\",\n    Stage:  \"test\",\n    Image:  GolangImage,\n    Script: List(\"go test -v ./...\"),\n    Needs:  []any{BuildJob},\n    Rules:  List(OnDefaultBranch),\n}\n\n// Typed component wrapper\nvar SecurityScan = sast.SAST{\n    Stage: \"test\",\n}\n\n// Deploy with environment\nvar DeployEnv = pipeline.Environment{\n    Name: \"production\",\n    URL:  \"https://example.com\",\n}\n\n// Rule extracted to separate variable\nvar OnTagRule = pipeline.Rule{\n    If:   CI.CommitTag,\n    When: Always,\n}\n\nvar DeployJob = pipeline.Job{\n    Name:        \"deploy\",\n    Stage:       \"deploy\",\n    Script:      List(\"./deploy.sh\"),\n    Environment: DeployEnv,\n    Needs:       []any{TestJob, SecurityScan},\n    Rules:       List(OnTagRule),\n}\n```\n\nGenerate configuration:\n\n```bash\nwetwire-gitlab build ./ci \u003e .gitlab-ci.yml\n```\n\nOutput:\n\n```yaml\nstages:\n  - build\n  - test\n  - deploy\n\nbuild:\n  stage: build\n  image: golang:1.23\n  script:\n    - go build -v ./...\n  artifacts:\n    paths:\n      - bin/\n    expire_in: 1 week\n\ntest:\n  stage: test\n  image: golang:1.23\n  script:\n    - go test -v ./...\n  needs:\n    - build\n  rules:\n    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n      when: always\n\ndeploy:\n  stage: deploy\n  script:\n    - ./deploy.sh\n  environment:\n    name: production\n    url: https://example.com\n  needs:\n    - test\n    - sast\n  rules:\n    - if: $CI_COMMIT_TAG\n      when: always\n```\n\n## Installation\n\n```bash\ngo install github.com/lex00/wetwire-gitlab-go/cmd/wetwire-gitlab@latest\n```\n\n## AI-Assisted Design (Kiro CLI)\n\nUse Kiro CLI for AI-assisted pipeline design:\n\n```bash\n# Install Kiro CLI\ncurl -fsSL https://cli.kiro.dev/install | bash\n\n# Start AI-assisted design session\nwetwire-gitlab design --provider kiro \"Create a CI/CD pipeline for a Go microservice\"\n```\n\nThe `design` command automatically configures the Kiro agent and launches an interactive session where Claude can use MCP tools (`wetwire_init`, `wetwire_lint`, `wetwire_build`) to help design your pipeline.\n\nSee [GITLAB-KIRO-CLI.md](docs/GITLAB-KIRO-CLI.md) for complete setup and usage guide.\n\n## CLI Commands\n\n| Command | Status | Description |\n|---------|--------|-------------|\n| `build` | ✅ Done | Generate `.gitlab-ci.yml` from Go definitions |\n| `validate` | ✅ Done | Validate via `glab ci lint` |\n| `list` | ✅ Done | List discovered pipelines/jobs |\n| `lint` | ✅ Done | Check Go code for quality issues (27 rules) |\n| `import` | ✅ Done | Import existing `.gitlab-ci.yml` to Go |\n| `graph` | ✅ Done | Generate DAG visualization (DOT/Mermaid) |\n| `design` | ✅ Done | AI-assisted pipeline design |\n| `test` | ✅ Done | Persona-based testing |\n| `init` | ✅ Done | Initialize new project |\n| `version` | ✅ Done | Print version information |\n\n## Core Concepts\n\n### Flat Declarations\n\nEvery job/config is a top-level `var` with a struct literal:\n\n```go\nvar MyJob = pipeline.Job{\n    Name:   \"my-job\",\n    Script: List(\"echo hello\"),\n}\n```\n\n### Direct References\n\nJob dependencies use variable names directly:\n\n```go\nvar TestJob = pipeline.Job{\n    Needs: []any{BuildJob, LintJob},  // Variable references\n}\n```\n\n### Extracted Nested Config\n\nComplex nested structures become separate variables:\n\n```go\n// Instead of inline nesting\nvar CacheConfig = pipeline.Cache{\n    Key:   \"deps-${CI_COMMIT_REF_SLUG}\",\n    Paths: List(\"vendor/\", \".cache/\"),\n}\n\nvar MyJob = pipeline.Job{\n    Cache: CacheConfig,  // Reference extracted config\n}\n```\n\n### Predefined Variables\n\nType-safe access via `intrinsics` package (dot-imported):\n\n```go\nvar DeployRule = pipeline.Rule{\n    If: CI.CommitTag,  // $CI_COMMIT_TAG\n}\n\nvar NotifyRule = pipeline.Rule{\n    If: CI.PipelineSource.Eq(\"merge_request_event\"),\n}\n\n// Pre-defined rules for common patterns\nvar TestJob = pipeline.Job{\n    Rules: List(OnDefaultBranch),  // if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n}\n```\n\n## Package Structure\n\n```\nwetwire-gitlab-go/\n├── cmd/wetwire-gitlab/       # CLI application\n├── internal/\n│   ├── agent/                # Tool definitions for orchestrator integration\n│   ├── discover/             # AST-based pipeline discovery\n│   ├── importer/             # YAML to Go code conversion\n│   ├── linter/               # Go code lint rules (WGL001-WGL012)\n│   ├── reference/            # Round-trip testing utilities\n│   ├── runner/               # Runtime value extraction\n│   ├── serialize/            # YAML serialization\n│   ├── template/             # Pipeline builder with topological sort\n│   └── validation/           # glab ci lint integration\n├── pipeline/                 # Core pipeline types (Job, Rule, Artifacts...)\n├── intrinsics/               # Helpers for dot-import (CI.*, OnDefaultBranch...)\n├── components/               # Generated component wrappers (SAST, DAST, etc.)\n├── templates/                # Auto DevOps template wrappers\n├── runner/                   # GitLab Runner config.toml types\n├── codegen/                  # Schema fetching, parsing, code generation\n├── testdata/                 # Sample pipelines for testing\n├── contracts.go              # Core interfaces\n└── scripts/\n    ├── ci.sh                 # Local CI script\n    └── import_samples.sh     # Fetch gitlab-org samples\n```\n\n### Package Design\n\nThe importer/init commands generate packages with strategic imports for clean syntax:\n\n```go\nimport (\n    . \"github.com/lex00/wetwire-gitlab-go/intrinsics\"  // Dot-import: CI.*, OnDefaultBranch, etc.\n    \"github.com/lex00/wetwire-gitlab-go/pipeline\"       // Prefixed: pipeline.Job, pipeline.Rule\n)\n```\n\n**intrinsics/** (dot-imported for clean syntax):\n- `Json` — type alias for `map[string]any`\n- `List[T]()` — create any typed slice (use for all slices except `[]any`)\n- `CI`, `GitLab`, `MR` — predefined variable namespaces\n- `OnDefaultBranch`, `OnTag`, `ManualOnly` — pre-defined rules\n- `Always`, `Never`, `OnSuccess`, `OnFailure`, `Manual` — when values\n\n**pipeline/** (explicit namespace):\n- `pipeline.Job`, `pipeline.Rule`, `pipeline.Artifacts` — core types\n- Explicit prefix prevents collisions with user-defined variables\n\n## Development\n\n```bash\n# Run tests\ngo test -v ./...\n\n# Run CI checks\n./scripts/ci.sh\n\n# Build CLI\ngo build -o wetwire-gitlab ./cmd/wetwire-gitlab\n```\n\n## Documentation\n\n- [Quick Start Guide](docs/QUICK_START.md) - Get started in 5 minutes\n- [CLI Reference](docs/CLI.md) - Complete command documentation\n- [Pre-Commit Hook Integration](docs/PRE_COMMIT.md) - Automate validation with Git hooks\n- [Templates Guide](docs/TEMPLATES.md) - Auto DevOps and job template wrappers\n- [Components Guide](docs/COMPONENTS.md) - Security component wrappers (SAST, DAST, etc.)\n- [Lint Rules Reference](docs/LINT_RULES.md) - Detailed lint rule documentation\n- [Developer Guide](docs/DEVELOPERS.md) - Contributing and architecture\n- [Adoption Guide](docs/ADOPTION.md) - Migration strategies for teams\n- [Import Workflow](docs/IMPORT_WORKFLOW.md) - Converting existing pipelines\n- [Internals](docs/INTERNALS.md) - Internal architecture details\n- [Code Generation](docs/CODEGEN.md) - Component code generation pipeline\n- [Examples Reference](docs/EXAMPLES.md) - Example catalog with patterns\n- [Versioning](docs/VERSIONING.md) - Version management\n- [FAQ](docs/FAQ.md) - Frequently asked questions\n- [Contributing](CONTRIBUTING.md) - How to contribute\n\n## Related Packages\n\n- [wetwire-aws-go](https://github.com/lex00/wetwire-aws-go) - AWS CloudFormation synthesis\n- [wetwire-github-go](https://github.com/lex00/wetwire-github-go) - GitHub Actions synthesis\n- [wetwire-core-go](https://github.com/lex00/wetwire-core-go) - Agent infrastructure\n\n## License\n\nMIT - See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flex00%2Fwetwire-gitlab-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flex00%2Fwetwire-gitlab-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flex00%2Fwetwire-gitlab-go/lists"}