Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Gradle, CLI options to load exhaustively #3254

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

damianw
Copy link
Contributor

@damianw damianw commented Jan 21, 2025

This PR adds a flag to the CLI and setting to the Gradle plugin to enable the loadExhaustively option.

It's currently not possible to correctly implement certain custom schema handlers without this option. In our case, we are using the Google API HTTP options, which introduce options that can refer to fields by nested path (e.g. field1.nestedField.anotherField). By default, Wire may not link fields referenced by such options.

An ideal solution might be some kind of API to tell Wire about additional types/fields/etc that need to be linked, but I don't know how possible that is. In the meantime, exposing this option unblocks implementing schema handlers that use options in this way.

Another use-case can be seen in #2748.

@damianw damianw marked this pull request as ready for review January 21, 2025 19:23
Copy link
Member

@oldergod oldergod left a comment

Choose a reason for hiding this comment

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

LGTM but needs one test

@damianw damianw requested a review from oldergod January 21, 2025 22:09
@oldergod oldergod merged commit 2b59490 into square:master Jan 23, 2025
11 checks passed
svc-squareup-copybara pushed a commit to cashapp/misk that referenced this pull request Feb 17, 2025
| Package | Type | Package file | Manager | Update | Change |
|---|---|---|---|---|---|
| org.flywaydb.flyway | plugin | misk/gradle/libs.versions.toml | gradle
| patch | `11.3.1` -> `11.3.2` |
| [com.squareup.wire](https://github.com/square/wire) | plugin |
misk/gradle/libs.versions.toml | gradle | minor | `5.2.1` -> `5.3.0` |
| [com.squareup.wire:wire-schema](https://github.com/square/wire) |
dependencies | misk/gradle/libs.versions.toml | gradle | minor | `5.2.1`
-> `5.3.0` |
| [com.squareup.wire:wire-runtime](https://github.com/square/wire) |
dependencies | misk/gradle/libs.versions.toml | gradle | minor | `5.2.1`
-> `5.3.0` |
| [com.squareup.wire:wire-reflector](https://github.com/square/wire) |
dependencies | misk/gradle/libs.versions.toml | gradle | minor | `5.2.1`
-> `5.3.0` |
| [com.squareup.wire:wire-moshi-adapter](https://github.com/square/wire)
| dependencies | misk/gradle/libs.versions.toml | gradle | minor |
`5.2.1` -> `5.3.0` |
| [com.squareup.wire:wire-grpc-client](https://github.com/square/wire) |
dependencies | misk/gradle/libs.versions.toml | gradle | minor | `5.2.1`
-> `5.3.0` |
| [com.squareup.wire:wire-bom](https://github.com/square/wire) |
dependencies | misk/gradle/libs.versions.toml | gradle | minor | `5.2.1`
-> `5.3.0` |
| [software.amazon.awssdk:sdk-core](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.30.20` -> `2.30.21` |
| [software.amazon.awssdk:sqs](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.30.20` -> `2.30.21` |
|
[software.amazon.awssdk:dynamodb-enhanced](https://aws.amazon.com/sdkforjava)
| dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.30.20` -> `2.30.21` |
| [software.amazon.awssdk:dynamodb](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.30.20` -> `2.30.21` |
| [software.amazon.awssdk:aws-core](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.30.20` -> `2.30.21` |
| [software.amazon.awssdk:bom](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.30.20` -> `2.30.21` |
| [software.amazon.awssdk:auth](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.30.20` -> `2.30.21` |

---

### Release Notes

<details>
<summary>square/wire (com.squareup.wire)</summary>

###
[`v5.3.0`](https://github.com/square/wire/blob/HEAD/CHANGELOG.md#Version-530)

[Compare Source](square/wire@5.2.1...5.3.0)

*2025-02-14*

##### Common

- Add support for weak imports in ProtoParser and ProtoFileElement
([#&#8203;3247](square/wire#3247) by
\[paul35621]\[paul35621])
- Add Gradle and CLI options to load the protobuf schema exhaustively
([#&#8203;3254](square/wire#3254) by \[Damian
Wieczorek]\[damianw])

##### Swift

- Fix conformance to ProtoMessage for heap allocated protos
([#&#8203;3260](square/wire#3260) by
\[Dimitris Koutsogiorgas]\[dnkoutso])

##### Gradle plugin

- Removed usage of internal Gradle APIs in the Wire Gradle plugin which
were crashing in Gradle `8.13`.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 6pm every weekday,before 2am
every weekday" in timezone Australia/Melbourne, Automerge - At any time
(no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://github.com/renovatebot/renovate).

GitOrigin-RevId: 99093fc154f455e28ebe8007a19636cb549f15d1
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