Skip to content

fix(e2e): normalize both sides of check-docs CLI parity check - #2265

Closed
kagura-chen wants to merge 1 commit into
NVIDIA:mainfrom
kagura-chen:fix/check-docs-normalization-parity
Closed

kagura-chen wants to merge 1 commit into
NVIDIA:mainfrom
kagura-chen:fix/check-docs-normalization-parity

Conversation

@kagura-chen

@kagura-chen kagura-chen commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The CLI parity check in check-docs.sh applies asymmetric normalization to
the two sides it compares, causing false mismatches in the nightly E2E run.

Help side (phase 1) strips trailing <arg>/[arg] placeholders and
descriptions separated by 2+ spaces, but:

  1. Descriptions separated by a single space after the last argument (e.g.
    channels remove <channel> Clear credentials and rebuild) slip through
    the \s{2,} regex.
  2. After description removal, newly-exposed trailing <arg>/[arg]
    placeholders are not re-stripped.

Doc side (phase 2) extracts ### \nemoclaw …`headings **verbatim** without stripping argument placeholders, so headings likenemoclaw channels add ` never match the stripped help output.

Fix

  • Help side: Add a post-strip pass that removes residual description text
    starting with a capitalized word (/\s+[A-Z][a-z].*$/), then re-strip
    any <arg>/[arg] placeholders exposed by the description removal.
  • Doc side: Strip trailing <arg> and [arg] placeholders from
    headings, applying the same normalization as the help side.

Testing

Verified both normalization paths produce identical output for all commands
listed in the issue's CI mismatch log.

Closes #2250

Summary by CodeRabbit

  • Chores
    • Updated internal testing and documentation validation processes to improve consistency checks between CLI help text and reference documentation.

…#2250)

The CLI parity check in check-docs.sh applies asymmetric normalization:
the help side strips trailing <arg>/[arg] placeholders and descriptions
separated by 2+ spaces, but the doc side extracts headings verbatim.

This causes false mismatches when:
1. A commands.md heading includes argument placeholders (e.g.
   `nemoclaw <name> channels add <channel>`) — the doc side keeps
   them while the help side strips them.
2. A --help line has a description separated by a single space after
   the last argument (e.g. `channels remove <channel> Clear
   credentials and rebuild`) — the \s{2,} regex does not catch it,
   leaving description text in the normalized command.

Fix both sides:
- Help side: add a post-strip pass that removes residual description
  text starting with a capitalized word, then re-strip any <arg>/[arg]
  placeholders exposed by description removal.
- Doc side: strip trailing <arg> and [arg] placeholders from headings,
  matching the help-side normalization.

Signed-off-by: kagura-agent <[email protected]>
@coderabbitai

coderabbitai Bot commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 890f435b-56d8-4b3c-b36a-89abf539433a

📥 Commits

Reviewing files that changed from the base of the PR and between 9b66b63 and 8a2b2ee.

📒 Files selected for processing (1)
  • test/e2e/e2e-cloud-experimental/check-docs.sh

📝 Walkthrough

Walkthrough

The CLI-doc parity check script is updated to normalize trailing argument placeholders and descriptive text symmetrically between CLI help output and documentation headings. Both sides now strip trailing <arg> and [arg] tokens consistently, and help text descriptions are more aggressively removed to prevent false mismatches.

Changes

Cohort / File(s) Summary
CLI Parity Check Normalization
test/e2e/e2e-cloud-experimental/check-docs.sh
Enhanced normalization logic in run_cli_check to strip trailing capitalized descriptive text after argument placeholders, re-apply placeholder removal, and align with docs heading extraction that now also strips [arg] and <arg> tokens from captured headings before comparison.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A rabbit hops through scripts with glee,
CLI and docs now finally agree!
Trailing words and brackets cast away,
Parity checks now pass each day! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely describes the main fix: applying symmetric normalization to both sides of the CLI parity check in check-docs.sh.
Linked Issues check ✅ Passed The PR fully addresses issue #2250 by implementing matching normalization on both the help-side and doc-side, fixing asymmetric stripping that caused false mismatches.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the CLI parity normalization in check-docs.sh; no unrelated modifications are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@wscurran

Copy link
Copy Markdown
Contributor

✨ Thanks for submitting this PR that proposes a way to improve the E2E testing process.


Related open issues:

@kagura-chen

Copy link
Copy Markdown
Contributor Author

Closing this PR — the underlying issue was resolved upstream by PR #2446, which replaced the --help parsing approach with --dump-commands from a typed command registry. This makes the normalization fix here obsolete. Thanks @wscurran for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: e2e End-to-end tests, nightly failures, or validation infrastructure bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nightly-e2e: check-docs CLI parity check fails due to normalization asymmetry

2 participants