Skip to content

Conversation

@omkarK06
Copy link
Contributor

@omkarK06 omkarK06 commented Aug 29, 2024

fix #4344
1. Sometimes user has to click cancel query multiple times for the query to get cancelled
2. Add Column and expand log, click on column header. Now when we expand any row, it does not expands at desired
position

Reverted the previous timestamp column functionality.

Summary by CodeRabbit

  • New Features

    • Introduced asynchronous loading for the QueryEditor component to improve initial load times in the JsonPreview.
    • Enhanced column order handling in SearchResult for more dynamic adjustments based on default columns.
  • Bug Fixes

    • Added error handling in the getNestedJson function to improve robustness against unexpected input.
  • Style

    • Updated the background color of the table resizer for better visual consistency.
  • Chores

    • Disabled sorting functionality by default in the table component to streamline user experience.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 29, 2024

Walkthrough

The changes primarily enhance the functionality and error handling of the logs-related components in the application. Key modifications include improved control flow in data processing, the introduction of asynchronous loading for components, and adjustments to column order handling in the search results. These updates aim to streamline user interactions and ensure more robust error management throughout the log search functionalities.

Changes

Files Change Summary
web/src/composables/useLogs.ts Enhanced control flow and error handling in useLogs, including changes to histogram generation and simplification of cancellation checks.
web/src/plugins/logs/JsonPreview.vue Added asynchronous loading for QueryEditor and introduced error handling in getNestedJson. Minor formatting adjustments made for readability.
web/src/plugins/logs/SearchResult.vue Modified handleColumnOrderUpdate method to dynamically adjust column order based on presence of default columns, improving flexibility in column management.
web/src/plugins/logs/TenstackTable.vue Disabled sorting by default in useVueTable configuration and updated .resizer styles. Removed media query for simplification of hover behavior.

Assessment against linked issues

