Skip to content

Conversation

adamint
Copy link
Member

@adamint adamint commented May 12, 2025

Description

Previously, when upserting a resource, the visibility function passed to UpdateFromResource would return false in the event that any value in the dictionary was false. For example, if container and project are values, container is marked as hidden (false), and then a resource of type project is updated, project will then be set to hidden. This is incorrect. Instead, the value should be visible if it was previously visible in the dictionary or if it's new (ie, when stopping a command, you may see the state Stopping for the first time).

Fixes #9220

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?

@@ -305,6 +305,53 @@ private static void AssertResourceFilterListEquals(IRenderedComponent<Components
Assert.Equal(healthStates, healthSelect.Instance.Values.ToImmutableSortedDictionary() /* sort for equality comparison */);
}

[Fact]
public void ResourcesShouldRemainUnchangedWhenFilterDoesNotMatchUpdatedResource()
Copy link
Member

Choose a reason for hiding this comment

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

does this test all 3 lines of your fix above?

@danmoseley danmoseley added the Servicing-approved Approved for servicing release label May 12, 2025
@danmoseley danmoseley merged commit 8c2ff89 into dotnet:main May 13, 2025
173 checks passed
@danmoseley
Copy link
Member

/backport to release/9.3

Copy link
Contributor

Started backporting to release/9.3: https://github.com/dotnet/aspire/actions/runs/14986296044

@github-actions github-actions bot locked and limited conversation to collaborators Jun 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-dashboard Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resource page filtering issues
3 participants