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

Adjust counting logic for categories/policy templates #716

Merged
merged 9 commits into from
Sep 8, 2021

Conversation

mtojek
Copy link
Contributor

@mtojek mtojek commented Sep 7, 2021

Issue: #714

This PR corrects following issues:

  • /categories counts policies and packages separatedly as now, but packages are counted too if they don't match but any of their policies does (for the AWS case this would mean that the count for datastore would be 3: the package and the rds and dynamodb policies, it is 2 now).
  • /search returns packages with their policies filtered out (for AWS it would return a package with just 2 policies, what would match the count of 3).

@mtojek mtojek self-assigned this Sep 7, 2021
@elasticmachine
Copy link

elasticmachine commented Sep 7, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-09-08T09:10:31.112+0000

  • Duration: 4 min 20 sec

  • Commit: 886963d

Test stats 🧪

Test Results
Failed 0
Passed 93
Skipped 0
Total 93

Trends 🧪

Image of Build Times

Image of Tests

@mtojek mtojek marked this pull request as ready for review September 8, 2021 09:00
@mtojek mtojek requested a review from jsoriano September 8, 2021 09:00
@mtojek mtojek marked this pull request as draft September 8, 2021 09:01
@mtojek mtojek marked this pull request as ready for review September 8, 2021 09:04
Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

Great, thanks!

package util

// StringsContains function checks if needle is present in the stack.
func StringsContains(haystack []string, needle string) bool {
Copy link
Member

Choose a reason for hiding this comment

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

😄 love the variable names

@mtojek mtojek merged commit 89b3dd2 into elastic:master Sep 8, 2021
@mtojek mtojek mentioned this pull request Sep 8, 2021
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.

3 participants