From 8b97323a7e46126bac48e2afee4d435f2a588da5 Mon Sep 17 00:00:00 2001 From: Charles-Henri de Boysson Date: Sat, 19 Sep 2026 12:56:07 -0400 Subject: [PATCH 1/3] chore(ci): add .codecov.yml to configure build counts and thresholds --- .codecov.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..1862958d --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,40 @@ +# Codecov configuration for python-zk/kazoo +# Reference: https://docs.codecov.com/docs/codecov-yaml + +codecov: + # Wait for all 21 test matrix jobs (7 Python versions x 3 ZooKeeper versions) + # to upload their coverage reports before calculating the final coverage status. + # NOTE: If the test matrix in .github/workflows/testing.yml changes (e.g. adding + # or removing Python or ZooKeeper versions), this number must be updated to match + # the new total: len(python-version) * len(zk-version). + after_n_builds: 21 + +coverage: + status: + # Project coverage measures overall repository coverage against the base branch. + project: + default: + # 'auto' uses the coverage percentage of the base commit as the target. + target: auto + # Allow up to a 1% decrease in overall coverage to account for minor + # fluctuations, refactoring, or platform-specific code. + threshold: 1% + # Mark status as informational so minor drops do not block or fail PR CI checks. + informational: true + + # Patch coverage measures test coverage specifically on the lines modified in the PR. + patch: + default: + # Require 80% coverage on new/changed lines rather than strict 100%, + # allowing for defensive error handling, deprecation warnings, or unreachable branches. + target: 80% + # Allow up to 5% variance below the target. + threshold: 5% + # Mark status as informational so uncovered edge-case branches do not fail PR CI checks. + informational: true + +comment: + layout: "diff, flags, files" + behavior: default + # Only post or update the PR comment once all builds are complete. + require_changes: false From 1e00aaac7119d93044e47c9d9b46c31c8e1827f9 Mon Sep 17 00:00:00 2001 From: Charles-Henri de Boysson Date: Sat, 19 Sep 2026 12:57:03 -0400 Subject: [PATCH 2/3] docs: add Codecov coverage badge to README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fa80ed89..779e18d3 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ Kazoo [![Kazoo Awesome Testing](https://github.com/python-zk/kazoo/actions/workflows/testing.yml/badge.svg?branch=master)](https://github.com/python-zk/kazoo/actions/workflows/testing.yml?query=branch%3Amaster) [![Latest Version](https://img.shields.io/pypi/v/kazoo.svg)](https://pypi.org/project/kazoo/) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) +[![codecov](https://codecov.io/gh/python-zk/kazoo/branch/master/graph/badge.svg)](https://codecov.io/gh/python-zk/kazoo) `kazoo` implements a higher level API to [Apache ZooKeeper](http://zookeeper.apache.org/) for Python clients. From b1dcb2deb8a48567ea3562f68e6967137341302f Mon Sep 17 00:00:00 2001 From: Charles-Henri de Boysson Date: Thu, 24 Sep 2026 15:35:54 -0500 Subject: [PATCH 3/3] chore(ci): cross-reference test matrix and codecov after_n_builds - Add note above testing.yml matrix to update codecov.after_n_builds when matrix changes. - Update .codecov.yml to 28 builds (7 Python versions x 4 ZooKeeper versions on master). --- .codecov.yml | 4 ++-- .github/workflows/testing.yml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 1862958d..5b1b06f5 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -2,12 +2,12 @@ # Reference: https://docs.codecov.com/docs/codecov-yaml codecov: - # Wait for all 21 test matrix jobs (7 Python versions x 3 ZooKeeper versions) + # Wait for all 28 test matrix jobs (7 Python versions x 4 ZooKeeper versions) # to upload their coverage reports before calculating the final coverage status. # NOTE: If the test matrix in .github/workflows/testing.yml changes (e.g. adding # or removing Python or ZooKeeper versions), this number must be updated to match # the new total: len(python-version) * len(zk-version). - after_n_builds: 21 + after_n_builds: 28 coverage: status: diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index cae7955e..ed19b8e3 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -48,6 +48,10 @@ jobs: strategy: fail-fast: false matrix: + # NOTE: If you add or remove Python versions or ZooKeeper versions from this + # matrix, you MUST update `codecov.after_n_builds` in .codecov.yml to match + # len(python-version) * len(zk-version) so Codecov waits for all matrix builds + # before evaluating coverage status checks. python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy-3.11-v7.3.21"] # Friendly note: If you change the minimum zk-version here, update it in # ensure-zookeeper-env.sh. Additionally, if you need to change the way that