Skip to content
Santekno.com | Level Up Your Engineering Skills
ID
📖 0%
02 Nov 2026 · 23 mnt baca ·Artikel 79 / 208
Go

Complete Golang AI DevOps Pipeline: SDD ke LLMOps Production

Pipeline lengkap Santekno Shop dari spec hingga deploy dan LLMOps. End-to-end integrasi Topik 1-4: SDD, Spec Kit, AI Coding Tools, dan AI-assisted CI/CD dalam satu pipeline.

IH
Ihsan Arif
Penulis di Santekno · Backend Engineer

Setelah 19 artikel di Topik 4, saatnya melihat big picture: bagaimana semua komponen bekerja bersama dalam satu pipeline Golang AI DevOps yang kohesif. Artikel ini adalah integration guide yang menghubungkan Topik 1 (SDD), Topik 2 (Spec Kit), Topik 3 (AI Coding Tools), dan Topik 4 (AI DevOps) menjadi satu workflow yang seamless — dari spesifikasi sampai LLMOps di production.


19.01 Big Picture: Dari Ide ke Production

Sebelum masuk ke detail konfigurasi, penting untuk memegang peta besar terlebih dahulu. Diagram fase berikut memperlihatkan bagaimana sebuah ide mengalir dari spesifikasi hingga menjadi AI feature yang berjalan di production.

text
 1FASE 1: SPECIFICATION (Topik 1 — SDD)
 2  Product → User Story → Spec file (specify create)
 3  Output: .specify/features/{feature}/spec.md
 4
 5  ↓ Developer membaca spec
 6
 7FASE 2: DEVELOPMENT (Topik 3 — AI Coding Tools)
 8  Developer + Claude Code + CLAUDE.md → Implementation
 9  Pre-commit: architecture check, secret scan
10  Output: Go code yang sesuai spec
11
12  ↓ git push → PR dibuka
13
14FASE 3: CI/CD PIPELINE (Topik 4 — ini)
15  L1: Build + Test + Lint (syntactic gate)
16  L2: Architecture check (semantic-static gate)
17  L3: AI Code Review (semantic-AI gate)
18  L4: Spec Compliance Audit (spec gate)
19  Auto PR Description (documentation)
20  Final Quality Gate (aggregate verdict)
21
22  ↓ PR merged → deploy triggered
23
24FASE 4: DEPLOYMENT
25  Staging: auto-deploy + smoke test + AI health check
26  Production: canary + monitoring + auto-rollback
27
28  ↓ Running in production
29
30FASE 5: LLMOps (Topik 4 Part 4)
31  Prompt version control → evaluation → canary
32  Feature flags → gradual rollout → A/B test
33  Cost monitoring → budget enforcement → alerts
34  Incident playbook → detection → rollback → post-mortem

Yang perlu ditangkap dari peta ini: tiap fase memvalidasi output fase sebelumnya, sehingga tidak ada kode yang lolos ke production tanpa melewati gate spec, kualitas, dan deployment.


19.02 Repository Structure untuk Full Pipeline

Peta fase di atas perlu tempat tinggal yang konkret di dalam repo. Struktur direktori berikut menata spec, workflow, kode domain, dan konfigurasi AI agar tiap artikel Topik 4 punya rumahnya sendiri.

text
 1santekno-shop/
 2├── .specify/                  ← Topik 2: Spec Kit
 3│   ├── config.yml
 4│   └── features/
 5│       ├── cancel-order/
 6│       │   └── spec.md
 7│       └── create-order/
 8│           └── spec.md
 9│
10├── .github/
11│   ├── workflows/
12│   │   ├── ci.yml             ← Main quality pipeline (Artikel 01-09)
13│   │   ├── pr-description.yml ← Auto PR description (Artikel 10)
14│   │   ├── release.yml        ← Changelog + release (Artikel 11)
15│   │   ├── migration-check.yml ← Migration validation (Artikel 12)
16│   │   ├── staging-deploy.yml  ← Staging deployment (Artikel 13)
17│   │   ├── production-deploy.yml ← Production canary (Artikel 13)
18│   │   ├── post-deploy-monitor.yml ← Auto rollback (Artikel 14)
19│   │   ├── prompt-eval.yml    ← Prompt evaluation (Artikel 15)
20│   │   ├── cost-report.yml    ← Daily cost report (Artikel 17)
21│   │   └── ai-health.yml      ← AI incident detection (Artikel 18)
22│   ├── copilot-instructions.md
23│   ├── CODEOWNERS
24│   └── pull_request_template.md
25│
26├── internal/
27│   ├── ai/
28│   │   ├── prompt/            ← Prompt registry (Artikel 15)
29│   │   │   ├── registry.go
30│   │   │   └── loader.go
31│   │   ├── cost/              ← Cost tracking (Artikel 17)
32│   │   │   ├── tracker.go
33│   │   │   └── budget.go
34│   │   └── monitor/           ← Quality monitoring (Artikel 18)
35│   │       └── detector.go
36│   ├── feature/               ← Feature flags (Artikel 16)
37│   │   ├── flags.go
38│   │   └── rollout.go
39│   ├── domain/                ← Core domain
40│   ├── usecase/               ← Business logic
41│   └── repository/            ← Data access
42│
43├── scripts/
44│   ├── claude-call.sh         ← Claude API wrapper (Artikel 03)
45│   ├── claude-review.sh       ← Code review (Artikel 05)
46│   ├── check-architecture.go  ← Architecture check (Artikel 08)
47│   ├── ai-security-review.sh  ← Security review (Artikel 06)
48│   ├── smoke-test.sh          ← Deployment verification (Artikel 13)
49│   └── generate-pr-description.js ← PR description (Artikel 10)
50│
51├── cmd/
52│   ├── server/                ← Main application
53│   ├── migrate/               ← Database migration runner
54│   ├── release-notes/         ← Release notes generator (Artikel 11)
55│   ├── eval-prompt/           ← Prompt evaluator (Artikel 15)
56│   ├── quality-gate/          ← Aggregate quality gate (Artikel 09)
57│   └── rollback-controller/   ← Deployment monitor (Artikel 14)
58│
59├── CLAUDE.md                  ← Universal AI context (Topik 3)
60├── .golangci.yml              ← Linting config
61├── .gitleaks.toml             ← Secret scan config
62├── .gosec.yml                 ← Security scan config
63└── config/
64    └── ai-budgets.yaml        ← LLM cost budgets (Artikel 17)

