Status: ✅ Done (2026-03-05)
Show analysis status of the HEAD commit in the repository and pull-request commands, and allow triggering reanalysis.
codacy repository <provider> <organization> <repository> --reanalyze
codacy pull-request <provider> <organization> <repository> <prNumber> --reanalyze
On success, show: "Reanalysis requested successfully, new results will be available in a few minutes." On failure, show: "Failed to request reanalysis: <error message>".
The "Last Analysis" row is replaced by "Analysis", showing the current analysis status of the HEAD commit:
- Reanalysis in progress (HEAD commit already analyzed, but currently being reanalyzed):
Analysis Finished 12h ago (c00e638) — Reanalysis in progress...
- First analysis (HEAD commit not yet analyzed):
Analysis In progress... (c00e638)
- Analysis finished, waiting for coverage (within 3h):
Analysis Finished 12h ago (c00e638) — Waiting for coverage reports...
- Analysis finished, coverage overdue (>3h):
Analysis Finished 12h ago (c00e638) — Missing coverage reports
- Normal finished state:
Analysis Finished 12h ago (c00e638)
"In progress..." and "Reanalysis in progress..." are colored light blue. "Missing coverage reports" is yellow.
Same "Analysis" row replaces the former "Head Commit" row, with the same status logic applied to the PR's HEAD commit.
- Being analyzed:
startedAnalysisis set AND (endedAnalysisis absent ORstartedAnalysis > endedAnalysis) - Coverage expected: determined by
listCoverageReports(limit=1).data.hasCoverageOverview - Coverage data present:
diffCoverage.value !== undefined OR deltaCoverage !== undefined(PR);coveragePercentage !== undefined(repo) - Wait threshold: 3 hours from
endedAnalysis
Implemented in formatAnalysisStatus() in src/utils/formatting.ts.
reanalyzeCommitById—RepositoryService.reanalyzeCommitById(provider, org, repo, { commitUuid: sha })getPullRequestCommitswithlimit=1— head commit timing for PRlistRepositoryCommitswithlimit=1— head commit timing for repolistCoverageReportswithlimit=1— checkhasCoverageOverview
- Update analysis status in the About section of the
repositorycommand - Update analysis status in the About section of the
pull-requestcommand - Add
--reanalyzeoption to therepositorycommand - Add
--reanalyzeoption to thepull-requestcommand - Update existing tests for the status sections
- Add tests for the new
--reanalyzeoption
src/utils/formatting.test.ts— 6 unit tests forformatAnalysisStatussrc/commands/repository.test.ts— 4 new tests (analysis status, reanalyze)src/commands/pull-request.test.ts— 3 new tests (analysis status, reanalyze)