Skip to content

fix(scripts): add short help to GitHub test map#3223

Merged
senamakel merged 1 commit into
tinyhumansai:mainfrom
alexzhu0:codex/OH-2611-test-map-short-help
Jun 2, 2026
Merged

fix(scripts): add short help to GitHub test map#3223
senamakel merged 1 commit into
tinyhumansai:mainfrom
alexzhu0:codex/OH-2611-test-map-short-help

Conversation

@alexzhu0
Copy link
Copy Markdown
Contributor

@alexzhu0 alexzhu0 commented Jun 2, 2026

Summary

  • Adds -h as a short help alias for scripts/test-planning/build-github-test-map.mjs.
  • Updates usage text to document both -h and --help.
  • Adds a focused Node test proving help exits before GitHub fetch or LLM synthesis work.

Problem

  • build-github-test-map.mjs is a contributor-facing planning helper, but it only accepted --help.
  • Normal execution can call GitHub CLI and an LLM CLI, so help must remain local and side-effect-free.
  • Adjacent helper scripts already support short help aliases, so this one was inconsistent.

Solution

  • Treat -h the same as --help before phase/include/LLM parsing work proceeds.
  • Test both help aliases with temporary failing gh, codex, and claude stubs in PATH.

Submission Checklist

If a section does not apply to this change, mark the item as N/A with a one-line reason. Do not delete items.

  • Tests added or updated (happy path + failure guard: help exits 0 and fails if GitHub/LLM CLIs are invoked).
  • N/A: Diff coverage gate was not run because this is a root helper script change and local Rust tooling is unavailable.
  • N/A: Coverage matrix not affected; this does not add, remove, or rename a product feature.
  • N/A: No affected feature IDs; contributor planning script only.
  • No new external network dependencies introduced.
  • N/A: Manual smoke checklist not affected; this does not touch release-cut surfaces.
  • N/A: Related to [Automated] Weekly code-review report — 2026-05-25 #2611 but does not close it by itself.

Impact

  • Runtime/platform impact: none.
  • Developer impact: node scripts/test-planning/build-github-test-map.mjs -h now prints usage and exits without requiring GitHub or LLM CLI setup.

Related


AI Authored PR Metadata (required for Codex/Linear PRs)

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

  • Branch: codex/OH-2611-test-map-short-help
  • Commit SHA: 40f3c3f

Validation Run

  • pnpm --filter openhuman-app format:check (blocked after Prettier passed; see Validation Blocked)
  • pnpm typecheck: N/A, root Node helper-only change
  • Focused tests: node --test scripts/__tests__/build-github-test-map-help.test.mjs
  • Rust fmt/check (if changed): N/A, no Rust files changed
  • Tauri fmt/check (if changed): N/A, no Tauri files changed
  • node scripts/codex-pr-preflight.mjs --lightweight
  • git diff --check

Validation Blocked

  • command: pnpm --filter openhuman-app format:check
  • error: sh: cargo: command not found
  • impact: Prettier passed, but the Rust format phase cannot run in this local environment until Cargo is installed.

Behavior Changes

  • Intended behavior change: -h now prints usage and exits 0 for build-github-test-map.mjs.
  • User-visible effect: contributor-facing planning CLI help is easier to discover.

Parity Contract

  • Legacy behavior preserved: --help, fetch/synthesize/all phases, include filtering, LLM selection, and invalid argument behavior are unchanged.
  • Guard/fallback/dispatch parity checks: focused test verifies both help aliases exit before any gh, codex, or claude invocation.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): none found in the current open PR list during preflight.
  • Canonical PR: this PR
  • Resolution (closed/superseded/updated): N/A

Summary by CodeRabbit

  • New Features

    • Added a short -h option alongside --help so the CLI prints usage immediately for faster access to help.
  • Tests

    • Added tests verifying both help flags print usage, exit successfully without invoking external tools, and produce no error output.

@alexzhu0 alexzhu0 requested a review from a team June 2, 2026 15:02
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 244efa83-364e-4ff7-8fae-d14bbd8ddd2a

📥 Commits

Reviewing files that changed from the base of the PR and between 40f3c3f and aad0c88.

📒 Files selected for processing (2)
  • scripts/__tests__/build-github-test-map-help.test.mjs
  • scripts/test-planning/build-github-test-map.mjs
🚧 Files skipped from review as they are similar to previous changes (2)
  • scripts/tests/build-github-test-map-help.test.mjs
  • scripts/test-planning/build-github-test-map.mjs

📝 Walkthrough

Walkthrough

Added -h short-form support to the build-github-test-map CLI and a test that verifies both -h and --help print usage and exit successfully before any external tools are invoked.

Changes

Help flag support for build-github-test-map

Layer / File(s) Summary
CLI short-form help flag
scripts/test-planning/build-github-test-map.mjs
Usage text and argument parsing updated so -h is an alias for --help, invoking the same help print-and-exit flow.
Help flag test validation
scripts/__tests__/build-github-test-map-help.test.mjs
New test creates temporary failing stubs for gh, codex, and claude, runs the script with --help and -h, and asserts exit code 0, expected help text on stdout, and empty stderr.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

working

Suggested reviewers

  • oxoxDev

Poem

A rabbit hops with joy, a tiny cheer,
-h now stands beside --help clear,
Stubs guard the path from accidental calls,
Help appears early, before anything falls,
I nibble a carrot — the CLI is austere! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 directly and accurately describes the main change: adding short form -h help flag to the build-github-test-map script alongside the existing --help option.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

Constraint: test planning help should be inspectable without GitHub fetching or LLM CLI setup.\nRejected: keeping only --help | adjacent contributor scripts support -h and this helper is user-facing.\nConfidence: high\nScope-risk: narrow\nDirective: parse help before fetch, filesystem output, or synthesis phases.\nTested: node --test scripts/__tests__/build-github-test-map-help.test.mjs; node scripts/codex-pr-preflight.mjs --lightweight; git diff --check; pnpm --filter openhuman-app format:check reached cargo blocker after Prettier passed.\nNot-tested: full Rust format because cargo is not installed locally.
@alexzhu0 alexzhu0 force-pushed the codex/OH-2611-test-map-short-help branch from 40f3c3f to aad0c88 Compare June 2, 2026 16:41
@coderabbitai coderabbitai Bot added the working A PR that is being worked on by the team. label Jun 2, 2026
@senamakel senamakel merged commit d1c9b02 into tinyhumansai:main Jun 2, 2026
23 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

working A PR that is being worked on by the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants