Skip to content

Conversation

@ErikEJ
Copy link
Contributor

@ErikEJ ErikEJ commented May 9, 2025

Closes #638

Add explicit start option for SQL projects

Update to check for ExplicitStartupAnnotation to determine resource state. Modify the redeploy command and add a test case in AddSqlProjectTests.cs to verify the new behavior.

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)
  • 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

Add explicit start option for SQL projects

Update to check for `ExplicitStartupAnnotation` to determine resource state. Modify the redeploy command and add a test case in `AddSqlProjectTests.cs` to verify the new behavior.
@ErikEJ ErikEJ requested a review from jmezach as a code owner May 9, 2025 13:21
@ErikEJ ErikEJ requested review from aaronpowell, Copilot and jmezach and removed request for aaronpowell, Copilot and jmezach May 9, 2025 13:23
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 introduces an explicit startup option for SQL projects, allowing users to delay the SQL project deployment until explicitly triggered.

  • Added a new test case in AddSqlProjectTests to verify the explicit startup behavior.
  • Modified SqlProjectBuilderExtensions to check for an ExplicitStartupAnnotation and adjust command state accordingly.
  • Updated the example project to demonstrate the use of the explicit start option.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects.Tests/AddSqlProjectTests.cs Added a new test to verify explicit startup behavior
src/CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects/SqlProjectBuilderExtensions.cs Updated event subscriptions and redeploy command to support explicit start
examples/sql-database-projects/CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects.AppHost/Program.cs Demonstrated the new explicit start option
Comments suppressed due to low confidence (1)

src/CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects/SqlProjectBuilderExtensions.cs:247

  • The command identifier remains 'redeploy' even though the display name is 'Deploy'. Consider aligning the identifier with the display name or documenting the rationale to avoid potential confusion.
builder.WithCommand( "redeploy", "Deploy", async (context) => {

Copy link
Contributor

@jmezach jmezach left a comment

Choose a reason for hiding this comment

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

LGTM

@ErikEJ ErikEJ merged commit 4d33a96 into CommunityToolkit:main May 13, 2025
88 checks passed
@Alirexaa
Copy link
Member

@ErikEJ, Next time, please use 'squash' to merge PRs to keep the history clean.

@ErikEJ
Copy link
Contributor Author

ErikEJ commented May 13, 2025

Thanks, I will keep that in mind

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.

WithExplicitStart has no effect with AddSqlProject

3 participants