Skip to content

feat: approve PR button + auto-update via tauri-plugin-updater - #8

Merged
IsraelAraujo70 merged 3 commits into
mainfrom
feat/approve-and-auto-update
Apr 30, 2026
Merged

IsraelAraujo70 merged 3 commits into
mainfrom
feat/approve-and-auto-update

Conversation

@IsraelAraujo70

@IsraelAraujo70 IsraelAraujo70 commented Apr 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Approve PR button — new "Aprovar" action in the PR header (visible on both Conversa and Arquivos tabs); opens a small popover with optional review comment. When the viewer's latest non-dismissed review is APPROVED, the green button is replaced with a greyed "Aprovado" chip so it's obvious you can't double-approve from there. Backed by the addPullRequestReview GraphQL mutation with event=APPROVE.
  • Auto-update — wired up via the official tauri-plugin-updater so the app actually downloads, verifies and installs signed bundles in-process (no more "open the release page" detour). The sidebar UpdatePill polls check() every 3h plus on mount and walks the user through Atualizar → Baixando X% → Reiniciar. Pill UX inspired by t3code's SidebarUpdatePill.

What changed

Approve button

  • commands.rs: new approve_pull_request command + viewer_has_approved field on PrDetails
  • pr-viewer.tsx: header button + popover, greyed "Aprovado" chip when applicable

Auto-update

  • Added tauri-plugin-updater + tauri-plugin-process (Rust) and @tauri-apps/plugin-updater + @tauri-apps/plugin-process (JS); registered behind #[cfg(desktop)]
  • tauri.conf.json: bundle.createUpdaterArtifacts=true, plugins.updater.endpoints pointing at https://github.com/IsraelAraujo70/prism/releases/latest/download/latest.json, and the minisign pubkey
  • capabilities/default.json: updater:default, process:default, process:allow-restart
  • update-pill.tsx: rewritten on top of the plugin — handles Started/Progress/Finished events, surfaces errors, calls relaunch() on completion, dismissable per version via localStorage
  • release.yml: tauri-action now receives TAURI_SIGNING_PRIVATE_KEY + TAURI_SIGNING_PRIVATE_KEY_PASSWORD; the asset rename step skips latest.json/*.tar.gz/*.sig so the manifest URLs keep resolving after the strip-version pass
  • The earlier custom checker (src-tauri/src/update_checker.rs + get_update_info/check_updates_now commands) was removed — the plugin replaces it

Required setup (already done on this repo)

  1. Signing keypair generated locally with tauri signer generate (private key stored at ~/.tauri/prism-updater.key, no password)
  2. Repo secrets configured at Settings → Secrets and variables → Actions:
    • TAURI_SIGNING_PRIVATE_KEY ← contents of the private key file
    • TAURI_SIGNING_PRIVATE_KEY_PASSWORD ← empty string

Test plan

Approve button

  • Open an OPEN PR → header shows green "Aprovar" → click → popover with textarea → submit → reload → header now shows greyed "Aprovado" chip
  • Approve, then submit a CHANGES_REQUESTED review on the same PR → header reverts to the green button (latest review state wins)
  • Verify approve hides on draft/closed/merged PRs
  • Verify approve hides when there is a pending review (Files tab SubmitReviewPanel still owns that flow)

Auto-update

  • Tag a release (e.g. v0.1.3) → CI builds, signs, uploads bundles + latest.json to the release
  • Install the older v0.1.2 build locally → within ~3h (or on next launch) the pill appears with the new version
  • Click the pill → app downloads (progress %), then "Reiniciar para atualizar" → relaunch boots the new version
  • Force a signature mismatch (e.g. tamper with the bundle) → expect plugin to refuse install and surface the error
  • Dismiss the pill → reload → still dismissed; ship a newer version → pill reappears

🤖 Generated with Claude Code

IsraelAraujo70 and others added 2 commits April 30, 2026 09:09
…roved

- New "Aprovar" action in the PR header (visible on both Conversa and
  Arquivos tabs); opens a small popover with optional review comment
- Backend computes viewer_has_approved from the latest non-dismissed
  review submitted by the viewer; when true the header shows a greyed
  "Aprovado" chip instead of the green button
- New approve_pull_request command wraps the addPullRequestReview
  GraphQL mutation with event=APPROVE

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Background task in update_checker queries /repos/IsraelAraujo70/prism/releases/latest
  every 3 hours (10-minute backoff on errors); compares the tag against
  CARGO_PKG_VERSION via semver-major/minor/patch and emits a
  prism:update-info event with the result
- Tauri commands get_update_info and check_updates_now expose the
  cached state and let the UI force an immediate check
- Sidebar UpdatePill (above UserMenu) appears when has_update is true,
  links to the GitHub release page, and can be dismissed for a given
  version via localStorage

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Apr 30, 2026

Copy link
Copy Markdown

🔍 PR checks

Type: feat
Areas: area/ci, area/backend, area/frontend

✅ Merging will trigger a release (minor bump)

feat: triggers a minor bump.

Auto-generated by pr-checks.yml. Edit the PR title to change the verdict.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7b2392b42

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src-tauri/src/commands.rs
Drops the bespoke 3h GitHub releases poll in favor of the official
tauri-plugin-updater so the app can download, verify, and install
signed bundles in-process — no more "open the release page in a
browser" detour.

- Removed src-tauri/src/update_checker.rs and the get_update_info /
  check_updates_now Tauri commands (no longer needed; the plugin
  exposes check() / downloadAndInstall() directly to JS)
- Added tauri-plugin-updater + tauri-plugin-process to Cargo.toml and
  the JS counterparts (@tauri-apps/plugin-updater, plugin-process);
  registered both behind #[cfg(desktop)] in lib.rs
- tauri.conf.json: bundle.createUpdaterArtifacts=true, plugins.updater
  endpoint pointing at the GitHub release "latest" download URL, and
  the minisign pubkey from ~/.tauri/prism-updater.key.pub
- capabilities/default.json: added updater:default, process:default,
  process:allow-restart so the renderer can drive the flow
- update-pill.tsx: rewritten on top of the plugin. Polls check() every
  3h plus on mount; renders Atualizar → Baixando X% → Reiniciar with
  Started/Progress/Finished events, calls relaunch() on completion,
  and surfaces the underlying error message on failure
- release.yml: tauri-action now receives TAURI_SIGNING_PRIVATE_KEY +
  TAURI_SIGNING_PRIVATE_KEY_PASSWORD; the asset rename step skips
  latest.json / *.tar.gz / *.sig so the manifest URLs keep resolving
  after the strip-version pass

Requires TAURI_SIGNING_PRIVATE_KEY + TAURI_SIGNING_PRIVATE_KEY_PASSWORD
secrets configured in the repo (already added).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@IsraelAraujo70 IsraelAraujo70 changed the title feat: approve PR button + auto-update check (every 3h) feat: approve PR button + auto-update via tauri-plugin-updater Apr 30, 2026
@IsraelAraujo70
IsraelAraujo70 merged commit 789604b into main Apr 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant