Skip to content

Automatically call AddDapr#1162

Merged
davidfowl merged 1 commit intomainfrom
davidfowl/auto-add-dapr
Dec 1, 2023
Merged

Automatically call AddDapr#1162
davidfowl merged 1 commit intomainfrom
davidfowl/auto-add-dapr

Conversation

@davidfowl
Copy link
Copy Markdown
Contributor

  • Make AddDapr idempotent so that calling it multiple times noops.
  • Use IOptions for top level DaprOptions
  • Calling WithDaprSidecar calls AddDapr

- Make AddDapr idempotent so that calling it multiple times noops.
- Use IOptions for top level DaprOptions
- Calling WithDaprSidecar calls AddDapr
@davidfowl davidfowl requested a review from philliphoff December 1, 2023 05:30
@ghost ghost added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Dec 1, 2023
@davidfowl davidfowl added the dapr label Dec 1, 2023
context.Writer.WriteStartObject("daprComponent");

context.Writer.TryWriteString("localPath", context.GetManifestRelativePath(resource.Options?.LocalPath));
if (resource.Options?.LocalPath is { } localPath)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Curious as to the need for this test. GetManifestRelativePath() returns null if given null, and TryWriteString() will omit the entry if given null.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Its possible my VS was going crazy. I was getting null warnings for this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I (at least attempted) to add the null analyzer attributes to make that work (which it did on my machine, but who knows).

@davidfowl davidfowl merged commit 82846cb into main Dec 1, 2023
@davidfowl davidfowl deleted the davidfowl/auto-add-dapr branch December 1, 2023 20:17
andrevlins pushed a commit to andrevlins/aspire that referenced this pull request Dec 3, 2023
- Make AddDapr idempotent so that calling it multiple times noops.
- Use IOptions for top level DaprOptions
- Calling WithDaprSidecar calls AddDapr
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication dapr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants