Commit Graph

1315 Commits (main)

Author SHA1 Message Date
Protobuf Team Bot 5dfdd85d34 Auto-generate files after cl/634787159 2024-05-17 15:56:35 +00:00
Joshua Haberman 6a2e4be010 Added C# unit tests verifying current UTF-8 behavior.
PiperOrigin-RevId: 634029739
2024-05-15 11:58:42 -07:00
Jaap Taal 91b7cf3325 Fix indention formatter for google.protobuf.Any (#16785)
`google.protobuf.Any` formatting with indentation was somewhat off.

Formatting an `Any` as root object:
```json
{"@type": "type.googleapis.com/protobuf_unittest3.ForeignMessage",
"c": 1
}
```
changes to
```json
{
  "@type": "type.googleapis.com/protobuf_unittest3.ForeignMessage",
  "c": 1
}
```

For messages were `Any` is in a nested field the change makes more of a visual impact.
The `c` field seems to be at the same level as the `anyField`, but it's nested so it should be indented:
```json
{
  "anyField": {"@type": "type.googleapis.com/protobuf_unittest3.ForeignMessage",
  "c": 1
  }
}
```
changes to:
```json
{
  "anyField": {
    "@type": "type.googleapis.com/protobuf_unittest3.ForeignMessage",
    "c": 1
  }
}
```

Closes #16785

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/16785 from q42jaap:main 72deed6ed7
PiperOrigin-RevId: 632506226
2024-05-10 08:46:04 -07:00
Protobuf Team Bot 2f6e705595 Auto-generate files after cl/630517509 2024-05-03 22:57:16 +00:00
Protobuf Team Bot 047fc7673e Introduce `MessageDescriptor.IsMapType` in C# reflection to make it easier to tell whether a given message was generated by protoc for a map field.
PiperOrigin-RevId: 628087118
2024-04-25 08:41:44 -07:00
Protobuf Team Bot b50ff60967 C#: Fix discovery of oneof declarations in descriptor protos.
PiperOrigin-RevId: 627384633
2024-04-23 07:47:25 -07:00
Protobuf Team Bot 2be4364e4c C#: Remove TODO, replacing it with an explanation.
PiperOrigin-RevId: 626125905
2024-04-18 13:12:02 -07:00
Mike Kruskal 95877d8569 Updating version.json and repo version numbers to: 28-dev (#16555)
Closes #16555

PiperOrigin-RevId: 626081638
2024-04-18 10:47:14 -07:00
Protobuf Team Bot 6afdd5a135 Auto-generate files after cl/625815212 2024-04-17 22:09:39 +00:00
Mike Kruskal e5502c746e Removed merged features from the edition defaults IR.
All of this information is still available by merging fixed_features and overridable_features.  This new split will make validation easier for runtimes that need to do dynamic builds.

PiperOrigin-RevId: 625815212
2024-04-17 14:58:17 -07:00
Protobuf Team Bot 5365930ef4 Auto-generate files after cl/625771423 2024-04-17 19:50:23 +00:00
Protobuf Team Bot f46a00f278 Auto-generate files after cl/625392504 2024-04-16 18:25:21 +00:00
Mike Kruskal ea81024ddf Refactor editions infrastructure to a top-level directory.
The only public target here is the edition defaults helper macro, which can be used by external runtimes and plugins.  None of this code is C++-specific though, and should be organized higher up.  Appropriate aliases are also placed at the top level for public targets

PiperOrigin-RevId: 625392504
2024-04-16 11:13:19 -07:00
Protobuf Team Bot a5be8bdb9f Auto-generate files after cl/625084569 2024-04-15 21:45:12 +00:00
Protobuf Team Bot fd19d7439c Auto-generate files after cl/623690798 2024-04-11 03:44:58 +00:00
Protobuf Team Bot 22c1178fc8 Auto-generate files after cl/623630219 2024-04-10 23:08:02 +00:00
Protobuf Team Bot 2322a8720f Auto-generate files after cl/623529512 2024-04-10 17:23:17 +00:00
Protobuf Team Bot 5422e9be37 Auto-generate files after cl/622859234 2024-04-08 16:11:29 +00:00
Mike Kruskal 69d1dacf74 Add delimited field binary/json conformance tests.
These are already supported, but this will lock down that there's no issues like the ones we hit with text-format.

This also fixes an unrelated bug in our BinaryToJsonString algorithm related to unknown group handling.   We still can't actually test binary->JSON in conformance tests for extensions due to TypeResolver's lack of support though.

PiperOrigin-RevId: 622360970
2024-04-05 21:07:15 -07:00
Protobuf Team Bot 7dc243c70a Auto-generate files after cl/622211473 2024-04-05 17:23:30 +00:00
Mike Kruskal 8ab39ed6f8 Add editions-specific conformance tests
For now, these are limited to tests of text-form for delimited fields that locks down our problematic behavior in editions.  Follow up changes will adjust the behavior to behave better under editions.

PiperOrigin-RevId: 622211473
2024-04-05 10:12:09 -07:00
Protobuf Team Bot 85edb7e783 Auto-generate files after cl/621365246 2024-04-03 02:43:54 +00:00
Protobuf Team Bot c49b0ace36 Auto-generate files after cl/621354397 2024-04-03 01:38:22 +00:00
Protobuf Team Bot 3a2cd26c13 Auto-generate files after cl/621236613 2024-04-02 18:26:50 +00:00
Protobuf Team Bot 132168069d Auto-generate files after cl/621041035 2024-04-02 04:15:43 +00:00
Protobuf Team Bot 83ec410d30 Internal change
PiperOrigin-RevId: 619377672
2024-03-27 05:50:55 -07:00
Protobuf Team Bot 1f1e64f804 Auto-generate files after cl/619266468 2024-03-26 19:12:43 +00:00
Protobuf Team Bot 68e6e3e8ee C#: Optimize JSON parsing in JsonTokenizer
PiperOrigin-RevId: 618097513
2024-03-22 01:31:27 -07:00
Protobuf Team Bot 19a47f3d93 Auto-generate files after cl/617933544 2024-03-21 20:02:44 +00:00
Mike Kruskal 0e167e796f Disallow all feature types except enum and boolean.
Features are designed as temporary migration tools, and any unbounded type leaves the system open to unexpected use.  Features should have a fixed set of values, with well defined behaviors.

PiperOrigin-RevId: 617933544
2024-03-21 12:51:15 -07:00
Protobuf Team Bot e6684ac037 C#: Avoid string concatenation when looking up enum values by name.
PiperOrigin-RevId: 616745400
2024-03-18 01:24:05 -07:00
Protobuf Team Bot 7ef5207d81 Auto-generate files after cl/616324144 2024-03-16 04:13:05 +00:00
Trayan Zapryanov fac929d9aa Cache StringBuilder instances in the .NET JsonTextTokenizer.
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/15794 from TrayanZapryanov:cache_stringbuilder 596147e6f1
PiperOrigin-RevId: 613251480
2024-03-06 09:57:37 -08:00
Protobuf Team Bot f7317e02e6 Refactor C# FieldDescriptor.FieldType for consistency.
PiperOrigin-RevId: 612337931
2024-03-04 00:13:30 -08:00
Protobuf Team Bot b6c0c30633 Auto-generate files after cl/611246775 2024-02-28 23:34:14 +00:00
Protobuf Team Bot 450022de99 Runtime support for Protobuf Editions in C#.
PiperOrigin-RevId: 611246775
2024-02-28 15:22:53 -08:00
Jaap Taal 72e0be1031 [csharp] Fix indentation for MapField with nested Messages (#15836)
WriteDictionary does not pass indentationLevel downwards to WriteValue. The existing test for `MapField` only tests `MapField<string, string>`, which isn't affected by the issue.
Tests are added for this issue.

Note: I also added `WriteValueWithIndentation_MapWithEmptyNested` to ensure this change would break things, but I doubt if it's necessary. Let me know whether to remove it.

Closes #15836

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/15836 from q42jaap:main 2b9399ba0c
PiperOrigin-RevId: 607000434
2024-02-14 08:53:44 -08:00
Protobuf Team Bot 6efaf1db54 Auto-generate files after cl/606786933 2024-02-14 00:52:33 +00:00
aiuto 3ab1276bbb Update Bazel references to rules_pkg to the supported file locations. (#15780)
WIP:  I want to see this pass CI first.

Fixes: #15779

3 scripted transforms:
```
  -load("@rules_pkg//:mappings.bzl", ...)
  +load("@rules_pkg//pkg:mappings.bzl", ...)
```
```
  -load("@rules_pkg//:pkg.bzl", "pkg_tar")
  +load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
```
```
  -load("@rules_pkg//:pkg.bzl", "pkg_zip")
  +load("@rules_pkg//pkg:zip.bzl", "pkg_zip")
```

Closes #15780

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/15780 from aiuto:rules_pkg a630276341
PiperOrigin-RevId: 606641398
2024-02-13 09:08:42 -08:00
Protobuf Team Bot 55e50ba406 C#: Ignore invalid enum string values in JSON, when invalid fields are being ignored.
PiperOrigin-RevId: 605310357
2024-02-08 07:30:41 -08:00
Protobuf Team Bot 4767a309d3 Auto-generate files after cl/605097398 2024-02-07 22:34:29 +00:00
Protobuf Team Bot 41732e8fee Auto-generate files after cl/604457261 2024-02-06 00:03:58 +00:00
Chris Kennelly 34a04c1fd5 Remove lazy=true from repeated fields.
This is currently a no-op in protoc.

PiperOrigin-RevId: 604457261
2024-02-05 15:53:12 -08:00
Anton Grbin a5e10aff2b [C#] Conformance test: don't skip JsonIgnoreUnknownParsingTest in runner (#15369)
# Motivation

https://github.com/protocolbuffers/protobuf/issues/7392#issuecomment-1884666885

This is for completeness - I am not blocked by this change in any way, so feel free to close the PR or treat is a low priority.

# Changes

Implement JsonIgnoreUnknownParsingTest in C# conformance test runner.

# Tested

Locally with:

```
bazel test //csharp:conformance_test \
    --action_env=DOTNET_CLI_TELEMETRY_OPTOUT=1 --test_env=DOTNET_CLI_HOME=~ \
    --action_env=DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
```

Closes #15369

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/15369 from noom:issue-7392/show-csharp-failures 3a652202a0
PiperOrigin-RevId: 602537927
2024-01-29 16:48:18 -08:00
Dennis Shao 9146ce6ddb Updating version.json and repo version numbers to: 27-dev (#15590)
Closes #15590

PiperOrigin-RevId: 601468713
2024-01-25 09:18:51 -08:00
Austin Wise 48c80e46bb Fix setting of environmental variables in build_release.sh
PiperOrigin-RevId: 601316979
2024-01-24 20:17:10 -08:00
Protobuf Team Bot 3d79d0374b Auto-generate files after cl/599369761 2024-01-18 04:31:54 +00:00
Protobuf Team Bot 27af4c802f Auto-generate files after cl/599220883 2024-01-17 18:51:46 +00:00
Protobuf Team Bot 41c8f2a5c6 Auto-generate files after cl/597378801 2024-01-11 00:10:17 +00:00
Protobuf Team Bot 55260d8321 Auto-generate files after cl/596018472 2024-01-05 18:01:42 +00:00