feat/backfill db - #1986
Open
alanpeixinho wants to merge 12 commits into
Open
Conversation
alanpeixinho
marked this pull request as draft
July 10, 2026 21:24
alanpeixinho
marked this pull request as ready for review
July 15, 2026 16:36
Member
|
@alanpeixinho I think this PR needs a rebase |
Part of kernelci#1948 Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Part of kernelci#1948 Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
* For analysis queries we are going for lab column information
first, and coalescing to json misc information.
* All COALESCE expressions are marked with TODO comments for removal
after the lab_id backfill is complete.
Closes kernelci#1948
Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Rename Builds/Tests FK field from lab to lab_id so lab is free for annotated lab names without conflicting with the ORM relation. Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Keep lab as the standard Django FK field and resolve build test lab names via raw SQL, matching the hardware query pattern. Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Enforce the lab FK db_constraint on builds and tests, drop the unused lab_id from the build tests response, and fix the tree query lab TODO. Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
* process historical data to use the lab foreign key Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Leave lab_id NULL for shell/k8s* and misc.automatic_lab so backfill matches ingest _real_lab and does not insert fake labs. Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
alanpeixinho
force-pushed
the
feat/backfill-db
branch
from
August 18, 2026 13:03
ce8a275 to
ae4fca2
Compare
felipebergamin
approved these changes
Aug 18, 2026
felipebergamin
left a comment
Member
There was a problem hiding this comment.
❯ docker compose exec backend poetry run python3 manage.py backfill_lab_ids
[2026-08-18 20:28:49] Collecting distinct lab names from JSONB...
[2026-08-18 20:28:50] Found 16 distinct lab names
[2026-08-18 20:28:50] Inserting missing lab names into labs table...
[2026-08-18 20:28:50] Staging builds ids...
[2026-08-18 20:28:50] Builds to backfill: 3075
[2026-08-18 20:28:50] builds: 3075/3075 (0.2s)
[2026-08-18 20:28:50] Staging tests ids...
[2026-08-18 20:28:51] Tests to backfill: 382421
[2026-08-18 20:28:55] tests: 50000/382421 (3.9s)
[2026-08-18 20:28:58] tests: 100000/382421 (7.3s)
[2026-08-18 20:29:02] tests: 150000/382421 (10.9s)
[2026-08-18 20:29:05] tests: 200000/382421 (14.7s)
[2026-08-18 20:29:09] tests: 250000/382421 (18.6s)
[2026-08-18 20:29:14] tests: 300000/382421 (23.0s)
[2026-08-18 20:29:18] tests: 350000/382421 (26.8s)
[2026-08-18 20:29:21] tests: 382421/382421 (29.7s)
[2026-08-18 20:29:21] Done.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what it is
Includes a backfill labs command to update old data into using the lab foreign key for builds and tests tables.
How to test