Skip to content

Conversation

@jmezach
Copy link
Contributor

@jmezach jmezach commented Nov 18, 2025

**Closes #942 **

This should fix the waiting for dependent resources.

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 November 18, 2025 07:20
Copilot AI review requested due to automatic review settings November 18, 2025 07:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the dependency waiting mechanism for SQL Database Projects by implementing proper waiting for dependencies before attempting to publish a SQL project. Previously, the publish operation may have proceeded without ensuring required resources were ready.

Key Changes:

  • Added explicit waiting for dependencies using WaitForDependenciesAsync when the target is a SqlServerDatabaseResource
  • Implemented handling of WaitAnnotation to wait for specific resource states based on WaitType
  • Ensures all waiting tasks complete before proceeding with dacpac publishing

}
}

await Task.WhenAll(waitingTasks);
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

If waitingTasks is empty, Task.WhenAll will return immediately, which is correct behavior. However, if the target is not a SqlServerDatabaseResource and there are no wait annotations, this may proceed without waiting for any dependencies when it should. Consider whether waiting should be mandatory for all resource types.

Copilot uses AI. Check for mistakes.
Signed-off-by: Jonathan Mezach <[email protected]>
@jmezach
Copy link
Contributor Author

jmezach commented Nov 18, 2025

Looks like this is being hit by #974 as well

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 18, 2025

@jmezach Great - ran my repro locally, and can confirm that this finally works as expected now

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 18, 2025

I will test this with #529 as well!

Signed-off-by: Jonathan Mezach <[email protected]>
@aaronpowell
Copy link
Member

When I run the sample app I see a bunch hanging:

image

This is why the tests time out.

Logs on the database show this:

image

Maybe something is causing db restores to fail that is then cascading elsewhere?

@jmezach
Copy link
Contributor Author

jmezach commented Nov 24, 2025

Closing this in favor of #994

@jmezach jmezach closed this Nov 24, 2025
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.

Wait ignored when a SqlProject waits for another SqlProject

4 participants