Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pipeline Plan inline

Seth Ford edited this page Mar 2, 2026 · 10 revisions

Plan saved to docs/plans/2026-03-02-ping-command.md.


Implementation Plan: shipwright ping

Summary

4 files to touch, 13 atomic steps.

Chosen approach: Standalone script pattern (same as sw-hello.sh) — rejected inline-in-router because it breaks the modular convention used by all 100+ commands.

Files to Modify

Action Path
Create scripts/sw-ping.sh
Create scripts/sw-ping-test.sh
Modify scripts/sw — insert ping) case after hello) block (before *))
Modify package.json — insert sw-ping-test.sh between sw-patrol-meta-test.sh and sw-pipeline-composer-test.sh

Task Checklist

  • Task 1: Create scripts/sw-ping-test.sh with 6 test cases (output, exit 0, --help, -h, --version, invalid option)
  • Task 2: Run test to confirm it fails (TDD red — script doesn't exist yet)
  • Task 3: Create scripts/sw-ping.sh with echo "pong" main path
  • Task 4: chmod +x scripts/sw-ping.sh
  • Task 5: Run bash scripts/sw-ping-test.sh — confirm 6/6 pass
  • Task 6: Commit sw-ping.sh and sw-ping-test.sh
  • Task 7: Add ping) case to scripts/sw router after hello) block
  • Task 8: Verify bash scripts/sw ping outputs pong
  • Task 9: Commit router change
  • Task 10: Insert sw-ping-test.sh into package.json test chain
  • Task 11: Verify registration with node one-liner
  • Task 12: Run bash scripts/sw-ping-test.sh — confirm still 6/6
  • Task 13: Commit package.json change

Key Risks

  • Router insertion position — must go BEFORE the *) catch-all, AFTER hello). Plan specifies exact location (line 607).
  • set -euo pipefail + exit code capture in tests — use || local exit_code=$? pattern (same as hello test), not bare $?.
  • VERSION — copy 3.2.4 from sw-hello.sh exactly.

Definition of Done

  • bash scripts/sw-ping.sh → prints pong, exits 0
  • bash scripts/sw ping (via router) → prints pong, exits 0
  • bash scripts/sw-ping-test.shPASS: 6 / FAIL: 0
  • sw-ping-test.sh registered in package.json test chain

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /