Commit graph

1586 commits

Author SHA1 Message Date
Protobuf Team Bot
7b091ee68e Auto-generate files after cl/970967137
Some checks failed
Tests / Bazel (push) Has been skipped
Auto-generate stale checked-in files / Refresh stale files (push) Failing after 0s
Tests / Apply Safe for Tests Label (push) Failing after 0s
Tests / Validate YAML (push) Has been skipped
Scorecard supply-chain security / Scorecard analysis (push) Failing after 4s
Tests / C++ (push) Has been skipped
Tests / Java (push) Has been skipped
Tests / Python (push) Has been skipped
Tests / Ruby (push) Has been skipped
Tests / PHP (push) Has been skipped
Tests / Remove safety tag (push) Failing after 0s
Tests / PHP Extension (push) Has been skipped
Tests / C# (push) Has been skipped
Tests / Objective-C (push) Has been skipped
Tests / Rust (push) Has been skipped
Tests / μpb (push) Has been skipped
Tests / hpb (push) Has been skipped
Tests / Staleness (push) Has been cancelled
Tests / All Blocking Tests (push) Has been cancelled
2026-08-26 03:24:01 +00:00
Protobuf Team Bot
67322442bd Auto-generate files after cl/970851165 2026-08-25 23:08:01 +00:00
Protobuf Team Bot
2d75af0868 Auto-generate files after cl/970750490 2026-08-25 20:36:15 +00:00
Protobuf Team Bot
80d472933a Auto-generate files after cl/966337187 2026-08-18 03:47:16 +00:00
Protobuf Team Bot
9ff0d2d197 Auto-generate files after cl/966266256 2026-08-18 00:27:25 +00:00
Protobuf Team Bot
dc693bc891 Auto-generate files after cl/966151323 2026-08-17 20:42:12 +00:00
Protobuf Team Bot
011fbe69e9 Auto-generate files after PR #28553 2026-08-12 19:45:18 +00:00
Tony Liao
692daead2a csharp: add support for custom json strings for enum values
PiperOrigin-RevId: 963493738
2026-08-12 09:35:57 -07:00
Protobuf Team Bot
c2cbda5b47 Auto-generate files after PR #28900 2026-08-12 16:08:15 +00:00
Protobuf Team Bot
f5fba07925 Auto-generate files after cl/963471731 2026-08-12 16:04:41 +00:00
Tony Liao
1b27892b8b Support custom JSON enum names in PHP
This CL adds support for the Edition 2026 custom JSON enum name feature (pb.enumvalue.json) in PHP Protobuf.

Note that we don't need extension caching similar to C++ or Java because our PHP code generator collects custom JSON names at protoc compile time and passes them to DescriptorPool::internalAddGeneratedFile(), populating EnumValueDescriptor and EnumDescriptor during descriptor registration.

Tested with PHP unit tests across pure-PHP and C-extension modes.

PiperOrigin-RevId: 963411589
2026-08-12 06:45:04 -07:00
Protobuf Team Bot
0939462046 Auto-generate files after cl/963394074 2026-08-12 13:14:09 +00:00
Tony Liao
e788b3ce3d Fix PHP update_reserved_words.sh formatting and CI idempotency test
Fix the GitHub Actions CI failure in
`UpdateReservedTest::testBashScriptIdempotency` introduced by PR #27456.

### Problem:

`update_reserved_words.sh` generated array formatting that differed from
the repository's checked-in files, causing the strict idempotency test
to fail:
1. Column padding used a single global max width across all columns
   instead of calculating padding per column.
2. Generated array line lengths in multiple files exceeded 80
   characters.
3. Proto test files had slight formatting differences compared to the
   script's one-liner output.

### Solution:

- `update_reserved_words.sh`:
  * Updated `format_columns()` to calculate padding per-column in pure
    Bash, matching standard C/C++ array alignment without requiring
    external tools.
  * Adjusted array column counts (`names.c` to 4, `php_generator.cc` to
    5, `GPBUtil.php` to 3) so lines stay strictly within 80 characters.
- `GPBUtil.php` & proto test files:
  * Synced formatting to match the updated script output byte-for-byte.

PiperOrigin-RevId: 963153840
2026-08-11 19:53:43 -07:00
Brent Shaffer
f0a3f38321 feat(php): script for updating php reserved words (#27456)
See https://github.com/googleapis/google-cloud-php/issues/9193

`protoc` is generating the invalid class name `Object` when it should be prefixed with `PB` to prevent a conflict with PHP reserved words. I've submitted a fix for this in #27475

This PR introduces the script `php/update_reserved_words.sh` which updates the library in the **8 different classfiles** which all have various ways this logic is defined. Hopefully this makes these things easier for us to maintain in the future.

**NOTE**: prefixing constants with PB has been unnecessary since PHP 7, so we can and should open those up to every word but `class` in the next major version. I've added a comment so we (hopefully) don't forget

```sh
$ bash php/update_reserved_words.sh
Updated src/google/protobuf/compiler/php/names.cc
Updated php/ext/google/protobuf/names.c
Updated src/google/protobuf/compiler/php/php_generator.cc
Updated php/tests/proto/test_reserved_message_lower.proto
Updated php/tests/proto/test_reserved_message_upper.proto
Updated php/tests/proto/test_reserved_enum_lower.proto
Updated php/tests/proto/test_reserved_enum_upper.proto
Updated php/tests/proto/test_reserved_enum_value_lower.proto
Updated php/tests/proto/test_reserved_enum_value_upper.proto
Updated php/tests/GeneratedClassTest.php
Updated php/src/Google/Protobuf/Internal/GPBUtil.php
```

Closes #27456

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/27456 from bshaffer:php-update-reserved-words 522d93f1c1
PiperOrigin-RevId: 962903274
2026-08-11 11:46:11 -07:00
Protobuf Team Bot
94c7e8ebc1 Auto-generate files after cl/960627263 2026-08-07 02:08:48 +00:00
Protobuf Team Bot
f23e709bcf Auto-generate files after cl/960555713 2026-08-06 23:32:03 +00:00
Protobuf Team Bot
de3eafeda5 Auto-generate files after cl/959880585 2026-08-05 21:59:29 +00:00
Protobuf Team Bot
f11e6f301a Auto-generate files after cl/959372170 2026-08-05 03:12:27 +00:00
Protobuf Team Bot
7c02abb54a Auto-generate files after cl/957163354 2026-07-31 16:00:30 +00:00
Protobuf Team Bot
8baed752ce Auto-generate files after cl/956632937 2026-07-30 18:29:41 +00:00
Protobuf Team Bot
a772068fea Auto-generate files after cl/956087593 2026-07-29 21:34:38 +00:00
Protobuf Team Bot
b97149ff4f Auto-generate files after cl/956061501 2026-07-29 20:50:21 +00:00
Protobuf Team Bot
60f509fa40 Auto-generate files after cl/955926792 2026-07-29 16:41:03 +00:00
Protobuf Team Bot
21bfc8ad38 Auto-generate files after cl/955347939 2026-07-28 18:04:47 +00:00
Protobuf Team Bot
6d7f56cbac Auto-generate files after cl/955260241 2026-07-28 15:19:20 +00:00
Protobuf Team Bot
6f2e31b2b8 Auto-generate files after cl/955047292 2026-07-28 06:26:07 +00:00
Protobuf Team Bot
232f2fbd50 Auto-generate files after cl/955022274 2026-07-28 05:21:33 +00:00
Protobuf Team Bot
545f3bafe4 Auto-generate files after cl/954919110 2026-07-28 00:36:08 +00:00
Protobuf Team Bot
b7491e2dc3 Auto-generate files after cl/953801430 2026-07-25 09:56:59 +00:00
Protobuf Team Bot
3094f87854 Auto-generate files after cl/953447806 2026-07-24 18:00:16 +00:00
Protobuf Team Bot
6d040c27a9 Fix memory safety issues in PHP Message object destruction.
PiperOrigin-RevId: 952812117
2026-07-23 09:52:52 -07:00
Protobuf Team Bot
8815f682d8 Auto-generate files after cl/952535247 2026-07-23 06:06:35 +00:00
Protobuf Team Bot
e9aa0183c7 Auto-generate files after cl/951099608 2026-07-20 23:07:13 +00:00
Protobuf Team Bot
bf735f2bba Auto-generate files after cl/950998569 2026-07-20 20:01:10 +00:00
Protobuf Team Bot
ed612a8b43 Remove total_bytes_limit from pure PHP CodedInputStream.
This limit has no public api to override to a different limit: it is only ever set to the 'default' of 32 MB but has actually just not applied at all in many cases.

If we 'fix the bug' by making it so this limit does apply, it would break any users who may be successfully parsing data arbitrarily larger than 32 MB with no issue today due to hitting a case where limit is consistently not applied. By contrast, removing this doesn't formally break any preexisting users, and realigns the behavior to match PHP-upb as well as the default behavior in all of our other supported runtimes.

Note that gRPC-PHP will also already enforce a 4mb limit by default before passing the data to Protobuf, so the only people who could be exposed to this topic either way would need to be either intentionally bumping up the gRPC limit or not using gRPC at all.

In general the need to have a limit within CodedInputStream is very weak in this case compared to other languages: since PHP only parses off of a string and not a stream, it trivial for application code to apply a limit with an if before the parse starts.

PiperOrigin-RevId: 950914431
2026-07-20 10:24:15 -07:00
Protobuf Team Bot
b472eb92ff Auto-generate files after cl/949697167 2026-07-17 19:26:48 +00:00
Protobuf Team Bot
6d5557a46f Auto-generate files after cl/949190424 2026-07-16 22:07:39 +00:00
Protobuf Team Bot
79756f62ab Auto-generate files after cl/949108864 2026-07-16 19:36:32 +00:00
Protobuf Team Bot
917911a3bb Auto-generate files after cl/948707011 2026-07-16 03:54:03 +00:00
Rachel Goldfinger
7c77f295c7 Fix memory leaks in PHP Protobuf C extension.
PiperOrigin-RevId: 948499805
2026-07-15 13:02:21 -07:00
Protobuf Team Bot
9c3a5143de Auto-generate files after cl/948094363 2026-07-15 05:08:57 +00:00
Protobuf Team Bot
3bc006d2c1 Auto-generate files after cl/947760935 2026-07-14 17:31:32 +00:00
Protobuf Team Bot
44a1a0bbc3 Auto-generate files after PR #28231 2026-07-14 05:43:50 +00:00
Protobuf Team Bot
255635a7fa Auto-generate files after cl/947129093 2026-07-13 18:03:08 +00:00
Protobuf Team Bot
774721742b Auto-generate files after cl/947071987 2026-07-13 16:16:12 +00:00
Protobuf Team Bot
bba54ac9ba Fix type confusion in PHP protobuf extension when message initializer array has integer keys
`'0'` as a key is automatically converted to `0`, so we need to explicitly stringify the keys back to handle that case correctly.

Original issue report from adalogics

PiperOrigin-RevId: 947066825
2026-07-13 08:54:59 -07:00
Protobuf Team Bot
cb2c93944e Auto-generate files after cl/945959296 2026-07-11 00:09:26 +00:00
rgoldfinger6
4b269eb436 Updating version.json and repo version numbers to: 37.0-dev (#28425)
NOTE: This should be reviewed and imported via Copybara per the normal PR review process.

Closes #28425

PiperOrigin-RevId: 945675238
2026-07-10 06:22:59 -07:00
Protobuf Team Bot
e22cabffa4 Auto-generate files after cl/945282190 2026-07-09 20:35:22 +00:00
Protobuf Team Bot
1eb5913459 Auto-generate files after cl/944789082 2026-07-09 00:33:26 +00:00