[#30] Client: Add object model for Rules #42

Merged
orikik merged 1 commit from PavelGrossSpb/frostfs-sdk-csharp:apeRules into master 2025-02-13 07:05:01 +00:00
Member

Signed-off-by: Pavel Gross p.gross@yadro.com

Signed-off-by: Pavel Gross <p.gross@yadro.com>
PavelGrossSpb added 1 commit 2025-02-12 01:22:05 +00:00
[#30] Client: Add object model for Rules
All checks were successful
DCO / DCO (pull_request) Successful in 29s
lint-build / dotnet8.0 (pull_request) Successful in 44s
cdad8ad3a8
Signed-off-by: Pavel Gross <p.gross@yadro.com>
requested reviews from dstepanov-yadro, orikik 2025-02-12 01:22:57 +00:00
dstepanov-yadro requested changes 2025-02-12 12:57:26 +00:00
Dismissed
@ -0,0 +91,4 @@
private static int ActionsSize(Actions? action)
{
return BoolSize // Inverted
+ (action != null ? SliceSize(action.Names, StringSize) : 0);

Null slice must have size 1

Null slice must have size 1
Author
Member

Seems that Golang SDK is not protected from null Action or Resources and panics in these cases. So, null Action/Resourse makes the rule invalid. I've fixed the code accordingly.

Seems that Golang SDK is not protected from null Action or Resources and panics in these cases. So, null Action/Resourse makes the rule invalid. I've fixed the code accordingly.

Golang SDK uses struct. It is value type, so it can't be nil.

Golang SDK uses struct. It is value type, so it can't be nil.

You can do the same by using struct instead of class

You can do the same by using `struct` instead of `class`
Author
Member

OK, let it be structs. Done.

OK, let it be structs. Done.
dstepanov-yadro marked this conversation as resolved
@ -0,0 +98,4 @@
private static int ResourcesSize(Resource? resource)
{
return BoolSize // Inverted
+ (resource != null ? SliceSize(resource.Names, StringSize) : 0);

Also, if null, then size must be 1. Some unit tests required.

Also, if null, then size must be 1. Some unit tests required.
Author
Member

Fixed, see previous comment

Fixed, see previous comment

Great! What do you think about some positive/negative unit tests for serializer?

Great! What do you think about some positive/negative unit tests for serializer?
Author
Member

I'm working on it, but we've committed to provide this functionality today. So the tests will be some later.

I'm working on it, but we've committed to provide this functionality today. So the tests will be some later.

Ok, will test on production. Hardcore!

Ok, will test on production. Hardcore!
dstepanov-yadro marked this conversation as resolved
PavelGrossSpb added 1 commit 2025-02-12 13:18:55 +00:00
[#30] Client: Add object model for Rules, fix for comments
All checks were successful
DCO / DCO (pull_request) Successful in 25s
lint-build / dotnet8.0 (pull_request) Successful in 51s
13da97520d
Signed-off-by: Pavel Gross <p.gross@yadro.com>
PavelGrossSpb added 1 commit 2025-02-12 14:04:07 +00:00
[#30] Client: Add object model, use structs instead of classes
All checks were successful
DCO / DCO (pull_request) Successful in 25s
lint-build / dotnet8.0 (pull_request) Successful in 43s
a785357268
Signed-off-by: Pavel Gross <p.gross@yadro.com>
dstepanov-yadro approved these changes 2025-02-12 14:21:07 +00:00
PavelGrossSpb force-pushed apeRules from a785357268 to 195854a45b 2025-02-12 14:29:27 +00:00 Compare
PavelGrossSpb scheduled this pull request to auto merge when all checks succeed 2025-02-12 14:30:18 +00:00
orikik merged commit 195854a45b into master 2025-02-13 07:05:01 +00:00
Sign in to join this conversation.
No description provided.