Perhatikan bahwa setiap komponen dianotasi dengan nomor artikel asalnya — struktur ini bukan teori, tapi akumulasi konkret dari 18 artikel sebelumnya yang kini hidup dalam satu repo.


19.03 Main CI Workflow: Semua Gates Terintegrasi

Inilah jantung pipeline: satu file ci.yml yang menjalankan keempat layer quality gate secara berurutan dan paralel. Workflow berikut menggabungkan build, security scan, AI review, dan spec compliance dalam satu alur GitHub Actions.

yaml
  1# .github/workflows/ci.yml
  2# The complete quality pipeline
  3
  4name: CI — AI-Assisted Quality Pipeline
  5on:
  6  push:
  7    branches: [main, develop]
  8  pull_request:
  9    branches: [main, develop]
 10    types: [opened, synchronize, ready_for_review]
 11
 12env:
 13  GO_VERSION: '1.22'
 14
 15jobs:
 16  # ============================================================
 17  # LAYER 1: SYNTACTIC
 18  # ============================================================
 19  go-quality:
 20    name: "L1: Build, Test & Lint"
 21    runs-on: ubuntu-latest
 22    timeout-minutes: 10
 23    outputs:
 24      coverage_usecase: ${{ steps.coverage.outputs.usecase }}
 25    steps:
 26      - uses: actions/checkout@v4
 27      - uses: actions/setup-go@v5
 28        with: { go-version: '${{ env.GO_VERSION }}', cache: true }
 29      - run: go build ./...
 30      - run: go test -race -count=1 -coverprofile=cov.out ./...
 31      - id: coverage
 32        run: |
 33          UC=$(go tool cover -func=cov.out | grep "internal/usecase" | \
 34            awk '{sum+=$3; n++} END {printf "%.0f", sum/n}')
 35          echo "usecase=$UC" >> $GITHUB_OUTPUT
 36          awk "BEGIN {exit ($UC >= 85) ? 0 : 1}" || \
 37            { echo "::error::Usecase coverage $UC% < 85%"; exit 1; }
 38      - uses: golangci/golangci-lint-action@v6
 39      - name: Security scan
 40        run: |
 41          go install github.com/securego/gosec/v2/cmd/gosec@latest
 42          gosec -conf .gosec.yml -fmt json -out /tmp/gosec.json ./...
 43          HIGHS=$(jq '[.Issues[] | select(.severity == "HIGH")] | length' /tmp/gosec.json)
 44          [ "$HIGHS" -gt 0 ] && { echo "::error::$HIGHS gosec HIGH issues"; exit 1; }
 45
 46  # ============================================================
 47  # LAYER 2: SEMANTIC-STATIC
 48  # ============================================================
 49  architecture:
 50    name: "L2: Architecture Boundaries"
 51    runs-on: ubuntu-latest
 52    needs: go-quality
 53    timeout-minutes: 5
 54    steps:
 55      - uses: actions/checkout@v4
 56      - uses: actions/setup-go@v5
 57        with: { go-version: '${{ env.GO_VERSION }}' }
 58      - run: go run ./scripts/check-architecture.go ./...
 59
 60  # ============================================================
 61  # SECURITY (parallel dengan L2, jalan sebelum L3)
 62  # ============================================================
 63  secret-scan:
 64    name: "Security: Secret Detection"
 65    runs-on: ubuntu-latest
 66    steps:
 67      - uses: actions/checkout@v4
 68        with: { fetch-depth: 0 }
 69      - uses: gitleaks/gitleaks-action@v2
 70        env:
 71          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 72          GITLEAKS_CONFIG: .gitleaks.toml
 73
 74  dependency-scan:
 75    name: "Security: Dependency Vulns"
 76    runs-on: ubuntu-latest
 77    needs: go-quality
 78    steps:
 79      - uses: actions/checkout@v4
 80      - uses: actions/setup-go@v5
 81        with: { go-version: '${{ env.GO_VERSION }}' }
 82      - run: |
 83          go install golang.org/x/vuln/cmd/govulncheck@latest
 84          govulncheck -json ./... > /tmp/vuln.json
 85          CRITICAL=$(jq '[.findings[] | select(.trace != null) |
 86            select(.osv.database_specific.severity == "CRITICAL")] | length' /tmp/vuln.json)
 87          [ "$CRITICAL" -gt 0 ] && { echo "::error::CRITICAL CVEs found"; exit 1; }
 88
 89  # ============================================================
 90  # LAYER 3: SEMANTIC-AI (PR only, parallel)
 91  # ============================================================
 92  ai-review:
 93    name: "L3: AI Code Review"
 94    runs-on: ubuntu-latest
 95    needs: [go-quality, architecture]
 96    if: github.event_name == 'pull_request' && !github.event.pull_request.draft
 97    permissions:
 98      pull-requests: write
 99      contents: read
