Replace Codecov with ReportGenerator coverage gate - #470
Merged
Conversation
Codecov was sold to Harness. Replace the upload with an in-repo approach using the ReportGenerator dotnet tool: a coverage summary in the workflow job summary, an HTML report uploaded as a build artifact, and a threshold check that fails the build when coverage regresses. Source-generated regex code is excluded from the report. It accounts for the entire gap between the raw 89.9% line coverage and the 100% of hand-written code, and Codecov never counted it either since those files do not exist in the commit. Also drop `secrets: inherit` from the calling workflows, since CODECOV_TOKEN was the only secret the build workflow used.
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.
Summary
Codecov was sold to Harness. This replaces the upload with a fully in-repo approach using the ReportGenerator dotnet tool — no third-party GitHub Actions involved:
MarkdownSummaryGithubreport type)minimumCoverageThresholdsfails the build when line or branch coverage falls below the floor.config/dotnet-tools.json, restored by the existinginstall-toolsaction, and already covered by Dependabot's nuget updatesdotnet-coverageglobal install and merge steps are gone — ReportGenerator reads all nine cobertura files directlycodecov.ymland the README badgesecrets: inheritfromCI.ymlandPR.yml, sinceCODECOV_TOKENwas the only secret the build workflow usedThresholds
Both line and branch coverage are gated at 95%, matching the target the old
codecov.ymlused. Current coverage is 100% line and 98.8% branch.Source-generated regex code is excluded via
-classfilters. It appears three times (once per TFM) and accounts for the entire gap between the raw 89.9% line coverage and the 100% of hand-written code. Codecov never counted it either — those files live under__artifacts/objand do not exist in the commit, which is what made a 95% target viable there.Notes
lineCoverage=95;branchCoverage=95throws a config-binder exception and still exits 0.!cancelled()guards on the summary and artifact steps still publish.pwshrather thancat >> "$GITHUB_STEP_SUMMARY"so it works on the windows-2025 leg of the PR matrix..config/**is inCI.yml'spaths-ignore, so Dependabot bumps of the tool will not trigger a CI build on main. They still run the full PR matrix, so the gate is exercised.