Adding support for google/protobuf v4.x#13
Conversation
No duplicates 🥲. I have searched for a similar issue. What should be improved or cleaned up? Need to consider support for google/protobuf v4
📝 WalkthroughWalkthroughThe google/protobuf dependency constraint in composer.json was updated from "^3.7" to "^3.7 || ^4.0", enabling support for both protobuf 3.x and 4.x versions while maintaining backward compatibility. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@composer.json`:
- Line 42: The composer.json protobuf version constraint is too permissive
("google/protobuf": "^3.7 || ^4.0") and can conflict with roadrunner-api-dto;
update the constraint to "google/protobuf": "^3.22 || ^4.0" to match the
roadrunner-api-dto requirement, ensuring dependency resolution consistency—edit
the composer.json entry for the google/protobuf package accordingly.
| "spiral/roadrunner": "^2023.2 || ^2024.1 || ^2025.1", | ||
| "spiral/goridge": "^4.0", | ||
| "google/protobuf": "^3.7" | ||
| "google/protobuf": "^3.7 || ^4.0" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's check the composer.json file to see the actual state
cd /tmp && find . -name "composer.json" -type f 2>/dev/null | head -1Repository: roadrunner-php/services
Length of output: 49
🏁 Script executed:
# List files to understand repo structure
git ls-files | grep -E "composer\.(json|lock)" | head -5Repository: roadrunner-php/services
Length of output: 80
🏁 Script executed:
# Read the composer.json file
cat composer.jsonRepository: roadrunner-php/services
Length of output: 1978
🏁 Script executed:
# Check roadrunner-api-dto from Packagist
curl -s "https://packagist.org/packages/roadrunner-php/roadrunner-api-dto.json" | jq -r '.package | {latest_release: .releases | keys[0], versions: (.versions | keys | .[:5])}' 2>/dev/null || echo "Failed to fetch"Repository: roadrunner-php/services
Length of output: 82
🏁 Script executed:
# Get more details on roadrunner-api-dto latest version
curl -s "https://packagist.org/packages/roadrunner-php/roadrunner-api-dto.json" | jq -r '.package.versions | to_entries | sort_by(.key) | reverse | .[0] | {version: .key, require: .value.require}' 2>/dev/null || echo "Failed"Repository: roadrunner-php/services
Length of output: 170
Update protobuf constraint to match roadrunner-api-dto requirement.
The constraint should be "^3.22 || ^4.0" instead of "^3.7 || ^4.0". The roadrunner-api-dto dependency (v1.9.0 latest) requires google/protobuf: "^3.22 || ^4.0", which means protobuf versions 3.7–3.21 would satisfy your project's constraint but fail to satisfy the transitive dependency constraint. This creates a potential version resolution conflict.
Align the protobuf constraint with the transitive dependency requirement to prevent dependency resolution issues:
Suggested change
- "google/protobuf": "^3.7 || ^4.0"
+ "google/protobuf": "^3.22 || ^4.0"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "google/protobuf": "^3.7 || ^4.0" | |
| "google/protobuf": "^3.22 || ^4.0" |
🤖 Prompt for AI Agents
In `@composer.json` at line 42, The composer.json protobuf version constraint is
too permissive ("google/protobuf": "^3.7 || ^4.0") and can conflict with
roadrunner-api-dto; update the constraint to "google/protobuf": "^3.22 || ^4.0"
to match the roadrunner-api-dto requirement, ensuring dependency resolution
consistency—edit the composer.json entry for the google/protobuf package
accordingly.
No duplicates 🥲.
I have searched for a similar issue.
What should be improved or cleaned up?
Need to consider support for google/protobuf v4
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.