100    steps:
101      - uses: actions/checkout@v4
102        with: { fetch-depth: 0 }
103      - uses: github/copilot-for-pull-requests@v1
104        with:
105          github-token: ${{ secrets.GITHUB_TOKEN }}
106          review-instructions: |
107            Review per .github/copilot-instructions.md.
108            CRITICAL: error not wrapped, float64 for money, arch violations.
109            REVIEW_SCORE: X/100
110
111  # ============================================================
112  # LAYER 4: SPEC COMPLIANCE (parallel dengan L3)
113  # ============================================================
114  spec-compliance:
115    name: "L4: Spec Compliance"
116    runs-on: ubuntu-latest
117    needs: [go-quality, architecture]
118    if: github.event_name == 'pull_request' && !github.event.pull_request.draft
119    permissions:
120      pull-requests: write
121    env:
122      ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
123    steps:
124      - uses: actions/checkout@v4
125        with: { fetch-depth: 0 }
126      - uses: actions/setup-node@v4
127        with: { node-version: '20' }
128      - run: npm install -g @santekno/spec-kit
129      - run: specify audit --output json --fail-on-score-below 80
130
131  # ============================================================
132  # AUTOMATION: PR Description + Migration Check
133  # ============================================================
134  pr-description:
135    name: "Auto: PR Description"
136    runs-on: ubuntu-latest
137    needs: go-quality
138    if: github.event_name == 'pull_request' && github.event.action == 'opened'
139    permissions:
140      pull-requests: write
141      contents: read
142    env:
143      ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
144      BASE_BRANCH: ${{ github.base_ref }}
145    steps:
146      - uses: actions/checkout@v4
147        with: { fetch-depth: 0 }
148      - uses: actions/setup-node@v4
149        with: { node-version: '20' }
150      - run: |
151          node scripts/generate-pr-description.js > /tmp/desc.txt || exit 0
152          [ -s /tmp/desc.txt ] && cat /tmp/desc.txt
153
154  migration-check:
155    name: "Auto: Migration Validation"
156    runs-on: ubuntu-latest
157    needs: go-quality
158    if: |
159      github.event_name == 'pull_request' &&
160      contains(github.event.pull_request.changed_files, 'migrations/')
161    permissions:
162      pull-requests: write
163    env:
164      ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
165    steps:
166      - uses: actions/checkout@v4
167      - run: |
168          for f in $(git diff origin/$BASE...HEAD --name-only -- 'migrations/*.up.sql'); do
169            bash scripts/check-migration-safety.sh "$f"
170            bash scripts/ai-migration-review.sh "$f"
171          done
172
173  # ============================================================
174  # FINAL: Aggregate Quality Gate
175  # ============================================================
176  quality-gate:
177    name: "Final Quality Gate"
178    runs-on: ubuntu-latest
179    needs:
180      - go-quality
181      - architecture
182      - secret-scan
183      - dependency-scan
184      - ai-review
185      - spec-compliance
186    if: always()
187    steps:
188      - uses: actions/checkout@v4
189      - uses: actions/setup-go@v5
190        with: { go-version: '${{ env.GO_VERSION }}' }
191      - run: go build -o /tmp/quality-gate ./cmd/quality-gate/
192      - name: Run aggregate gate
193        env:
194          COVERAGE_SCORE: ${{ needs.go-quality.outputs.coverage_usecase }}
195          ARCH_PASS: ${{ needs.architecture.result == 'success' && '90' || '0' }}
196          SEC_PASS: ${{ needs.secret-scan.result == 'success' && '90' || '0' }}
197        run: /tmp/quality-gate

Kunci desain workflow ini adalah needs dan if: layer syntactic jalan lebih dulu sebagai gerbang, sementara security scan berjalan paralel, dan gate AI hanya aktif pada PR non-draft — sehingga cepat, hemat, dan tetap menyeluruh.


19.04 End-to-End Flow: Cancel Order Feature

