-
Notifications
You must be signed in to change notification settings - Fork 418
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 support for showing custom resources in the dashboard #2390
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Left some comments from my phone while waiting for a plane, so apologies for the lack of depth here.
src/Aspire.Dashboard/Components/ResourcesGridColumns/SourceColumnDisplay.razor
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting/Extensions/ParameterResourceBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
ResourceSnapshot? snapshot = default; | ||
|
||
// If the resource is a redirect, we want to create a snapshot for the resource it redirects to. | ||
if (resource.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var redirectAnnotation)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should change the name of this annotation if we are going to use it in this way ... its scope is now much broader than connection strings.
playground/CustomResources/CustomResources.AppHost/TestResource.cs
Outdated
Show resolved
Hide resolved
- Added DashboardAnnotation which allows changing a dashboard context. This context consists of properties, urls and the resource state. - Show all resources based on the app model before watching dcp for updates. Added a model for upates - Use a snapshotting model for dashboard updates Update the previous state Clean up how we resolve projects from DCP resources Some feedback - Make the initial snapshot state take computed values from well known annotations. Fixed typos Small change Added a public DashboardKnownProperties Added playground for testing custom resource API Remove manifest Handle missing parameter values Fix configuration Apply feedback and made more changes - Clean up te threading model. There can only be a single producer and consumer. The producer is responsible to keeping the state around if small mutations are to be made. - Keep the resource type filter working Remove exit code, fix create timestamp ExecutionContext not used Flow the cancellation token Move to single loop Remove logs hack for now
f30595c
to
41570c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a couple of suggestions
playground/CustomResources/CustomResources.AppHost/TestResource.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Some reservations about the annotation name. But overall this is a good change (and much needed).
…e.cs Co-authored-by: Karol Zadora-Przylecki <[email protected]>
- Rename the annotation to CustomResourceAnnotation - Simplify the UI - Suppress async warning
src/Aspire.Hosting/ApplicationModel/CustomResourceAnnotation.cs
Outdated
Show resolved
Hide resolved
- Does not remove resource types from the filter
Thanks for the review all! I will follow up with a logs PR. |
* Add support for showing custom resources in the dashboard - Added CustomResourceAnnotation which exposes methods for getting the initial snapshot and changing resource snapshots. These changes show up in the dashboard. - Show all resources based on the app model before watching dcp for updates. We put a placeholder in the dashboard in the "Starting" state and then remove it when DCP updates come in.
custom-resource2.mp4
Left TODO:
Replicas are broken on the resources view with this change. We need to delete the existing project resources if there are replicas.Tests?Follow up work to enable logging.
Fixes #436
Microsoft Reviewers: Open in CodeFlow