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

feat: add helpful notes when tables are missing due to clickhouse misconfiguration #407

Merged
merged 3 commits into from
Nov 13, 2024

Conversation

duyet
Copy link
Owner

@duyet duyet commented Nov 13, 2024

Screenshot 2024-11-13 at 17 17 02

Summary by Sourcery

Introduce a feature to provide users with helpful notes and documentation links when tables are missing due to ClickHouse misconfiguration. Enhance the ErrorAlert component to support displaying these notes, improving user guidance during error scenarios. Update the ClickHouse documentation to reflect these changes.

New Features:

  • Add a feature to display useful notes when tables are missing due to ClickHouse misconfiguration, enhancing error alerts with documentation links.

Enhancements:

  • Enhance the ErrorAlert component to include a new 'docs' prop for displaying documentation links related to errors.

Documentation:

  • Update the ClickHouse system tables documentation to include a new entry for enabling system tables.

Copy link

vercel bot commented Nov 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clickhouse-monitoring ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 13, 2024 10:34am

Copy link
Contributor

sourcery-ai bot commented Nov 13, 2024

Reviewer's Guide by Sourcery

This PR adds helpful documentation links and error messages when ClickHouse system tables are missing due to misconfiguration. The implementation adds a new docs property to query configurations and enhances the error alert component to display documentation guidance when queries fail.

Class diagram for ErrorAlert component

classDiagram
    class ErrorAlertProps {
        +string title
        +string|React.ReactNode|React.ReactNode[] message
        +string|React.ReactNode|React.ReactNode[] docs
        +string query
        +void reset()
        +string className
    }
    class ErrorAlert {
        +string title
        +string|React.ReactNode|React.ReactNode[] message
        +string|React.ReactNode|React.ReactNode[] docs
        +string query
        +void reset()
        +string className
        +renderContent(message)
        +renderAccordion(title, content)
        +renderDocs(docs)
    }
    note for ErrorAlert "Added docs property and renderDocs method"
Loading

Class diagram for QueryConfig interface

classDiagram
    class QueryConfig {
        +string name
        +string description
        +string sql
        +ClickHouseSettings clickhouseSettings
        +string docs
    }
    note for QueryConfig "Added docs property for documentation links"
Loading

File-Level Changes

Change Details Files
Added documentation links for missing system tables
  • Created constants for system table documentation messages
  • Added docs property to QueryConfig interface
  • Added documentation links to various query configurations
lib/table-notes.ts
types/query-config.ts
app/[host]/[query]/queries/query-cache.ts
app/[host]/[query]/merges/merge-performance.ts
app/[host]/[query]/more/count-across-replicas.ts
app/[host]/[query]/more/top-usage-columns.ts
app/[host]/[query]/queries/expensive-queries-by-memory.ts
app/[host]/[query]/queries/expensive-queries.ts
app/[host]/[query]/queries/failed-queries.ts
app/[host]/[query]/more/backups.ts
app/[host]/[query]/more/top-usage-tables.ts
app/[host]/[query]/more/zookeeper.ts
app/[host]/[query]/queries/history-queries.ts
Enhanced error alert component to display documentation guidance
  • Added docs property to ErrorAlertProps interface
  • Implemented new renderDocs function to display documentation with an icon
  • Updated error alert rendering in Table component
components/error-alert.tsx
components/table.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @duyet - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Review instructions: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov-commenter
Copy link

codecov-commenter commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.34%. Comparing base (fe41af6) to head (f427220).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #407   +/-   ##
=======================================
  Coverage   78.34%   78.34%           
=======================================
  Files           5        5           
  Lines         157      157           
  Branches       57       57           
=======================================
  Hits          123      123           
  Misses         34       34           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-commenter
Copy link

codecov-commenter commented Nov 13, 2024

Bundle Report

Changes will increase total bundle size by 8.51kB (0.14%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
clickhouse-monitoring-bundle-server-cjs 2.37MB 2.04kB (0.09%) ⬆️
clickhouse-monitoring-bundle-client-array-push 3.57MB 6.47kB (0.18%) ⬆️

@duyet duyet changed the title feat: add useful note when tables are missing due to clickhouse misconfiguration feat: add helpful notes when tables are missing due to clickhouse misconfiguration Nov 13, 2024
@duyet
Copy link
Owner Author

duyet commented Nov 13, 2024

cc @gregzuro

@duyet duyet merged commit 3d26aa5 into main Nov 13, 2024
22 checks passed
@duyet duyet deleted the feat/table-not-found-message branch November 13, 2024 10:39
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.

2 participants