Konfigurasi di atas terasa abstrak sampai kita menjalankannya pada satu fitur nyata. Kronologi berikut menelusuri fitur cancel order dari spesifikasi hari pertama hingga rollout LLMOps beberapa hari kemudian.

text
 1Contoh konkret: implementasi fitur cancel order
 2
 3DAY 1: SPECIFICATION
 4  PM → Developer: "Customer perlu bisa cancel order PENDING dalam 30 menit"
 5  Developer: specify create --feature cancel-order
 6  Output: .specify/features/cancel-order/spec.md
 7  Spec review: Tech Lead + PM approve spec
 8
 9DAY 2: DEVELOPMENT
10  Developer: buka Claude Code dengan CLAUDE.md
11  Claude Code: generate implementation berdasarkan spec
12  Developer: review, adjust, commit
13  Pre-commit: architecture check → pass, secret scan → pass
14
15DAY 2-3: PR REVIEW
16  git push → PR dibuka
17  Pipeline L1: build ✅, test ✅ (5 new tests per AC), lint ✅
18  Pipeline L2: architecture ✅ (no layer violations)
19  Pipeline L3: Copilot review → REVIEW_SCORE: 91/100
20  Pipeline L4: specify audit → AC1✅, AC2✅, AC3✅, AC4✅ → 95/100
21  Auto PR description: generated
22  Final gate: PASS (weighted 92/100)
23  Human review: 20 menit (fokus ke business logic)
24  Merge ✅
25
26DAY 3: DEPLOYMENT
27  Merge ke develop → auto staging deploy
28  Staging smoke test: ✅
29  AI health check: HEALTHY
30  Manual trigger production deploy
31  Canary 10% → 5 menit monitoring → HEALTHY → 100%
32
33DAY 4+: LLMOPS
34  AI order review feature flag: enable untuk 5% users
35  Cost monitoring: $0.003/review, $3/bulan at scale
36  Quality sampling: 95% accuracy
37  Gradual rollout: 5% → 25% → 100% atas 2 minggu

Yang membuat alur ini bekerja adalah review manusia menyusut jadi 20 menit — bukan karena kualitas dikorbankan, tapi karena gate otomatis sudah menangani semua cek mekanis sebelum mata manusia melihat kode.


19.05 Metrics Scorecard: Full Pipeline Health

Pipeline yang tidak diukur tidak bisa diperbaiki. Struct Go berikut mendefinisikan scorecard bulanan yang mengagregasi metrik kualitas, biaya, dan reliabilitas AI ke dalam satu laporan.

go
 1// cmd/pipeline-scorecard/main.go
 2// Monthly pipeline health scorecard
 3
 4type PipelineScorecard struct {
 5    Month string
 6
 7    // Quality metrics
 8    PRMechanicalComments float64  // per PR, target: < 2
 9    PRCycleTimeHours     float64  // target: < 4
10    PostDeployBugs       int      // per sprint, target: < 2
11
12    // Pipeline metrics
13    CISuccessRate        float64  // target: > 95%
14    AvgPipelineMinutes   float64  // target: < 10
15    FalsePositiveRate    float64  // target: < 5%
16
17    // Cost metrics
18    MonthlyCostUSD       float64  // target: < $20
19    CostPerPR            float64  // target: < $0.01
20
21    // LLMOps metrics
22    AIFeatureUptime      float64  // target: > 99.5%
23    AIIncidentsP1P2      int      // target: < 1/month
24    PromptQualityScore   float64  // target: > 80%
25}
26
27func GenerateScorecard() *PipelineScorecard {
28    // Aggregate from Prometheus, GitHub API, cost records
29    return &PipelineScorecard{
30        Month:                time.Now().Format("2006-01"),
31        PRMechanicalComments: 1.8,   // ✅ target < 2
32        PRCycleTimeHours:     3.2,   // ✅ target < 4
33        PostDeployBugs:       1,     // ✅ target < 2
34        CISuccessRate:        96.2,  // ✅ target > 95%
35        AvgPipelineMinutes:   7.4,   // ✅ target < 10
36        MonthlyCostUSD:       8.40,  // ✅ target < $20
37        AIFeatureUptime:      99.7,  // ✅ target > 99.5%
38        AIIncidentsP1P2:      0,     // ✅ target < 1
39        PromptQualityScore:   87.3,  // ✅ target > 80%
40    }
41}

Dengan setiap field membawa target di komentarnya, scorecard ini langsung memberi tahu di mana pipeline sehat dan di mana ia butuh perhatian — data mentah berubah jadi keputusan.


19.06 Cross-Topik Dependencies

Pipeline ini bukan pulau terisolasi; ia menganyam output dari empat topik. Peta dependency berikut menunjukkan bagaimana artefak Topik 1 sampai 4 saling mengonsumsi satu sama lain.

text
 1Dependency map antar Topik:
 2
 3Topik 1 (SDD):
 4  → Topik 2: specify CLI membaca SDD output
 5  → Topik 3: CLAUDE.md derived dari SDD conventions
 6  → Topik 4: Spec compliance audit uses SDD spec files
 7
 8Topik 2 (Spec Kit):
 9  → Topik 4 Artikel 04: specify audit di CI
