Skip to content

Conversation

WhitWaldo
Copy link
Contributor

Description

To date, we have several standalone clients from the standard Dapr.Client package and these use a common static client builder alongside separate (but similar) static extension registration methods. This PR eliminates duplicate code by introducing a common generic extension method that each of these standalone clients utilize instead of their current separate-but-identical approaches.

This also consolidates how the clients are built to have them work in a consistent way through.

  • Dapr.Jobs now reflects the same internal DaprJobsGrpcClient as the other client.
  • All clients implement IDisposable to do cleanup on their respective HttpClient instances.
  • All client builder implement a local interface facilitating future fluent registration operations globally and on a per-type basis (similar to how Aspire does this).
  • This sets the groundwork to remove a dependency going forward on the static builder and rely strictly on DI (which would be necessary with proposed changes to client serialization)

Added unit tests throughout to validate everything.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation - not necessary, no breaking changes made (all example projects build without error or change)

WhitWaldo added 16 commits April 1, 2025 02:50
… packages to reduce code duplication throughout.

Signed-off-by: Whit Waldo <[email protected]>
…mpty constructor overload in client builders.

Signed-off-by: Whit Waldo <[email protected]>
… other clients for consistency.

Signed-off-by: Whit Waldo <[email protected]>
…g. implements IDisposable, primary constructors, use of generic service registration extension)

Signed-off-by: Whit Waldo <[email protected]>
…aming - no need to introduce a breaking change here.

Signed-off-by: Whit Waldo <[email protected]>
…e issues identified with Dapr.Common.Tests unit tests

Signed-off-by: Whit Waldo <[email protected]>
@WhitWaldo WhitWaldo added kind/enhancement New feature or request area/client labels Apr 1, 2025
@WhitWaldo WhitWaldo added this to the v1.16 milestone Apr 1, 2025
@WhitWaldo WhitWaldo self-assigned this Apr 1, 2025
@WhitWaldo WhitWaldo requested review from a team as code owners April 1, 2025 10:42
@WhitWaldo WhitWaldo changed the base branch from master to release-1.16 April 1, 2025 10:42
@WhitWaldo WhitWaldo moved this from Backlog to In review in v1.16 Release Tracking Board Apr 1, 2025
@WhitWaldo WhitWaldo added the P0 label Apr 1, 2025
@WhitWaldo WhitWaldo merged commit 51cc2f5 into dapr:release-1.16 Apr 1, 2025
8 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in v1.16 Release Tracking Board Apr 1, 2025
@WhitWaldo WhitWaldo deleted the consolidate-service-registration branch April 1, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant