* fix: add disk fallback to GetPersistedIssueList when cache is empty [IDE-1514]
Add fallback mechanism to GetPersistedIssueList() to check disk for
persisted issues when the in-memory cache lookup fails.
Changes:
- Modified GetPersistedIssueList() to scan disk files when cache miss
occurs
- Update in-memory cache after finding matching file on disk
- Added test coverage for fallback scenario
* feat: add comprehensive debug logging for cache fallback to disk [IDE-1514]
Enhance debug logging in GetPersistedIssueList() fallback mechanism to
provide detailed visibility when cache lookup fails but files exist on disk.
New debug logs include:
- Cache directory path when fallback starts
- File count and expected hash/product when scanning disk
- Detailed logging for each file checked:
* Parse errors when file schema parsing fails
* Hash mismatches with actual vs expected values
* Product mismatches with actual vs expected values
* Expired file detection
- Summary when no matching file found after scanning all files
- Error details when fallback ultimately fails
This improves debugging capabilities for IDE-1514 scenarios where cache
is not initialized but persisted files exist on disk.
* refactor(persistence): reduce cyclomatic complexity in GetPersistedIssueList [IDE-1514]
Extract fallback logic into separate helper functions to reduce cyclomatic complexity from 17 to ~8-9, meeting gocyclo lint requirements.
- Extract findCommitHashOnDisk() to handle disk lookup when cache misses
- Extract tryMatchCacheFile() to validate individual cache file matches
- Maintains same functionality and test coverage
- Fixes CI/CD lint failure: cyclomatic complexity 17 of func GetPersistedIssueList is high (> 15)
* perf(persistence): avoid duplicate hash calculation in GetPersistedIssueList [IDE-1514]
Move getHashForFolderPath() call before the if statement to calculate hash only once instead of twice.
- Calculate hash once at the start of the function
- Reuse the same hash value in both fallback lookup and file path construction
- Improves performance by eliminating redundant computation