-
Notifications
You must be signed in to change notification settings - Fork 715
Decouple hidden resource attribute from state #9063
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
Decouple hidden resource attribute from state #9063
Conversation
|
|
||
| internal static class ResourceViewModelExtensions | ||
| { | ||
| public static bool IsHiddenState(this ResourceViewModel resource) |
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.
I think we keep this for now so hidden resources don't suddenly start showing up. We can still infer hidden from this.
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.
Added a method IsHidden that also checks for Hidden state.
| public static Task WaitForResources(this DistributedApplication app, IEnumerable<string>? targetStates = null, CancellationToken cancellationToken = default) | ||
| { | ||
| targetStates ??= [KnownResourceStates.Running, KnownResourceStates.Hidden]; | ||
| targetStates ??= [KnownResourceStates.Running]; |
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.
I'd put this back
|
Should showing hidden resources also show those with |
|
I think you should make 3 changes:
This would help us asses the risk of breaking more easily. |
|
I agree with @davidfowl. This is a good change overall but we need to deliver the changes in small chunks. The first stage is to unlock code running inside the app host to allow it to check for running state of hidden resources (so separating hiddenness from state). That is a big enough change for one PR and then I think adding support for showing hidden resources in the dashboard would be a welcome change - but should come later. Doing this incrementally with small tight PRs will get this change in faster. (p.s. I was so happy when I saw you picked this up overnight @adamint !) |
I can't think of a reason it shouldn't. Were you thinking of any scenario in particular? |
Description
Adds a new
hiddenfield to the resource proto definition and refactors everywhere thatKnownResourceStates.Hiddenwas used in apphost and dashboard. Also adds a toggle to show/hide hidden resources in the dashboard on the console logs and resources page.ex:

Fixes #8428
Checklist
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplate