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

Field, Function and test fixes, adding missing struct to node stats #572

Merged
merged 6 commits into from
Jun 27, 2024

Conversation

Jakob3xD
Copy link
Collaborator

Description

  • Fix FLS role type
  • Fix json compare when response is null
  • Fix function where the wrong var is given to parse the response
  • Add missing node stats cache field

Issues Resolved

Closes #560

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Jakob3xD added 4 commits June 26, 2024 15:22
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
…ecovery

Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Copy link

codecov bot commented Jun 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.96%. Comparing base (06a6dc8) to head (11eeb80).
Report is 39 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #572       +/-   ##
===========================================
+ Coverage   57.29%   67.96%   +10.67%     
===========================================
  Files         315      376       +61     
  Lines        9823     8853      -970     
===========================================
+ Hits         5628     6017      +389     
+ Misses       2902     1555     -1347     
+ Partials     1293     1281       -12     
Flag Coverage Δ
integration 60.39% <100.00%> (+9.55%) ⬆️
unit 15.28% <0.00%> (+2.43%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
opensearchapi/api_indices-mapping.go 95.00% <100.00%> (+1.66%) ⬆️
opensearchapi/api_indices.go 96.07% <100.00%> (+1.16%) ⬆️
opensearchapi/api_nodes-stats.go 100.00% <ø> (ø)
plugins/security/api_actiongroups.go 100.00% <100.00%> (ø)
plugins/security/api_internalusers.go 100.00% <100.00%> (ø)
plugins/security/api_roles-get.go 100.00% <ø> (ø)
plugins/security/api_roles-put.go 84.61% <ø> (ø)
plugins/security/api_roles.go 100.00% <100.00%> (ø)
plugins/security/api_rolesmapping.go 100.00% <100.00%> (ø)
plugins/security/api_tenants.go 100.00% <100.00%> (ø)

... and 265 files with indirect coverage changes

dblock
dblock previously approved these changes Jun 26, 2024
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

Want to write some tests for this one? Looks like lots of tests failed.

@Jakob3xD
Copy link
Collaborator Author

Want to write some tests for this one? Looks like lots of tests failed.

Test are failing because of the omitempty tag causing the json compare to omit them and resulting in missing fields when comparing. I am currently thinking about a solution.

@Jakob3xD Jakob3xD changed the title Field, Function and test fixes, adding missing struct to node stats Draft: Field, Function and test fixes, adding missing struct to node stats Jun 26, 2024
@Jakob3xD Jakob3xD marked this pull request as draft June 26, 2024 16:25
…ithout omitempty

Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
@Jakob3xD
Copy link
Collaborator Author

I am not totally happy with this solution as I would have liked to not duplicate the structs but there is not lib that compares a struct against a json blob and respects the omitempty tag. Or at least I did not find such a lib.
Therefore duplicating the structs but without omitemtpy is simplest and easiest way of solving this.

@Jakob3xD Jakob3xD marked this pull request as ready for review June 27, 2024 10:47
@Jakob3xD Jakob3xD changed the title Draft: Field, Function and test fixes, adding missing struct to node stats Field, Function and test fixes, adding missing struct to node stats Jun 27, 2024
@dblock dblock merged commit dbe714b into opensearch-project:main Jun 27, 2024
57 checks passed
@Jakob3xD Jakob3xD deleted the jh-fields branch June 28, 2024 07:30
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.

[BUG] MappingFieldResp struct is not parsed correctly.
2 participants