fix tag filter matching logic to recognize null val #4001
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Victoria Jeffrey vjeffrey@chef.io
π© Description: What code changed, and why?
from the customer: "When using the 'Control Tag' filter in the Compliance tab of Automate, no output is generated when exporting to .csv."
https://getchef.zendesk.com/agent/tickets/25517
After some investigation I realized this was the case only for tags that used the "no value" option (or empty string) for the values. We were incorrectly matching when the values were empty and since no matches were found, only returning profile/node info from the report and no controls.
This fixes that issue by resolving the matching of null value for the tag key in es with the record of the empty string value for the tag val in the api
βοΈ Related Resources
https://getchef.zendesk.com/agent/tickets/25517
https://github.com/chef/customer-bugs/issues/205
π Definition of Done
filtering the reports by a tag with only key (no value) correctly filters the reports and returns matching controls
π How to Build and Test the Change
rebuild compliance
load_compliance_reports
filter by a key that has no value (web is a good one for this)
download reports
check they have the correct info
β Checklist
π· Screenshots, if applicable