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

Improve endpoint metadata debugging #48207

Merged

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented May 12, 2023

Fixes #39792

This PR:

  • Adds ToString implementations to many types used as metadata on endpoints
  • Adds DebuggerDisplayAttribute that uses the ToString
  • Adds display and proxy attributes to EndpointMetadataCollection

Replaces #47163 by @SeanFarrow

Before:

image

After:

image

SeanFarrow and others added 18 commits May 10, 2023 08:50
…than specifically implementing aDebuggerToString method.
@JamesNK JamesNK requested a review from a team as a code owner May 12, 2023 10:29
src/Http/Routing/src/SuppressLinkGenerationMetadata.cs Outdated Show resolved Hide resolved
src/Middleware/CORS/src/EnableCorsAttribute.cs Outdated Show resolved Hide resolved
src/Security/Authorization/Core/src/AuthorizeAttribute.cs Outdated Show resolved Hide resolved
Copy link
Member

@amcasey amcasey left a comment

Choose a reason for hiding this comment

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

Minor questions, but LGTM

src/Http/Http.Extensions/src/TagsAttribute.cs Outdated Show resolved Hide resolved
src/Http/Routing/src/SuppressLinkGenerationMetadata.cs Outdated Show resolved Hide resolved
src/Middleware/CORS/src/DisableCorsAttribute.cs Outdated Show resolved Hide resolved
@JamesNK
Copy link
Member Author

JamesNK commented May 17, 2023

@Tratcher I added a helper method for building up a debug string for types. There are some allocations (the values array, string builder), but these methods are unlikely to ever be used on a hot path. Could avoid the values array in most cases by adding something like TagList, but I'm not concerned about perf here so I skipped it.

What do you think?

@JamesNK JamesNK merged commit ba58563 into main May 19, 2023
@JamesNK JamesNK deleted the SeanFarrow-feature/sf/39792-improve-endpoint-metadata-debugging branch May 19, 2023 01:28
@ghost ghost added this to the 8.0-preview5 milestone May 19, 2023
@amcasey amcasey added area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve endpoint metadata debugging by overriding ToString
4 participants