Repository navigation
Conversation
The protobuf modules existed only as a side effect of `hatch build`, so CI had to build every package on every Python version to obtain them and a new contributor had to know to run a build before the tests would import. Build hooks belong to artifact construction; test inputs do not come from them. Generation moves into hatch_build_protoc.py, which `poe generate-protos` runs as the first step of `test`, `test-cov` and `mypy`. The build hook (hatch_build.py) calls the same module so a checkout still builds from the submodule pin, and only ships what it generated. hatch-protobuf is dropped: the protoc invocation is now defined once, in Python, and the mypy plugins resolve against the running interpreter rather than an activated PATH. Output is byte-identical to what hatch-protobuf produced. Signed-off-by: Simon Schrottner <simon.schrottner@flagsmith.com>
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Protobuf generation and build artifacts providers/openfeature-provider-flagd/hatch_build_protoc.py, providers/openfeature-provider-flagd/hatch_build.py |
The provider generates Python, gRPC, and mypy protobuf modules. The Hatch hook registers generated paths as build artifacts. |
Task and build configuration providers/openfeature-provider-flagd/pyproject.toml, .github/workflows/build.yml |
The provider adds generation dependencies and a generate-protos task. Tests, coverage, and mypy run generation first. The workflow no longer runs uv build before validation. |
Contributor test workflow CONTRIBUTING.md |
Testing instructions now use poe test and remove the initial hatch build requirement. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Other · Severity of issue fixed: Medium
Sequence Diagram(s)
sequenceDiagram
participant PoeTask
participant ProtobufGenerator
participant Protoc
PoeTask->>ProtobufGenerator: run generate-protos
ProtobufGenerator->>Protoc: generate Python, gRPC, and mypy modules
Protoc-->>ProtobufGenerator: return generated outputs
ProtobufGenerator-->>PoeTask: continue test or mypy task
Suggested reviewers: gruebel
🚥 Pre-merge checks | ✅ 5
-
✅ Passed checks (5 passed)
-
Check name Status Explanation Title check ✅ Passed The title clearly and concisely describes the main change: moving flagd protobuf generation from the build hook into a task. Description check ✅ Passed The description accurately explains the protobuf generation changes, related build-hook reuse, CI updates, contributor guidance, and validation results. Linked Issues check ✅ Passed The changes satisfy the coding requirements in issue #446.hatch_build_protoc.pyprovides reusable generation. Thegenerate-protostask runs beforetest,test-cov, andmypy. The Hatch build …Out of Scope Changes check ✅ Passed The reported changes stay within issue #446. They modify protobuf generation, build-hook packaging, CI build steps, dependencies, contributor instructions, and related test-task ordering. These change…Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (2 skipped: 2 u…
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #447 +/- ##
==========================================
+ Coverage 95.45% 96.10% +0.65%
==========================================
Files 24 47 +23
Lines 1077 1798 +721
==========================================
+ Hits 1028 1728 +700
- Misses 49 70 +21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closes #446.
Protoc moves out of the build hook into
hatch_build_protoc.py, whichpoe generate-protosruns as the first step oftest,test-covandmypy. The build hook calls the same module, so a checkout still builds from the submodule pin and ships only what it generated. Same split the flagd testkit already uses.hatch-protobufis dropped: the protoc invocation is defined once, and the mypy plugins now resolve against the running interpreter instead of an activatedPATH. CI no longer runsuv buildfor every package on every Python version.CONTRIBUTING.mddrops the stalehatch build/hatch testinstructions.hatch-protobufpoe mypypoe testuv builduv.lockalso carries an unrelatedexceptiongroupmarker collapse from re-locking with uv 0.11.6.