-
Notifications
You must be signed in to change notification settings - Fork 77
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
Reference test table directly in label2test table #2390
Conversation
1d0d6b3
to
cd1dfb2
Compare
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.
Test site works as expected! LGTM!
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.
Actually, I can replicate the MySQL errors for queryTests
in local testing. I'll see if I can figure out anything quickly
cd1dfb2
to
407c465
Compare
407c465
to
6542b3e
Compare
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.
Looks good again 👍
#2390 accidentally changed the formatting of the labels attribute in the viewTest.php API response.
#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.
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.