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

Trim regex from Grpc.AspNetCore #2326

Merged
merged 1 commit into from
Nov 28, 2023
Merged

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Nov 21, 2023

AddGrpc calls AddRouting to configure a route constraint. This is a problem when publishing with trimming/AOT because AddRouting registers the regex route constraint.

Configure RouteOptions directly and rely on the host to add routing. If the host is created with slim builder, then regex is never referenced and can be trimmed away.

I confirmed regex is trimmed after this change with sizoscope:

image

@JamesNK
Copy link
Member Author

JamesNK commented Nov 28, 2023

Ping for review now that holidays are over.

The changes are in GrpcServiceExtensions.cs. Everything else is for testing.

Copy link
Contributor

@BrennanConroy BrennanConroy left a comment

Choose a reason for hiding this comment

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

Technically a breaking change. But not sure if it's worth calling out, or if grpc has a way to call out breaking changes if it is worth it.

@JamesNK
Copy link
Member Author

JamesNK commented Nov 28, 2023

I don't think it is worth calling out.

Regex route would never be used with gRPC (it defines routes for you) and if you have regex in routes in another framework, e.g. MVC, Minimal API, then that framework or hosting will already be calling AddRouting to add the regex route.

@JamesNK JamesNK merged commit 1625f89 into grpc:master Nov 28, 2023
5 checks passed
@JamesNK JamesNK deleted the jamesnk/aot-trim-regex branch November 28, 2023 00:37
oguzhand95 referenced this pull request in cerbos/cerbos-sdk-net Jan 8, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [Grpc.Net.Client](https://togithub.com/grpc/grpc-dotnet) | `2.59.0` ->
`2.60.0` |
[![age](https://developer.mend.io/api/mc/badges/age/nuget/Grpc.Net.Client/2.60.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/Grpc.Net.Client/2.60.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/Grpc.Net.Client/2.59.0/2.60.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/Grpc.Net.Client/2.59.0/2.60.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>grpc/grpc-dotnet (Grpc.Net.Client)</summary>

###
[`v2.60.0`](https://togithub.com/grpc/grpc-dotnet/releases/tag/v2.60.0)

#### What's Changed

- Update to GA .NET 8 SDK by
[@&#8203;JamesNK](https://togithub.com/JamesNK) in
[https://github.com/grpc/grpc-dotnet/pull/2321](https://togithub.com/grpc/grpc-dotnet/pull/2321)
- Update to use Directory.Packages.props by
[@&#8203;JamesNK](https://togithub.com/JamesNK) in
[https://github.com/grpc/grpc-dotnet/pull/2315](https://togithub.com/grpc/grpc-dotnet/pull/2315)
- Add Native AOT test by [@&#8203;JamesNK](https://togithub.com/JamesNK)
in
[https://github.com/grpc/grpc-dotnet/pull/2324](https://togithub.com/grpc/grpc-dotnet/pull/2324)
- Trim regex from Grpc.AspNetCore by
[@&#8203;JamesNK](https://togithub.com/JamesNK) in
[https://github.com/grpc/grpc-dotnet/pull/2326](https://togithub.com/grpc/grpc-dotnet/pull/2326)

**Full Changelog**:
grpc/grpc-dotnet@v2.59.0...v2.60.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC),
Automerge - At any time (no schedule defined).

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

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

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

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/cerbos/cerbos-sdk-net).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjEyMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Oğuzhan Durgun <oguzhandurgun95@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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