Repository navigation
Unify coverage gate and add coverage badge - #119
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
2 times, most recently
from
November 5, 2026 06:42
d18a458 to
9700f25
Compare
make cover now ends in scripts/coverage.py, shared by all SDKs and copied from the codegen repository: it prints the line coverage, applies COVERAGE_THRESHOLD (default 80) and writes coverage/coverage-badge.json and coverage/coverage-summary.json. The workflow runs with permissions: contents: read. The job that runs make cover uploads the result as an artifact, and a separate publish-coverage job, on push to the default branch only, commits it to aspose-barcode-cloud/test-coverage with a GitHub App token (scripts/publish-coverage.bash). The README coverage badge reads the JSON from that repository through shields.io.
Denis-Averin
force-pushed
the
unified-coverage
branch
from
November 5, 2026 07:03
9700f25 to
f9a2402
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.
Part of the unified coverage change across all Aspose.BarCode Cloud SDKs; the shared scripts and docs are in aspose-barcode-cloud/aspose-barcode-cloud-codegen (branch
unified-coverage, seedoc/test-coverage-requirements.mdthere).What changes
make coverends inscripts/coverage.py(copied from codegen, identical in every SDK): it printsLine coverage: NN.NN% (covered/total lines, threshold: 80%), appliesCOVERAGE_THRESHOLD(default 80) and writescoverage/coverage-badge.jsonandcoverage/coverage-summary.json.permissions: contents: readat the top level; CI never writes to this repository. The job that runsmake coveruploads the badge, the summary and the native report as a workflow artifact and has no credentials.publish-coveragejob runs only on push to the default branch, and only while the organization variableCOVERAGE_APP_IDexists; on pull requests and until the app is configured it is skipped. It downloads the artifact, takes a short-lived token foraspose-barcode-cloud/test-coveragefromactions/create-github-app-token(limited to that repository and tocontents: write) and runsscripts/publish-coverage.bash <sdk>, which commits<sdk>/coverage-badge.json,<sdk>/summary.jsonand the native report there. The token goes to git through the environment, not through the remote URL or argv.test-coverage/main/<sdk>/coverage-badge.json. The badge line also lives in the codegen README template, so regeneration keeps it (checked: regenerating from codegen leaves no diff here).Before the first publish
An organization admin creates the public
test-coveragerepository, a GitHub App with Contents: read and write installed only on that repository, the organization variableCOVERAGE_APP_IDand the secretCOVERAGE_APP_PRIVATE_KEY(both limited to the SDK repositories). Steps are indoc/test-coverage-requirements.mdin codegen. Merging before that is fine: the publish job is skipped and the badge shows an error until the first publish.SDK specifics
make coverwritescoverage/coverage.xml(+ HTML incoverage/html) and runsscripts/coverage.py cobertura;make testruns it..coveragercfail_under = 80stays.make coverno longer passes-Werror(theunittesttarget still does).Notes
TEST_CONFIGURATION_ACCESS_TOKENas before, and they pass on this PR.Generated by Claude Code