Skip to content

ci(release): split update asset upload storage#458

Merged
hiqiancheng merged 1 commit into
mainfrom
codex/issue-457-release-hot-cache
Jun 12, 2026
Merged

ci(release): split update asset upload storage#458
hiqiancheng merged 1 commit into
mainfrom
codex/issue-457-release-hot-cache

Conversation

@hiqiancheng

Copy link
Copy Markdown
Collaborator

Summary

Split release asset storage so GitHub Releases remain per-version cold archives, while R2 only carries the hot update feed and current-version downloadable assets.

  • Keep the full Velopack staging directory for feed generation, including hydrated history.
  • Upload only current-version downloadable assets to the matching GitHub Release.
  • Copy only current-version downloadable assets into update-dist for R2 deployment; older feed entries can resolve through the existing Worker GitHub fallback.
  • Add CI tests for GitHub upload filtering, R2 update-dist filtering, and workflow wiring.

Related issue or RFC

AI assistance disclosure

  • Tool(s) used: Codex
  • Scope of assistance: release workflow diagnosis, CI script implementation, and test updates
  • Human review or rewrite performed: diff and test output reviewed locally before PR creation
  • Architecture or boundary impact: release/package CI only; no AgentService, runtime, MCP, or schema impact

Testing evidence

pnpm --filter @touchai/desktop exec vitest run --configLoader runner --testTimeout 20000 tests/ci
# 18 files, 70 tests passed; command exited 0, with a trailing local Vite 504 diagnostic

pnpm --filter @touchai/desktop exec vitest run --configLoader runner --passWithNoTests --testTimeout 20000
# 156 files, 976 tests passed; command exited 0, with a trailing local Vite 504 diagnostic

pnpm --filter @touchai/desktop test:typecheck
# passed

pnpm --filter @touchai/desktop lint:check
# passed with existing Vue warnings, 0 errors

pnpm format:check
# passed

pnpm --filter @touchai/desktop test:unit did not complete cleanly under the default 5s Vitest timeout in this local worktree; the equivalent command with --testTimeout 20000 passed. npx tsc --noEmit timed out locally, while the repository typecheck command above passed.

Risk notes

  • AgentService, runtime, MCP, or schema impact: none
  • database baseline or migration impact: none
  • release or packaging impact: GitHub release uploads now exclude hydrated historical .nupkg files; R2 deploy artifacts contain current-version downloads plus feed files, with older assets expected to be served from GitHub Release fallback when not hot in R2

Screenshots or recordings

Not applicable; release CI change only.

Checklist

  • The PR title follows Conventional Commits and is valid for squash merge.
  • This PR is either ready for review or explicitly marked as a Draft PR.
  • I did not use [WIP] or similar title prefixes.
  • If AI materially assisted this PR, I disclosed the tools and scope and I personally reviewed every affected change.
  • I can explain the why, what, and how of this change without relying on an AI tool.
  • If this touches AgentService, runtime, MCP, or schema boundaries, there is an accepted RFC.
  • If this changes architecture or adds a new cross-boundary abstraction, there is an accepted RFC.
  • I ran pnpm test:pr for this code PR, or this is a docs-only change.
  • If I changed Rust behavior or tests, I reviewed pnpm test:coverage:rust or relied on CI coverage evidence.
  • If I changed desktop startup/window/search/popup/settings/E2E paths, I ran pnpm test:e2e locally or documented why CI is the first valid proof.
  • I added tests or explained why tests are not appropriate.
  • I updated docs when behavior changed.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Summary by CodeRabbit

Chores

  • Refined the release asset staging process in the build pipeline to filter and validate artifacts by version, ensuring only the correct release files are uploaded to GitHub during the release workflow.
  • Added enhanced validation and staging capabilities to improve the reliability and accuracy of the release publishing process.

Walkthrough

This PR separates historical release assets from current-version assets in GitHub Releases by introducing a version-scoped staging mechanism. A new stage-release-upload-assets script filters release assets to only the current version, the build-update-channels script gains version-aware asset filtering, and the CI workflow uses the staged assets for GitHub Release uploads while maintaining historical assets in R2.

Changes

Version-scoped release asset staging for GitHub Releases

Layer / File(s) Summary
Stage Release Upload Assets module
apps/desktop/scripts/ci/stage-release-upload-assets.d.mts, apps/desktop/scripts/ci/stage-release-upload-assets.mjs, apps/desktop/tests/ci/stage-release-upload-assets.test.ts
New stageReleaseUploadAssets function validates inputs, clears the output directory, filters source files to only those matching the provided version via isDownloadAssetName and versionFromAssetName, copies them into the output directory, sorts filenames, and rejects if no current-version assets are found. Tests cover both successful staging and error cases.
Version-filtered asset copying in build-update-channels
apps/desktop/scripts/ci/build-update-channels.mjs, apps/desktop/tests/ci/build-update-channels.test.ts
The copyReleaseAssets helper now accepts an optional version parameter and skips assets that don't match the provided version. buildUpdateChannels passes release?.version ?? null when copying assets, enabling per-version filtering. Test fixture expanded to assert that older release artifacts are not copied.
GitHub workflow staging and upload wiring
.github/workflows/velopack-build.yml, apps/desktop/tests/ci/release-workflow-environments.test.ts
A new workflow step stages current-version release assets into touchai-github-release-assets by running the stage-release-upload-assets script. The subsequent GitHub Release upload step reads release_dir from the staged directory instead of the general release assets directory. Workflow test expectations updated to require the staging step and verify the correct directory is used.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • TouchAI-org/TouchAI#274: Updates the same workflow to upload staged public assets to GitHub Releases, directly modifying the GitHub release asset upload wiring as this PR does.

Poem

🐰 The hopper hops with careful grace,
Each version finds its rightful place—
No old nupkgs in new releases blend,
Just current assets, start to end!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely describes the main change: splitting release asset upload storage between GitHub Releases and R2, following Conventional Commits format with proper scope and subject.
Description check ✅ Passed The PR description includes all required sections: Summary explaining the split storage approach, Related issue #457 closure, AI assistance disclosure with tools and scope, Testing evidence with command results, Risk notes clearly documenting impacts, and complete Checklist. Only unchecked items are legitimate exemptions (test:pr not needed locally, E2E documented as CI proof).
Linked Issues check ✅ Passed The PR implements all coding requirements from issue #457: splitting release assets by versioning assets during upload [stage-release-upload-assets.mjs], filtering during build-update-channels [build-update-channels.mjs], updating GitHub workflow wiring [velopack-build.yml], and adding comprehensive CI tests validating both upload and update-dist filtering.
Out of Scope Changes check ✅ Passed All changes are scoped to release CI: staging script, build-update-channels filtering, workflow configuration, and related tests. No unrelated modifications to production code, schemas, runtime, or non-CI systems are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 codex/issue-457-release-hot-cache

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added the area:ci CI, automation, or repository workflow changes label Jun 12, 2026
@hiqiancheng hiqiancheng marked this pull request as ready for review June 12, 2026 10:37
@hiqiancheng hiqiancheng added this pull request to the merge queue Jun 12, 2026
Merged via the queue into main with commit ebc3494 Jun 12, 2026
35 of 36 checks passed
@hiqiancheng hiqiancheng deleted the codex/issue-457-release-hot-cache branch June 12, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, automation, or repository workflow changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split release assets between R2 hot cache and GitHub archives

1 participant