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

chore: add debug info for query blank issue #1406

Merged
merged 2 commits into from
Sep 11, 2024
Merged

Conversation

saravmajestic
Copy link
Collaborator

@saravmajestic saravmajestic commented Sep 11, 2024

Overview

Problem

Query results panels does not show the table sometimes

Solution

Added a debug workflow for getting more info for debugging this issue

Screenshot/Demo

A picture is worth a thousand words. Please highlight the changes if applicable.

How to test

  • execute a dbt sql
  • Open command paletter Cmd/Ctrl + shift + P
  • Select "Query Results Debug Info"
  • This will send a telemetry event with debug info

Checklist

  • I have run this code and it appears to resolve the stated issue
  • README.md updated and added information about my change

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a new command to gather debug information related to query results for improved debugging and data analysis.
    • Enhanced the query panel to collect detailed metrics about query results, including viewer height and row count.
    • Added a new option in the command palette titled "Query Results Debug Info."
  • Bug Fixes

    • Improved handling of query results and error processing within the query panel.
  • Style

    • Updated the layout of the perspective viewer component to ensure a minimum height for better usability across different screen sizes.

@saravmajestic saravmajestic self-assigned this Sep 11, 2024
Copy link
Contributor

coderabbitai bot commented Sep 11, 2024

Walkthrough

The changes introduce a new command for collecting query results debug information in the application, enhancing the functionality of the dbt Power User features. This includes modifications to the package.json, updates to the QueryResultPanel class to handle the new command, adjustments to the query panel's CSS for improved layout, and enhancements to the query panel's state management to include detailed runtime metrics.

Changes

Files Change Summary
package.json Added command dbtPowerUser.collectQueryResultsDebugInfo to the commands array.
src/webview_provider/queryResultPanel.ts Added enum value CollectQueryResultsDebugInfo and method collectQueryResultsDebugInfo to handle command. Updated handleCommand method to include telemetry for the new command.
webview_panels/src/modules/queryPanel/components/perspective/perspective.module.scss Added min-height: 50vh to the .altimatePerspectiveViewer class for improved layout.
webview_panels/src/modules/queryPanel/useQueryPanelListeners.ts Included queryResults in state management and added collectQueryResultsDebugInfo function for metrics collection.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CommandPalette
    participant QueryResultPanel
    participant Webview

    User->>CommandPalette: Trigger "Query Results Debug Info"
    CommandPalette->>QueryResultPanel: Execute dbtPowerUser.collectQueryResultsDebugInfo
    QueryResultPanel->>Webview: Send debug info request
    Webview-->>QueryResultPanel: Return debug info
    QueryResultPanel->>User: Display debug info
Loading

Poem

🐰 In the garden of code, changes bloom bright,
A command for debug, brings new delight.
With metrics and insights, our queries will sing,
Hopping through data, oh what joy they bring!
So gather 'round, friends, let’s cheer and play,
For the power of dbt shines brighter today! 🌼


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between efcdf89 and e86fd71.

Files selected for processing (4)
  • package.json (1 hunks)
  • src/webview_provider/queryResultPanel.ts (3 hunks)
  • webview_panels/src/modules/queryPanel/components/perspective/perspective.module.scss (1 hunks)
  • webview_panels/src/modules/queryPanel/useQueryPanelListeners.ts (7 hunks)
Files skipped from review due to trivial changes (2)
  • src/webview_provider/queryResultPanel.ts
  • webview_panels/src/modules/queryPanel/components/perspective/perspective.module.scss
Files skipped from review as they are similar to previous changes (2)
  • package.json
  • webview_panels/src/modules/queryPanel/useQueryPanelListeners.ts

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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@anandgupta42
Copy link
Contributor

@coderabbitai review all

Copy link
Contributor

coderabbitai bot commented Sep 11, 2024

@anandgupta42: I have reviewed all the changes in the PR. The new command dbtPowerUser.gatherQueryResultsDebugInfo has been added to gather debug information for query results, and the implementation looks solid. The debug information collected includes useful details such as perspective height, number of rows, and query results data. Everything seems to be in order.

