Repository navigation
Fix coverage.findProfile path matching so perf-linter coverage gating actually applies - #52566
Merged
pelikhan merged 2 commits intoAug 13, 2026
Merged
Conversation
Co-authored-by: pelikhan <[email protected]>
Copilot
AI
changed the title
[WIP] Fix coverage path-matching bug for perf linter gates
Fix coverage.findProfile path matching so perf-linter coverage gating actually applies
Aug 13, 2026
pelikhan
marked this pull request as ready for review
August 13, 2026 19:12
pelikhan
deleted the
copilot/deep-report-fix-coverage-path-matching-bug
branch
August 13, 2026 19:12
Contributor
|
🎉 This pull request is included in a new release. Release: |
1 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
coverage.findProfile()matched on-disk absolute source paths against Go coverage profile keys (module-qualified paths likegithub.com/github/gh-aw/pkg/foo/foo.go) using a plain suffix check. This only succeeded when the checkout directory happened to sit under a path resembling the module's import path — never true on a standardgit cloneor GitHub Actions checkout (/home/runner/work/gh-aw/gh-aw/...).ShouldApplytherefore always fell through to its permissive nil-profile fallback, making the-hot-thresholdcoverage gate a silent no-op for all 14 gated perf linters.Changes
modulePrefix(), which reads the running binary's main module path viaruntime/debug.ReadBuildInfo().findProfilestrips this prefix from each profile key to derive its module-relative form and matches the on-disk path against that as well as the original raw key (kept for profiles built from a different module).TestFilenameMatchingActionsStyleAbsolutePath, which uses this repo's real module path against a realistic Actions-style absolute path (/home/runner/work/gh-aw/gh-aw/pkg/foo/foo.go) rather than constructing the on-disk path by literally concatenating the profile key, so it exercises the actual mismatch instead of matching by construction.