Skip to content

feat(hardware-registry): show the last registry sync on the hardware page - #2184

Open
alanpeixinho wants to merge 2 commits into
kernelci:mainfrom
profusion:feat/2170/hardware-registry-sync
Open

alanpeixinho wants to merge 2 commits into
kernelci:mainfrom
profusion:feat/2170/hardware-registry-sync

Conversation

@alanpeixinho

@alanpeixinho alanpeixinho commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What it is

The nightly update_hardware_registry --index run now records each file it fetched. For the index and every vendor file it stores a sha256 of the raw bytes and the time those bytes last changed. GET /api/hardware/registry-sync/ returns that record, plus synced_at for the run itself.

The hardware listing shows the record under the table. index.yaml is visible with its date and hash. The vendor files open from the chevron.

That same --index run deletes registry rows missing from the fetched files. A single-file run still only upserts that file and leaves the record alone.

The platform table also gains a compatible array, copied from the YAML.

Closes #2170.

How to test

  1. Apply migrations 0021 and 0022.
  2. Run python manage.py update_hardware_registry --index=<index.yaml>. The default URL is the kernelci-pipeline index.
  3. Open /hardware. Under the table, confirm index.yaml, a date, and a hash. The hash should match sha256sum of that file. Open the chevron and confirm each vendor file has its own date and hash.
  4. Run the command again without changing the files. The hashes and file dates stay the same. synced_at in GET /api/hardware/registry-sync/ moves forward.
  5. Point --index at a local index, remove one platform from a vendor file, and run again. That platform is gone from hardware_registry_platforms, and that file's hash and date change. Put the platform back and run again to restore the row.
  6. Fetch a file that the index lists but that is missing. The command fails, and the previous rows and record stay as they were.

Add hardware_registry_sync, one row holding the last full --index run
and the SHA-256 of each file it fetched. Store the device tree
compatible strings that kernelci-pipeline added to each platform.

Part of kernelci#2170
Part of kernelci#1886
Assisted-by: Cursor

Signed-off-by: Alan Peixinho <[email protected]>
…page

update_hardware_registry now reads files nested under hardware_registry,
the format kernelci-pipeline moved to, and stores compatible. An --index
run loads every file in one transaction, deletes rows missing from the
files, and records each file's SHA-256 and the day its content last
changed. Single-file runs do neither.

GET /api/hardware/registry-sync/ returns that record. The hardware page
lists it below the table, so sha256sum on an upstream file can be
compared with what the dashboard loaded.

Closes kernelci#2170
Part of kernelci#1886
Assisted-by: Cursor

Signed-off-by: Alan Peixinho <[email protected]>
@felipebergamin

felipebergamin commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

@alanpeixinho can you add a description and test instructions to this PR, please?

@alanpeixinho
alanpeixinho marked this pull request as ready for review October 20, 2026 22:16

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.

Show the last hardware registry sync

2 participants