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 resource relationship to app model #5311

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Aug 15, 2024

Description

This PR adds:

  • Relationship annotation and WithRelationship extension method to app model
  • WithRelationship calls are in various methods that add or reference resources.
  • Relationship field to resource service proto contract
  • Relationship field to ResourceViewModel.
  • UI to resource details to display References and Back references
  • Color to resource name on resources page and resource names in detail's references UI

image

image

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
      • Link to aspire-docs issue:
    • No
Microsoft Reviewers: Open in CodeFlow

@JamesNK JamesNK force-pushed the jamesnk/resource-relationship branch from dff7497 to 8248dae Compare August 19, 2024 01:47
@JamesNK JamesNK marked this pull request as ready for review August 19, 2024 02:19
@mitchdenny
Copy link
Member

From an app model perspective I am happy with where this is at except for the XML doc comments ;)

@JamesNK JamesNK marked this pull request as draft September 27, 2024 14:12
@JamesNK JamesNK force-pushed the jamesnk/resource-relationship branch from 8248dae to 82aa476 Compare October 9, 2024 08:18
@JamesNK JamesNK force-pushed the jamesnk/resource-relationship branch 2 times, most recently from 2a63a77 to 0c6bdbc Compare October 30, 2024 01:47
@JamesNK JamesNK marked this pull request as ready for review October 30, 2024 01:47
@JamesNK JamesNK requested a review from radical as a code owner October 30, 2024 01:47
@JamesNK JamesNK force-pushed the jamesnk/resource-relationship branch from d209098 to d62dfa5 Compare November 12, 2024 06:04
@JamesNK
Copy link
Member Author

JamesNK commented Nov 12, 2024

I think this is ready for folks to review.

@leslierichardson95 @davidfowl UI feedback is welcome on adding colors to resources page. This is the same thing the dashboard does in telemetry pages, i.e. frontend could be assigned a blue color that shows up in various UI including the span waterfall on trace detail.

IMO the colors back it easier to quickly identify resources, but I'm curious whether folks think it makes the resources page too busy.

@@ -349,6 +349,8 @@ public static IResourceBuilder<TDestination> WithReference<TDestination>(this IR
var resource = source.Resource;
connectionName ??= resource.Name;

builder.WithRelationship(resource, "ConnectionString");
Copy link
Member

Choose a reason for hiding this comment

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

WellKnownRelationshipTypes constants class?

@mitchdenny
Copy link
Member

I think this is looking good. Just a few minor things and a bit of a UX nit:

image

Why not just hyperlink the resource name?

@JamesNK
Copy link
Member Author

JamesNK commented Nov 14, 2024

Yeah, it doesn't look that great. However, it's the UI we're using everywell else. Buttons looking a bit ugly is why I've been switching to the action column with ... button.

I'll play around with options later. I don't want to hold this PR up on a new UI design for row links.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants