-
Notifications
You must be signed in to change notification settings - Fork 7
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
Query grouping dashboard changes and extensive tests #33
Conversation
Maybe I am not fully understanding the group-by feature, but if you do not do group_by on the table, shouldn't it show all of the single queries by themselves? Or does group-by have a different meaning in terms of the data? |
480693b
to
7336988
Compare
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.
@derek-ho Could you please also take a look?
Note after we add the cypress tests, we need to follow up on this PR to add integ tests for query group details page and also all other related changes as well.
package.json
Outdated
@@ -45,7 +45,7 @@ | |||
"@types/react-dom": "^16.9.8", | |||
"@types/object-hash": "^3.0.0", | |||
"@types/react-router-dom": "^5.3.2", | |||
"cypress": "9.5.4", | |||
"cypress": "12.17.4", |
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.
we are not adding cypress tests, why is this change needed?
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.
Getting error that version is not matching the version in OSD without this change
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.
You can add single-version=loose flag as true: https://github.com/opensearch-project/dashboards-observability/blob/453cca820efec085eeb922e0b200d63fa6207880/.github/workflows/lint.yml#L49
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.
But there is also no harm that I can see in bumping cypress version
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.
We need to update the package lock file if we want to bump up the version. Let's rebase the main branch to pick up the cypress version bump.
public/pages/QueryGroupDetails/Components/QueryGroupAggregateSummary.tsx
Outdated
Show resolved
Hide resolved
@derek-ho , |
Also please avoid creating branches in the original repo, follow the best practices in OpenSearch-Dashboards developer guide: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/DEVELOPER_GUIDE.md#fork-and-clone-opensearch-dashboards
|
public/pages/QueryGroupDetails/Components/QueryGroupAggregateSummary.tsx
Outdated
Show resolved
Hide resolved
public/pages/QueryGroupDetails/Components/QueryGroupAggregateSummary.tsx
Outdated
Show resolved
Hide resolved
Also please wait until this PR is merged: opensearch-project/query-insights#184 |
render: (indices: string[]) => Array.from(new Set(indices.flat())).join(', '), | ||
render: (indices: string[], query: SearchQueryRecord) => { | ||
const isSimilarity = query.group_by === 'SIMILARITY'; | ||
return isSimilarity ? '-' : Array.from(new Set(indices.flat())).join(', '); |
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.
Why are we not showing the indices of the group here?
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.
The group only contains indices of the first query in the group. Since displaying this information might be misleading we decided to not display this here after consulting with UX.
render: (nodeId: string, query: SearchQueryRecord) => { | ||
const isSimilarity = query.group_by === 'SIMILARITY'; | ||
return isSimilarity ? '-' : nodeId; | ||
}, | ||
sortable: true, | ||
truncateText: true, | ||
}, | ||
{ | ||
field: TOTAL_SHARDS_FIELD, | ||
name: TOTAL_SHARDS, | ||
render: (totalShards: number, query: SearchQueryRecord) => { | ||
const isSimilarity = query.group_by === 'SIMILARITY'; | ||
return isSimilarity ? '-' : totalShards; | ||
}, |
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.
Some of these don't seem to make sense if looking at group_by. Should we remove some columns from the table depending on the type you are looking at? Which brings up another question, I wasn't able to get to a situation where both group and single queries show up. If it is only one or the other, IMO it is confusing to put type filter - it should just be one or the other based on your configuration.
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.
Only if the user just switched from single query to group (or vice versa), the type parameter would be useful.
I think it makes sense to change the table column based on the data. A lot of the columns can be hidden if there's only one type of 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.
Some minor implementation concerns but nothing blocking - they can be addressed in follow ups. I am also not loving re-creating a component for the possibility they will diverge in the future, but if that is a UX call then let's go with it.
+1. I still think we should reuse the previous component. Splitting it out to a separate page would make it harder to maintain - for example, updating the chart library etc - Or you can abstract all the "sample query panels" into one component, and reuse it across query details page and sample queries page |
Also please add e2e tests for the grouping features as well. |
This reverts commit 9efdbaf. Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
956c0ff
to
6312c3d
Compare
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Will do this as a followup |
Discussed this specific point with Kevin and UX before implementation and they recommended creating a new component. Keeping this in mind lets keep it as is for now and take a call in the future based on how the pages evolve. |
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/query-insights-dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/query-insights-dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-33-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 67fd811437662e9b69ff5943440e2d5ec489d476
# Push it to GitHub
git push --set-upstream origin backport/backport-33-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/query-insights-dashboards/backport-2.x Then, create a pull request where the |
…ect#33) * Revert "remove records with grouping (opensearch-project#26)" This reverts commit 9efdbaf. Signed-off-by: Siddhant Deshmukh <[email protected]> * Query grouping dashboard changes and extensive tests Signed-off-by: Siddhant Deshmukh <[email protected]> * Fix tests and linting Signed-off-by: Siddhant Deshmukh <[email protected]> * Address review comments Signed-off-by: Siddhant Deshmukh <[email protected]> * Address review comments and update tests Signed-off-by: Siddhant Deshmukh <[email protected]> * Update cypress tests, hashcode to id, refactoring Signed-off-by: Siddhant Deshmukh <[email protected]> * Lint Signed-off-by: Siddhant Deshmukh <[email protected]> --------- Signed-off-by: Siddhant Deshmukh <[email protected]>
* Revert "remove records with grouping (#26)" This reverts commit 9efdbaf. * Query grouping dashboard changes and extensive tests * Fix tests and linting * Address review comments * Address review comments and update tests * Update cypress tests, hashcode to id, refactoring * Lint --------- Signed-off-by: Siddhant Deshmukh <[email protected]> Co-authored-by: Siddhant Deshmukh <[email protected]>
Description
Query grouping dashboard changes based on the proposed UX. Support grouping related configurations setting and viewing query groups using the query insights dashboards.
Currently, dashboards only supports Top N queries. With the introduction of grouping Top N queries by similarity, this PR aims to integrate query insights dashboard with the query grouping changes.
Change Details:
type
to filter outgroups
orqueries
Issues Resolved
List any issues this PR will resolve, e.g. Closes [...].
Closes : #14
Screenshots
Top N queries/groups page displaying multiple query groups:
Option to filter by group/query:
Query Group Details Page after clicking on the query group row in the Top N page:
Sample Query Details section on the query group details page:
Query Configuration Page to configure Top N Query Groups:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.