- ALM used: GitHub
- CI system used: Github Actions
- Scanner command used: SonarCloud Github Actions
- Languages of the repository: mainly Typescript (others JS, Python…)
- Repository type: Monorepo
Errors observed
...
Cache strategy set to 'WRITE_ONLY' for file 'libs/domain/...' as current analysis requires all files to be analyzed.
...
INFO: Sensor JavaScript/TypeScript analysis [javascript]
INFO: Detected os: Linux arch: amd64 alpine: true. Platform: UNSUPPORTED
INFO: Using Node.js executable: 'node'.
INFO: Resolving TSConfig files using 'tsconfig.base.json' from property sonar.typescript.tsconfigPaths
INFO: Found 1 TSConfig file(s): [/github/workspace/tsconfig.base.json]
INFO: Creating TypeScript program
INFO: TypeScript configuration file /github/workspace/tsconfig.base.json
INFO: 7427 source files to be analyzed
INFO: Creating TypeScript program (done) | time=9065ms
INFO: Starting analysis with current program
INFO: 1/7427 file analyzed, current file: /github/workspace/jest.config.ts
INFO: 98/7427 files analyzed, current file: /github/workspace/libs/......
...
INFO: Hit the cache for 0 out of 7427.
INFO: Miss the cache for 7427 out of 7427: ANALYSIS_MODE_INELIGIBLE [7427/7427].
...
DEBUG: File already analyzed: '/github/workspace/libs/domain/...'. Check your project configuration to avoid files being part of multiple projects.
Steps to reproduce
- Trigger a pull request in the GitHub repository.
- Observe the GitHub Actions workflow.
- Notice that the SonarCloud Scanner is analyzing all files instead of only the changed ones in the monorepo.
- Cache issues are observed during the process, with all files missing the cache.
- Despite setting only one TSConfig file as suggested in other topics, the “File already analyzed” warning persists.
Questions
- What does “Platform: UNSUPPORTED” mean in the logs?
- What is the cause of the “ANALYSIS_MODE_INELIGIBLE” message?
- Why is the cache always missed, even for minor changes like updating the
sonar-project.properties
file in the monorepo? - How can I resolve the “File already analyzed” warning in our monorepo, given that I’ve already tried the recommended solution of setting only one TSConfig file?
Potential workaround
Currently, I haven’t identified a workaround. Looking for insights from the community.