Skip to content
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

Add WithExplicitStart to conditionally not start some resources #7324

Merged
merged 6 commits into from
Jan 31, 2025

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Jan 30, 2025

Description

WithExplicitStart adds a annotation that instructs DCP not to start the resource. Resources with this attribute have the NotStarted state. The dashboard knows about this state and gives it an appropriate icon and enables the start command.

explicitstart

Fixes #5879

TODO:

  • Tests

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?

@JamesNK JamesNK added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Jan 30, 2025

Choose a reason for hiding this comment

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

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

Files not reviewed (1)
  • src/Aspire.Hosting/PublicAPI.Unshipped.txt: Language not supported
Comments suppressed due to low confidence (1)

src/Aspire.Hosting/ResourceBuilderExtensions.cs:757

  • The new method WithExplicitStart should be covered by tests to ensure its functionality.
public static IResourceBuilder<T> WithExplicitStart<T>(this IResourceBuilder<T> builder) where T : IResource
@JamesNK JamesNK requested a review from mitchdenny as a code owner January 30, 2025 06:27
@davidfowl davidfowl merged commit f849e06 into main Jan 31, 2025
9 checks passed
@davidfowl davidfowl deleted the jamesnk/explicit-start branch January 31, 2025 01:03
@davidfowl davidfowl mentioned this pull request Jan 31, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it possible to start and stop containers and executables that aren't weren't fully initialized by DCP
2 participants