Skip to content

refactor(check-update): switch to static release metadata#75

Merged
BlackHole1 merged 2 commits into
mainfrom
refactor-check-update
Apr 21, 2026
Merged

refactor(check-update): switch to static release metadata#75
BlackHole1 merged 2 commits into
mainfrom
refactor-check-update

Conversation

@BlackHole1
Copy link
Copy Markdown
Member

The update check flow is being simplified to remove package manager specific command resolution and rely on published release metadata. This points users to oo update, validates the returned version, and keeps the CLI contract aligned with the new endpoint.

The update check flow is being simplified to remove package manager
specific command resolution and rely on published release metadata.
This points users to `oo update`, validates the returned version,
and keeps the CLI contract aligned with the new endpoint.

Signed-off-by: Kevin Cui <bh@bugs.cc>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

Warning

Rate limit exceeded

@BlackHole1 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 48 minutes and 28 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 48 minutes and 28 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2bc05791-3588-4e47-90f5-ac36c9e15b1e

📥 Commits

Reviewing files that changed from the base of the PR and between 6014154 and c7d9dc0.

📒 Files selected for processing (2)
  • docs/commands.md
  • docs/commands.zh-CN.md

Walkthrough

This PR refactors the CLI's update-checking mechanism from a package-manager-dependent approach to a fixed CLI-specific endpoint. The code transitions from querying npm registry metadata (with dist-tags.latest format) to fetching from a dedicated latest-release endpoint (with direct version field). The upgrade command generation shifts from dynamically resolving package-manager-specific commands to always displaying the static oo update command. Core logic changes include introducing Zod validation for the response payload, removing package manager detection from the environment, and updating all related tests and documentation to reflect the new behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~28 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the required format (): with 'refactor' as type and 'check-update' as scope, clearly describing the main change.
Description check ✅ Passed The description is directly related to the changeset, explaining the simplification of update-check flow and removal of package-manager-specific resolution.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/commands.md`:
- Around line 111-115: Update the three "Notes:" bullets: change the first to
reflect that transient request failures are retried twice (3 total attempts)
instead of "retried once"; rewrite the second to say successful and failed
checks are not cached so every invocation fetches the latest release metadata
(remove the phrase "published update endpoint"); and rewrite the third to avoid
internal endpoint naming and use user-facing wording such as "when the update
service is temporarily unavailable, the CLI prints a retry-later message instead
of exiting with an error" — modify the existing "Notes:" lines in
docs/commands.md accordingly.

In `@docs/commands.zh-CN.md`:
- Around line 102-105: Update the Chinese CLI docs to state that a single
"最新版本检查" will try up to 3 request attempts (instead of saying "重试一次") and remove
any mention of internal "更新端点" implementation; ensure the three bullet lines in
docs/commands.zh-CN.md are rewritten to: 1) explain the CLI will attempt the
latest-version check up to 3 times on transient failures, 2) note that results
are never cached so each run fetches current metadata, and 3) say the CLI will
suggest retrying later if the update service is temporarily unavailable—use only
user-facing wording and avoid internal endpoint/detail descriptions.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 34d82b74-f47b-4b49-aa4a-16472b321f58

📥 Commits

Reviewing files that changed from the base of the PR and between 0a4b32e and 6014154.

⛔ Files ignored due to path filters (1)
  • src/application/commands/__snapshots__/check-update.cli.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (6)
  • docs/commands.md
  • docs/commands.zh-CN.md
  • src/application/commands/check-update.cli.test.ts
  • src/application/commands/check-update.ts
  • src/application/update/update-notifier.test.ts
  • src/application/update/update-notifier.ts

Comment thread docs/commands.md Outdated
Comment thread docs/commands.zh-CN.md Outdated
The previous docs still described one retry and referenced the
internal update endpoint, which no longer matched the CLI contract.
Update the English and Chinese command docs to reflect two retries
and user-facing wording for the latest release check.

Signed-off-by: Kevin Cui <bh@bugs.cc>
@BlackHole1 BlackHole1 merged commit 165d153 into main Apr 21, 2026
4 of 5 checks passed
@BlackHole1 BlackHole1 deleted the refactor-check-update branch April 21, 2026 00:49
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