Skip to content

Pipeline Plan 22

Seth Ford edited this page Feb 13, 2026 · 2 revisions

The plan is complete. Here's the implementation plan summary:


Implementation Plan: Fleet Auto-Discovery from GitHub Org

Architecture Decision

Extend sw-fleet.sh with a discover subcommand and fleet_rediscover_loop() background loop (same pattern as the existing fleet_rebalance() loop). Uses gh api REST calls for org repo listing, consistent with existing GitHub API patterns. Only 3 files need changes.

Files to Modify

File Action Purpose
scripts/sw-fleet.sh Modify Add discover subcommand, fleet_discover(), fleet_rediscover_loop(), topology in fleet_status()
scripts/sw-fleet-test.sh Modify 13 test cases for discover, filters, opt-out, re-discovery, topology
.claude/CLAUDE.md Modify Document new commands and config keys

Task Checklist (14 tasks)

  1. Add CLI argument parsing for discover flags (--org, --language, --activity-days, --topic, --has-issues, --include-forks, --merge, --dry-run)
  2. Implement fleet_discover() — GitHub org API call with pagination via gh api /orgs/{org}/repos --paginate
  3. Implement filters — language, activity window, topics, has-issues, archived/disabled/fork exclusion
  4. Implement opt-out — shipwright-ignore topic + .shipwright-ignore file detection
  5. Implement config generation — build fleet-config.json, support --merge with existing config
  6. Implement --dry-run mode
  7. Implement fleet_rediscover_loop() — periodic background re-discovery with auto_discover config key
  8. Implement fleet_add_repo() — hot-add new repos to running fleet
  9. Add topology display to fleet_status() — repos, machines, workers, auto-discover status
  10. Wire discover into command router and help text
  11. Update load_fleet_config() to parse auto_discover settings
  12. Write 13 test cases in sw-fleet-test.sh
  13. Update .claude/CLAUDE.md documentation
  14. Run full test suite and fix failures

Key Design Details

  • Config schema: New auto_discover block in fleet-config.json with enabled, org, interval_seconds, and filters (language, activity_days, has_issues, topics, include_forks)
  • Opt-out: Repos with shipwright-ignore topic in GitHub are excluded. Repos with a .shipwright-ignore file are also excluded (checked via gh api /repos/{owner}/{repo}/contents/.shipwright-ignore)
  • Re-discovery loop: Background process (like rebalancer) runs every interval_seconds, calls discover with --merge, signals fleet via fleet-rediscover.flag for hot-addition
  • Topology in status: Repos grouped by machine (local/remote), workers allocated, active/queued jobs, last activity, auto-discover last scan time
  • All Bash 3.2 compatible, atomic writes, NO_GITHUB env var respected

Clone this wiki locally