googleapis / googleapis/gapic-generator-php
Protobuf Upgrade to 25.2 has broken V1 GAPIC Generator
- Dominant language
- PHP
- Stars
- 14
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
cl/603226138 has broken the GAPIC generation in the V1 clients (see https://github.com/googleapis/google-cloud-php/pull/7023). Some of the changes that look wrong are:
- All RPC method arguments have been removed
- All sample arguments have been removed
- All setters used in tests have been removed
- References to resource name helpers have been removed in comments
This may be due to changes in the way the GAPIC generator locates `google.api.field_behavior`, which is done in [`FieldDetails::determineIsRequired`](https://github.com/googleapis/gapic-generator-php/blob/277c7036edbcd245fc38cd3a97a761807af05188/src/Generation/FieldDetails.php#L217), and is read by `ProtoHelpers::getCustomOptionRaw`:
https://github.com/googleapis/gapic-generator-php/blob/277c7036edbcd245fc38cd3a97a761807af05188/src/Utils/ProtoHelpers.php#L351-L384
**Note**: There may be a way to [get options from UPB](https://github.com/protocolbuffers/protobuf/issues/3065). However, the APIs would need to be implemented for both the pure-PHP and upb backends. The upb library itself supports it, but there is currently no glue.
**UPDATE**: We've been able to duplicate the error (which seems to be affecting all "repeated" custom options) by updating the `protoc` binary to `25.2` and running the following test:
```sh
vendor/bin/phpunit tests/Unit/Utils/ --filter testProtoCustomOptions
```
**UPDATE 2** - If we add `[packed = false]` to the custom option, the previous custom option logic works as expected.
Contributor guide
Assessment
This issue has not been assessed yet.