* Improve actor getting started and add more docs
Fixes: #546Fixes: #612
This change runs through the getting started docs and improves trims all
of the unnecessary fat. I've reorganized all of the details that aren't
relevant as part of the first tutorial into separate docs.
I've also fleshed out all of the content we have to be relevant to a new
user and added new sections like DI and logging.
* Update daprdocs/content/en/dotnet-sdk-docs/dotnet-actors/dotnet-actors-howto.md
Co-authored-by: Aaron Crawfis <Aaron.Crawfis@microsoft.com>
* Update daprdocs/content/en/dotnet-sdk-docs/dotnet-actors/dotnet-actors-howto.md
Co-authored-by: Aaron Crawfis <Aaron.Crawfis@microsoft.com>
* Update daprdocs/content/en/dotnet-sdk-docs/dotnet-actors/dotnet-actors-howto.md
Co-authored-by: Aaron Crawfis <Aaron.Crawfis@microsoft.com>
* Update daprdocs/content/en/dotnet-sdk-docs/dotnet-actors/dotnet-actors-howto.md
Co-authored-by: Aaron Crawfis <Aaron.Crawfis@microsoft.com>
Co-authored-by: Aaron Crawfis <Aaron.Crawfis@microsoft.com>
* Fix DaprSecretStoreConfigurationProvider
* Add comment for `SendBulkResponseWithSecrets`.
Co-authored-by: Your Name <you@example.com>
Co-authored-by: Ryan Nowak <nowakra@gmail.com>
* Added support for custom delimiters in secret keys.
* Removed hard-coded double underscore delimiter.
* Updated the KeyDelimiters property to use IList.
* Reverted the AddDaprSecretStore keyDelimiters parameter to IEnumerable.
* Fix for build failure due to dumb save issue.
* NormalizeKey Secret Store configuration key.
* Add test.
* Add option to disable NormalizeKey.
Co-authored-by: Your Name <you@example.com>
Co-authored-by: Ryan Nowak <nowakra@gmail.com>
Fixes: #592
This change teaches the cloud events middleware to JSON-decode non-JSON
content when it appears in the `data` attribute in a cloud event.
There are three cases for cloud events that matter:
- data is used, content is a JSON object, datacontentype is JSON
- data is used, content is a JSON string, dataconenttype != JSON
- data_base64 is used, content is base64 bytes
We weren't handling the second of this. If you submitted the content:
`"data": "hello, "\world!\""` with datacontenttype = text/plain
You would end up with `"hello, \"world!\""` in the request body instead
of `hello, "world!"`.
This is a very subtle case, and I'm trying to fix it before users couple
their code to the wrong behavior. Since this is technically a breaking
change, I've added a opt-out so you can restore the buggy behavior.
* Add one more case to troubleshooting guide
Found this was missing with a user's help.
* PR feedback
* Update daprdocs/content/en/dotnet-sdk-docs/dotnet-troubleshooting/dotnet-troubleshooting-pubsub.md
Our experience right now is pretty bad when tests fail, you get a
generic `failed with exit code 1`.
This change adds more full-featured integration with GitHub Actions as
well as fixes a few minor issues:
- We were missing the codecov package on one project
- Updates to test SDK
- Annotations on failing tests
- Each test project as its own status check
- Separating a parallelizing steps of the build
Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>
This change introduces a better API for us to test the DaprClient or
other HttpClient based APIs.
This will resolve the flakiness problems that we're seeing with some of
the actors tests.
Fixes: #573Fixes: #588
Additionally fixed an issue where DaprHttpInteractor was misuing
HttpClientHandler. This would result in a new handler being created when
it isn't needed.
Merging the following two commits from master into release branch
* Add missing cancellation token
* read binary data
Co-authored-by: Ryan Nowak <nowakra@gmail.com>
Co-authored-by: Sander Molenkamp <a.molenkamp@gmail.com>
Co-authored-by: Vinaya Damle <vinayadamle@gmail.com>
Fixes: #574
Changes ActorHost constructor to be public again. Now the state manager
and http interactor are set via properties. This means that code in unit
tests won't be able to cover the methods that interact with timers or
reminders - however this was already the case. Testing state management
is covered by replacing the `IActorStateManager` with a mock.
Logged an issue to improve this.
Also added validation. If you try to use something that's not fully
initialized it will result in an exception with a meaningful message
instead of a null reference.
Also skips tests that are failing due to #573. We know the cause of why
these are failing, and these tests have not been stable since they were
introduced. Failing additional CI builds is not giving us new
information.
* Add raw API for using bindings with non-text data
Fixes: #560
This change adds some new data types and a new overload of
`InvokeBindingAsync` that can work with raw data (non-text) as bytes.
* PR feedback
* Unify DaprException classes
We have two classes called DaprException.
It makes way more sense for us to have DaprException in the Dapr.Client
project, and it also makes sense for Dapr.Actors to reference
Dapr.Client (it did not for some reason).
There's some additional cleanup of code related to
JsonSerializerOptions. The Actors code was not referencing the 5.0.0
version of the package, and so it's now got access to some new stuff,
so we could remove a polyfill.
* Throw DaprException for errors
Fixes: #516
This updates all of the locations in DaprClient that handle networking
or serialization to throw DaprException instead of the underlying
exception type. This allows for simpler error handling.
* Add one more unit test
Fixes: #559
This change adds disposable support to DaprClient, and updates samples
to dispose it.
I didn't update tests because there are literally hundreds of
non-find-and-replacable cases, and we're not actually doing networking
in our tests so it won't cause an issue.
Fixes: #442
We're making it absolutely clear which methods do JSON (most of them)
and which do gRPC. We have the ability to do both 'raw' functionality
and optimized paths for JSON+HTTP and gRPC+Protobuf for invoke. We're
not going to add 'raw' or Protobuf support for other building blocks
until there's a specific use case.
For the most part the functionality that's being removed here isn't used
anymore since that was part of the invoke changes.
Fixes: #549
This change mixes up the service invocation APIs to reflect some changes
that are coming down the pipe in dapr/dapr#2683.
We're now using HTTP's semantics and JSON for the main functionality in
`InvokeMethodAsync`. This means that the error handling is simplified
and base on HTTP's status codes rather than trying to abstract over HTTP
and gRPC's different error models. This also means that we're free to
expose HttpRequestMessage and related types in the API because it's no
longer an abstraction.
You can still use `InvokeMethodAsync` to invoke gRPC services, but you
will get a status code in the response, and it will expect JSON, etc,
similar to how gRPC gateway works.
In addition to that we're added `InvokeMethodGrpcAsync` for cases where
you really want *gRPC's* semantics. These methods do Protobuf
serialization, as is a natural choice for gRPC. I do not recommend using
this approach to invoke HTTP services.
---
I also mad updates and improvments to various infrastructure where
necessary (like InvocationException). Also, the gRPC sample in the repo
now uses the new `InvokeMethodGrpcAsync` APIs.