Skip to content

Conversation

@jmezach
Copy link
Contributor

@jmezach jmezach commented Mar 20, 2025

Closes #502

This ensures that SqlProject and SqlPackage resources are nested underneath the SqlServerDatabase resource in the Aspire dashboard, like this:

Screenshot 2025-03-20 at 10 03 42

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • [-] New integration
    • [-] Docs are written
    • [-] Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

@jmezach jmezach requested a review from ErikEJ as a code owner March 20, 2025 09:04
Signed-off-by: Jonathan Mezach <jonathan.mezach@rr-wfm.com>
@ErikEJ
Copy link
Contributor

ErikEJ commented Mar 20, 2025

Wonder why status is Running when SQL container is UnHealthy? Should it not be "Pending" ?

@jmezach
Copy link
Contributor Author

jmezach commented Mar 20, 2025

@ErikEJ Hmm, yeah, good point. I'll look into that.

@jmezach
Copy link
Contributor Author

jmezach commented Mar 20, 2025

@ErikEJ Not sure what changed, but it looks like the resources are no longer put into the Waiting state. Even our initial state that we're setting as Pending is not shown.

@ErikEJ
Copy link
Contributor

ErikEJ commented Mar 20, 2025

@jmezach Maybe @aaronpowell or @davidfowl has some ideas??

@aaronpowell
Copy link
Member

is it only doing that with the change to a parent/child relationship?

@jmezach
Copy link
Contributor Author

jmezach commented Mar 21, 2025

@aaronpowell Interestingly, it does something else if I don't add the WithParentRelationship call.

Screenshot 2025-03-21 at 08 15 37

From the screenshot you can see that they are now in a Pending state, which is what we are setting explicitly here and here.

So it looks like adding the WithParentRelationship call somehow makes our initial state not come through. Regardless of that, the waiting state doesn't seem to work anymore either?

@aaronpowell
Copy link
Member

Weird, does the info of the resource tell you why the state is that?

I've seen weird things if I have the wrong Aspire SDK and NuGet package versions

@jmezach
Copy link
Contributor Author

jmezach commented Mar 21, 2025

@aaronpowell Not sure what I'm looking for. What I did notice as well as that in the past I believe I saw in the console logs for the resource that it is waiting on some other resource. I'm not seeing that anymore either?

@aaronpowell
Copy link
Member

Just tried on Windows and Linux and I'm not seeing the problems:

Linux:

image

Windows:

image

If this is the expected outcome we can merge the PR in.

@jmezach
Copy link
Contributor Author

jmezach commented Mar 25, 2025

@aaronpowell I believe the end state is correct, it is just the intermediate state while we're waiting for the SQL Server to become healthy that is somehow not showing.

@ErikEJ
Copy link
Contributor

ErikEJ commented Mar 26, 2025

@jmezach I tested this - what happens is that the initial state of pending is never set, the child seems to inherit the parent state.

Then the state changes to "Publishing" and then "Finished" - so agree with @aaronpowell that this works as intended!

LGTM!

@aaronpowell aaronpowell merged commit 3070266 into CommunityToolkit:main Mar 27, 2025
83 checks passed
@aaronpowell
Copy link
Member

Feel free to hit merge too - you don't have to wait for me 😉

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add resource relationships for SQL database projects

3 participants