ci: add python-core-coverage gate for band-sdk-core-core - #636
AlexanderZ-Band wants to merge 17 commits into
Conversation
Resolves the pinned band-sdk-core version from this repo's own
dependency lock, checks that exact band-sdk-core-core-v{version} tag
out as a sibling, and runs its coverage-python-consumer recipe against
this repo's real test suite -- so a PR here fails if it stops
exercising a material part of the shared Rust core, not just this
SDK's own coverage.py numbers.
Companion PR: band-ai/band-sdk-core#71.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TmtjU5tgPv9Y6bd238JSBL
The path-filtered pull_request trigger correctly doesn't fire on a PR that only touches this workflow file itself, so there was no way to run it on demand to verify the cross-repo checkout/tag-resolution steps under real GitHub Actions before merging. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TmtjU5tgPv9Y6bd238JSBL
Temporary -- exists only to fire the path-filtered pull_request event so the new coverage workflow gets one real GitHub Actions run before merge. Removed in a follow-up commit once confirmed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TmtjU5tgPv9Y6bd238JSBL
The default GITHUB_TOKEN is scoped to this repo only, so the sibling checkout of band-ai/band-sdk-core (private) 404'd on a real run. Mirrors release.yml's existing add-band cross-repo checkout: a create-github-app-token step scoped to just this one repository. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TmtjU5tgPv9Y6bd238JSBL
Confirmed via a real run: the workflow's own logic (checkout, version resolution, App-token generation) all succeed. The remaining failure is that the shared GitHub App isn't installed on band-sdk-core yet -- an org-admin action, not something this branch can fix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TmtjU5tgPv9Y6bd238JSBL
|
Ran this workflow for real on GitHub Actions. Its own logic (checkout, ``` The shared GitHub App behind `APP_CLIENT_ID`/`APP_PRIVATE_KEY` (same one `release.yml` uses for the `add-band` checkout) isn't installed on `band-sdk-core`. Needs an org admin: GitHub org Settings → GitHub Apps → that app → Configure → Repository access → add `band-sdk-core`. No workflow changes needed after that — full details on INT-1304. |
AlexanderZ-Band
left a comment
There was a problem hiding this comment.
Automated review (my-code-review): 6 findings — 4 issue, 1 nit, 1 suggestion. See inline comments. (Submitted as COMMENT, not REQUEST_CHANGES: GitHub blocks requesting changes on one's own PR.)
- Reject a pre-release band-sdk-core pin (e.g. a .devN version) before attempting the cross-repo checkout, with a clear message -- dev pre-releases publish to PyPI but are never tagged in git, so the checkout would otherwise fail on a nonexistent ref with a generic git error. - Add tests/test_python_core_coverage_workflow.py asserting the pin step's shape, the checkout ref interpolation, the pre-release guard, and step ordering (mirrors tests/docker/test_kit_publish_workflow.py's existing yaml.BaseLoader pattern). - Add an else branch to the coverage-summary step so a failure before summary.txt exists leaves a diagnostic line in the job summary instead of silently producing nothing. - Extract the duplicated git-HTTPS-auth line into a small composite action (.github/actions/git-https-auth), and set REPORT_DIR once at job level instead of repeating the report path four times. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TmtjU5tgPv9Y6bd238JSBL
AlexanderZ-Band
left a comment
There was a problem hiding this comment.
Cycle 2 of /my-code-review (fixed-criteria pass, second cycle after cycle-1's 6 fixes). 8 new findings: 1 real bug (E, graceful-degradation break when the checkout is skipped), 1 test-quality gap (D), 1 runtime-safety defense-in-depth note (C), 3 style/hygiene (A), 2 design/reuse (B). Logical Bugs (F) re-verified guard polarity, the injection surface, and multi-line -c argument passing empirically and found nothing further. (Submitted as COMMENT, not REQUEST_CHANGES: GitHub blocks requesting changes on one's own PR.)
- Guard "Write coverage summary" against a missing band-sdk-core/ checkout: drop its working-directory (which fails the step outright when absent) and reference the path directly, so the graceful fallback message still reaches the job summary instead of erroring. - Pass the resolved version to the pre-release guard via the environment instead of bash-splicing it into the embedded Python three times, removing the (currently unreachable, but unenforced) literal-injection surface. - Hoist the "band-sdk-core-core-v" tag prefix into a job-level env var, single-sourced between the guard's error message and the checkout ref. - Declare packaging as an explicit dev dependency (was only present transitively) since the guard depends on it directly. - Extend the workflow's structural tests: execute the real guard script via subprocess against stable/dev version strings instead of only checking for substrings, and cover the new env-var single sources of truth and the working-directory fix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TmtjU5tgPv9Y6bd238JSBL
Summary
Adds a CI gate proving this repo's real test suite exercises at least 80% of
band-sdk-core-core's lines through the PyO3 binding — separate from this SDK's owncoverage.pynumbers, fromband-sdk-core's own Rust-only floor, and from TypeScript/wasm coverage..github/workflows/python-core-coverage.yml: checks out this repo,uv sync's it, resolves the pinnedband-sdk-coreversion viaimportlib.metadata, checks that exactband-sdk-core-core-v{version}tag out as a sibling (never silently tests againstband-sdk-core'smain, which is already ahead), and runsjust coverage-python-consumer ../band-sdk-pythonfrom there. Uploads the LCOV/HTML/summary artifact and writes a per-module job summary.maintouchingsrc/**,tests/**,pyproject.toml, oruv.lock, plusmerge_group— same shape as this repo's existingci.yml.Baseline
84.75% lines, measured against a real checkout at
b060ba19(5593 tests passed, 610 skipped). Full per-module breakdown and theclassify_close/classify_upgradefinding are on INT-1304.No ratchet: all six Python-adoption tickets (INT-1236, INT-1245, INT-1300, INT-1301, INT-1302, INT-1303) are Done and tested, so 80% is achievable today.
Follow-up (repo admin, out of scope here)
Whether this becomes a required status check is a branch-protection setting, not something this PR can set — flagging for whoever owns
main's protection rules once this has run green a few times.Test plan
coverage-python-consumerdirectly: local dry run against a real band-sdk-python worktree returns 84.75% lines and passes the gate;--fail-under-lines 99against the same data returns a non-zero exit, confirming the gate is load-bearing.Companion PR: band-ai/band-sdk-core#71.
Closes INT-1304.
🤖 Generated with Claude Code
https://claude.ai/code/session_01TmtjU5tgPv9Y6bd238JSBL