Repository navigation
fix(watch): wire missing CLI flags, validate state-backend, fix auth stderr (#834) - #837
Conversation
🟡 Impact Analysis — PR #837Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affectedroot (1 file)
squad-cli (3 files)
This report is generated automatically for every PR. See #733 for details. |
🛫 PR Readiness Check
|
| Status | Check | Details |
|---|---|---|
| ✅ | Single commit | 1 commit — clean history |
| ✅ | Not in draft | Ready for review |
| ✅ | Branch up to date | Up to date with dev |
| ❌ | Copilot review | No Copilot review yet — it may still be processing |
| ✅ | Changeset present | Changeset file found |
| ✅ | Scope clean | No .squad/ or docs/proposals/ files |
| ✅ | No merge conflicts | No merge conflicts |
| ✅ | Copilot threads resolved | 0 active Copilot thread(s) resolved (7 outdated skipped) |
| ❌ | CI passing | 16 check(s) still running |
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
There was a problem hiding this comment.
Pull request overview
This PR introduces GitHub automation to moderate spam and auto-lock stale items, plus test coverage for the new scripts (despite the PR metadata describing a docs-only fact-checker template update).
Changes:
- Add a new GitHub Actions workflow to filter issue comments, moderate newly opened issues for spam, and auto-lock stale closed items on a schedule.
- Add two Node scripts (
moderate-spam.mjs,lock-stale.mjs) with comprehensive Vitest test suites. - Update Vitest config with a pre-transform plugin to strip shebangs from
.mjsscripts during testing.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
vitest.config.ts |
Adds a Vite/Vitest plugin to strip shebang lines so .mjs scripts can be imported in tests. |
scripts/moderate-spam.mjs |
Implements spam scoring + moderation actions (label/close/comment) for newly opened issues. |
scripts/lock-stale.mjs |
Implements scheduled search + lock of stale closed issues/PRs. |
test/scripts/moderate-spam.test.ts |
Adds unit tests for spam scoring and moderation API behavior. |
test/scripts/lock-stale.test.ts |
Adds unit tests for stale search, lock behavior, and run summaries. |
.github/workflows/squad-comment-moderation.yml |
Wires the scripts/actions into issue/issue_comment/scheduled automation with permissions. |
187d2b6 to
fc7ceaf
Compare
b4ee2a9 to
88391f5
Compare
88391f5 to
866958f
Compare
…stderr (#834) P0: - Wire --notify-level, --overnight-start, --overnight-end, --sentinel-file to WatchConfig interface, loadWatchConfig merge, and normalizeFileConfig - Validate --state-backend upfront against allowed values (worktree, git-notes, orphan, external); reject invalid with exit(1) P1: - Fix probeCurrentGhUser() to use 'gh api user -q .login' (stdout) instead of parsing 'gh auth status' stderr output - Wire authUser through loadWatchConfig merge (was accepted but dropped) - Add --dispatch-mode, --log-file, and new flags to knownValueFlags so they are not treated as positional args Also extends SQUAD_TEAM_ROOT env var to all resolveSquad() call sites so all commands respect it for subprocess compatibility. Closes #834 Closes #835 Related: PR #763, #734 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
866958f to
b302e5c
Compare
tamirdresher
left a comment
There was a problem hiding this comment.
Approved by @tamirdresher — reviewed diff, CI green, changes are clean and well-tested. cc @diberry
…stderr (#834) (#837) P0: - Wire --notify-level, --overnight-start, --overnight-end, --sentinel-file to WatchConfig interface, loadWatchConfig merge, and normalizeFileConfig - Validate --state-backend upfront against allowed values (worktree, git-notes, orphan, external); reject invalid with exit(1) P1: - Fix probeCurrentGhUser() to use 'gh api user -q .login' (stdout) instead of parsing 'gh auth status' stderr output - Wire authUser through loadWatchConfig merge (was accepted but dropped) - Add --dispatch-mode, --log-file, and new flags to knownValueFlags so they are not treated as positional args Also extends SQUAD_TEAM_ROOT env var to all resolveSquad() call sites so all commands respect it for subprocess compatibility. Closes #834 Closes #835 Related: PR #763, #734 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
scripts/moderate-spam.mjswithGITHUB_REPOSITORYvalidation, injectable env,fileURLToPathisMain checkscripts/lock-stale.mjswithparseIntNaN-safe defaults, pluralization,fileURLToPathisMain checktest/scripts/moderate-spam.test.ts(18 tests) andtest/scripts/lock-stale.test.ts(8 tests) — all 26 pass.github/workflows/squad-comment-moderation.ymlwithactions/setup-node@v4(node-version: 22) and withoutpull-requests: writevitest.config.tswith CRLF-safe shebang stripping plugin (/^#![^\r\n]*\r?\n/)