10  → Topik 4 Artikel 15: prompt evaluation using spec ACs
11
12Topik 3 (AI Coding Tools):
13  → Topik 4 Artikel 03: CLAUDE.md in CI context
14  → Topik 4 Artikel 05: copilot-instructions.md for PR review
15  → Topik 4 Artikel 08: architecture.go script from Topik 3
16
17Topik 4 (AI DevOps):
18  → Topik 5: AI features built here + LLMOps managed here

Peta ini menegaskan bahwa spec adalah sumber kebenaran hulu: satu file spec.md mengalir ke CLI, ke context AI, dan ke audit compliance — semua topik berbagi fondasi yang sama.


19.07 Minimum Viable Pipeline

Tidak setiap tim sanggup mengadopsi full pipeline sekaligus, dan itu wajar. Skema tier berikut memecah pipeline menjadi lapisan bernilai yang bisa diadopsi bertahap sesuai budget dan kematangan tim.

text
 1Tidak semua tim perlu full pipeline dari hari pertama.
 2Minimum Viable Pipeline yang masih valuable:
 3
 4Tier 1 (Day 1, 2 jam):
 5  ✅ go build + go test (di-run otomatis via GitHub Actions)
 6  ✅ gitleaks (secret scan — zero cost, zero config)
 7  ✅ golangci-lint (standar Go quality)
 8
 9  Cost: $0 additional (GitHub Actions gratis sampai 2000 menit/bulan)
10  Value: baseline quality + no secrets exposed
11
12Tier 2 (Sprint 1):
13  + Architecture check script
14  + Copilot PR review (jika sudah subscribe)
15  + Auto PR description (Claude haiku)
16
17  Cost: ~$2/bulan API
18  Value: architecture stays clean + PRs have context
19
20Tier 3 (Sprint 2-3):
21  + Spec compliance audit
22  + Coverage enforcement
23  + Final quality gate
24  + Staging auto-deploy + smoke test
25
26  Cost: ~$5/bulan total
27  Value: complete quality gate system
28
29Full Pipeline (Month 2+):
30  + LLMOps (prompts, cost monitoring, incidents)
31  + Production canary + auto-rollback
32  + Feature flags + A/B testing
33
34  Cost: ~$10-20/bulan total
35  Value: production-grade AI reliability

Pesan pentingnya: mulai dari Tier 1 yang gratis dan berdampak, ukur nilainya, lalu naik tier — bukan memaksakan full pipeline sebelum tim siap.


19.08 Team Adoption Roadmap

Tier di atas perlu dipetakan ke kalender nyata agar adopsi tidak berhenti sebagai wacana. Roadmap 4 bulan berikut menunjukkan urutan mingguan yang sudah terbukti untuk tim beranggota 8 developer.

text
 18-developer team, baseline: minimal CI (build + test only)
 2
 3MONTH 1: Foundation
 4  Week 1: Setup L1 + secret scan
 5  Week 2: Add golangci-lint + architecture check
 6  Week 3: Add Copilot PR review (shadow mode)
 7  Week 4: Enable Copilot enforcement for CRITICAL
 8
 9  Target: PR mechanical comments -30%
10
11MONTH 2: Quality Gates
12  Week 1: Add spec compliance audit (shadow mode)
13  Week 2: Add coverage enforcement
14  Week 3: Enable spec audit enforcement
15  Week 4: Add final quality gate + branch protection
16
17  Target: PR mechanical comments -60%, coverage 85%+
18
19MONTH 3: Automation
20  Week 1: Auto PR description
21  Week 2: Changelog + release notes
22  Week 3: Staging auto-deploy + smoke test
23  Week 4: Production canary + auto-rollback
24
25  Target: PR cycle time -40%
26
27MONTH 4: LLMOps
28  Week 1-2: Prompt version control + evaluation
29  Week 3: Cost monitoring + budgets
30  Week 4: Incident playbook + detection
31
32  Target: AI feature incidents < 1/month
33
34OUTCOME (Month 4 vs baseline):
35  PR review overhead: -70%
36  Post-deploy bugs: -60%
37  Pipeline visibility: 100% (scorecard)
38  AI feature reliability: 99.5%

Perhatikan pola “shadow mode” sebelum enforcement: tim membangun kepercayaan pada gate baru sambil melihat hasilnya, sebelum gate itu boleh memblokir merge.


19.09 Common Integration Pitfalls

Mengintegrasikan banyak komponen membuka peluang kesalahan yang khas dan berulang. Daftar pitfall berikut merangkum jebakan paling umum beserta solusi konkret yang sudah dibahas di artikel-artikel sebelumnya.

text
 1Pitfall 1: "One-size-fits-all CI"
 2  Problem: sama persis workflow untuk semua services
 3  Solution: parameterized workflows, service-specific thresholds
 4
 5Pitfall 2: "Pipeline tanpa observability"
 6  Problem: tidak tahu kenapa pipeline sering fail
 7  Solution: pipeline metrics, failure categorization, weekly review
 8
 9Pitfall 3: "AI tanpa fallback"
