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

Query validator FE #47098

Merged
merged 10 commits into from
Aug 29, 2024
Merged

Query validator FE #47098

merged 10 commits into from
Aug 29, 2024

Conversation

npfitz
Copy link
Contributor

@npfitz npfitz commented Aug 21, 2024

Closes #45546

Depends on https://github.com/metabase/harbormaster/issues/5156

Description

Adds a UI for the Query Field Validation Feature. This will display queries with broken data references in a table under Admin -> Troubleshooting -> Query Validation.

How to verify

The easiest way to create an invalid card is to do so via SQL Queries. Go to New -> SQL Query and type Select foo from Orders. Save the card, then go to Admin -> Troubleshooting -> Query Validation. Your card should be present.

Demo

image
(pretend creator is populated above)

Checklist

  • Tests have been added/updated to cover changes in this PR

@npfitz npfitz added the no-backport Do not backport this PR to any branch label Aug 21, 2024
@npfitz npfitz self-assigned this Aug 21, 2024
@metabase-bot metabase-bot bot added the .Team/AdminWebapp Admin and Webapp team label Aug 21, 2024
@npfitz npfitz marked this pull request as ready for review August 23, 2024 12:35
@npfitz npfitz requested a review from camsaul as a code owner August 23, 2024 12:35
@npfitz npfitz changed the title Query validator WIP - Do Not Merge: Query validator Aug 23, 2024
@npfitz npfitz force-pushed the query-validator branch 2 times, most recently from 7718fad to b0fa4dc Compare August 28, 2024 03:27
@npfitz npfitz changed the title WIP - Do Not Merge: Query validator Query validator FE Aug 28, 2024
@npfitz npfitz requested a review from iethree August 28, 2024 18:43
Copy link
Contributor

@sloansparger sloansparger left a comment

Choose a reason for hiding this comment

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

The code looks good, going to pull it down before approving though.

@@ -0,0 1,19 @@
import { Api } from "metabase/api";
Copy link
Contributor

Choose a reason for hiding this comment

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

Use the EnterpriseApi instead

if (messages.length > 0) {
return messages.join(", ");
} else {
return "I don't know what's wrong, but it's broken";
Copy link
Contributor

Choose a reason for hiding this comment

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

Translate probably pick something more Metabase-y sounding 😅

Comment on lines 34 to 36
const errorTypes = Object.keys(
ERROR_DICTIONARY,
) as (keyof typeof ERROR_DICTIONARY)[];
Copy link
Contributor

Choose a reason for hiding this comment

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

two minor nits

  • this can be moved out of this function so it's only done once
  • i think using _.keys will do the same without having to do the typecasting

Copy link
Contributor

@sloansparger sloansparger left a comment

Choose a reason for hiding this comment

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

Can we get some kind of empty state in here before merging?

CleanShot 2024-08-28 at 14 22 31@2x

@sloansparger sloansparger self-requested a review August 28, 2024 19:46
Copy link
Contributor

@sloansparger sloansparger left a comment

Choose a reason for hiding this comment

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

ship it!

@npfitz npfitz merged commit b7349ec into master Aug 29, 2024
120 of 121 checks passed
@npfitz npfitz deleted the query-validator branch August 29, 2024 19:20
qnkhuat pushed a commit that referenced this pull request Aug 30, 2024
* Query Validator FE

* collection path, unit tests

* wrapping feature with token flag

* updating util function, adding row type

* updating session_test.clj

* type adjustment

* fixing other table sorting

* Empty state, clean up utils

* unit test adjustment

* e2e adjustment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-backport Do not backport this PR to any branch .Team/AdminWebapp Admin and Webapp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query Validator page in Admin App
2 participants