fix(release): refresh Cargo.lock on bump, attach uid to core Sentry, hide debug settings#1465
Conversation
The bump step updates [package].version in both Cargo.toml manifests but never refreshed the matching entries in Cargo.lock / app/src-tauri/Cargo.lock, so the next local cargo invocation rewrote them and left an uncommitted diff after every staging/prod release. Add a `cargo update --workspace` step after the bump and stage both lockfiles in the release commit.
The core's `before_send` was zeroing out `event.user` for every event, so Sentry could never group issues by user or report 'users affected'. Source the cached account uid via `peek_cached_current_user_identity` (which already strips everything but id/name/email) and attach only `id` — no email, name, or IP — so this stays consistent with `send_default_pii: false`. The frontend already attaches the same uid from the core-state snapshot in its own `beforeSend`, so events from both surfaces will now group under the same user in Sentry.
…ug entries Comment out the three debug entries from Developer Options and the 'Advanced settings' shortcut on the Screen Awareness panel. Routes in pages/Settings.tsx are retained for trivial re-enable, matching the precedent set by Autocomplete/Voice Debug (tinyhumansai#717).
📝 WalkthroughWalkthroughThis PR makes three independent changes: production and staging release workflows now refresh and commit Cargo.lock files during version bumps; debug menu routes are hidden from the Developer Options and Screen Intelligence panels; and the Sentry telemetry hook attaches cached user identity to events instead of stripping it. ChangesRelease Workflow Lockfile Sync
Debug UI Routes Hidden
Sentry User Identity Telemetry
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/release-staging.yml (1)
105-112: ⚡ Quick winAdd explicit Rust toolchain setup before lockfile refresh
Lines 105–112 execute
cargo updatewithout explicitly installing the Rust toolchain. While this may work on runner images with pre-installed Rust, adding an explicit setup step will make lockfile refreshes deterministic across runner image updates and align with the repository's declared rust-toolchain.toml (1.93.0).Suggested patch
- name: Verify version sync run: node scripts/release/verify-version-sync.js "${{ steps.bump.outputs.version }}" + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@1.93.0 - name: Refresh Cargo.lock files🤖 Prompt for 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. In @.github/workflows/release-staging.yml around lines 105 - 112, Add an explicit Rust toolchain setup step before the "Refresh Cargo.lock files" step: call a setup action (e.g., actions-rs/toolchain or rust-lang/setup-rust) to install and set the toolchain to 1.93.0 (matching rust-toolchain.toml) and make it the default for the job, then run the existing cargo update commands (the step named "Refresh Cargo.lock files") so lockfile refreshes are deterministic across runners.
🤖 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.
Nitpick comments:
In @.github/workflows/release-staging.yml:
- Around line 105-112: Add an explicit Rust toolchain setup step before the
"Refresh Cargo.lock files" step: call a setup action (e.g., actions-rs/toolchain
or rust-lang/setup-rust) to install and set the toolchain to 1.93.0 (matching
rust-toolchain.toml) and make it the default for the job, then run the existing
cargo update commands (the step named "Refresh Cargo.lock files") so lockfile
refreshes are deterministic across runners.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 401c913c-c8c8-4661-9c48-ac31ec187e58
⛔ Files ignored due to path filters (2)
Cargo.lockis excluded by!**/*.lockapp/src-tauri/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
.github/workflows/release-production.yml.github/workflows/release-staging.ymlapp/src/components/settings/panels/DeveloperOptionsPanel.tsxapp/src/components/settings/panels/ScreenIntelligencePanel.tsxsrc/main.rs
…hide debug settings (tinyhumansai#1465)
Summary
Cargo.lock/app/src-tauri/Cargo.lockafter the version bump and stage them in the release commit, so the lockfiles no longer drift on every release.before_send(src/main.rs) attaches the cached account uid (peek_cached_current_user_identity().idonly — no name/email/IP) so Sentry can group issues by user and report "users affected".Problem
Cargo.lockdiff becausebump-version.jsupdatesCargo.tomlbut never refreshes the matching[package].versionentries in the lockfiles. The next localcargoinvocation rewrote them and dirtied the tree.before_sendhadevent.user = None;, so even though the React side already attachesevent.user = { id }, no core-side event carried a uid. Sentry could not count unique users affected by core errors.Solution
release-staging.yml,release-production.yml): added acargo update --workspace --manifest-path …step on both manifests after the bump, then included both lockfiles in thegit addline of the release commit.--workspaceconstrains updates to workspace members only, so transitive dep churn stays out.src/main.rs): replacedevent.user = None;with a lookup against the existingpeek_cached_current_user_identity()(which already strips everything butid/name/email). Onlyidis attached; consistent withsend_default_pii: false. Empty on early-startup events before theauth_get_mecache populates — same trade-off the frontend has.DeveloperOptionsPanel.tsxand the "Advanced settings" shortcut onScreenIntelligencePanel.tsx. Removed the now-unusednavigateToSettingsfrom the destructure. Routes inpages/Settings.tsxare intact, matching the Autocomplete/Voice Debug precedent (Temporarily hide Text-to-Speech and Auto-complete from UI #717).Submission Checklist
before_sendbranch — diff-cover scope is minimalImpact
user.id, enabling "users affected" rollups across React + Rust surfaces.Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
Validation Run
Validation Blocked
Behavior Changes
Parity Contract
Duplicate / Superseded PR Handling