Skip to content

Fix CI: suppress RepeatedField psalm errors, restore PHP 8.1 support#1966

Open
bobstrecansky wants to merge 1 commit into
open-telemetry:mainfrom
bobstrecansky:fix/ci-psalm-and-php81-support
Open

Fix CI: suppress RepeatedField psalm errors, restore PHP 8.1 support#1966
bobstrecansky wants to merge 1 commit into
open-telemetry:mainfrom
bobstrecansky:fix/ci-psalm-and-php81-support

Conversation

@bobstrecansky
Copy link
Copy Markdown
Contributor

Summary

  • Add Psalm UndefinedDocblockClass suppression for Google\Protobuf\Internal\RepeatedField (mirrors the existing UndefinedMethod suppression for the same class). Clears the 32 errors blocking PHP QA on 8.2 / 8.3 / 8.4.
  • Revert two renovate bumps that together broke composer install on PHP 8.1: pin phpspec/prophecy back to 1.22.* (1.23+ dropped PHP 8.1) and phpdocumentor/reflection-docblock back to ^5.3 (prophecy 1.22 conflicts with v6). Restores the project's declared "php": "^8.1" support.

Supersedes #1959 (same psalm fix) and reverts the install-breaking parts of #1915 and #1919.

Test plan

  • PHP QA workflow goes green on 8.1 / 8.2 / 8.3 / 8.4
    EOF

@bobstrecansky bobstrecansky requested a review from a team as a code owner May 20, 2026 12:35
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.78%. Comparing base (471b51d) to head (1558b6a).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1966      +/-   ##
============================================
+ Coverage     67.75%   67.78%   +0.02%     
  Complexity     3044     3044              
============================================
  Files           459      459              
  Lines          8883     8885       +2     
============================================
+ Hits           6019     6023       +4     
+ Misses         2864     2862       -2     
Flag Coverage Δ
8.1 67.53% <ø> (?)
8.2 67.72% <ø> (?)
8.3 67.74% <ø> (?)
8.4 67.74% <ø> (?)
8.5 67.70% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 471b51d...1558b6a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.
@bobstrecansky bobstrecansky force-pushed the fix/ci-psalm-and-php81-support branch from e055c99 to 1558b6a Compare May 20, 2026 12:51
Copy link
Copy Markdown
Contributor

@jerrytfleung jerrytfleung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants