Skip to content

Conversation

@adamint
Copy link
Member

@adamint adamint commented May 2, 2025

Description

First part of #9063, adds the hidden attribute and consumes it in the dashboard. @mitchdenny

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 (added one small mapping test)
    • 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?

repeated ResourceRelationship relationships = 20;

// Whether the resource should be visually hidden in the dashboard.
bool hidden = 21;
Copy link
Member

Choose a reason for hiding this comment

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

Is optional bool a thing @JamesNK? We need to distinguish false and not set.

if you have state “Hidden” and Hidden false what does it mean @adamint ?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we want a tri state bool.

IMO a resource is hidden if hidden property is true or the state is hidden (for backwards compatibility).

@mitchdenny
Copy link
Member

@adamint I'm working on a copy of your branch integrating the changes I just merged to main and its looking like the dashboard resource is showing up in the dashboard even though the Hidden field is set to true. Are we not filtering on that flag yet in the PR?

Copy link
Member

@JamesNK JamesNK left a comment

Choose a reason for hiding this comment

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

All other bool properties follow is_xxx naming standard.

@dotnet-policy-service dotnet-policy-service bot added the needs-author-action An issue or pull request that requires more info or actions from the author. label May 2, 2025
@mitchdenny
Copy link
Member

@adamint please confirm that this works for the dashboard resource.

@adamint
Copy link
Member Author

adamint commented May 2, 2025

@adamint I'm working on a copy of your branch integrating the changes I just merged to main and its looking like the dashboard resource is showing up in the dashboard even though the Hidden field is set to true. Are we not filtering on that flag yet in the PR?

@adamint please confirm that this works for the dashboard resource.

The hidden field is only set if the AppHost launch profile doesn't set ASPIRE_SHOW_DASHBOARD_RESOURCES to true. I've tested removing that property and the dashboard resource does not show up on the dashboard itself. Are you seeing something different?

@dotnet-policy-service dotnet-policy-service bot removed the needs-author-action An issue or pull request that requires more info or actions from the author. label May 2, 2025
@adamint adamint requested a review from JamesNK May 2, 2025 21:58
return app.ResourceNotifications.WaitForResourceAsync(resourceName, targetState, cancellationToken);
}

#pragma warning disable CS0618 // Type or member is obsolete
Copy link
Member

Choose a reason for hiding this comment

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

nit: can you place these just around KnownResourceStates.Hidden in the method instead of the entire method

@davidfowl
Copy link
Member

Looking good!

@davidfowl davidfowl merged commit 157fdd4 into dotnet:main May 3, 2025
170 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants