-
Notifications
You must be signed in to change notification settings - Fork 14
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(ci): testing configured queries against ClickHouse versions #433
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Reviewer's Guide by SourceryThis PR enhances the query detail view with improved UI elements, better link handling, and adds testing for configured queries against different ClickHouse versions. The changes include UI refinements, new link behaviors for database and table references, and the addition of a new CI workflow. No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Bundle ReportChanges will increase total bundle size by 1.38kB (0.02%) ⬆️. This is within the configured threshold ✅ Detailed changes
|
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.
Hey @duyet - I've reviewed your changes - here's some feedback:
Overall Comments:
- The test-queries-config job has an incomplete Jest run command that needs to be completed to properly test against different ClickHouse versions
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Review instructions: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -139,7 +146,7 @@ export async function QueryDetailCard({ | |||
key="initial_user" | |||
> | |||
{initial_user} |
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.
suggestion: FilterIcon seems inappropriate for a user detail link - consider using a more semantically appropriate icon
The FilterIcon suggests filtering functionality which isn't present here. Consider using the original ExternalLinkIcon or another icon that better represents viewing user details.
{initial_user}
<ExternalLinkIcon className="size-3" />
@@ -16,6 +16,7 @@ export function TruncatedList({ | |||
}: TruncatedListProps) { | |||
const [isExpanded, setIsExpanded] = useState(false) | |||
const isClamped = Children.count(children) > items |
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.
suggestion (performance): Avoid calling Children.count() twice by storing the result in a variable
The children count is calculated both for isClamped and length. Consider calculating it once and reusing the value.
const childrenCount = Children.count(children)
const isClamped = childrenCount > items
@@ -299,36 +311,70 @@ export async function QueryDetailCard({ | |||
} | |||
} | |||
|
|||
function bindingDatabaseLink(databases: Array<string>): React.ReactNode[] { | |||
function bindingDatabaseLink( |
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.
issue (complexity): Consider using a factory function pattern to unify the link binding functions.
The binding functions share significant common patterns that can be simplified using a factory approach. This reduces duplication while keeping domain logic clear:
// Factory function for creating link bindings
function createLinkBinding(
urlGenerator: (item: string) => string | Promise<string>,
icon: React.ReactNode = <ExternalLinkIcon className="size-3" />,
transform?: (item: string) => { text: string, url: string | Promise<string> }
) {
return (items: string[]): React.ReactNode[] | null => {
if (!items.length) return null;
return items.map(async (item) => {
const { text, url } = transform
? transform(item)
: { text: item, url: urlGenerator(item) };
return (
<Link
className="flex flex-row items-center gap-1"
key={item}
href={await url}
>
{text} {icon}
</Link>
);
});
};
}
// Example usage:
const bindingDataFormat = createLinkBinding(
() => "https://clickhouse.com/docs/en/chdb/data-formats",
);
const bindingTableLink = createLinkBinding(
async (item) => {
const [database, table] = item.split('.');
return database.startsWith('_table_function')
? `https://clickhouse.com/docs/en/sql-reference/table-functions/${table}`
: await getScopedLink(`/database/${database}/${table}`);
},
<MoveRightIcon className="size-3" />
);
This approach:
- Eliminates repeated null checks and Link boilerplate
- Keeps domain-specific logic explicit and configurable
- Makes it easy to customize URLs and icons per binding type
- Reduces overall code size while improving maintainability
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #433 +/- ##
=======================================
Coverage 77.16% 77.16%
=======================================
Files 5 5
Lines 162 162
Branches 60 59 -1
=======================================
Hits 125 125
- Misses 34 37 +3
+ Partials 3 0 -3 ☔ View full report in Codecov by Sentry. |
121b1bb
to
c8f5b50
Compare
c8f5b50
to
81d4445
Compare
81d4445
to
8f7579d
Compare
97fd6bb
to
9bbf357
Compare
9bbf357
to
7037abe
Compare
7037abe
to
3d584e0
Compare
ba8d6c7
to
e0bc4fe
Compare
e0bc4fe
to
71dbe6a
Compare
71dbe6a
to
b129f87
Compare
72ee8fe
to
f0913c8
Compare
f0913c8
to
6001f7f
Compare
6001f7f
to
2a472c5
Compare
2a472c5
to
33bb5df
Compare
Summary by Sourcery
Add a new CI workflow to test queries against multiple ClickHouse versions and enhance UI components for better user experience. Update tests to align with UI changes.
New Features:
Enhancements:
CI:
Tests: