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

fix tag filter matching logic to recognize null val #4001

Merged
merged 1 commit into from
Jun 30, 2020

Conversation

vjeffrey
Copy link

@vjeffrey vjeffrey commented Jun 28, 2020

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

@vjeffrey vjeffrey changed the title wip fix tag filter matching logic to recognize null val Jun 29, 2020
we were not matching on requests for tag keys that do not have
values, and so customers were seeing empty csv reports and json reports
with no controls array. this fixes the match logic to ensure a tag with
no values matches the filter request format

Signed-off-by: Victoria Jeffrey <vjeffrey@chef.io>
@vjeffrey vjeffrey marked this pull request as ready for review June 29, 2020 23:24
@lancewf lancewf requested a review from a team June 30, 2020 16:07
@lancewf lancewf added bug πŸ› Something isn't working compliance reporting This issue or pull request applies to the compliance reporting part of Automate labels Jun 30, 2020
Copy link
Contributor

@lancewf lancewf left a comment

Choose a reason for hiding this comment

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

Fixes it for me

@vjeffrey vjeffrey merged commit 90b8f6e into master Jun 30, 2020
@chef-expeditor chef-expeditor bot deleted the vj/fix-tag-filt-report branch June 30, 2020 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug πŸ› Something isn't working compliance reporting This issue or pull request applies to the compliance reporting part of Automate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants