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

ignore status for chicklets #3254

Merged
merged 3 commits into from
Apr 3, 2020

Conversation

rickmarry
Copy link
Contributor

🔩 Description: What code changed, and why?

When we send it status as a filter for nodes or profiles lists, do not apply the status filter to the actual summary counts. If we apply the status filter to the counts then we won't be able to subsequently choose them in the UI

⛓️ Related Resources

👍 Definition of Done

👟 How to Build and Test the Change

✅ Checklist

📷 Screenshots, if applicable

Signed-off-by: Rick Marry <[email protected]>
@rickmarry rickmarry force-pushed the rm/keep-node-counts-unfiltered-for-chicklets branch from 0e2d3b3 to 485b761 Compare March 31, 2020 20:28
Signed-off-by: Rick Marry <[email protected]>
@vjeffrey
Copy link

vjeffrey commented Apr 1, 2020

i'm noticing some differences between the results for nodes and profiles:

curl --insecure -H "api-token: g7AqNx2Pnv8E6hyoGZVlkQPRvPw=" -s https://a2-dev.test/api/v0/compliance/reporting/nodes/search -d '{"filters": [{"type": "status", "values": ["waived"] } ]}'

{"nodes":[{"id":"34cbbb55-c502-4971-2222-999999999999","name":"osx(1)-omega-pro2(w)-waived","platform":{"name":"mac_os_x","release":"17.7.0","full":"mac_os_x 17.7.0"},"environment":"DevSec Prod Omega","latest_report":{"id":"44024b50-2e0d-42fa-dddd-wwwwwwwwwwww","end_time":"2020-04-01T10:18:41Z","status":"waived","controls":{"total":1,"passed":{"total":0},"skipped":{"total":0},"failed":{"total":0,"minor":0,"major":0,"critical":0},"waived":{"total":1}}},"tags":[],"profiles":[{"name":"myprofile2","version":"1.0.5","id":"447542ecfb8a8800ed0146039da3af8fed047f575f6037cfba75f3b664a97ea5","status":"waived","full":"My Profile 2 title, v1.0.5"}]}],
"total":1,"total_passed":0,"total_failed":2,"total_skipped":1,"total_waived":1}%                                                                                                                                                          

curl --insecure -H "api-token: g7AqNx2Pnv8E6hyoGZVlkQPRvPw=" -s https://a2-dev.test/api/v0/compliance/reporting/profiles -d '{"filters": [{"type": "status", "values": ["waived"] } ]}'

{"profiles":[{"name":"myprofile2","title":"My Profile 2 title","id":"447542ecfb8a8800ed0146039da3af8fed047f575f6037cfba75f3b664a97ea5","version":"1.0.5","status":"waived"}],"counts":{"total":5,"failed":2,"skipped":1,"passed":1,"waived":1}}

note that on the nodes call, we return the correct counts for individual statuses, but the total is affected by the status filter.
on the profiles call, the total is not affected by the status filter

@rickmarry
Copy link
Contributor Author

i'm noticing some differences between the results for nodes and profiles:

curl --insecure -H "api-token: g7AqNx2Pnv8E6hyoGZVlkQPRvPw=" -s https://a2-dev.test/api/v0/compliance/reporting/nodes/search -d '{"filters": [{"type": "status", "values": ["waived"] } ]}'

{"nodes":[{"id":"34cbbb55-c502-4971-2222-999999999999","name":"osx(1)-omega-pro2(w)-waived","platform":{"name":"mac_os_x","release":"17.7.0","full":"mac_os_x 17.7.0"},"environment":"DevSec Prod Omega","latest_report":{"id":"44024b50-2e0d-42fa-dddd-wwwwwwwwwwww","end_time":"2020-04-01T10:18:41Z","status":"waived","controls":{"total":1,"passed":{"total":0},"skipped":{"total":0},"failed":{"total":0,"minor":0,"major":0,"critical":0},"waived":{"total":1}}},"tags":[],"profiles":[{"name":"myprofile2","version":"1.0.5","id":"447542ecfb8a8800ed0146039da3af8fed047f575f6037cfba75f3b664a97ea5","status":"waived","full":"My Profile 2 title, v1.0.5"}]}],
"total":1,"total_passed":0,"total_failed":2,"total_skipped":1,"total_waived":1}%                                                                                                                                                          

curl --insecure -H "api-token: g7AqNx2Pnv8E6hyoGZVlkQPRvPw=" -s https://a2-dev.test/api/v0/compliance/reporting/profiles -d '{"filters": [{"type": "status", "values": ["waived"] } ]}'

{"profiles":[{"name":"myprofile2","title":"My Profile 2 title","id":"447542ecfb8a8800ed0146039da3af8fed047f575f6037cfba75f3b664a97ea5","version":"1.0.5","status":"waived"}],"counts":{"total":5,"failed":2,"skipped":1,"passed":1,"waived":1}}

note that on the nodes call, we return the correct counts for individual statuses, but the total is affected by the status filter.
on the profiles call, the total is not affected by the status filter

So you agree with the way profiles call responds and are pointing out the the total on the nodes call is off.. correct?

@vjeffrey
Copy link

vjeffrey commented Apr 2, 2020

yes!

Signed-off-by: Rick Marry <[email protected]>
Copy link

@vjeffrey vjeffrey left a comment

Choose a reason for hiding this comment

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

nice thank you!

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.

2 participants