Feat: workflow integration test#1686
Open
pandigresik wants to merge 21 commits into
Open
Conversation
- Update config/scribe.php with proper auth, routes, and OpenAPI config - Add artisan command scribe:copy-openapi to copy spec to repo root - Add composer scripts: generate-openapi, validate-openapi - Add openapi.yaml (initial generated spec with 54 endpoints) - Add CI workflow: openapi.yml (generate & validate on PR/push) - Update test.yml to also copy & validate OpenAPI spec - Add docs/integration-testing.md with local dev instructions - Add SCRIBE_AUTH_KEY to .env.example
- Fix CekDesa rule: lazy-load DB query in message() instead of constructor - Add missing test() method to PendudukController - Regenerate openapi.yaml (now 61 paths, covering all api.php routes) - Remove outdated note about missing endpoints from docs
- Add @group and @bodyParam/response annotations to all api/v1 controllers - Add meaningful summaries to frontend API controllers - Fix AuthController login with proper Scribe annotations - Regenerate openapi.yaml with all 61 paths properly described - Each OpenSID submission endpoint now has documented body params & response
- Remove api/frontend/* from scribe route prefixes - Regenerate spec: 21 paths, focused on OpenSID endpoints only
- Add detailed ZIP column contracts to controller docblocks - Separate JSON vs ZIP endpoints with proper @bodyParam types - Add ZIP contract validation table to docs/integration-testing.md - Add sample ZIP generator script and Pest contract test example - Each file upload endpoint now documents expected internal file format
- Add Pest-based contract tests validating 11 request payloads vs OpenAPI spec - Create example JSON payloads for auth, penduduk, laporan, pesan, identitas-desa - Add contract.yml CI workflow (no DB needed, runs on PR to master/dev) - Fix laporan_apbdes & laporan_penduduk controller annotations for proper object[] schema - Add composer test:contract and npm run test:contract scripts - Document running contract tests locally in docs/integration-testing.md Issue: #1673
Contributor
|
🔄 AI PR Review sedang antri di server...
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: feat: GitHub Actions Integration Regression Pipeline
Description
Menambahkan GitHub Actions workflow (
integration-regression.yml) yang menjalankan rangkaian pengujian otomatis untuk mencegah regresi integrasi antara OpenDK (provider) dan OpenSID (consumer). Pipeline mencakup lint → unit tests → generate/validate OpenAPI → contract tests → integration tests → E2E bersyarat, beserta upload coverage ke Codecov dan coverage gate threshold.Changes made:
.github/workflows/integration-regression.yml— GitHub Actions workflow dengan 8 jobs: lint, unit, generate-openapi, contract, integration, e2e, coverage-gate, ci-summarybin/check-coverage.php— Script PHP untuk coverage threshold gate (min 30%, drop max 2%)bin/detect-flaky-tests.php— Script PHP untuk deteksi flaky tests dari laporan JUnit XMLpint.json— Laravel Pint configuration untuk menonaktifkan rules yang terlalu ketatphpunit.xml— Added Contract testsuite and clover coverage loggingReason for change:
Impact of change:
✅ Quality Assurance: Semua PR otomatis diuji secara komprehensif sebelum merge
✅ Early Detection: Regresi integrasi terdeteksi sejak awal, bukan saat deployment
✅ Coverage Tracking: Codecov integration memberikan visibilitas tren coverage dari waktu ke waktu
✅ Developer Experience: CI summary dengan test durations dan flaky test detection membantu debugging
✅ Gated E2E: E2E tests hanya berjalan saat push ke master atau label
run-e2e, menghemat waktu CIRelated Issue
#1676
Steps to Reproduce
Before (no CI pipeline):
After (with CI pipeline):
master,rilis-dev,dev, ataubug-fixrun-e2eatau push ke master)Testing on related features:
Checklist
Technical Details
Technical Explanation
Pipeline dibangun dengan arsitektur DAG (Directed Acyclic Graph) untuk parallelisasi yang optimal:
Job Details:
Key Features:
actions/cache@v4dengan key berbasiscomposer.lockhashphp artisan test --testsuite— Menggunakan PHPUnit's testsuite filtering (bukan Pest groups) untuk menghindari loading Browser/Playwrightphp artisan migrate --force— Semua job menjalankan migrasi sebelum test untuk memastikan struktur database validCOVERAGE_MIN_THRESHOLD: 30danCOVERAGE_DROP_THRESHOLD: 2(baseline, naikkan bertahap)pint.jsonmenonaktifkan rules yang terlalu ketat sehingga CI lint check lebih realistisCoverage Gate Script (
bin/check-coverage.php):COVERAGE_PREVenv var (default 2%)GITHUB_STEP_SUMMARYCoverage Threshold Strategy:
MIN_THRESHOLD = current_coverage - buffer (2-5%)Flaky Test Detection Script (
bin/detect-flaky-tests.php):GITHUB_STEP_SUMMARYConfiguration changes
phpunit.xml: AddedContracttestsuite (clover logging via CLI option)pint.json: Laravel Pint configuration untuk menonaktifkan rules yang terlalu ketatconfig/scribe.php: Tidak ada perubahan (frontend routes prefix sudah di-inherit dari base branch)Dependencies added
actions/checkout@v4actions/cache@v4actions/upload-artifact@v4actions/download-artifact@v4shivammathur/setup-php@v2actions/setup-node@v4codecov/codecov-action@v4Testing
Manual Testing
run-e2eAutomated Testing
Browser Compatibility
Not applicable — CI pipeline configuration only
Screenshots / Video
No UI changes — this is a CI/CD configuration PR
Breaking Changes
None
Migration Guide
Required GitHub Secrets
Add the following secrets to repository settings:
CODECOV_TOKENE2E_ADMIN_EMAILE2E_ADMIN_PASSWORDOptional Configuration
Environment variables in workflow can be customized:
Developer Workflow
run-e2eto PR, or push tomasterReferences
Additional notes:
php artisan test --testsuitedigunakan daripadavendor/bin/pest --groupuntuk menghindari loading Playwrightphp artisan migrate --forcesebelum test untuk memastikan struktur database validbuild/logsdirectory sebelum test untuk memastikan coverage file ter-generate--coverage-cloverCLI option (bukan via phpunit.xml clover element)fail_ci_if_error: falseuntuk mencegah CI gagal saat token belum di-setCODECOV_TOKEN) perlu di-set di GitHub repository secrets untuk branch protectedpint.jsonmenonaktifkan rules sepertitrailing_comma_in_multiline,fully_qualified_strict_types,not_operator_with_successor_space, dll yang terlalu ketat untuk codebase yang sudah adaCara Meningkatkan Coverage:
Jalankan coverage report lokal:
Prioritas test berdasarkan impact:
Contoh test sederhana:
Naikkan threshold bertahap: