Cicd pipeline design
CI/CD pipeline-as-code review/tasarım — GHA/GitLab/Jenkins, hız+determinizm+güvenlik, cache+matrix+secrets, artifact lifecycle (SBOM/sign/attestation), DORA metric.From its SKILL.md
npx -y skills add resultakak/argos --skill cicd-pipeline-designAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
6.4 KB, as published. Nobody here has run it
CI/CD Pipeline Design
Ortak Doktrin
agents/shared/severity-rubric.md ve agents/shared/escalation-matrix.md default-load
sayılır (agents/coordination.md §11). Bu skill'in çıktısı Critical / High / Medium /
Low + kanıt formatında olmak zorunda — spekülatif Critical yasak. Sahiplik dışı bulgu
ilgili agent'a delege; karar yetkisi eşiği aşılırsa kullanıcı onayı zorunlu.
Ne Zaman Kullanılır
- Pipeline ≥ 25 dk → hızlandırma
- Flaky test → quarantine + kök neden
- Cache miss / her run sıfırdan derleme
- Yeni servis CI bootstrap
- Supply chain hardening (SBOM, sign, provenance)
- DORA metric retrospektifi
Workflow
1) Pipeline tespit
| Tool | Dosya |
|---|---|
| GitHub Actions | .github/workflows/*.yml |
| GitLab CI | .gitlab-ci.yml, .gitlab/ |
| Jenkins | Jenkinsfile, .jenkins/ |
| CircleCI | .circleci/config.yml |
| Argo | .argo/, workflowtemplates/ |
| Tekton | .tekton/, pipelines/ |
Stack birden fazlaysa hepsi paralel review.
2) Hız analizi
- Toplam süre ana iş kolu (main branch push) ve PR.
- Aşama başına süre (checkout/install/lint/test/build/deploy).
- Slow job p95.
- Critical path — paralelize edilemez bağımlılık zinciri.
- Cache hit oranı — lock-hash key ile hit/miss.
3) Determinizm
- Flaky test oranı (3 son run aynı commit'te aynı sonuç mu).
- Network bağımlılığı test'lerde (DNS lookup, external API).
- Time-bound test'ler (sleep + timeout pattern, race condition).
- Resource leak (port, container, tmpfile).
- Order-dependent test'ler (test ID'sine göre koşum).
4) Güvenlik
- Secret tarama: gitleaks / trufflehog. PR diff'inde block.
- Permission inventory: GHA
permissions:her workflow'da, en az gerekli. pull_request_targetvspull_request— secret expose ayrımı doğru mu?- OIDC kullanılıyor mu? Long-lived AWS/GCP cred → OIDC federation öner.
- Self-hosted runner + public repo PR — supply chain risk.
- Action pin:
uses: foo/bar@v1yerineuses: foo/bar@<sha>(özellikle 3rd party). - Dependency scan: trivy/grype/snyk/dependabot. Severity threshold + ignore policy.
5) Cache stratejisi
- Key:
${runner.os}-${hashFiles('lock')}pattern. - Restore-keys: fallback chain.
- Cache size: > 1 GB inceleme; gereksiz dosya cache'lenmiyor mu?
- Cache poison riski: PR head_ref ile key prefix.
- Layer cache (Docker buildx):
cache-from: type=gha,cache-to: type=gha,mode=max. - Selective restore: tüm
~/.cache/pipyerine spesifik path.
6) Test stratejisi
- Pyramid uyumu: unit %60-70 + integration %20-30 + e2e %5-10.
- Shard: CPU başına paralelizm (
--shard 1/N,pytest-xdist). - Selective: değişen path'e yakın test'leri önce (
testmon,jest --findRelatedTests). - Flaky katalog: 3 retry → quarantine + issue. 14 gün limit.
- Coverage: staged scope %70 hedef + total %60.
7) Matrix
- Version matrix (Python 3.11+/3.12; Node 20+/22; Go 1.22+).
- Platform matrix release-only (linux/amd64 + arm64).
fail-fast: falsematrix sapma görmek için.
8) Artifact lifecycle
- Tag stratejisi:
git rev-parse --short HEAD,git describe --always. - Digest pin prod deploy.
- SBOM:
docker buildx --sbom=trueveyasyft. - Provenance:
actions/attest-build-provenance(SLSA L2+). - Sign: cosign + Sigstore keyless.
- Scan: trivy/grype build-time.
- Retention: PR < 7 gün, main < 30, release ≥ 1 yıl.
9) Deploy zinciri
- Staging her merge.
- Prod manual approval veya zaman-gated.
- Migration ayrı PR.
- Health probe sonrası rollout devam.
- Rollback komutu planda yazılı.
- Feature flag ile deploy ↔ release ayrımı.
10) Reusable workflow
- Ortak pattern'i tek yere topla (GHA
workflow_call, GitLabinclude). - Plugin'in
templates/github-actions/reusable-build.ymlörnek.
11) DORA metric
- Deploy frequency — günde kaç deploy?
- Lead time — commit → prod arası süre.
- MTTR — incident → recovery.
- Change fail rate — deploy'lardan kaçı rollback?
- Trend: 2 haftalık + 90 günlük.
Checklist
- Toplam süre ≤ 10 dk PR, ≤ 30 dk release
- Flaky test oranı < %2
- Cache hit oranı > %80
- Secret hardcode yok (gitleaks block aktif)
-
permissions:minimum (her workflow explicit) - Action pin SHA bazlı (3rd party)
- OIDC federation (long-lived cred yok)
- Image tag git SHA + digest pin prod
- SBOM + provenance attestation
- Trivy/grype build-time scan
- Cosign sign
- Test pyramid uyumu (60/30/10)
- Coverage staged ≥ %70
- Reusable workflow ortak pattern için
- DORA metric dashboard
Antipattern
latestimage tag prod deploy.pull_request_targetile untrusted PR kodu + secrets aynı job'da.permissions: write-allveya default broad.continue-on-error: truetest job'ında.if: always()test sonucu bağımsız ilerleme.- Cache key sadece
${runner.os}— her run miss. actions/checkout@v3(Node 16 EoL).- Flaky retry rutinleşmiş, kök sebep çözülmemiş.
--no-verify+[skip ci]rutin kullanım.- Test silme bahanesi "yavaş çalışıyor".
- Self-hosted runner public repo'da PR olmadan koruma.
- Hardcoded image registry credential workflow yml içinde.
- Pipeline UI'dan job kapatma (diff yok).
Örnek Agent Davranışı
User: /cicd-review
Agent (ci-cd-engineer):
1. .github/workflows/ tara: 4 workflow.
2. Toplam süre p95: 28 dk (PR), 47 dk (release).
3. Bottleneck: e2e job 18 dk (no shard); unit test 7 dk.
4. Cache hit %43 — restore-keys yok.
5. Secret: GITHUB_TOKEN her workflow'da `permissions: read-all`; `release.yml`'da
`id-token: write` yok ama OIDC kullanılıyor → fail.
6. Image tag: `release.yml`'da `:latest` push; deploy'da değil ama yine kötü pattern.
7. Plan: shard e2e (4-way), restore-keys ekle, OIDC permission düzelt, latest tag'ı kaldır.
8. Output: rapor + diff + DORA referansı.
Çıktı Formatı
# CI/CD Review: <repo>
## Mevcut Durum
- Toplam süre, hit oranı, flaky %, DORA snapshot
## Critical / High / Medium / Low
## Diff (özet)
```yaml
# fixed workflow snippet
Test Eksiği
- selective test, shard, coverage
Sonraki Adım
- ...