Skip to content

Commit 692acf8

Browse files
committed
Normalize Codacy LCOV reports
1 parent 1dec31d commit 692acf8

2 files changed

Lines changed: 61 additions & 1 deletion

File tree

.agents/sow/done/SOW-0013-20260603-codacy-metrics-investigation.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Status: completed
66

7-
Sub-state: coverage workflow implemented; remote C build regression repaired locally and queued for remote revalidation after push.
7+
Sub-state: LCOV parser regression repaired locally; remote workflow validation is the post-push verification path.
88

99
## Requirements
1010

@@ -475,3 +475,61 @@ Artifact updates:
475475
- SOW lifecycle: reopened from `done/` to `current/` for this regression.
476476
- Specs/docs/skills: no protocol/API/operator behavior changes expected from
477477
this test portability fix.
478+
479+
## Regression - 2026-06-03 - Codacy LCOV Parser
480+
481+
What broke:
482+
483+
- After adding the `CODACY_API_TOKEN` GitHub Actions secret, rerun attempt 2 of
484+
GitHub Actions run `26877997132` passed report generation, artifact upload,
485+
and token verification.
486+
- The first real upload step, `Upload C coverage to Codacy`, failed.
487+
- Codacy reporter 14.1.3 logged `Could not parse report, unrecognized report
488+
format (tried: LCOV)` for `coverage/codacy/c-lcov.info`.
489+
490+
Evidence:
491+
492+
- Downloaded artifact `codacy-coverage-reports` from run `26877997132`.
493+
- C LCOV record-type scan showed only one non-basic extension type: `VER`.
494+
- Artifact contained four `VER:` checksum records, one per `SF:` source file.
495+
496+
Why previous validation missed it:
497+
498+
- Local validation proved `gcovr` could generate LCOV and paths were
499+
repository-relative, but did not prove Codacy's stricter LCOV parser accepted
500+
`gcovr` checksum extension records.
501+
502+
Repair plan:
503+
504+
- Strip `VER:` records in the existing LCOV normalization step.
505+
- Keep all basic LCOV coverage records and repository-relative `SF:` paths.
506+
- Re-run script lint, SOW audit, local coverage generation, and GitHub Actions
507+
Codacy Coverage.
508+
509+
Validation:
510+
511+
- `bash -n tests/generate-codacy-coverage.sh` passed.
512+
- `shellcheck --severity=error tests/generate-codacy-coverage.sh` passed.
513+
- `actionlint .github/workflows/codacy-coverage.yml` passed.
514+
- `git diff --check` passed.
515+
- `bash .agents/sow/audit.sh` passed with `SOW initialization complete and
516+
clean`.
517+
- `tests/generate-codacy-coverage.sh /tmp/plugin-ipc-codacy-coverage` passed
518+
end to end.
519+
- LCOV extension scan found no remaining `VER:` records in C or Rust reports.
520+
- C LCOV record-type scan found only standard LCOV records:
521+
`TN`, `SF`, `FN`, `FNDA`, `FNF`, `FNH`, `DA`, `LF`, `LH`, `BRDA`, `BRF`,
522+
and `BRH`.
523+
- Generated report path scan found no workstation absolute paths and no Go
524+
module-prefix paths.
525+
- Final C LCOV path sample remains repository-relative:
526+
`SF:src/libnetdata/netipc/src/protocol/netipc_protocol.c`.
527+
- GitHub Actions `Codacy Coverage` will run again after this repair is pushed.
528+
If the remote reporter rejects another report format issue, this SOW will be
529+
reopened again as a regression with the new evidence.
530+
531+
Artifact updates:
532+
533+
- SOW lifecycle: reopened from `done/` to `current/` for this parser
534+
regression, then completed and moved back to `done/` with the repair.
535+
- Specs/docs/skills: no protocol/API/operator behavior changes expected.

tests/generate-codacy-coverage.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ prefix = f"SF:{root}/"
7171
rewritten = []
7272
7373
for line in report.read_text(encoding="utf-8").splitlines():
74+
if line.startswith("VER:"):
75+
continue
7476
if line.startswith(prefix):
7577
line = "SF:" + line[len(prefix):]
7678
rewritten.append(line)

0 commit comments

Comments
 (0)