Objective Addressed Explanation
Histogram should partially load when user cancels query mid-way (related to issue #4344)
Sometimes user has to click cancel query multiple times for the query to get cancelled (related to issue #4344) Unclear if multiple clicks issue is resolved.
The data on logs UI does not load and displays infinite loading when user searches longer duration (related to issue #4344) No changes related to loading issues were observed.
Add Column and expand log, click on column header. Now when we expand any row, it does not expand at desired position (related to issue #4344)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the ☢️ Bug Something isn't working label Aug 29, 2024
@bjp232004 bjp232004 force-pushed the fix/cancel_query_histogram_issue branch from c11007d to d60c9f9 Compare August 29, 2024 04:36
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a7990a4 and c11007d.

Files selected for processing (4)
  • web/src/composables/useLogs.ts (5 hunks)
  • web/src/plugins/logs/JsonPreview.vue (4 hunks)
  • web/src/plugins/logs/SearchResult.vue (1 hunks)
  • web/src/plugins/logs/TenstackTable.vue (2 hunks)
Additional comments not posted (14)
web/src/plugins/logs/JsonPreview.vue (2)

234-234: LGTM!

The import of defineAsyncComponent is correct and necessary for defining asynchronous components.

The code changes are approved.


268-270: LGTM!

Defining QueryEditor as an asynchronous component using defineAsyncComponent improves the loading behavior by loading it only when needed.

The code changes are approved.

web/src/plugins/logs/TenstackTable.vue (2)

476-476: LGTM!

Disabling sorting by default in useVueTable configuration might be intentional to improve performance or user experience.

The code changes are approved.


688-688: LGTM!

Updating the background color of the .resizer class to $primary ensures consistency in the UI.

The code changes are approved.

web/src/plugins/logs/SearchResult.vue (7)

259-259: LGTM!

Introducing updatedColOrder enhances the flexibility of the column order handling by allowing for the dynamic adjustment of the order based on the presence of default columns.

The code changes are approved.


261-262: LGTM!

Removing the timestamp column from updatedColOrder ensures that it is not included in the saved column order, which might be a requirement for the application.

The code changes are approved.


264-265: LGTM!

Removing the "source" column from updatedColOrder if its resizing is disabled ensures that it is not included in the saved column order, which might be a requirement for the application.

The code changes are approved.


264-264: LGTM!

Finding the index of the "source" column using updatedColOrder.indexOf("source") is necessary to determine if it is present in updatedColOrder.

The code changes are approved.


266-267: LGTM!

Finding the index of the "source" column in the columns array using columns.findIndex((col: any) => col.name === "source") is necessary to determine if it is present in the columns array.

The code changes are approved.


271-272: LGTM!

Checking the resizing property of the "source" column using columns[sourceColIndex].enableResizing === false ensures that it is removed from updatedColOrder if its resizing is disabled.

The code changes are approved.


277-278: LGTM!

Updating the column order using this.searchObj.data.resultGrid.colOrder[this.searchObj.data.stream.selectedStream] = [...updatedColOrder] ensures that the column order is updated with the modified updatedColOrder.

The code changes are approved.

web/src/composables/useLogs.ts (3)

2334-2342: LGTM!

The function getHistogramQueryData has been simplified to streamline the condition for checking if the operation was cancelled. The changes enhance the clarity and efficiency of the code.

The code changes are approved.


Line range hint 3004-3026: LGTM!

The function updateGridColumns has been simplified to handle the resultGrid.columns array. The changes enhance the clarity and efficiency of the code.

The code changes are approved.


1705-1707: LGTM! But verify the function usage.

The function generateHistogramSkeleton is correctly implemented. However, ensure that the function is called in the correct context after reversing the partitions array.

The code changes are approved.

Run the following script to verify the function usage:

Verification successful

Function generateHistogramSkeleton is used correctly.

The function generateHistogramSkeleton is implemented and used appropriately within the web/src/composables/useLogs.ts file. Its usage aligns with the expected behavior of preparing the histogram skeleton before further processing.

  • The function is awaited before iterating over partitions.
  • It is also called before generating histogram data.

No issues were found with its usage.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `generateHistogramSkeleton`.

# Test: Search for the function usage. Expect: Only occurrences of the new context.
rg --type javascript -A 5 $'generateHistogramSkeleton'

Length of output: 88


Script:

#!/bin/bash
# Description: Verify all function calls to `generateHistogramSkeleton`.

# Test: Search for the function usage. Expect: Only occurrences of the new context.
rg --type typescript -A 5 $'generateHistogramSkeleton'

Length of output: 88


Script:

#!/bin/bash
# Description: Verify all function calls to `generateHistogramSkeleton`.

# Test: Search for the function usage. Expect: Only occurrences of the new context.
rg -A 5 $'generateHistogramSkeleton'

Length of output: 1288

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c11007d and d60c9f9.

Files selected for processing (4)
  • web/src/composables/useLogs.ts (5 hunks)
  • web/src/plugins/logs/JsonPreview.vue (4 hunks)
  • web/src/plugins/logs/SearchResult.vue (1 hunks)
  • web/src/plugins/logs/TenstackTable.vue (2 hunks)
Files skipped from review as they are similar to previous changes (4)
  • web/src/composables/useLogs.ts
  • web/src/plugins/logs/JsonPreview.vue
  • web/src/plugins/logs/SearchResult.vue
  • web/src/plugins/logs/TenstackTable.vue

@omkarK06 omkarK06 force-pushed the fix/cancel_query_histogram_issue branch from d60c9f9 to 993137a Compare August 29, 2024 05:22
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d60c9f9 and 993137a.

Files selected for processing (4)
  • web/src/composables/useLogs.ts (5 hunks)
  • web/src/plugins/logs/JsonPreview.vue (4 hunks)
  • web/src/plugins/logs/SearchResult.vue (1 hunks)
  • web/src/plugins/logs/TenstackTable.vue (2 hunks)
Files skipped from review as they are similar to previous changes (4)
  • web/src/composables/useLogs.ts
  • web/src/plugins/logs/JsonPreview.vue
  • web/src/plugins/logs/SearchResult.vue
  • web/src/plugins/logs/TenstackTable.vue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

☢️ Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logs related issues

2 participants