Skip to content

Offer the build's tarballs for download in the firmware explorer - #384

Merged
widgetii merged 1 commit into
masterfrom
explorer-download
Oct 3, 2026
Merged

widgetii merged 1 commit into
masterfrom
explorer-download

Conversation

@widgetii

@widgetii widgetii commented Oct 3, 2026

Copy link
Copy Markdown
Member

The firmware explorer showed what a build measured but gave no way to fetch it.

  • GET /api/v1/explorer/{source}/builds/{build}/platforms/{platform} now carries downloads: the tarballs the build published for the platform, with size, SHA-256, storage and the GitHub address in the build's own dated release (so an old nightly links to its own files).
    • firmware: openipc.<board>-<storage>-<edition>.tgz for the report's board and variant (build_assets.board/edition);
    • builder: <device>-<storage>.tgz, device matched exactly — …-ipc-1 is not offered …-ipc-1-w's.
  • The summary shows them as a "Download this build:" row of links (en/ru/zh), SHA-256 on hover.

These are release tarballs (kernel + rootfs); full flash images remain the installer's, for the newest build only.

Verification

  • service/run.sh test passes; the explorer round trip checks the firmware link, and a new test covers builder's prefix case.
  • Frontend lint, typecheck pass; npm test 601/609 — the 8 failures are the club component tests (localStorage undefined), which fail identically on master under the local Node v26.

The explorer showed what a build measured but gave no way to fetch it. The
report endpoint now lists the tarballs the build published for the platform,
each with its size, SHA-256 and the address in the build's own dated release,
so an older nightly links to its own files rather than the newest:

- firmware: openipc.<board>-<storage>-<edition>.tgz for the report's board
  and variant;
- builder: <device>-<storage>.tgz for the device, matched exactly, so a
  device whose name prefixes another's is not offered the other's.

The summary shows them as a row of links under the size facts.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Offer build-specific tarballs in the firmware explorer

✨ Enhancement 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Add platform-specific release tarballs to explorer reports, linking older builds to their own
 dated releases.
• Show download links with file sizes and SHA-256 tooltips in English, Russian, and Chinese.
• Test firmware board selection and exact builder device matching to prevent unrelated downloads.
Diagram

graph TD
  A["Explorer page"] --> B["Report API"] --> C[("Build tables")] --> D["Asset matcher"] --> E["Download entries"] --> F["Summary links"] --> G["GitHub release"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Reuse the installer's asset index
  • ➕ Avoids a separate asset-selection path.
  • ➖ The index selects the newest retained asset by name, so historical reports could link to a different build.
  • ➖ It does not provide the same builder coverage.
2. Query GitHub releases on demand
  • ➕ Could discover release assets without relying on pushed asset records.
  • ➖ Adds remote requests and availability dependencies to report reads.
  • ➖ Separates downloads from the build metadata already stored with the measured report.

Recommendation: Use the PR's stored build assets and release tag. They preserve the selected build's provenance without a GitHub lookup, while exact platform matching avoids offering a related device's tarball.

Files changed (10) +144 / -4

Enhancement (3) +90 / -4
Summary.tsxDisplay available release tarballs in the summary +12/-0

Display available release tarballs in the summary

• Shows a download row when the report has tarballs. Each link displays its filename and size, with storage and SHA-256 in the tooltip.

frontend/apps/site/src/components/explorer/Summary.tsx

types.tsType the report's download entries +10/-0

Type the report's download entries

• Adds optional downloads to the Sizes report type and defines each entry's name, size, SHA-256, storage, and URL.

frontend/apps/site/src/lib/explorer/types.ts

explorer.goAttach build-specific tarballs to explorer reports +68/-4

Attach build-specific tarballs to explorer reports

• Reads the selected build's release and published tarballs, filters them by firmware board and edition or exact builder device, and adds download metadata and release URLs to the report.

service/internal/builds/explorer.go

Tests (1) +42 / -0
builds_test.goVerify firmware and builder download selection +42/-0

Verify firmware and builder download selection

• Extends the firmware round-trip test to check its board-specific tarball and dated release URL. Adds a builder test proving a device is not offered another device's similarly prefixed tarball.

service/internal/builds/builds_test.go

Other (6) +12 / -0
explorer.en.ymlAdd English download text +2/-0

Add English download text

• Adds the summary label and a tooltip template that identifies storage and SHA-256.

data/locales/explorer.en.yml

explorer.ru.ymlAdd Russian download text +2/-0

Add Russian download text

• Adds localized download label and tarball tooltip strings.

data/locales/explorer.ru.yml

explorer.zh.ymlAdd Chinese download text +2/-0

Add Chinese download text

• Adds localized download label and tarball tooltip strings.

data/locales/explorer.zh.yml

explorer.en.jsonExpose English download strings to the frontend +2/-0

Expose English download strings to the frontend

• Adds the English label and tooltip template used by the summary.

frontend/apps/site/src/i18n/explorer.en.json

explorer.ru.jsonExpose Russian download strings to the frontend +2/-0

Expose Russian download strings to the frontend

• Adds the Russian label and tooltip template used by the summary.

frontend/apps/site/src/i18n/explorer.ru.json

explorer.zh.jsonExpose Chinese download strings to the frontend +2/-0

Expose Chinese download strings to the frontend

• Adds the Chinese label and tooltip template used by the summary.

frontend/apps/site/src/i18n/explorer.zh.json

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can copy the agent prompt from any finding and feed it to your IDE agent

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@widgetii
widgetii merged commit 59c6269 into master Oct 3, 2026
2 checks passed
@widgetii
widgetii deleted the explorer-download branch October 3, 2026 18:21
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.

1 participant