[WIP] feat(hardware): add daily hardware aggregates recomputed from raw - #2037
Draft
alanpeixinho wants to merge 1 commit into
Draft
[WIP] feat(hardware): add daily hardware aggregates recomputed from raw#2037alanpeixinho wants to merge 1 commit into
alanpeixinho wants to merge 1 commit into
Conversation
alanpeixinho
force-pushed
the
feat/hardware-daily-aggregates
branch
2 times, most recently
from
August 17, 2026 21:19
931ec7b to
39d0d5b
Compare
- Add daily aggregate tables and recompute_hardware_daily (idempotent, locked, keeps rows when raw is pruned) - Materialize day_tests once per day so both aggregate inserts share one raw scan - Cron: hourly for today, every 6h for the last 7 days (drop the 60-day run) - Wire prune_db, seed_test_data and update_db for the new tables - Leave hardware_status written and read as before Closes #2034 Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
alanpeixinho
force-pushed
the
feat/hardware-daily-aggregates
branch
from
August 17, 2026 21:59
39d0d5b to
27eb2e6
Compare
alanpeixinho
marked this pull request as ready for review
August 17, 2026 22:10
alanpeixinho
marked this pull request as draft
August 17, 2026 22:13
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
Adds daily hardware aggregate tables (hardware_daily_builds, hardware_daily_tests) built from raw checkouts / builds / tests.
exist, keeps the stale rows.
Closes #2034.
How to test
migrate
Run local database and apply migration
manual recompute
python manage.py recompute_hardware_daily --day=2025-07-18python manage.py recompute_hardware_daily --days=7verify rows
Check that the aggregate counts for builds, boots and tests match the sum of the raw tables (builds and tests).
prune dry-run (aggregates only)
python manage.py prune_db --older-than "30 days" \ --tables hardware_daily_builds,hardware_daily_tests --dry-run