Repository navigation
Conversation
This branch has not been deployed
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.
Add
upload_coverage_filesfor uploading coverage reports from diskWho this helps
Anyone uploading coverage from CI. Today every caller has to read each report file, pick a unique relative name, build
UploadedReportobjects, and pass the commit SHA by hand (the README example usesTESTED_SHA). This adds one call that does that for them on bothProoflineClientandAsyncProoflineClient.What changed
proofline/coverage.py(new):coverage_request(paths, *, tested_sha=None, root=None)builds aCoverageUploadRequestfrom files.proofline/client.py:upload_coverage_fileson both clients. It builds the request, then calls the existingupload_coverage_reports, so transport, retries and error handling are unchanged.README.md: short example under "Coverage uploads".tests/test_coverage_files.py(new): 13 tests.Decisions
tested_shadefaults toGITHUB_SHA. The API accepts a merge commit for a PR head, which is whatGITHUB_SHAis onpull_requestevents, so the default works in GitHub Actions. An explicittested_shaalways wins.ValueErrorbefore any request, instead of a server refusal after uploading up to 64 MiB.root(default: cwd), with forward slashes. Matches the API'sweb/lcov.infoexample and gives the same names on Windows and Linux. Files outsiderootand duplicate names raiseValueError. I preferred failing loudly over guessing a name like the basename, which would collide in monorepos.TypeError, since iterating it would silently treat each character as a path.asyncio.to_thread) so it doesn't block the event loop.upload_coverage_reports, and retry behavior.How I verified it
GITHUB_SHAdefault and override, each error case, and a request through the test server for both sync and async clients (checking path and exact JSON body). They also check that invalid input sends no request.tests/test_http.pyandtests/test_release_version.pypass (102 total with the new tests).ruff check,ruff format --checkandmypyare clean.scripts/check.pyandtests/test_generated_operation.py(they need the pinned generator toolchain), and no real upload against the live API since I had no token.