Repository navigation
fix(test): assert protobuf parity, not a version literal, in the reach check (#15981) - #15982
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe protobuf parity test now checks that the root and backend requirements files contain identical protobuf constraints. It no longer enforces a specific version. ChangesProtobuf parity validation
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to The protobuf check now permits synchronized dependency updates while continuing to reject mismatched root and backend constraints. The change is ready to merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
Closes #15981
Thinking Path
repo_tests/requirements_pin_parity_test.py:138was failing every protobuf bumpand holding up the dependabot queue — red on #15972 and #15977, and one of the
two failures on #15975 before it was closed.
The test's own docstring states its subject:
That is a reach check, and the line above it already performs it
(
assert "protobuf" in set(root) & set(backend)). The failing line additionallyasserted a hard-coded version literal, which is a claim about which version —
something neither this test nor #15070 (whose subject is divergence between two
files) is about.
The failure mode is the one this repo keeps finding: it reported a version
mismatch, so it read as the guard working correctly rather than as a reach
check over-specifying. Three dependabot PRs sat red without the cause being
obvious, and the literal would need hand-editing on every bump — an edit that
restores the test without restoring any property.
What Changed
One assertion, from a version literal to the parity the guard is actually about:
Deliberately not changed: the two literals in the test below it. Those look
identical in shape and are the opposite case.
test_the_rationale_matches_the_pinasserts
opentelemetry-proto == "==1.44.0"and the protobuf constrainttogether, on purpose: otel's pin determines which protobuf majors are admissible,
the two drifted apart historically (#10589 moved otel, #10678 raised protobuf the
next day, the note was updated neither time), and its failure message tells the
reader to re-read
Requires-Distand update both. That test is meant to fail ona bump. I nearly "fixed" it before reading its docstring.
So a protobuf bump still requires a human to revisit the otel rationale — which
is correct, and is why this change unblocks the reach check without making
protobuf bumps automatic.
Verification
repo_tests/requirements_pin_parity_test.py— 13 passed.:45-48(test_compute_divergence_flags_a_package_pinned_differently_in_each_file):differing pins are flagged, identical ones are not. No duplicate added.
:137is untouched, so the property this test existsfor is unchanged.
Model Used
Claude Opus 5 (1M context)
Summary by CodeRabbit
Single-issue rationale: this is a one-line change to a single assertion, currently blocking the dependabot queue on
python-suite shard 8/12(#15972, #15977, #15978). Batching it with any other issue would delay the unblock behind a larger review, and there is no same-scope issue open — the sibling literals in the same file are a deliberate tripwire that this PR explicitly does not touch.