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

Reference test table directly in label2test table #2390

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

williamjallen
Copy link
Collaborator

The label2test table currently relates labels to tests indirectly, storing the label ID, test output ID, and build ID, from which the test ID can be derived. By not referencing tests directly, the database is forced to perform suboptimal queries for some of our large pages.

This PR removes the test output ID and build ID columns, and replaces them with a test ID column in preparation for larger upcoming changes to label-related tables. As part of this work, I set up eloquent relationships between the Test and Label models for future use. The functions deprecated in this PR will be removed in a separate PR.

Copy link
Member

@josephsnyder josephsnyder left a comment

Choose a reason for hiding this comment

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

Test site works as expected! LGTM!

@josephsnyder josephsnyder self-requested a review August 26, 2024 14:29
Copy link
Member

@josephsnyder josephsnyder left a comment

Choose a reason for hiding this comment

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

Actually, I can replicate the MySQL errors for queryTests in local testing. I'll see if I can figure out anything quickly

Copy link
Member

@josephsnyder josephsnyder left a comment

Choose a reason for hiding this comment

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

Looks good again 👍

@josephsnyder josephsnyder added this pull request to the merge queue Aug 27, 2024
Merged via the queue into Kitware:master with commit b9c96e3 Aug 27, 2024
6 checks passed
@williamjallen williamjallen deleted the label2test-refactor branch August 27, 2024 15:06
github-merge-queue bot pushed a commit that referenced this pull request Sep 18, 2024
#2390 accidentally changed the
formatting of the labels attribute in the viewTest.php API response.
github-merge-queue bot pushed a commit that referenced this pull request Oct 10, 2024
#2390 added a migration which affects every row in the `label2test`
table. MySQL is very inefficient at bulk updates, and real-world test
have shown that the running time can be reduced by using small batches.
This PR updates the migration to use a batching approach for both MySQL
and Postgres.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants