Repository navigation
Unify SDK coverage gates and add coverage badges - #161
Draft
Denis-Averin wants to merge 1 commit into
Draft
Denis-Averin wants to merge 1 commit into
Denis-Averin wants to merge 1 commit into
Conversation
Denis-Averin
force-pushed
the
unified-coverage
branch
10 times, most recently
from
November 10, 2026 12:41
a829aaa to
956e3bd
Compare
Add scripts/coverage.py, one line coverage gate for every SDK: it reads the native report of each SDK (LCOV, Cobertura, JaCoCo, Go cover profile), prints the percentage, applies COVERAGE_THRESHOLD (default 80) and writes a shields.io endpoint JSON and a summary JSON. scripts/publish-coverage.py commits those and the native report to aspose-barcode-cloud/test-coverage; each SDK runs it in a separate job on push to its default branch with a GitHub App token, so the SDK workflows keep permissions: contents: read. The generate scripts copy both files into every SDK, the README templates get a coverage badge read from test-coverage, and doc/test-coverage-requirements.md describes the make cover contract, the test-coverage layout and the one-time app setup. Submodules point to the unified-coverage branch of each SDK.
Denis-Averin
force-pushed
the
unified-coverage
branch
from
November 10, 2026 12:53
956e3bd to
af2181d
Compare
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.
Unifies the line coverage gate of all 8 SDKs (android stays exempt) and adds a coverage badge to every SDK README. Coverage results are collected in a separate public repository,
aspose-barcode-cloud/test-coverage; the SDK repositories are never written by CI.What changes
scripts/coverage.py: one gate for every SDK. It reads the native report of each SDK in one of four formats (LCOV: dart, node, swift; Cobertura: dotnet, python, php; JaCoCo XML: java; Go cover profile: go), printsLine coverage: NN.NN% (covered/total lines, threshold: 80%), appliesCOVERAGE_THRESHOLD(default 80) and writescoverage/coverage-badge.json(shields.io endpoint format) andcoverage/coverage-summary.json.mypy --strictandblackclean. Checked against real reports: Go matchesgo tool cover, PHP's Cobertura matches the old Clover-basedcoverage-check.php(2019/2400), Python matches pytest-cov, .NET matches coverlet, Node matches jest, Java uses the bundle LINE counter thatjacoco:checkuses.scripts/publish-coverage.py(Python, standard library only;mypy --strictandblackclean): clonestest-coverage, replaces<sdk>/with the badge JSON, asummary.json(percent, lines, SDK commit, run URL, date) and the native report, commits and pushes; starts over from the new tip when another SDK pushed at the same moment (3 attempts). Tested against a local bare repository: empty repository, second SDK, rejected push with retry, unreachable repository.Each SDK workflow runs with
permissions: contents: read. The job that runsmake coveruploads the result as an artifact and has no credentials; a separatepublish-coveragejob, on push to the default branch only and only while theCOVERAGE_APP_IDvariable exists, takes a short-lived token fromactions/create-github-app-token(limited totest-coverageandcontents: write) and runs the publish script.codegen/generate-*.bashcopy both scripts into every SDK (likecheck-badges.bash).README templates get the coverage badge, read from
test-coverage/main/<sdk>/coverage-badge.json(swift also gets a CI badge; it had none). Regenerating dart, dotnet, go, java, node and python leaves no diff in the submodules; for php and swift the README, scripts and workflow match (their source formatters were not available to regenerate the rest).doc/test-coverage-requirements.mddocuments themake covercontract, a per-SDK table, thetest-coveragelayout, the publish flow, the one-time GitHub App setup and Codecov as an alternative.Agents.mdmentionsmake cover.Scripts are run as
python: the workflows call it directly (it exists on the GitHububuntu-24.04andubuntu-26.04images), and the Makefiles andcoverage.shscripts usePYTHON ?= $(shell command -v python 2>/dev/null || echo python3)(or the samecommand -vfallback in shell), somake coveralso works on a stock Ubuntu 26.04 that only haspython3.SDK pull requests
One-time setup (organization admin)
aspose-barcode-cloud/test-coveragewith a README.test-coverageonly.COVERAGE_APP_IDand secretCOVERAGE_APP_PRIVATE_KEY(the.pem), both limited to the 8 SDK repositories.Full steps in
doc/test-coverage-requirements.md. Until this is done the publish job is skipped, so the order of merges does not matter for it.Merge order
unified-coveragebranches.test-coverageexists (the doc and the badges link to it).Coverage in CI on the SDK PRs
make coverwithTEST_CONFIGURATION_ACCESS_TOKEN, all SDK PRs green: dart 86.67%, dotnet 84.69%, go 91.05% (80.4% before the new offline tests), java 82.82% (printed for the first time), node 85.39%, php 84.17%, python 88.15% (3.12) / 87.96% (3.9), swift 94.63%. The only red check is node's "Try publish to NPM", which fails on every branch because 26.10.0 is already published.Without credentials (live tests fail): go 86.2% (was 42.1%), java 81.3%, php 84.1%, python 87.0%, dart 77.3%, node 75.9%, dotnet ~11.6%. dotnet, node and dart reach 80% only thanks to the live API tests.
Generated by Claude Code