Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case-insensitive parsing of metadata properties actorStateStore and keyPrefix #6206

Merged
merged 8 commits into from Apr 11, 2023

Conversation

ItalyPaleAle
Copy link
Contributor

In components-contrib, we've been making some efforts to make all component metadata parsing case-insensitive (thanks especially to @berndverst ) and use utils.IsTruthy to parse booleans.

The runtime itself parses the component metadata to extract certain fields, including: actorStateStore (state stores) and keyPrefix (state stores and locks).

This PR changes matching for actorStateStore and keyPrefix to be case-insensitive. Additionally, it uses utils.IsTruthy to convert actorStateStore to a boolean (so it's case-insensitive too and values like "1" map to true).

Also includes some fixes to pkg/components/lock/lock_config.go that were applied in pkg/components/state/state_config.go (whose code looks almost identical and perhaps should be merged into a single file)

… `keyPrefix`

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
@ItalyPaleAle ItalyPaleAle requested review from a team as code owners April 7, 2023 17:53
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Apr 7, 2023

Codecov Report

Merging #6206 (ae23a9b) into master (e8d10ae) will increase coverage by 0.01%.
The diff coverage is 92.30%.

@@            Coverage Diff             @@
##           master    #6206      +/-   ##
==========================================
+ Coverage   64.12%   64.13%   +0.01%     
==========================================
  Files         185      185              
  Lines       17945    17957      +12     
==========================================
+ Hits        11507    11517      +10     
- Misses       5530     5531       +1     
- Partials      908      909       +1     
Impacted Files Coverage Δ
pkg/runtime/runtime.go 66.85% <83.33%> (+0.03%) ⬆️
pkg/components/lock/lock_config.go 95.23% <92.30%> (-4.77%) ⬇️
pkg/components/state/state_config.go 96.15% <100.00%> (-0.08%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

shubham1172
shubham1172 previously approved these changes Apr 10, 2023
mukundansundar
mukundansundar previously approved these changes Apr 11, 2023
Copy link
Contributor

@mukundansundar mukundansundar left a comment

Choose a reason for hiding this comment

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

small nitpick comments.

pkg/runtime/runtime.go Outdated Show resolved Hide resolved
pkg/runtime/runtime_test.go Outdated Show resolved Hide resolved
@mukundansundar mukundansundar added this to the v1.11 milestone Apr 11, 2023
berndverst
berndverst previously approved these changes Apr 11, 2023
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
@mukundansundar
Copy link
Contributor

@ItalyPaleAle docs need to be added for this.

@mukundansundar mukundansundar added the documentation required This issue needs documentation label Apr 11, 2023
@mukundansundar mukundansundar merged commit 7ac8dd7 into dapr:master Apr 11, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation required This issue needs documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants