fix(cli): rank chm-v* tags by semver and polish upgrade UX by duyet · Pull Request #3149 · chmonitor/chmonitor · GitHub
Skip to content

fix(cli): rank chm-v* tags by semver and polish upgrade UX - #3149

Merged
duyet merged 1 commit into
mainfrom
cursor/cli-upgrade-polish-dcb0
Aug 19, 2026
Merged

fix(cli): rank chm-v* tags by semver and polish upgrade UX#3149
duyet merged 1 commit into
mainfrom
cursor/cli-upgrade-polish-dcb0

Conversation

@duyet

@duyet duyet commented Aug 19, 2026

Copy link
Copy Markdown
Member

Follow-up to #3147 for #3145. The alias itself already shipped; this pass fixes remaining upgrade-path bugs and CLI polish found while verifying that work.

Summary

chm upgrade / chm update and scripts/install.sh now pick the newest published chm-v* tag by semver (not the first GitHub API match), normalize pin tags like 0.2.0 / chm-0.2.0, and print a copy-pasteable fallback on download failures. Dashboard flags work after the subcommand (chm hosts --base-url …).

Changes

  • rust/ch-monitor-cli/src/update.rs: paginate GitHub releases; normalize_release_tag; download/API errors include install.sh / cargo fallback
  • scripts/install.sh: same newest-published-tag pick (skip drafts/prereleases); CHM_VERSION normalization; CHM_INSTALL_SELF_TEST=1
  • rust/ch-monitor-cli/src/main.rs: --version includes target triple; help text for every command; global = true on --base-url / --host-id / --api-key / --config; explicit hosts/chart/table HTTP errors; empty-result messages
  • Docs kept in sync: crate README, docs/content/guide/guides/diagnostics-cli.mdx, docs/knowledge/standalone-cli.md

Left alone

  • chm update still works; telemetry stays ("cli_run", "update") for both commands
  • CHM_LICENSE_KEY honor-system ping unchanged
  • No Homebrew / crates.io / DRM / dashboard UI / release-please

Test plan

  • CHM_INSTALL_SELF_TEST=1 bash scripts/install.sh
  • cargo test --locked in rust/ch-monitor-cli (running)
  • cargo clippy --locked -- -D warnings
  • cargo fmt --all -- --check
  • chm --help / chm hosts --base-url http://127.0.0.1:9 error copy
  • pnpm run lint — not applicable (Rust CLI / docs / install script)
  • pnpm run build — not applicable
  • Docs updated in docs/content/
  • docs/content/ai-agent.mdx — not applicable

Notes for reviewer

Guess, then verified: install.sh head -n 1 on chm-v* grep matches GitHub created_at order (and can include drafts/prereleases). Live API currently returns a draft chm-v0.1.0 before published chm-v0.1.1. Rust already ranked by semver; the installer did not.

Pin chm-0.2.0 previously became chm-vchm-0.2.0. Unsupported-target errors still point at cargo install only (install.sh would refuse that platform too).


Co-Authored-By: duyetbot bot@duyet.net

Open in Web Open in Cursor 

Follow-up to the chm upgrade alias: pick the newest published release
instead of the first GitHub API match, normalize pin tags, and print
copy-pasteable fallbacks on download failures. Also accept dashboard
flags after the subcommand and make hosts/chart/table errors explicit.

Co-Authored-By: duyetbot <bot@duyet.net>

Co-authored-by: duyet <duyet@users.noreply.github.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation area: rust Rust monitor-core / WASM labels Aug 19, 2026
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

☁️ Cloudflare Preview Deployment

App Preview URL
Dashboard https://preview.dash.chmonitor.dev
MCP https://preview.dash.chmonitor.dev/api/mcp
Landing https://preview.chmonitor.dev
Docs https://preview.docs.chmonitor.dev
Property Value
Commit b083f33
Deployed at 2026-08-19T12:01:59.641Z

Previews are automatically updated on every push to this PR.
Unchanged apps keep their previous preview (path-filtered deploys).

@duyet
duyet marked this pull request as ready for review August 19, 2026 13:08

@duyet duyet left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Review: the diff matches the PR body. GitHub refuses a self-APPROVE on this token, so this is a comment review.

  • update.rs paginates releases, ranks published chm-v* tags by semver (newest_chm_tag skips drafts/prereleases), and normalize_release_tag accepts chm-v0.2.0 / v0.2.0 / 0.2.0 / chm-0.2.0.
  • Download/API errors go through with_fallback; unsupported targets still point at cargo install only (no install.sh).
  • install.sh has the same newest-published-tag pick (grep-based JSON, no jq), CHM_VERSION normalization, and CHM_INSTALL_SELF_TEST=1 covering the draft-first / Helm-tag / prerelease fixture.
  • main.rs global = true on dashboard flags, --version includes the target triple, HTTP errors include copy-pasteable hints.
  • Docs (crate README, diagnostics-cli.mdx, standalone-cli.md) stay in sync.

Required CI (unit-tests, dashboard, plus rust-cli) is already green. Marked ready; arming squash auto-merge.

@duyet
duyet merged commit d62efdf into main Aug 19, 2026
25 checks passed
@duyet
duyet deleted the cursor/cli-upgrade-polish-dcb0 branch August 19, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: rust Rust monitor-core / WASM documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants