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

Handle nil value in NewFactValue #263

Merged
merged 1 commit into from
Oct 2, 2023
Merged

Handle nil value in NewFactValue #263

merged 1 commit into from
Oct 2, 2023

Conversation

arbulu89
Copy link
Contributor

@arbulu89 arbulu89 commented Sep 26, 2023

Handle nil value in NewFactValue. For instance, the new saptune gatherer can have some null values, so we need to send them as null.
This doesn't mean that in many gatherers, if we get kind of null value we don't need to send a fact gathering error.

Fact output example. The () is the null value in rhai:

#{
  "$schema": "file:///usr/share/saptune/schemas/1.0/saptune_solution_verify.schema.json",
  "argv": "saptune --format json solution verify",
  "command": "solution verify",
  "exit_code": 0,
  "messages": [],
  "pid": 11179,
  "publish_time": "2023-09-26 16:02:18.474",
  "result": #{
    "attentions": [],
    "notes_enabled": [],
    "system_compliance": (),
    "verifications": []
  }
} 

How it was tested

I tested together with wanda and web.
The value arrives properly what we visualize in the frontend as NULL_VALUE. I don't know if we need to change something there:

image

@arbulu89 arbulu89 added the enhancement New feature or request label Sep 26, 2023
@arbulu89 arbulu89 marked this pull request as ready for review September 27, 2023 07:57
Copy link
Contributor

@rtorrero rtorrero left a comment

Choose a reason for hiding this comment

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

LGTM @arbulu89, thanks!

Copy link
Member

@EMaksy EMaksy left a comment

Choose a reason for hiding this comment

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

Not an golang expert, but lgtm :D

@arbulu89 arbulu89 merged commit afa36cf into main Oct 2, 2023
@arbulu89 arbulu89 deleted the fact-value-nil-type branch October 2, 2023 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

3 participants