10  Problem: AI outage = feature outage
11  Solution: setiap AI call punya fallback (Artikel 07, 18)
12
13Pitfall 4: "Prompt tanpa evaluation"
14  Problem: prompt change yang merusak quality tidak terdeteksi
15  Solution: evaluation suite wajib untuk setiap prompt (Artikel 15)
16
17Pitfall 5: "LLMOps tanpa budget"
18  Problem: cost spike yang tidak terkontrol
19  Solution: per-feature budget enforcement (Artikel 17)
20
21Pitfall 6: "Feature flag tanpa cleanup"
22  Problem: flag accumulation, cognitive overhead
23  Solution: quarterly audit, lifecycle management (Artikel 16)

Benang merah keenam pitfall ini sama: setiap kemampuan AI harus dipasangkan dengan pengaman — fallback, evaluation, budget, dan cleanup — bukan dibiarkan berjalan tanpa rem.


19.10 Comparing Before and After

Angka lebih meyakinkan daripada klaim. Perbandingan berikut menyandingkan kondisi Santekno Shop di bulan 0 versus bulan 4 setelah pipeline diadopsi penuh.

text
 1SANTEKNO SHOP: BEFORE (bulan 0) vs AFTER (bulan 4)
 2
 3PR Workflow:
 4  Before: 1-2 hari dari PR ke merge, 8 mechanical comments/PR
 5  After:  4 jam dari PR ke merge, 1.8 mechanical comments/PR
 6
 7Quality:
 8  Before: 65% usecase coverage, architecture violations monthly
 9  After:  88% usecase coverage, zero architecture violations
10
11Production:
12  Before: 4-6 bugs per sprint, 35 menit MTTR
13  After:  1-2 bugs per sprint, 8 menit MTTR
14
15AI Features:
16  Before: tidak ada AI features
17  After:  3 AI features in production, 99.7% uptime
18
19Cost:
20  Pipeline cost: $0 → $12/bulan
21  Savings: ~$45,000/bulan (developer time + incident cost)
22  ROI: 3,750%

ROI 3.750% ini bukan sihir: ia datang dari waktu developer yang dibebaskan dari review mekanis dan dari insiden production yang dicegah sejak dini.


19.11 Future-Proofing Pipeline

Pipeline yang bagus hari ini bisa jadi beban besok kalau tidak dirancang untuk berevolusi. Prinsip desain berikut memastikan tiap komponen bisa di-update atau diganti tanpa merombak keseluruhan.

text
 1Pipeline yang baik harus bisa evolve:
 2
 3Modular design:
 4  Setiap component (review, security, spec) adalah job terpisah
 5  Gampang disable, update, atau ganti satu komponen tanpa affect yang lain
 6
 7Version control pipeline:
 8  .github/workflows/ di-review seperti code
 9  PIPELINE_CHANGELOG.md untuk track changes
10  Tags untuk pipeline versions (pipeline-v1.0, pipeline-v2.0)
11
12Abstraction layers:
13  claude-call.sh: API wrapper yang bisa ganti model/provider
14  check-architecture.go: rules yang bisa dikonfigurasi
15  quality-gate binary: weights dan thresholds yang configurable
16
17Stay current:
18  Monthly review: ada tool baru yang lebih baik?
19  Quarterly review: semua tools masih optimal?
20  Annual: audit full pipeline untuk relevance

Kunci future-proofing ada pada abstraksi: karena claude-call.sh menyembunyikan detail provider, mengganti model AI besok tidak menyentuh satu pun workflow.


19.12 Security Posture Summary

Keamanan dalam pipeline ini bukan satu langkah, melainkan pertahanan berlapis. Ringkasan berikut memetakan kontrol keamanan dari secret scanning hingga deployment gate.

text
 1Security yang sudah kita bangun:
 2
 3Secrets:
 4  ✅ gitleaks pre-commit + CI (semua commits di-scan)
 5  ✅ TruffleHog untuk deep scan
 6  ✅ API keys di GitHub Secrets, bukan di YAML
 7
 8Code Security:
 9  ✅ gosec HIGH issues = CI block
10  ✅ govulncheck CRITICAL CVEs = CI block
11  ✅ AI semantic security review (authorization, injection, disclosure)
12
13AI Security:
14  ✅ Diff redacted sebelum ke AI API
15  ✅ Budget enforcement (mencegah data exfiltration via cost spike)
16  ✅ Prompt injection review untuk setiap prompt baru
17
18Deployment Security:
19  ✅ Branch protection (no direct push to main)
20  ✅ CODEOWNERS (right people review right files)
21  ✅ Required status checks (semua gates wajib pass)
22
23Posture: defense in depth across all layers

Filosofi defense in depth di sini berarti tidak ada satu lapisan pun yang jadi single point of failure — kalau satu kontrol lolos, lapisan berikutnya masih menangkap.


19.13 Documentation Pipeline

Dokumentasi yang ditulis manual selalu tertinggal; pipeline ini membuatnya sebagai produk sampingan otomatis. Ikhtisar berikut menunjukkan dokumentasi apa yang ter-generate di tiap level PR, release, dan bulanan.

