Skip to content

Add StateStore Query API#3695

Merged
yaron2 merged 1 commit into
dapr:masterfrom
dmitsh:ds-query
Nov 2, 2021
Merged

Add StateStore Query API#3695
yaron2 merged 1 commit into
dapr:masterfrom
dmitsh:ds-query

Conversation

@dmitsh

@dmitsh dmitsh commented Sep 20, 2021

Copy link
Copy Markdown
Contributor

Description

Added StateStore query API

Issue reference

Please reference the issue this PR will close: #3662

Checklist

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

@dmitsh
dmitsh requested review from a team as code owners September 20, 2021 18:56
@dmitsh dmitsh changed the title Add StateStore Query API (WIP, do not merge) Add StateStore Query API Oct 18, 2021
@codecov

codecov Bot commented Oct 18, 2021

Copy link
Copy Markdown

Codecov Report

Merging #3695 (a7eb1fb) into master (aaaeb8c) will increase coverage by 0.16%.
The diff coverage is 81.92%.

❗ Current head a7eb1fb differs from pull request most recent head 8f92600. Consider uploading reports for the commit 8f92600 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3695      +/-   ##
==========================================
+ Coverage   62.75%   62.92%   +0.16%     
==========================================
  Files         100      100              
  Lines        9340     9423      +83     
==========================================
+ Hits         5861     5929      +68     
- Misses       3016     3028      +12     
- Partials      463      466       +3     
Impacted Files Coverage Δ
pkg/grpc/endpoints.go 100.00% <ø> (ø)
pkg/http/responses.go 90.00% <ø> (ø)
pkg/grpc/api.go 59.14% <76.47%> (+0.94%) ⬆️
pkg/http/api.go 78.70% <85.71%> (+0.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aaaeb8c...8f92600. Read the comment docs.

artursouza
artursouza previously approved these changes Oct 20, 2021
Comment thread dapr/proto/runtime/v1/dapr.proto Outdated
Comment thread dapr/proto/runtime/v1/dapr.proto
Comment thread pkg/grpc/api.go Outdated
@artursouza

Copy link
Copy Markdown
Contributor

@dmitsh We need an issue to add this to Redis and another issue to add E2E tests.

@yaron2

yaron2 commented Oct 20, 2021

Copy link
Copy Markdown
Member

Added do not merge label.

@dmitsh

dmitsh commented Oct 20, 2021

Copy link
Copy Markdown
Contributor Author

@dmitsh
dmitsh requested review from artursouza and pkedy October 20, 2021 19:36
@yaron2

yaron2 commented Oct 20, 2021

Copy link
Copy Markdown
Member

@artursouza please do not merge until my review. thanks.

Comment thread dapr/proto/runtime/v1/dapr.proto
@yaron2

yaron2 commented Oct 25, 2021

Copy link
Copy Markdown
Member

As discussed with @artursouza, the status of these APIs should be alpha. With this change, we can leave the feature flag out.

For HTTP:

v1.0-alpha1/state.

For gRPC:

We can either introduce a new proto v2 with the new method, or we can add the new method to the existing v1 proto with a naming convention, ie. rpc QueryStateAlpha1(QueryStateRequest) returns (QueryStateResponse) {}.

/cc @msfussell @pkedy for thoughts.

@pkedy

pkedy commented Oct 25, 2021

Copy link
Copy Markdown
Member

For gRPC, I like having an operation suffix and not creating a V2 for preview features. Then we would remove the preview methods later because we don't care about backward compatibility for preview features. I think we should stick to the idea of only versioning schemas/protos when there are non-backward compatible changes to V1 APIs.

@msfussell

Copy link
Copy Markdown
Member

This proposal makes sense in that;

  1. Eventually the stable "final" API for HTTP will be http://localhost:3500/v1.0/state/query. This is non-breaking since this is an additive method to the state API. It is not required to be implemented by all stores.
  2. Temporarily the API for testing in the v1.5 release will be for HTTP http://localhost:3500/v1.0-alpha1/state/query and this applies to only using the query API and the existing state APIs are not affected. After this is tested then move to point 1)
  3. SDKs will have to do some API manipulation between point 1) and point 2) Temporarily. No SDKs will support this query API until v1.6 release.

@dmitsh

dmitsh commented Oct 26, 2021

Copy link
Copy Markdown
Contributor Author

As discussed with @artursouza, the status of these APIs should be alpha. With this change, we can leave the feature flag out.

For HTTP:

v1.0-alpha1/state.

For gRPC:

We can either introduce a new proto v2 with the new method, or we can add the new method to the existing v1 proto with a naming convention, ie. rpc QueryStateAlpha1(QueryStateRequest) returns (QueryStateResponse) {}.

/cc @msfussell @pkedy for thoughts.

addressed

@artursouza

Copy link
Copy Markdown
Contributor

For gRPC, I like having an operation suffix and not creating a V2 for preview features. Then we would remove the preview methods later because we don't care about backward compatibility for preview features. I think we should stick to the idea of only versioning schemas/protos when there are non-backward compatible changes to V1 APIs.

It should not be v2 but v1alpha1 instead since it is an API that is not fully supported in v1 yet. The suffix hurts readability IMO.

@yaron2 yaron2 left a comment

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.

LGTM

@yaron2
yaron2 merged commit e84a610 into dapr:master Nov 2, 2021
@yaron2

yaron2 commented Nov 2, 2021

Copy link
Copy Markdown
Member

Congrats on this PR and contribution @dmitsh!

@dmitsh
dmitsh deleted the ds-query branch November 2, 2021 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

State Store Query API

5 participants