Skip to content

Commit 6a3ac75

Browse files
committed
ci: tambah job pint non-blocking ke CI (ST-05/BP-2)
- CI phpunit sudah ada dari review-2 (matrix 8.2/8.3, MySQL, Vite, pymupdf, migrate) - tambah job 'pint' informational (continue-on-error) - repo masih punya 290 file utang style, jadi non-blocking sampai ada inisiatif pint repo-wide terpisah Catatan risiko CI didokumentasikan: 2 test time-dependent (subMonths off-by-one) bisa bikin CI merah di tanggal berbeda; uncompromised() HIBP butuh internet. Ref: docs/review-version-3/tasks/ST-05-ci.yml
1 parent 6e68b51 commit 6a3ac75

3 files changed

Lines changed: 68 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,26 @@ jobs:
104104
- name: Run PHPUnit
105105
# artisan test OOM di app ini (render menu) — pakai phpunit langsung + flag memory.
106106
run: php -d memory_limit=2G -d xdebug.mode=off vendor/bin/phpunit --no-coverage
107+
108+
pint:
109+
name: Pint (style, informational)
110+
runs-on: ubuntu-latest
111+
# Non-blocking: repo masih punya utang style lama (290 file). Job ini
112+
# menampilkan pelanggaran tanpa memerahkan CI, sampai ada inisiatif
113+
# `pint` repo-wide terpisah. Setelah bersih, hapus continue-on-error.
114+
continue-on-error: true
115+
steps:
116+
- uses: actions/checkout@v4
117+
118+
- name: Setup PHP
119+
uses: shivammathur/setup-php@v2
120+
with:
121+
php-version: '8.3'
122+
coverage: none
123+
tools: composer:v2
124+
125+
- name: Install dependencies
126+
run: composer install --no-interaction --prefer-dist --no-progress
127+
128+
- name: Check code style (Pint)
129+
run: vendor/bin/pint --test

docs/review-version-3/rencana-perbaikan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
| ST-02 | `app/Exports/SalaryRecapExport.php` | PERF-7 FromQuery + chunk | 🟡 | [x] DONE |
4040
| ST-03 | `app/Exports/LoanExport.php` | PERF-7 FromQuery + chunk | 🟡 | [x] DONE |
4141
| ST-04 | `app/Repositories/LoanRepository.php` | PERF-3 buang subquery ganda O(n) | 🟡 | [x] DONE |
42-
| ST-05 | `.github/workflows/ci.yml` (baru) | BP-2 CI phpunit + pint | 🟠 | [ ] TODO |
42+
| ST-05 | `.github/workflows/ci.yml` (baru) | BP-2 CI phpunit + pint | 🟠 | [x] DONE (CI phpunit sudah ada dari v2; +job pint non-blocking) |
4343

4444
---
4545

docs/review-version-3/tasks/ST-05-ci.yml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,54 @@
22

33
**Fokus:** BP-2 — GitHub Actions CI (file BARU)
44
**Severity:** 🟠 Tinggi
5-
**Status:** [ ] TODO — commit: `______`
5+
**Status:** [x] DONE — commit: `pending` (terverifikasi 2026-08-29)
66
**File (satu-satunya) yang disentuh:** `.github/workflows/ci.yml`
77

88
---
99

10+
## ⚠️ KOREKSI (temuan saat eksekusi)
11+
12+
Ternyata `.github/workflows/ci.yml` **SUDAH ADA** (dari review-2) dan JAUH lebih lengkap
13+
dari draft awal ST-05 — sudah menangani semua pitfall CI:
14+
- Matrix PHP **8.2/8.3**, service **MySQL 8.0** + health-check + wait loop.
15+
- **Vite build** (`npm ci && npm run build`) → view test punya `public/build/manifest.json`.
16+
- **pymupdf** (`pip install`) → CvExtractionService bisa baca PDF.
17+
- migrate `--force` + phpunit dgn flag memory (hindari OOM `artisan test`).
18+
19+
Yang KUTAMBAH di ST-05: job **`pint`** sebagai **informational (`continue-on-error: true`)**.
20+
21+
## Keputusan penting (jujur)
22+
- **Kode belum pint-clean: 290 file punya pelanggaran style** (utang lama, bukan dari
23+
Review v3). Menjadikan `pint --test` sebagai gate BLOCKING → CI langsung merah di 290
24+
file → CI tak berguna.
25+
- Maka job pint dibuat **non-blocking** (`continue-on-error: true`): pelanggaran TERLIHAT
26+
di tab Actions tapi tak memerahkan CI. Setelah ada inisiatif `pint` repo-wide terpisah,
27+
tinggal hapus `continue-on-error`.
28+
29+
## PROOF (2026-08-29)
30+
```
31+
$ ruby -ryaml validate .github/workflows/ci.yml
32+
YAML valid
33+
jobs: phpunit, pint
34+
35+
$ vendor/bin/pint --test | grep -c "⨯"
36+
290 # utang style lama -> alasan job pint non-blocking
37+
38+
$ phpunit (simulasi CI lokal)
39+
Tests: 427, Assertions: 1111, Failures: 2 # 2 baseline time-dependent
40+
```
41+
42+
## Catatan risiko CI (untuk ditindak terpisah)
43+
1. **2 failure baseline `time-dependent`** (`OrgStructureTest` months-of-service,
44+
`TaxServiceTest` THR prorata — `subMonths()` off-by-one). Di CI yang jalan pada
45+
tanggal berbeda, jumlah failure bisa berubah → CI bisa merah tak terduga. **Perlu
46+
di-fix agar CI stabil** (pakai `Carbon::setTestNow()` di test tsb).
47+
2. **`uncompromised()` (HIBP) di QW-04/05** memanggil API eksternal → di CI perlu internet
48+
(runner GitHub punya, tapi menambah latensi/kerapuhan). Pertimbangkan mock/disable rule
49+
HIBP di env test.
50+
51+
---
52+
1053
## Masalah
1154
Tak ada CI. 51 test PHPUnit + harness browser tak jalan otomatis per-PR → regres lolos.
1255

0 commit comments

Comments
 (0)