Analysis chain
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Fetch the diff of the PR to review all changes.
gh pr diff 1406

Length of output: 5767

Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

coderabbitai bot commented Sep 11, 2024

Walkthrough

The changes introduce a new command, dbtPowerUser.gatherQueryResultsDebugInfo, to the application, enabling users to gather debug information related to query results. This command is integrated into various components, including the QueryResultPanel and the useQueryPanelListeners, enhancing the functionality for debugging and data analysis. The updates include new methods and state management improvements to facilitate the collection and reporting of query results and associated metrics.

Changes

File Path Change Summary
package.json Added command dbtPowerUser.gatherQueryResultsDebugInfo to commands array.
src/webview_provider/queryResultPanel.ts Added enum value CollectQueryResultsDebugInfo, method collectQueryResultsDebugInfo, and updated command handling.
webview_panels/src/modules/queryPanel/useQueryPanelListeners.ts Added queryResults to state, introduced collectQueryResultsDebugInfo function for gathering metrics.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CommandPalette
    participant QueryResultPanel
    participant Webview

    User->>CommandPalette: Execute "Query Results Debug Info"
    CommandPalette->>QueryResultPanel: Trigger `collectQueryResultsDebugInfo`
    QueryResultPanel->>Webview: Send debug info request
    Webview-->>QueryResultPanel: Return query results debug info
    QueryResultPanel->>User: Display debug info
Loading

Poem

🐇 In the garden of code, a new command blooms,
Gathering debug info, dispelling the glooms.
With queries in hand, we hop and we play,
Debugging our data, come join the ballet!
So let’s celebrate changes, both big and small,
For in this code garden, there’s room for us all! 🌼


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between efcdf89 and 9116d86.

Files selected for processing (3)
  • package.json (1 hunks)
  • src/webview_provider/queryResultPanel.ts (3 hunks)
  • webview_panels/src/modules/queryPanel/useQueryPanelListeners.ts (7 hunks)
Additional comments not posted (9)
webview_panels/src/modules/queryPanel/useQueryPanelListeners.ts (4)

30-31: LGTM!

The code change is approved. Destructuring queryResults from the state allows the function to access and utilize query results directly.


82-83: LGTM!

The code change is approved. Including queryResults in the dispatched action improves the state management.


97-97: LGTM!

The code change is approved. Including queryResults in the dispatched action improves the state management.


114-132: LGTM!

The code changes are approved. The new function collectQueryResultsDebugInfo enhances the debugging capabilities of the query panel by providing detailed runtime information.

src/webview_provider/queryResultPanel.ts (4)

82-82: LGTM!

The code change is approved. Adding the new enum value CollectQueryResultsDebugInfo to the InboundCommand enum facilitates the handling of a specific command related to gathering debug information for query results.


181-187: LGTM!

The code change is approved. Registering the new command dbtPowerUser.gatherQueryResultsDebugInfo in the constructor of the QueryResultPanel class allows the collectQueryResultsDebugInfo method to be triggered via the command palette.


189-193: LGTM!

The code change is approved. The new private method collectQueryResultsDebugInfo in the QueryResultPanel class is correctly implemented and enhances the functionality by enabling it to collect and report debug information.


489-494: LGTM!

The code change is approved. Adding a case for the new CollectQueryResultsDebugInfo command in the handleCommand method is correctly implemented and improves the debugging capabilities of the application by sending a telemetry event with relevant data.

package.json (1)

343-347: LGTM!

The code change is approved. Adding the new command dbtPowerUser.gatherQueryResultsDebugInfo to the commands array in the package.json file is correctly implemented and enhances the functionality of the application by providing users with a new option to gather debug information related to query results.


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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@saravmajestic saravmajestic marked this pull request as ready for review September 11, 2024 10:33
Copy link

ellipsis-dev bot commented Sep 11, 2024

Your free trial has expired. To keep using Ellipsis, sign up at https://app.ellipsis.dev for $20/seat/month or reach us at [email protected]

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