Skip to content

fix: describe the monitors create help topic explicitly - #20

Merged
subalee merged 8 commits into
mainfrom
fix/upt-3562-monitors-create-topic-help
Jul 28, 2026
Merged

fix: describe the monitors create help topic explicitly#20
subalee merged 8 commits into
mainfrom
fix/upt-3562-monitors-create-topic-help

Conversation

@subalee

@subalee subalee commented Jul 28, 2026

Copy link
Copy Markdown
Member

Fixes UPT-3562.

The bug

$ uptimerobot monitors --help
TOPICS
  monitors bulk    Run bulk monitor actions
  monitors create  Create a monitor (API)     <-- wrong
  monitors stats   Query monitor statistics

monitors create covers nine monitor types (api, dns, heartbeat, http, keyword, ping, port, udp, visual-comparison), but its help line claimed it only creates API monitors.

Why

The oclif block in package.json is hand-maintained — nothing generates it. oclif.topics.monitors.subtopics declared bulk and stats but not create.

When a topic has no declared description, oclif synthesizes one: it walks every non-hidden command, splits the id on :, and registers each unclaimed prefix as a topic borrowing that command's summary (@oclif/core/lib/config/config.js, "Add missing topics for displaying help when partial commands are entered"). First writer wins, so monitors create inherited the summary of monitors:create:api — first alphabetically.

The fix

Declare the missing subtopic:

"create": { "description": "Create a monitor of a given type" }

This also fixes uptimerobot monitors create --help, whose header showed the same borrowed summary.

Same latent bug one level down

monitors stats response-time is both a real command and a synthesized topic (the prefix walk registers it on the way up from monitors:stats:response-time:all). It rendered as a duplicated line in monitors stats --help, and read correctly only by coincidence — the summary it happened to borrow was the identical string:

TOPICS
  monitors stats response-time  Get monitor response time statistics
COMMANDS
  monitors stats response-time  Get monitor response time statistics

That is one command-summary edit away from silently going wrong, so the nested subtopic is now declared too. The topic and the command are distinct things and now read as such:

TOPICS
  monitors stats response-time  Query response time statistics overall or by
                                region
COMMANDS
  monitors stats response-time  Get monitor response time statistics
  monitors stats uptime         Get monitor uptime statistics

Test

No test asserted topic help text — test/root-help.test.ts only covers root-level output, which is why this slipped through. Added test/topic-help.test.ts covering both topics; it fails on main and passes here.

Checks

pnpm build, format:check, lint, typecheck, test (182 passing across 22 files), and openapi:check all pass. No generated file and no openapi/openapi.yaml change — the fix is entirely in the hand-maintained oclif block.

Summary by CodeRabbit

  • Bug Fixes

    • Corrected CLI help text so the “monitors create” topic is described accurately.
    • Clarified monitors stats help by explicitly documenting the nested response-time topic.
  • Tests

    • Added automated checks to verify monitors and monitors stats help output, including the nested response-time topic.

`oclif.topics.monitors.subtopics` in package.json listed `bulk` and `stats`
but not `create`, so oclif synthesized the missing `monitors create` topic
from its first subcommand and borrowed that subcommand's summary. The topic
therefore read "Create a monitor (API)" in `uptimerobot monitors --help`,
implying it only creates API monitors when it in fact covers nine types.

Add the `create` subtopic, and add the nested `stats.response-time` subtopic
for the same latent problem one level down: `monitors stats response-time` is
both a real command and a synthesized topic, and only read correctly because
the borrowed summary happened to match. It now has its own description, so
`monitors stats --help` distinguishes the topic from the command.

Cover both in test/topic-help.test.ts — no test asserted topic help text
before, which is why this went unnoticed.
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 91d416b8-c79e-4242-8cfd-4b139df2c3ad

📥 Commits

Reviewing files that changed from the base of the PR and between c96b543 and 3bb28c6.

📒 Files selected for processing (1)
  • CHANGELOG.md

Walkthrough

The monitor topic configuration now defines create and stats response-time descriptions. New CLI help tests verify the updated output, and the changelog records both corrections.

Changes

Monitor topic help

Layer / File(s) Summary
Define monitor topic descriptions
package.json
Adds explicit descriptions for the monitors create and monitors stats response-time topics.
Validate and document help output
test/topic-help.test.ts, CHANGELOG.md
Tests the corrected help text and documents the two topic-description fixes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • UPT-3562: Adds the missing monitors.subtopics.create description to correct the monitors --help output.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The added monitors stats response-time topic and its test appear outside the linked issue's create-help fix. Move the response-time topic changes to a separate PR or add a linked issue that covers that scope.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: making the monitors create help topic description explicit.
Linked Issues check ✅ Passed The PR adds the missing monitors.subtopics.create description and fixes the help text as requested by UPT-3562.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/upt-3562-monitors-create-topic-help
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/upt-3562-monitors-create-topic-help

Comment @coderabbitai help to get the list of available commands.

subalee added 4 commits July 28, 2026 18:25
…-create-topic-help

# Conflicts:
#	CHANGELOG.md
The merge with main auto-combined both branches' [Unreleased] blocks but left
two ### Fixed headings under it.

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
CHANGELOG.md (1)

28-35: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Merge this into the existing ### Fixed section.

[Unreleased] now contains two consecutive ### Fixed headings. Add this bullet under the existing section at Lines 20-26 to keep release notes grouped consistently.

🤖 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 `@CHANGELOG.md` around lines 28 - 35, Merge the newly added changelog bullet
into the existing “### Fixed” section under “[Unreleased]” rather than retaining
a second consecutive “### Fixed” heading; preserve the bullet text and
surrounding release-note structure.
🤖 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.

Outside diff comments:
In `@CHANGELOG.md`:
- Around line 28-35: Merge the newly added changelog bullet into the existing
“### Fixed” section under “[Unreleased]” rather than retaining a second
consecutive “### Fixed” heading; preserve the bullet text and surrounding
release-note structure.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f6bbab30-3b6b-47ef-bdef-d10fd1f8f46d

📥 Commits

Reviewing files that changed from the base of the PR and between 9b9b5e8 and c96b543.

📒 Files selected for processing (1)
  • CHANGELOG.md

subalee added 3 commits July 28, 2026 23:11
…-create-topic-help

# Conflicts:
#	CHANGELOG.md
…-create-topic-help

# Conflicts:
#	CHANGELOG.md
…-create-topic-help

# Conflicts:
#	CHANGELOG.md
@subalee
subalee merged commit 3ec25cc into main Jul 28, 2026
3 checks passed
@subalee
subalee deleted the fix/upt-3562-monitors-create-topic-help branch July 28, 2026 22:32
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