From b10546b81ae6425a3ed0f464d758fbe1b48b9715 Mon Sep 17 00:00:00 2001 From: ht Date: Sun, 6 Sep 2026 18:34:15 +0300 Subject: [PATCH] add CI quality gates --- .github/workflows/quality.yml | 39 +++++++++++++++++++++++++++++++++ docs/quality/uygulama-durumu.md | 4 ++++ 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/quality.yml diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml new file mode 100644 index 0000000..fa9ae7e --- /dev/null +++ b/.github/workflows/quality.yml @@ -0,0 +1,39 @@ +name: Quality gates + +on: + push: + pull_request: + +jobs: + test-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + - run: npm ci + - run: npm test + - run: npm run build + + container: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build production image + run: docker build --tag ihaleist:ci . + - name: Validate nginx configuration + run: docker run --rm ihaleist:ci nginx -t + - name: Validate container health + run: | + set -eu + cid=$(docker run -d -p 18080:80 -e NODE_ENV=production -e AUTH_SECRET=$(openssl rand -hex 32) ihaleist:ci) + cleanup() { docker rm -f "$cid" >/dev/null 2>&1 || true; } + trap cleanup EXIT + for attempt in $(seq 1 30); do + if curl --fail --silent http://127.0.0.1:18080/api/health; then exit 0; fi + sleep 1 + done + echo 'Container health endpoint did not become ready' >&2 + exit 1 diff --git a/docs/quality/uygulama-durumu.md b/docs/quality/uygulama-durumu.md index bbc2891..7013208 100644 --- a/docs/quality/uygulama-durumu.md +++ b/docs/quality/uygulama-durumu.md @@ -2082,3 +2082,7 @@ Doğrulama: 289 test geçti, Vite üretim derlemesi başarılı. Host ortamında Docker runtime image’ında backend’in kullandığı ortak `src/` klasörünün eksik kopyalandığı bulundu ve Dockerfile’a eklendi; önceki image Node `ERR_MODULE_NOT_FOUND` nedeniyle 502 üretiyordu. Yeniden build sonrası `nginx -t` başarılı, `/api/health` 200 ve statik güvenlik başlıkları doğrulandı. Kanıt [`qa-container-runtime.json`](evidence/qa-container-runtime.json) içinde. İlk container doğrulamasında runtime npm audit, `@huggingface/transformers` üzerinden `sharp` için iki yüksek önem dereceli ve otomatik düzeltmesi olmayan uyarı bildirdi. Dockerfile semantic embedding paketini artık varsayılan olarak kurmuyor (`ENABLE_SEMANTIC_MATCH=1` ile açıkça opt-in); varsayılan image audit sonucu 0 açık ve `UYUM_GOMME=0`. Embedding açılacaksa ayrı güvenlik incelemesi ve bağımlılık yükseltmesi gerekir. + +### 2026-09-06 · CI kalite kapıları + +GitHub Actions iş akışı eklendi. Her push ve pull request’te test/üretim derlemesi; ayrıca Docker image build’i, nginx yapılandırma testi ve `/api/health` çalışma zamanı kontrolü otomatik çalışacak. Bu iş akışı gerçek production rollout kanıtının yerine geçmez.