Skip to content

feat(hardware): recompute daily hardware aggregates from raw - #2181

Draft
alanpeixinho wants to merge 3 commits into
kernelci:mainfrom
profusion:feat/hardware-daily-aggregates
Draft

alanpeixinho wants to merge 3 commits into
kernelci:mainfrom
profusion:feat/hardware-daily-aggregates

Conversation

@alanpeixinho

@alanpeixinho alanpeixinho commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Rebuilds hardware_daily_* from raw checkouts, builds, and tests. Cron runs --days=1 hourly and --days=15 every 6 hours. prune_db drops those rows by checkout_day, and --origins filters checkout_origin. hardware_status stays as it is.

Depends on #2180. Merge that first.

Replaces #2037. That PR was opened from the upstream repo.

Closes #2034.

How to test

After #2180 is applied:

  • python manage.py recompute_hardware_daily --day=2025-07-18
  • python manage.py recompute_hardware_daily --days=7
  • Build, boot, and test counts match the raw tables.
  • python manage.py prune_db --older-than "30 days" --tables hardware_daily_builds,hardware_daily_tests --dry-run

Add hardware_daily_builds and hardware_daily_tests keyed by checkout
day, origin, lab, and platform. Depends on the labs migration already
on main, so no merge migration is required.

Signed-off-by: Alan Peixinho <[email protected]>
Rebuild one UTC day at a time with DELETE + INSERT, an advisory lock,
and a rollback when raw rows are gone. Materialize the day's tests
once, ANALYZE them, and raise work_mem so the planner hashes instead
of spilling. Cron refreshes today hourly and the last 15 days every
6 hours. Wire prune_db, seed_test_data, and update_db for the new
tables.

Closes kernelci#2034

Signed-off-by: Alan Peixinho <[email protected]>
Filter hardware_daily_* on checkout_origin the same way raw rows use
origin, so an origin-scoped prune cannot wipe every tenant's aggregates.

Signed-off-by: Alan Peixinho <[email protected]>
@alanpeixinho
alanpeixinho changed the base branch from feat/hardware-daily-aggregate-tables to main October 15, 2026 14:07
@alanpeixinho
alanpeixinho marked this pull request as draft October 16, 2026 19:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HW-list: split hardware_status (migration + aggregations)

1 participant