Commit Graph

405 Commits

Author SHA1 Message Date
Ryan Nowak 8e645bc364 Update daprdocs/content/en/dotnet-sdk-docs/dotnet-development/_index.md
Co-authored-by: Aaron Crawfis <Aaron.Crawfis@microsoft.com>
2021-03-15 13:55:43 -07:00
Ryan Nowak 47b6372f39 Update daprdocs/content/en/dotnet-sdk-docs/_index.md
Co-authored-by: Aaron Crawfis <Aaron.Crawfis@microsoft.com>
2021-03-15 13:55:43 -07:00
Ryan Nowak 0eafec4b66 Add local development docs
Fixes: #534
Fixes: #604
2021-03-15 13:55:43 -07:00
Ryan Nowak 4baad5453f
Improve actor getting started and add more docs (#623)
* Improve actor getting started and add more docs

Fixes: #546
Fixes: #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>
2021-03-15 13:38:27 -07:00
Fabian b62612af3d
Fix DaprSecretStoreConfigurationProvider (#625)
* Fix DaprSecretStoreConfigurationProvider

* Add comment for `SendBulkResponseWithSecrets`.

Co-authored-by: Your Name <you@example.com>
Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2021-03-15 10:49:02 -07:00
Samuel McAravey c40145259b
[WIP] Added support for custom delimiters in secret keys. (#629)
* 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.
2021-03-11 23:01:23 -08:00
Fabian 7890bc7977
Separator character for Dapr Sercet Store Configuration Provider (#616)
* 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>
2021-03-06 16:58:21 -08:00
Ryan Nowak cda2900997
Support non-JSON text in cloud events middleware (#621)
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.
2021-03-06 16:48:53 -08:00
Ryan Nowak c00a9e54b8
Add one more case to troubleshooting guide (#610)
* 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
2021-03-05 15:47:42 -08:00
Laurent Kempé 684718e940
Update README.md (#617)
Fix wrong path

Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2021-03-05 11:34:09 -08:00
Ryan Nowak 089a395f3d
Suppress TRX parser on PR from fork (#620)
(attempt 2)
2021-03-05 11:25:02 -08:00
Ryan Nowak 34d77d6269
Diable TRX parser on forks (#618)
Unfortunately this action requires permissions that a workflow running
for a fork does not have. You can see an example of this failing here:
https://github.com/dapr/dotnet-sdk/pull/617/checks?check_run_id=2033224542
2021-03-04 13:03:27 -08:00
Aaron Crawfis 07e8a9fec6
Merge pull request #608 from dapr/daprdocs-update
Update .NET docs to prepare for website integration
2021-03-01 13:42:26 -08:00
Aaron Crawfis aafe24e7e8
Merge branch 'master' into daprdocs-update 2021-03-01 12:11:43 -08:00
vinayada1 386898afd1
End to end test for service invocation (#602)
* add e2e test for service invocation
2021-02-25 22:05:50 -08:00
Alexander Batishchev dd31a40143
Update README.md (#605) 2021-02-24 11:47:04 -08:00
Aaron Crawfis 5f5326b83f Remove blank files 2021-02-24 11:23:46 -08:00
Ryan Nowak 008a4f35dd
Merge pull request #603 from dapr/release-1.0.0
Merge test changes for 1.0 -> master
2021-02-19 17:07:23 -08:00
Ryan Nowak 0aab615202
Add better test reporting (#591)
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>
2021-02-19 17:02:49 -08:00
Aaron Crawfis f54a646d48
Merge pull request #601 from pranavq212/master
Corrected link for .NET SDK for DAPR
2021-02-19 13:29:58 -08:00
Aaron Crawfis 1e07db5895
Merge branch 'master' into master 2021-02-19 13:24:19 -08:00
Ryan Nowak 7228d9fe16
Add basic binding and secret examples (#599) 2021-02-19 13:01:35 -08:00
Pranav Singh da818a5562
Merge branch 'master' into master 2021-02-19 09:41:29 +05:30
Ryan Nowak 1a3ae87c13
DaprClient usage guide (#594)
* DaprClient usage guide

Adds a usage guide for the DaprClient. Also fixing some misc issues that
were problably a bad copy-past.

* Apply suggestions from code review

Co-authored-by: Mukundan Sundararajan <musundar@microsoft.com>

* Apply suggestions from code review

Co-authored-by: Mukundan Sundararajan <musundar@microsoft.com>

* Update daprdocs/content/en/dotnet-sdk-docs/dotnet-client/dotnet-daprclient-usage.md

Co-authored-by: Mukundan Sundararajan <musundar@microsoft.com>

* pr feedback

Co-authored-by: Mukundan Sundararajan <musundar@microsoft.com>
2021-02-18 10:48:53 -08:00
Pranav Singh 36dc94144e
Corrected link for .NET SDK for DAPR 2021-02-18 12:18:34 +05:30
Aaron Crawfis 277249cf0d
Fix broken link (#597) 2021-02-17 19:43:12 -08:00
Aaron Crawfis eb568116e5
SDK Docs (#572)
* Setup dapr docs content

* Update SDK docs for new format

* Update daprdocs/content/en/dotnet-sdk-contributing/dotnet-contributing.md

Co-authored-by: Ryan Nowak <nowakra@gmail.com>

* Update daprdocs/content/en/dotnet-sdk-contributing/dotnet-contributing.md

Co-authored-by: Ryan Nowak <nowakra@gmail.com>

* Update python reference

* Update samples to examples

* Update layout

* Update prereqs

* Apply correct branding for .NET Core vs .NET

* Update examples/Client/StateManagement/README.md

* fix solution file

Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2021-02-16 22:15:33 -08:00
Ryan Nowak 94fc926170
Fix pattern for tests that use HttpClient (#589)
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: #573
Fixes: #588

Additionally fixed an issue where DaprHttpInteractor was misuing
HttpClientHandler. This would result in a new handler being created when
it isn't needed.
2021-02-16 10:09:34 -08:00
vinayada1 847cd310c2
Rc6 (#584)
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>
2021-02-10 19:37:08 -08:00
vinayada1 eea1e762b9
Merge pull request #578 from amolenk/amolenk/cancellationtoken
Add missing cancellation token
2021-02-10 15:58:42 -08:00
vinayada1 539896c8d9
Merge branch 'master' into amolenk/cancellationtoken 2021-02-10 15:55:52 -08:00
vinayada1 953c9fa60c
Merge pull request #583 from dapr/contenttype
read binary data
2021-02-10 15:54:12 -08:00
vinayada1 949c64bed6 fix comment 2021-02-10 15:34:31 -08:00
vinayada1 b1f93047de fix review comments 2021-02-10 14:57:52 -08:00
vinayada1 0e2b802f7a update proto files from dapr runtime 2021-02-10 11:17:09 -08:00
vinayada1 6b7db7cf10 read binary data 2021-02-10 11:11:13 -08:00
Ryan Nowak 8ac5f303bb
Merge branch 'master' into amolenk/cancellationtoken 2021-02-04 14:55:48 -08:00
vinayada1 bb891fa14f
Merge pull request #580 from dapr/merge-release-rc5
Merge release-1.0.0 into master after rc5
2021-02-03 15:29:20 -08:00
vinayada1 a98f0e66d7 Merge branch 'release-1.0.0' into master 2021-02-03 15:20:37 -08:00
Sander Molenkamp 21796a8532 Add missing cancellation token 2021-02-02 11:13:21 +01:00
Ryan Nowak 55e0dba8dd
Make Actors unit testable (#576)
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.
2021-02-01 11:47:02 -08:00
vinayada1 7f9d23cdf5
fixes for getting the samples to work (#570)
* fixes for getting the samples to work

* add ut
2021-01-29 18:40:23 -08:00
Ryan Nowak aa41915e38
Update protobuf files (#567) 2021-01-29 10:29:14 -08:00
vinayada1 a4f6f041bc
Merge into release (#565)
*Merge master into release branch

Co-authored-by: Ryan Nowak <nowakra@gmail.com>

Co-authored-by: Ryan Nowak <nowakra@gmail.com>
Co-authored-by: Carlos Mendible <cmendible@gmail.com>
Co-authored-by: Arghya Sadhu <arghya88@gmail.com>
Co-authored-by: Per Ökvist <perokvist@users.noreply.github.com>
Co-authored-by: Sander Molenkamp <a.molenkamp@gmail.com>
Co-authored-by: LukePammant <Luke.pammant@gmail.com>
2021-01-27 14:46:35 -08:00
vinayada1 a2ed096b79
API to set DAPR_API_TOKEN (#558)
* API to set DAPR_API_TOKEN

Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2021-01-27 13:39:44 -08:00
Ryan Nowak 1ccbacc9ed
Add raw API for using bindings with non-text data (#564)
* 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
2021-01-27 09:46:37 -08:00
Ryan Nowak b00c02f320
Throw DaprException for errors in DaprClient (#561)
* 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
2021-01-26 20:05:17 -08:00
Ryan Nowak 8a7bac13b3
Add IDisposable to DaprClient (#563)
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.
2021-01-26 15:45:01 -08:00
Ryan Nowak 9ca4a43cc7
Remove automatic protobuf conversion (#557)
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.
2021-01-22 17:05:04 -08:00
Ryan Nowak 9748ca0a82
Simplify service invocation APIs (#555)
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.
2021-01-22 16:28:20 -08:00