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

DEV: Split the Query Listing and Query Editing code #356

Merged
merged 10 commits into from
Feb 10, 2025

Conversation

pento
Copy link
Member

@pento pento commented Feb 7, 2025

✨ What's This?

The code for listing all of the defined queries is mixed together with the code for editing a single query. Notably, this results in large amounts of unnecessary data being loaded for the list view, which causes substantial rendering slowdowns.

To address this issue, we now only load the necessary data for the list view, and load the full data when it's actually needed (any endpoint that returns a single query). The primary changes that achieve this are:

  • Create a new QueryDetailsSerializer serialiser, which includes all of the query info, and change the existing QuerySerializer serialiser to only include the necessary attributes of each query for generating a list of them all.
  • Split the monolith /plugins/explorer route into /plugins/explorer for showing just the list of queries, and /plugins/explorer/queries/:query_id, for showing/editing/running a specific query.

👑 Testing

Check that plugin functionality works as expected. I've gone through everything I could find, but I'm not 100% familiar with expected behaviour, so may've missed something.

Review the acceptance tests and system specs, to confirm that there are no missing uses cases.

@pento pento self-assigned this Feb 7, 2025
@pento pento marked this pull request as ready for review February 10, 2025 01:12
@martin-brennan martin-brennan self-requested a review February 10, 2025 01:14
Copy link
Contributor

@martin-brennan martin-brennan left a comment

Choose a reason for hiding this comment

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

Looks great, mostly a vibes based review and local testing, I think we should be able to fix any issues that crop up fairly quick, and any potential bugs are outweighed by the benefit of doing this. Just a few minor comments.

@pento pento merged commit d726c48 into main Feb 10, 2025
6 checks passed
@pento pento deleted the pento/dev-split-list-and-edit-code branch February 10, 2025 03:54
@martin-brennan
Copy link
Contributor

martin-brennan commented Feb 11, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants