-
Notifications
You must be signed in to change notification settings - Fork 0
Auto Updater #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Auto Updater #33
Conversation
WalkthroughAdds Tauri updater support: configures updater plugin and endpoints, enables updater artifacts, adds plugin to the Tauri builder, introduces a desktop capability for updater permission, updates platform-specific Cargo deps, adds JS plugin dependency, and injects private key/password env vars into the release workflow. Minor .gitignore update. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant App as Tauri App
participant Updater as Updater Plugin
participant GH as GitHub Releases
User->>App: Launch application
App->>Updater: Initialize with config (pubkey, endpoints)
Updater->>GH: GET latest.json (endpoint)
GH-->>Updater: latest.json (version, assets, sig)
Updater->>Updater: Compare current vs latest
alt Update available
Updater->>GH: Download updater artifact
Updater->>Updater: Verify signature (pubkey)
alt Verification OK
Updater->>App: Apply update and relaunch
else Verification failed
Updater-->>App: Report error / continue without update
end
else Up-to-date
Updater-->>App: No action
end
App-->>User: App ready
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Flag potential breaking changes that are not documented:
1. Identify changes to public APIs/exports, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints (including removed/renamed items and changes to types, required params, return values, defaults, or behavior).
2. Ignore purely internal/private changes (e.g., code not exported from package entry points or marked internal).
3. Verify documentation exists: a "Breaking Change" section in the PR description and updates to CHANGELOG.md.Please share your feedback with us on this Discord post. ✨ Finishing Touches
🧪 Generate unit tests
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. Comment |
…nd enable updater artifacts in tauri configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src-tauri/src/lib.rs (1)
9-16: Gate the updater plugin for non-mobile targets to avoid mobile build breakage.Cargo only includes the crate on non-Android/iOS, but the code always references it; mobile builds will fail to compile.
Apply this refactor to conditionally add the plugin:
pub fn run() { - tauri::Builder::default() - .plugin(tauri_plugin_updater::Builder::new().build()) - .plugin(tauri_plugin_fs::init()) + let builder = tauri::Builder::default(); + #[cfg(not(any(target_os = "android", target_os = "ios")))] + let builder = builder.plugin(tauri_plugin_updater::Builder::new().build()); + #[cfg(any(target_os = "android", target_os = "ios"))] + let builder = builder; + builder + .plugin(tauri_plugin_fs::init()) .plugin(tauri_plugin_dialog::init()) .plugin(tauri_plugin_opener::init()) .invoke_handler(tauri::generate_handler![read_file, sync, generate_epub]) .run(tauri::generate_context!()) .expect("error while running tauri application"); }
🧹 Nitpick comments (3)
package.json (1)
35-35: Add updater dep looks good; consider aligning semver style.You use
^2for most Tauri JS plugins and~2here. For consistency, consider switching to caret.- "@tauri-apps/plugin-updater": "~2", + "@tauri-apps/plugin-updater": "^2",.gitignore (1)
26-29: Good adds; also ignore Rust build outputs.Ignoring
.tauriand coverage is fine. To avoid accidentally committing Rust artifacts, consider addingtarget/(and the nested one some setups create)..early.coverage .tauri +target/ +src-tauri/target/.github/workflows/release.yaml (1)
156-157: Secrets wired correctly; verify they exist and match the pubkey.Make sure repo/org secrets
TAURI_PRIVATE_KEYandTAURI_KEY_PASSWORDare set and correspond to the public key intauri.conf.json. Otherwise updater verification will fail.I can provide a hardened checklist for key setup and a dry-run script to validate release assets once secrets are in place.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
src-tauri/Cargo.lockis excluded by!**/*.lockyarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (7)
.github/workflows/release.yaml(1 hunks).gitignore(1 hunks)package.json(1 hunks)src-tauri/Cargo.toml(1 hunks)src-tauri/capabilities/desktop.json(1 hunks)src-tauri/src/lib.rs(1 hunks)src-tauri/tauri.conf.json(1 hunks)
🔇 Additional comments (4)
src-tauri/Cargo.toml (1)
34-36: Correct target-specific dep; align with code gating.Dependency is properly limited to desktop. Once you conditionally register the plugin in
lib.rs, desktop/mobile builds will be consistent.Try
cargo check --target aarch64-apple-ios(or Android) after thelib.rschange to ensure mobile builds succeed.src-tauri/capabilities/desktop.json (1)
1-14: Capability looks correct.Platforms and
windows: ["main"]withupdater:defaultare appropriate for desktop. No issues.src-tauri/tauri.conf.json (2)
33-35: Enabling updater artifacts is right; verify multi-arch release has a single coherent latest.json.When building both macOS arches in parallel, ensure the release ends up with a single
latest.jsonthat references all assets. Tauri Action usually handles this, but it’s worth checking after the first release.I can provide a small
gh-CLI script to assert thatlatest.jsonexists and lists all artifact URLs for darwin-x64, darwin-arm64, windows, and linux if you want.
36-43: Ensure updater pubkey matches your Tauri private key
Decode the Base64 string in src-tauri/tauri.conf.json (lines 36–43) locally—e.g.echo '<pubkey>' | base64 -d # or use openssl: openssl base64 -dand confirm it begins with “untrusted comment: minisign public key:” and corresponds to your TAURI_PRIVATE_KEY. If it doesn’t, replace it to prevent client update failures.
Summary by CodeRabbit
New Features
Chores