Add file fixes generation for code coverage uploads#2125
Add file fixes generation for code coverage uploads#2125CarlosNietoP merged 6 commits intomasterfrom
Conversation
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: c2beb00 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a54abc659d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
e7747c4 to
4be1df9
Compare
File fixes identifies non-executable lines (comments, blank lines, brackets, etc.) so the backend can exclude them from coverage calculations, reducing false negatives. This brings parity with Codecov's file fixes feature. Supported languages: Go, Kotlin, C/C++/Swift/ObjC, PHP. Key implementation details: - Uses git ls-files by default for fast tracked-file enumeration - Falls back to filesystem walk when --file-fixes-search-path is provided - Processes files concurrently with bounded parallelism (8 workers) - Encodes results as compact bitmaps (one bit per line) - Adds --disable-file-fixes and --file-fixes-search-path CLI flags - Includes debug-level timing log (visible with --verbose) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4be1df9 to
35c45af
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35c45af977
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Drarig29
left a comment
There was a problem hiding this comment.
LGTM, you'll need to fix the formatting to pass CI
Identifies non-executable lines (comments, blank lines, brackets, etc.) in tracked source files and uploads them alongside coverage reports so the backend can exclude them from coverage calculations.
What and why?
Code coverage reports sometimes flag non-executable lines (comments, blank lines, closing brackets, etc.) as "uncovered", creating false negatives. This PR adds file fixes — a bitmap per source file marking which lines are non-executable — so the backend can exclude them from coverage calculations.
How?
During
datadog-ci coverage upload, the CLI:git ls-files) and filters to supported languages (Go, Kotlin, C/C++, Swift, ObjC, PHP)file_fixes.json.gz) alongside the coverage reportFile discovery uses two strategies:
git ls-files): fast, respects.gitignore, only tracked files. Used when running inside a git repo without--file-fixes-search-path.--file-fixes-search-pathis provided. This is useful in monorepos to scope the scan to a specific subdirectory.Files are processed concurrently (8 async workers).
New CLI flags:
--disable-file-fixes— skip file fixes generation entirely--file-fixes-search-path— override the root directory used to scan source files (defaults to repo root). Triggers the filesystem walk instead ofgit ls-files.Review checklist