Revert "Fix getLabel() deprecation warning with Protobuf 4.33+"#1880
Conversation
…telemetry#1854)" This reverts commit b4b274d.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1880 +/- ##
============================================
+ Coverage 68.22% 68.33% +0.10%
Complexity 3009 3009
============================================
Files 449 449
Lines 8796 8798 +2
============================================
+ Hits 6001 6012 +11
+ Misses 2795 2786 -9
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 7 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
brettmc
left a comment
There was a problem hiding this comment.
It seems like getLabel will be removed in 5.34 (currently a release candicate), so we probably need an issue to implement a future fix that works with protobuf 4.x and 5.x ?
|
Any version with |
Three issues are currently failing PHP QA on main: 1. Psalm reports 32 UndefinedDocblockClass errors against Google\Protobuf\Internal\RepeatedField on every Otlp converter. google/protobuf 4.x deprecated the Internal class in favor of Google\Protobuf\RepeatedField; the legacy name is now a runtime class_alias that Psalm's static parser cannot see. Add an UndefinedDocblockClass suppression alongside the existing UndefinedMethod suppression for the same class. 2. The PHP 8.1 matrix job fails composer install because phpspec/prophecy 1.26 dropped PHP 8.1 in 1.23 and requires phpdocumentor/reflection-docblock ^6, which itself needs prophecy 1.26. Revert both renovate bumps (open-telemetry#1915, open-telemetry#1919) to the prior constraints so the project's declared "php": "^8.1" support holds. 3. With Psalm fixed, PHPStan now runs and reports an undefined method Google\Protobuf\FieldDescriptor::getLabel() in ProtobufSerializer::traverseDescriptor(). That branch is dead code under google/protobuf >= 4.31 (the serializeToJsonString path returns early via PrintOptions), but PHPStan cannot infer that. See open-telemetry#1880, which reverted the prior compile-time fix for the same reason. Suppress the warning scoped to the one file.
Reverts #1854 / resolves #1879.
The
::getLabel()method was deprecated in protobuf4.31,::traverseDescriptor()(which uses::getLabel()) won't be called with protobuf^4.31due to #1593. Related earlier PR that was closed for to the same reason: #1596