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

Rewrite useTableDefinitions hook as getTableDefinitions util #7821

Merged
merged 1 commit into from
Apr 12, 2021

Conversation

doeg
Copy link
Contributor

@doeg doeg commented Apr 11, 2021

Signed-off-by: Sara Bee 855595+doeg@users.noreply.github.com

Description

This rewrites the Schema[] -> TableDefinition[] logic as a utility function instead of a query hook. This feels like a better separation of concerns (more reusable + easier to test), albeit slightly less convenient (since components need to call, and usually memoize, the getTableDefinitions transform).

One note is that getTableDefinitions now returns tables that define table_size but not table_definition. This unearthed a minor bug, #7820. The user-facing behaviour is that tables that have a size but no table definition will link to a schema detail route that 404s, even though the table technically exists. As described in #7820, once the bug is fixed the front-end won't need to conflate the existence of the table_definition property with whether the table exists, and these links will no longer 404.

Related Issue(s)

N/A

Checklist

  • Should this PR be backported? No
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

N/A

Impacted Areas in Vitess

Components that this PR will affect:

  • Query Serving
  • VReplication
  • Cluster Management
  • Build/CI
  • VTAdmin

Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
@doeg doeg added this to In progress in VTAdmin via automation Apr 11, 2021
@ajm188 ajm188 merged commit c886361 into vitessio:master Apr 12, 2021
VTAdmin automation moved this from In progress to Done Apr 12, 2021
@doeg doeg deleted the sarabee-vtadmin-web-tidy-hooks branch April 12, 2021 10:02
@askdba askdba added the Component: VTAdmin VTadmin interface label Apr 13, 2021
@askdba askdba added this to the v11.0 milestone Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: VTAdmin VTadmin interface
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants