Diagnose and fix CI pipeline failures across Go, TypeScript/Vue.js, and PHP stacks
3f:Tde2,
# Read failure logs
gh run view <run-id> --log-failed
# Re-run failed jobs after fixing
gh run rerun <run-id> --failed
Read the failure logs:
gh run view <run-id> --log-failedClassify the failure type:
Apply the appropriate fix by stack:
Go common fixes:
go mod tidygo test ./... locally, fix assertionsgolangci-lint run --fix ./... then fix remaining issues manuallyTypeScript/Vue common fixes:
npm install or add missing dependencytsconfig.json paths, Vue component importsnpx vitest run locally, update snapshots if needed with npx vitest run -unpx eslint . --ext .ts,.tsx,.vue --fixPHP common fixes:
composer dump-autoload or fix namespace/pathcomposer update --with-all-dependenciesvendor/bin/phpunit locally, fix assertionsVerify the fix locally:
Push the fix and monitor:
gh run watch| Error | Cause | Fix |
|---|---|---|
| Fix works locally but fails in CI | Environment mismatch | Check runtime versions in workflow YAML; match locally |
go mod tidy changes go.sum | Dependency update needed | Commit the updated go.sum |
npm ci fails | package-lock.json out of sync | Run npm install locally and commit the updated lockfile |
composer install fails | composer.lock out of sync | Run composer update locally and commit the updated lockfile |
| Snapshot tests fail | UI changed intentionally | Update snapshots: npx vitest run -u and commit |
| PHPStan baseline outdated | New errors not in baseline | Regenerate: vendor/bin/phpstan analyse --generate-baseline |
| Flaky test | Test depends on timing or external service | Add retry logic or mock the external dependency |
| CI timeout | Tests or build too slow | Optimize slow tests, add caching in workflow, increase timeout |