Skip to content

updater#13

Merged
anirudhisonline merged 2 commits into
mainfrom
updater
May 19, 2026
Merged

updater#13
anirudhisonline merged 2 commits into
mainfrom
updater

Conversation

@anirudhisonline
Copy link
Copy Markdown
Contributor

@anirudhisonline anirudhisonline commented May 19, 2026

Summary by CodeRabbit

  • New Features

    • Automatic update checking runs shortly after startup, notifying users of new versions with a one-click "Install & Restart" flow.
    • Multi-platform release workflow added to publish builds for macOS, Windows, and Linux.
  • Chores

    • Added/updated Tauri updater and process plugins and enabled updater configuration (including release endpoint and signing support).
    • App identifier updated for desktop builds.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: dc08a5ee-cf92-4b4b-abeb-3718eb877f2a

📥 Commits

Reviewing files that changed from the base of the PR and between f8226c8 and 672c91e.

📒 Files selected for processing (1)
  • src/lib/updater.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/updater.ts

📝 Walkthrough

Walkthrough

Adds Tauri updater and process plugins (Rust + JS), configures updater endpoints and capabilities, registers plugins in the Tauri builder, implements a frontend update check with toast-driven install+relaunch, and adds a cross-platform GitHub Actions release workflow publishing draft releases on version tags.

Changes

App Update System

Layer / File(s) Summary
Backend Plugin Configuration & Wiring
src-tauri/Cargo.toml, package.json, src-tauri/tauri.conf.json, src-tauri/capabilities/default.json, src-tauri/src/lib.rs
Cargo and npm dependencies add tauri-plugin-updater and tauri-plugin-process. App identifier becomes app.anide.desktop, tauri.conf.json configures the updater plugin (pubkey, endpoints). Capabilities include updater:default and process:allow-relaunch. The Tauri app builder registers both plugins.
Frontend Update Check & Layout Integration
src/lib/updater.ts, src/routes/+layout.svelte
Adds checkForUpdates() that uses Tauri updater to detect updates, shows an infinite toast with "Install & Restart", downloads/installs and relaunches on user action (errors shown via toast). Layout schedules a browser-only delayed check on mount.

Release Automation Pipeline

Layer / File(s) Summary
Cross-Platform Release Workflow
.github/workflows/release.yml
New Release workflow triggers on v* tags and manual dispatch. publish-tauri job runs on a matrix (macOS arm64/x86_64, Ubuntu 22.04, Windows), installs Bun and Rust (with macOS target triples), caches Rust build artifacts, installs Ubuntu system packages when applicable, runs bun install, and calls tauri-apps/tauri-action to build and publish a draft GitHub release with signing/notarization secrets and per-matrix build args.

Sequence Diagram(s)

sequenceDiagram
  participant Layout as +layout.svelte
  participant Updater as src/lib/updater.ts
  participant Tauri as Tauri Runtime
  participant UI as Toast
  Layout->>Updater: schedule checkForUpdates() after 3s
  Updater->>Tauri: check for updates
  alt update available
    Tauri-->>Updater: update info
    Updater->>UI: show "Install & Restart"
    UI-->>Updater: user clicks install
    Updater->>Tauri: downloadAndInstall()
    Tauri->>Tauri: relaunch()
  else no update
    Tauri-->>Updater: no update
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • anide-app/anide#4: Adds sonner Toaster wiring in src/routes/+layout.svelte, which is directly relevant for the updater toast UI.

Poem

🐰
I hop and bring an auto-update song,
A toast appears where it belongs,
Click "Install & Restart," the app takes flight,
Releases built across platforms at night,
A tiny rabbit cheers—your app's up to right.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'updater' is generic and vague, failing to describe the specific changes made in the pull request beyond a single feature area. Consider a more descriptive title that specifies what was added, such as 'Add Tauri updater plugin integration with automated update checks' or 'Set up application auto-update functionality with GitHub release deployment'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 updater

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 skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release.yml:
- Around line 28-39: Replace mutable action references with pinned 40-character
commit SHAs: change actions/checkout@v4, oven-sh/setup-bun@v2,
dtolnay/rust-toolchain@stable, Swatinem/rust-cache@v2 and
tauri-apps/tauri-action@v0 to their respective full commit SHAs (you may add the
existing tag as a comment for readability); update the workflow to use those
SHAs everywhere these action identifiers appear so the pipeline no longer tracks
mutable refs.
- Line 73: The workflow currently sets releaseDraft: true which leaves GitHub
releases as drafts and prevents updater discovery; change the releaseDraft
property in the release job from true to false (i.e., set releaseDraft: false)
so releases are published instead of drafted, ensuring the Tauri updater and
public API can discover them.

In `@src-tauri/tauri.conf.json`:
- Around line 21-23: The configured auto-update "endpoints" entry currently
points to
"https://github.com/anide-app/anide/releases/latest/download/latest.json" which
only resolves published releases and thus won't surface draft releases from your
draft-release workflow; either change the CI to publish releases (set
releaseDraft: false) or replace the endpoints entry with an endpoint that can
return draft releases (for example use the GitHub Releases API for the repo such
as the /repos/{owner}/{repo}/releases or
/repos/{owner}/{repo}/releases/tags/{tag} endpoint with appropriate auth) so
update checks include drafts—update the "endpoints" array value accordingly and
ensure any necessary auth/token handling is implemented.

In `@src/lib/updater.ts`:
- Around line 12-17: The Install & Restart action lacks error handling and
protection against concurrent clicks—wrap the onClick callback body (the calls
to update.downloadAndInstall() and relaunch()) in a try/catch and surface errors
to the user (e.g., via the existing UI notification/logger) and ensure the catch
re-enables UI state; add a guard flag (e.g., isInstalling) or disable the action
while running to prevent double-clicks and set/clear that flag before/after
awaiting downloadAndInstall() and relaunch(); update references: the action
object’s onClick, update.downloadAndInstall(), and relaunch() so failures are
caught and the UI state is consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f74cef22-9e17-42e6-ac6c-e5d23ff32c4c

📥 Commits

Reviewing files that changed from the base of the PR and between 31a754d and f8226c8.

⛔ Files ignored due to path filters (2)
  • bun.lock is excluded by !**/*.lock
  • src-tauri/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • .github/workflows/release.yml
  • package.json
  • src-tauri/Cargo.toml
  • src-tauri/capabilities/default.json
  • src-tauri/src/lib.rs
  • src-tauri/tauri.conf.json
  • src/lib/updater.ts
  • src/routes/+layout.svelte

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread src-tauri/tauri.conf.json
Comment thread src/lib/updater.ts
@anirudhisonline anirudhisonline merged commit 23b59c5 into main May 19, 2026
1 check passed
@anirudhisonline anirudhisonline deleted the updater branch May 19, 2026 04:25
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