Skip to content

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

Merged
alanpeixinho merged 3 commits into
kernelci:mainfrom
profusion:feat/hardware-daily-aggregates
Oct 23, 2026
Merged

alanpeixinho merged 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

@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
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 <alan.peixinho@profusion.mobi>
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 <alan.peixinho@profusion.mobi>
Rebasing onto main left two migration leaves, so migrate failed on a fresh database.

Assisted-by: Grok 4.7
Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
@alanpeixinho
alanpeixinho force-pushed the feat/hardware-daily-aggregates branch from 62dc826 to 3dcc639 Compare October 23, 2026 18:35
@alanpeixinho
alanpeixinho added this pull request to the merge queue Oct 23, 2026
Merged via the queue into kernelci:main with commit a088790 Oct 23, 2026
7 checks passed
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)

2 participants