Skip to content

feat: persistent GitHub release download sources - #7

Merged
wha7ev9r merged 3 commits into
mainfrom
feature/release-sources
Jul 30, 2026
Merged

feat: persistent GitHub release download sources#7
wha7ev9r merged 3 commits into
mainfrom
feature/release-sources

Conversation

@wha7ev9r

@wha7ev9r wha7ev9r commented Jul 30, 2026

Copy link
Copy Markdown
Owner

详见已关闭的 PR #6

Summary by CodeRabbit

  • New Features

    • Added a Releases page for saving GitHub Release sources and selecting specific assets.
    • Added validation when creating sources, including repository and asset availability checks.
    • Added one-click downloads for the latest stable matching asset, with availability and release details.
    • Added source deletion, refresh, download confirmation, and status messaging.
    • Saved release sources persist across restarts in the application data directory.
  • Documentation

    • Updated dashboard, persistence, and capabilities documentation with Release download instructions and limitations.

wha7ev9r added 3 commits July 30, 2026 13:14
Store custom GitHub Releases sources in SQLite so they survive restarts,
then stream the pinned asset of the latest stable release through DevBox
with one click from the new Releases page.

- store: release_sources table (case-insensitive owner/repo, unique per
  owner/repo/asset) with create/list/get/delete helpers
- dashboard: /api/release-sources CRUD, one-time download tickets and a
  streaming /api/release-download endpoint
- dashboard: validate github.com/{owner}/{repo}/releases URLs and asset
  names, cache latest-release lookups for 5m to save GitHub API quota
- dashboard: resolve assets by verified asset ID and restrict download
  redirects to github.com and *.githubusercontent.com
- web: Releases page with add form, source list and download/delete
- tests: store CRUD/persistence plus handler, ticket and redirect tests
- dashboard: resolve the pinned asset from the cached latest release and
  only re-query GitHub when the cache is cold or no longer lists it, so
  downloads stop spending an API call each time
- dashboard: bound dial, TLS handshake and response-header waits on the
  download client while leaving Client.Timeout unset for large assets
- web: keep a zero asset size rendering as "0 B" instead of "-"
- tests: assert the warm cache serves tickets, stale caches refresh and
  the download client keeps bounded connection timeouts
TestLatestReleaseAssetRefreshesStaleCache seeded an unexpired entry, so it
never exercised the TTL path its name promised.

- rename it to TestLatestReleaseAssetRefreshesWhenCachedAssetMissing, which
  is what the fixture actually covers
- add TestLatestReleaseAssetRefreshesExpiredCache for the TTL path: an
  expired entry that still lists the asset must be re-queried and recached
@wha7ev9r
wha7ev9r merged commit ad23115 into main Jul 30, 2026
7 of 8 checks passed
@wha7ev9r
wha7ev9r deleted the feature/release-sources branch July 30, 2026 05:55
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 62f12699-b0ae-4ef6-9e1a-146c9816ef24

📥 Commits

Reviewing files that changed from the base of the PR and between 344d6c5 and 27439d2.

📒 Files selected for processing (12)
  • README.md
  • internal/dashboard/dashboard.go
  • internal/dashboard/release.go
  • internal/dashboard/release_test.go
  • internal/server/server.go
  • internal/store/sqlite.go
  • internal/store/sqlite_test.go
  • web/src/App.vue
  • web/src/api/client.ts
  • web/src/router/index.ts
  • web/src/views/Releases.vue
  • web/src/views/Settings.vue

📝 Walkthrough

Walkthrough

Adds persistent GitHub Release sources, cached latest-release resolution, one-time download tickets, safe streaming downloads, backend routes, and a new Releases dashboard page with creation, refresh, download, and deletion controls.

Changes

Release download flow

Layer / File(s) Summary
Release source persistence
internal/store/sqlite.go, internal/store/sqlite_test.go
Adds the release_sources SQLite table and CRUD methods, enforces uniqueness, and verifies persistence across database reopen.
Release resolution and downloads
internal/dashboard/*, internal/server/server.go, internal/dashboard/release_test.go
Adds authenticated source handlers, GitHub URL and asset validation, cached release lookup, one-time tickets, redirect restrictions, streamed asset responses, API route registration, and corresponding tests.
Releases dashboard integration
web/src/*, README.md
Adds navigation and routing, typed release APIs, source management UI, download and delete interactions, capability labeling, and usage/persistence documentation.

Registry proxy response handling

Layer / File(s) Summary
Unauthorized proxy response
internal/server/server.go
Forwards the upstream 401 status and response body before returning.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ReleasesView
  participant ReleaseAPI
  participant Dashboard
  participant GitHub
  ReleasesView->>ReleaseAPI: request download ticket
  ReleaseAPI->>Dashboard: create ticket for source
  Dashboard->>GitHub: fetch latest release asset
  GitHub-->>Dashboard: return release metadata
  Dashboard-->>ReleaseAPI: return ticket and filename
  ReleasesView->>ReleaseAPI: open download URL
  ReleaseAPI->>Dashboard: consume ticket
  Dashboard->>GitHub: request asset stream
  GitHub-->>Dashboard: return asset bytes
  Dashboard-->>ReleasesView: return attachment
Loading

Possibly related PRs

  • wha7ev9r/devbox#6: Overlapping implementation of release-source persistence, dashboard handlers, download tickets, routes, and the Releases frontend.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/release-sources

Comment @coderabbitai help to get the list of available commands.

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