2.4 KiB
2.4 KiB
Investigation and Remediation Plan: CI Failures on feature/beta-release
1. Incident Summary
Issue: CI builds failing on feature/beta-release.
Symptoms:
- Frontend build fails due to missing module
../data/crowdsecPresets. - Backend coverage check fails (likely due to missing tests or artifacts).
- Docker build fails. Root Cause Identified:
- The file
frontend/src/data/crowdsecPresets.tsexists locally but was ignored by git due to an overly broad pattern in.gitignore. - The pattern
data/in.gitignore(intended for the rootdata/directory) accidentally matchedfrontend/src/data/.
2. Diagnosis Details
- Local Environment: The file
frontend/src/data/crowdsecPresets.tswas present, so localnpm run buildandnpm run test:cipassed. - CI Environment: The file was missing because it was not committed.
- Git Ignore Analysis:
.gitignorecontaineddata/under "Caddy Runtime Data".- This pattern matches any directory named
dataanywhere in the tree. - It matched
frontend/src/data/, causingcrowdsecPresets.tsto be ignored.
3. Remediation Steps
- Fix
.gitignore:- Change
data/to/data/to anchor it to the project root. - Change
frontend/frontend/to/frontend/frontend/for safety.
- Change
- Add Missing File:
- Force add or add
frontend/src/data/crowdsecPresets.tsafter fixing.gitignore.
- Force add or add
- Verify:
- Run
git check-ignoreto ensure the file is no longer ignored. - Run local build/test to ensure no regressions.
- Run
4. Verification Results
- Local Tests:
- Backend Coverage: 85.4% (Pass)
- Frontend Tests: 70 files passed (Pass)
- Frontend Coverage: 85.97% (Pass)
- Build: Passed
- Git Status:
frontend/src/data/crowdsecPresets.tsis now staged for commit..gitignoreis modified and staged.
5. Next Actions
- Commit the changes with message:
fix: resolve CI failures by unignoring frontend data files. - Push to
feature/beta-release. - Monitor the next CI run.
6. Future Prevention
- Use anchored paths (starting with
/) in.gitignorefor root-level directories. - Check
git statusfor unexpected ignored files when adding new directories. - Add a pre-commit check or CI step to verify that all imported modules exist in the git tree (though
tscin CI does this, the issue was the discrepancy between local and CI).