Skip to content

feat(updates): allow opting out of automatic version checks - #847

Merged
runkids merged 7 commits into
mainfrom
runkids/automatic-update-opt-out
Nov 11, 2026
Merged

runkids merged 7 commits into
mainfrom
runkids/automatic-update-opt-out

Conversation

@runkids

@runkids runkids commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Type

Summary

SKILLSHARE_AUTO_UPDATE_CHECK > global updates.auto_check > true
                          ├─ CLI updates on/off/check
                          ├─ Web Settings switch
                          └─ companion desktop app integration
  • Add skillshare updates on|off to save the global preference and updates check for an explicit, uncached CLI version check.
  • Suppress automatic CLI/skill checks, cached notices, Web dialogs and version badges when disabled, including status, doctor, project mode and checks already in flight. Explicit checks and upgrades remain available.
  • Add Web Settings controls, schema/completions, localized documentation and regression coverage. Resource-source update checks are unchanged.

Linked Issue

Closes #846

Companion desktop PR: runkids/skillshare-app#126

Verification

  • Before: there was no supported opt-out; automatic startup/status checks and cached update notices still ran.
  • After: make check, 883 Web tests, Web build, and the website build for all five locales passed in the devcontainer.
  • Isolated E2E runbook: 5/5 passed. A live updates check --json and explicit Web API check still reached the release endpoint with the preference disabled.
  • Inspected Clean/Playful × light/dark Settings screenshots and the disabled desktop/Web integration in Linux noVNC.
  • Five-pass local review completed (correctness, rules, spec, consumers, simplification), with targeted corrective re-reviews. All reported findings are addressed. Current HEAD: ef3cdbb2c481e50322dfe442ba110feb0e0bf38d; the full Web suite/build and devcontainer make check passed, including the latest CLI corrective changes.
  • Added delayed/prefilled-result regressions and structurally marked Doctor update notices so cached warnings, summary counts and next-step advice can be suppressed without hiding diagnostics.
  • Browser fixture: verified manual Settings check → upgrade dialog → completed dev simulation → reopen while automatic checks are off; inspected the screenshot. API responses were mocked for this UI-only check; no real upgrade was performed.
  • Codex round 1: fixed the JSON-error-contract finding in 678b1b659, covering all argument/read/save/network/rate-limit failures at one boundary. Eight unit failure scenarios and five real-binary cases verify clean JSON, empty stderr and exit 1; plain mode is unchanged. The corrective diff passed all five local review passes.
  • Codex round 2: fixed incomplete manual skill checks in ef3cdbb2c. Missing skill results now fail the manual API rather than imply all versions are current; refetch errors hide stale cached success/upgrade actions. Eight global/project API cases, full make check, 883 Web tests, the Web build, and four inspected localized theme screenshots passed. Five local review passes found no remaining issue in this corrective diff. Codex round 3 completed on ef3cdbb2c with no new findings.
  • Not covered: native Windows/macOS desktop acceptance. A pre-existing narrow-screen source-folder row layout issue is outside this change.

Merge Danger

Two-way, global preference only. Defaults remain enabled; environment overrides are process-local and are not written back. An open Web dashboard refreshes only the local policy every five seconds; desktop external changes refresh within a minute.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check)
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

Add a shared global preference and environment override for automatic release checks and notifications. Keep explicit checks and upgrades available, including when cached results exist or a check finishes after opt-out.

Expose the preference through the CLI and dashboard, and document the desktop app integration.

Closes #846
Recheck the effective preference before publishing CLI and doctor results, and before starting another automatic request. Keep project doctor attached to the global config instead of freezing its initial policy in a subprocess.

Hide cached doctor update notices without hiding diagnostic warnings, refresh version data when the external preference changes, and retain an explicit dashboard upgrade action. Localize manual-check failures.

Add regressions for in-flight opt-out, buffered results and manual upgrades.
Keep automatic update suggestions distinct from diagnostic advice so a late opt-out removes their summary warnings and next steps without hiding unrelated fixes.

Allow the explicitly requested Web upgrade simulation in development builds and cover both cases with regressions.
Notify Settings when the simulated upgrade closes so the user can open another explicitly requested upgrade without reloading the page.
Use the typed upgrade response fields in the explicit-dev-upgrade regression fixture.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T03:42:53.680544Z ef3cdbb Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 009085c0aa

ℹ️ 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 cmd/skillshare/updates.go
Comment on lines +62 to +63
if err != nil {
return err

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve JSON output when update commands fail

When skillshare updates check --json encounters a network failure or GitHub rate limit, this branch returns the error without calling writeJSONError. Consequently, main.go prints a blank line and a human-readable error to stdout, breaking consumers expecting JSON. Route JSON-mode failures through the existing structured-error helper; the same issue affects argument validation, preference-save, preference-read, and unknown-action errors in this handler.

Useful? React with 👍 / 👎.

@runkids runkids Nov 11, 2026 •

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in 678b1b6. The handler now detects --json before parsing and uses the existing writeJSONError boundary for all returned errors, covering unknown actions, argument validation (including a trailing --json), preference reads/saves, network failures and rate limits. Main receives jsonSilentError and exits 1 without appending text. TestUpdatesJSONFailures covers eight error scenarios; TestUpdates_JSONFailures verifies five real-binary cases with clean JSON stdout, empty stderr and exit 1. Plain-mode behavior is also covered. Targeted tests and full make check passed in the devcontainer; the corrective diff passed all five local review passes.

Detect --json before argument validation and route every updates failure through the shared JSON error boundary. Main can then exit nonzero without contaminating stdout with plain-text errors.

Cover argument order, unknown actions, preference reads and saves, network failures and rate limits. Real-binary regressions verify JSON purity, silent stderr and exit status while preserving plain-mode behavior.
@runkids

runkids commented Nov 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: 678b1b6595

ℹ️ 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 ui/src/pages/SettingsPage.tsx Outdated
Comment on lines +151 to +153
{manualCheck.data.cliUpdateAvailable || manualCheck.data.skillUpdateAvailable
? t('settings.updates.available', { cli: manualCheck.data.cliLatest ?? manualCheck.data.cliVersion, skill: manualCheck.data.skillLatest ?? manualCheck.data.skillVersion })
: t('settings.updates.current')}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Distinguish a failed skill check from an up-to-date result

When the CLI is current and the release API succeeds but the built-in skill request fails, this branch reports “No newer version found” without determining whether the skill is current. FetchRemoteSkillVersion() returns an empty string on transport errors or non-200 responses, so handleVersionCheck returns success with skillLatest unset and skillUpdateAvailable: false. For an installed skill, distinguish that missing result from a successful check, either by showing a partial/check-failed status or propagating the manual-check failure.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in ef3cdbb. The manual version API now returns HTTP 502 when the installed built-in skill's remote result is missing, including transport errors, non-200 responses and missing version metadata; automatic checks remain quiet. Settings prioritizes the error over retained query data, hiding both stale success notices and stale upgrade actions after a failed refetch. TestManualVersionCheckSkillResult covers all three failures and a genuinely current result in both global and project modes. Full make check, 883 Web tests and the Web build passed. A browser fixture verified success-then-failure cache handling and localized error rendering in Clean/Playful light/dark; all four screenshots were inspected. The three-file corrective diff passed five local review passes.

A successful release API request does not establish that the built-in skill is current when its separate request fails. Return a manual-check error for missing remote skill results, while retaining quiet automatic behavior.

Prioritize the error over retained query data so failed refetches cannot display stale success notices or upgrade actions. Cover network, HTTP and missing-version failures plus verified-current results in global and project mode.
@runkids

runkids commented Nov 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: ef3cdbb2c4

ℹ️ 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".

@runkids
runkids merged commit adf6c9e into main Nov 11, 2026
9 checks passed
@runkids
runkids deleted the runkids/automatic-update-opt-out branch November 11, 2026 07:03
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.

Feature request: opt out of automatic version checks and update notifications

1 participant