text
 1Auto-generated documentation dari pipeline:
 2
 3Per PR:
 4  → Auto PR description (dari diff + spec + commits)
 5  → Copilot review comments (mechanical issues)
 6  → Spec compliance report (AC coverage)
 7  → Architecture review (layer violations)
 8
 9Per Release:
10  → Changelog (dari conventional commits)
11  → Release notes (technical + user-facing)
12  → Security changelog (CVE patches highlighted)
13
14Per Month:
15  → Pipeline scorecard (quality metrics)
16  → LLM cost report (AI spending + ROI)
17  → Security posture report (issues found + fixed)
18  → Prompt quality trend (are prompts getting better?)
19
20Destination:
21  GitHub Release pages, CHANGELOG.md, Notion/Confluence, Slack digest

Karena dokumentasi lahir dari data pipeline itu sendiri, ia selalu akurat dan tidak pernah basi — masalah klasik dokumentasi manual yang terpecahkan otomatis.


19.14 Handling Multiple Services

Santekno Shop adalah monorepo, dan monorepo punya tantangan pipeline tersendiri. Daftar adaptasi berikut menunjukkan cara membuat pipeline efisien saat satu repo menampung banyak service.

text
 1Santekno Shop adalah monorepo dengan multiple services.
 2Pipeline adaptations untuk monorepo:
 3
 41. Path-based triggers:
 5   on:
 6     paths: ['services/order-service/**']
 7
 8   → Hanya trigger pipeline untuk service yang berubah
 9
102. Service-specific thresholds:
11   order-service: coverage 90% (critical path)
12   catalog-service: coverage 80% (less critical)
13
143. Cross-service dependency check:
15   → Verify tidak ada cross-service internal imports
16   → Verify Kafka event schema compatibility
17
184. Shared library changes:
19   → Trigger ALL service pipelines (shared library)
20   → Extra caution: run integration tests untuk semua services
21
225. Monorepo scorecard:
23   → Per-service scorecard + aggregate scorecard
24   → Identify which service needs most attention

Inti adaptasi monorepo adalah path-based triggers: pipeline hanya jalan untuk service yang berubah, menghemat menit CI dan biaya tanpa mengorbankan cakupan.


19.15 Pipeline as Product

Cara paling sehat memandang pipeline adalah memperlakukannya seperti produk internal, lengkap dengan pengguna dan feedback loop. Kerangka berikut menjabarkan siapa penggunanya dan bagaimana prioritas fiturnya ditentukan.

text
 1Treat the pipeline as a product dengan:
 2
 3Users: developers di tim
 4Product manager: tech lead / engineering manager
 5Support: DevOps engineer atau pipeline owner
 6
 7Feedback mechanisms:
 8  → "thumbs up/down" di PR comments untuk AI review quality
 9  → Monthly developer survey: "Pipeline helpful or hindrance?"
10  → Flaky test tracking: pipeline reliability for developers
11
12Feature prioritization:
13  → Based on developer pain points
14  → Based on quality metrics (where are bugs coming from?)
15  → Based on ROI (which gate prevents most incidents?)
16
17Versioning dan communication:
18  → PIPELINE_CHANGELOG.md
19  → Announce changes in Slack #engineering
20  → Give 1-sprint notice before enforcement changes

Dengan memperlakukan developer sebagai pelanggan, pipeline tetap dipakai dengan senang hati alih-alih dilihat sebagai birokrasi yang menghambat.


19.16 Observability Stack untuk Pipeline

Pipeline itu sendiri butuh dipantau, bukan hanya aplikasi yang dihasilkannya. Stack observability berikut memperlihatkan metrik, log, dashboard, dan alert yang membuat kesehatan pipeline selalu terlihat.

text
 1Complete observability untuk pipeline itself:
 2
 3Metrics (Prometheus):
 4  ci_pipeline_duration_seconds{workflow}
 5  ci_pipeline_success_total{workflow}
 6  ai_cost_usd_total{feature}
 7  quality_gate_score{pr_author}
 8
 9Logs (Structured):
10  Every AI call: model, feature, tokens, latency, error
11  Every deployment: environment, version, actor, verdict
12  Every incident: severity, feature, duration, resolution
13
14Dashboards (Grafana):
15  Pipeline health: success rate, duration trend, most failing jobs
16  AI cost: daily/monthly by feature, budget utilization
17  Quality trend: PR mechanical comments, coverage over time
18  Deployment: frequency, duration, rollback rate
19
20Alerts (Alertmanager → PagerDuty/Slack):
21  CI success rate < 90%: Slack #engineering
22  AI cost > 80% budget: Slack #engineering
23  AI incident P1/P2: PagerDuty
24  Coverage drop > 5%: Slack #engineering

Dengan metrik, log, dashboard, dan alert yang lengkap, kegagalan pipeline tidak lagi jadi misteri — ia jadi sinyal yang bisa ditindaklanjuti dalam hitungan menit.


19.17 Cross-Team Pipeline Standards

Saat organisasi punya banyak tim Go, pipeline perlu distandarkan tanpa mematikan otonomi tim. Model reusable workflow berikut menyeimbangkan standar bersama dengan override spesifik per tim.

text
 1Untuk organisasi dengan multiple Go teams:
 2
 3Shared pipeline library (reusable workflows):
 4  .github/workflows/reusable-*.yml
 5  → go-quality.yml: standard Go quality checks
 6  → ai-review.yml: AI code review
 7  → deploy-staging.yml: staging deployment pattern
 8
 9Team-specific overrides:
10  Each team can extend but not weaken shared standards
11  Example: override coverage threshold up (not down)
12
13Platform team responsibility:
14  → Maintain shared pipeline library
15  → Publish changes with SLA (1 sprint notice for breaking)
16  → Support teams adopting new pipeline features
17
18Adoption metrics:
19  → Which teams using which pipeline features?
20  → Which teams need help adopting?
21  → What blocks adoption?

Aturan emasnya: tim boleh memperketat standar bersama, tapi tidak boleh melemahkannya — sehingga kualitas minimum organisasi terjaga sambil tiap tim tetap fleksibel.


19.18 Compliance dan Audit Trail

Output pipeline ternyata berharga jauh setelah PR di-merge, yaitu sebagai bukti audit. Skema retensi berikut menunjukkan artefak apa yang disimpan di tiap level dan berapa lama.

text
 1Pipeline output yang berguna untuk audit:
 2
 3Per PR (stored as GitHub artifacts, 90 days):
 4  review-result.json: AI review score + issues
 5  spec-audit.json: AC compliance per feature
 6  security-scan.json: gosec + govulncheck results
 7  cost-event.json: AI API usage + cost
 8
 9Per Release (stored in CHANGELOG.md + GitHub Releases):
10  What changed (technical)
11  Security patches (CVE references)
12  Breaking changes
13
14Per Month (dashboard + report):
15  AI cost report (billing evidence)
16  Security posture (for compliance reviews)
17  Quality metrics (for engineering effectiveness review)
18
19Retention:
20  GitHub artifacts: 90 days (sufficient for sprint reviews)
21  Release artifacts: forever (git tags + GitHub Releases)
22  Cost records: 1 year (financial compliance)

Dengan retensi berjenjang ini, saat auditor bertanya “kapan fitur X di-review dan berapa biayanya?”, jawabannya sudah tersimpan otomatis — bukan direkonstruksi manual.


19.19 Next Steps: Menuju Topik 5

Semua fondasi Topik 4 ini punya tujuan akhir: memungkinkan Topik 5. Checklist kesiapan berikut menegaskan apa yang harus sudah ada sebelum membangun AI features yang menghadap user.

text
 1Pipeline Topik 4 adalah fondasi untuk Topik 5:
 2
 3Topik 5: AI-Powered E-Commerce Go Applications
 4  → AI features yang dibangun menggunakan pipeline ini
 5  → LLMOps yang dikelola oleh tools Topik 4
 6  → Quality yang dijaga oleh gates Topik 4
 7
 8Apa yang perlu siap dari Topik 4 sebelum Topik 5:
 9
10Infrastruktur:
11  ✅ Claude API integration (Artikel 03)
12  ✅ Feature flags (Artikel 16)
13  ✅ Cost monitoring (Artikel 17)
14  ✅ Incident playbook (Artikel 18)
15
16Development workflow:
17  ✅ CLAUDE.md dengan domain context
18  ✅ Prompt version control (Artikel 15)
19  ✅ AI review yang understand Go patterns
20
21Quality:
22  ✅ Spec compliance untuk AI-generated features
23  ✅ Coverage enforcement termasuk AI integration tests
24  ✅ Architecture linting termasuk AI dependency patterns

Semua tanda centang ini adalah prasyarat, bukan formalitas: tanpa infrastruktur ini, AI features Topik 5 akan dibangun tanpa jaring pengaman — dengan infrastruktur ini, tiap fitur baru mewarisi monitoring dan cost control secara gratis.


19.20 Ringkasan: Pipeline sebagai Competitive Advantage

Banyak tim membangun Go applications. Sedikit yang punya pipeline secanggih ini. Dan bahkan lebih sedikit yang membangun pipeline dengan AI-augmentation yang komprehensif.

Pipeline ini adalah competitive advantage yang:

  • Memungkinkan tim ship faster (otomasi mechanical review)
  • Dengan quality lebih tinggi (spec compliance, coverage)
  • Dengan reliability lebih baik (canary, auto-rollback, incident playbook)
  • Dengan cost terkontrol (budget enforcement, monitoring)

Total investment: 4 sprint untuk full implementation. Total ROI: 3.750%+ berdasarkan angka yang kita hitung di artikel-artikel sebelumnya.

Di artikel berikutnya, kita menutup Topik 4 sekaligus membuka jalan ke Topik 5: bagaimana semua infrastruktur ini menjadi fondasi untuk membangun AI-powered e-commerce features yang langsung mengubah pengalaman customer Santekno Shop.

Artikel Terkait

💬 Komentar