-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Cloud Posture] fix findings table sort casing bug #148529
Conversation
Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security) |
return { [sort.field]: sort.direction }; | ||
}; | ||
|
||
const requiredSortingByPainlessScript = ['rule.section', 'resource.name', 'resource.type']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ofiriro3,
Forgive me if I need more context here. Would you mind adding a comment about why these fields require such a sorting instead of using a more native Elasticsearch solution like normalizer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @opauloh.
We had a long discussion about how should we solve the sorting problem.
One of the solutions that I suggested was indeed a normalizer, in the end, it was decided to use a painless script.
Long story short, we didn't want to change the schema/mapping.
You are more than welcome to read the discussion ->
.../plugins/cloud_security_posture/public/pages/findings/latest_findings/use_latest_findings.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM, just left a suggestion
…test_findings/use_latest_findings.ts Co-authored-by: Paulo Henrique <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good! 🥇
left some comments for your discretion
.../plugins/cloud_security_posture/public/pages/findings/latest_findings/use_latest_findings.ts
Show resolved
Hide resolved
x-pack/test/cloud_security_posture_functional/pages/findings.ts
Outdated
Show resolved
Hide resolved
|
||
// We need to use a dataset for the tests to run | ||
// We intentionally make some fields start with a capital letter to test that the query bar is case-insensitive/case-sensitive | ||
const data = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defining the data is now longer and very focused on sorting. i think we can narrow it down a bit. for example, using single chars or shorter sentences would achieve the same result. and instead of doing chance.integer() % 2 ...
multiple times, we can do it once and do the same for the text casing.
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
Summary
Currently our cloud-security-posture Findings page sort some fields with regard to case sensitivity, we would like them to be sorted in alphabetical order regardless of their upper case/lower case characters.
Related Findings fields
rule.section
resource.name
resource.type
Related issues: