fix: describe the monitors create help topic explicitly - #20
Conversation
`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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe monitor topic configuration now defines ChangesMonitor topic help
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
…-create-topic-help # Conflicts: # CHANGELOG.md
…-create-topic-help
…-create-topic-help
The merge with main auto-combined both branches' [Unreleased] blocks but left two ### Fixed headings under it.
There was a problem hiding this comment.
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 winMerge this into the existing
### Fixedsection.
[Unreleased]now contains two consecutive### Fixedheadings. 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.
…-create-topic-help # Conflicts: # CHANGELOG.md
…-create-topic-help # Conflicts: # CHANGELOG.md
…-create-topic-help # Conflicts: # CHANGELOG.md
Fixes UPT-3562.
The bug
monitors createcovers 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
oclifblock inpackage.jsonis hand-maintained — nothing generates it.oclif.topics.monitors.subtopicsdeclaredbulkandstatsbut notcreate.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, somonitors createinherited the summary ofmonitors:create:api— first alphabetically.The fix
Declare the missing subtopic:
This also fixes
uptimerobot monitors create --help, whose header showed the same borrowed summary.Same latent bug one level down
monitors stats response-timeis both a real command and a synthesized topic (the prefix walk registers it on the way up frommonitors:stats:response-time:all). It rendered as a duplicated line inmonitors stats --help, and read correctly only by coincidence — the summary it happened to borrow was the identical string: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:
Test
No test asserted topic help text —
test/root-help.test.tsonly covers root-level output, which is why this slipped through. Addedtest/topic-help.test.tscovering both topics; it fails onmainand passes here.Checks
pnpm build,format:check,lint,typecheck,test(182 passing across 22 files), andopenapi:checkall pass. No generated file and noopenapi/openapi.yamlchange — the fix is entirely in the hand-maintainedoclifblock.Summary by CodeRabbit
Bug Fixes
monitors statshelp by explicitly documenting the nestedresponse-timetopic.Tests
monitorsandmonitors statshelp output, including the nestedresponse-timetopic.