Skip to content

fix(watch): allow --board-owner override for org-owned ProjectV2#1087

Open
vejadu wants to merge 1 commit into
bradygaster:mainfrom
vejadu:fix/board-org-owner
Open

fix(watch): allow --board-owner override for org-owned ProjectV2#1087
vejadu wants to merge 1 commit into
bradygaster:mainfrom
vejadu:fix/board-org-owner

Conversation

@vejadu
Copy link
Copy Markdown

@vejadu vejadu commented May 5, 2026

Summary

  • BoardCapability hardcoded --owner @me when shelling out to gh project item-list, so users whose project boards live under an organization (e.g. https://github.com/orgs/<org>/projects/22) could not use --board at all — gh resolved @me and failed with Could not resolve to a ProjectV2 with the number N.
  • Added --board-owner <name> CLI flag (default @me); also accepts capabilities.board.owner in .squad/config.json.
  • Plumbed boardOwner through the legacy WatchOptions shim.
  • Added tests covering the configured-owner and default-owner code paths.
  • Documented the new flag in the CLI reference and the Ralph features page.

Closes #1079

Test plan

  • npx vitest run test/watch-board-capability.test.ts — both new tests pass.
  • npx tsc --noEmit — clean.
  • npx eslint on the touched files — 0 errors (only pre-existing no-console warnings in cli-entry.ts).
  • Manual smoke test: run squad watch --board --board-project 22 --board-owner my-org against an org-owned ProjectV2 board and confirm gh project item-list is invoked with the configured owner.

🤖 Generated with Claude Code

The board capability hardcoded `--owner @me` when calling
`gh project item-list`, so users whose project boards are org-owned
(e.g. https://github.com/orgs/<org>/projects/22) could not use
`--board` at all — gh resolved `@me` and failed with
"Could not resolve to a ProjectV2 with the number N".

- Read `owner` from board capability config, defaulting to `@me`.
- Add `--board-owner <name>` CLI flag and document it.
- Plumb `boardOwner` through legacy WatchOptions.
- Add tests covering supplied and default owner.

Closes bradygaster#1079
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an override for the GitHub Projects v2 owner used by the watch board capability, enabling squad watch --board to work with org-owned ProjectV2 boards (not just @me).

Changes:

  • Introduces --board-owner <name> (default @me) and threads it into watch capability config.
  • Updates BoardCapability to use the configured owner when calling gh project item-list.
  • Adds a focused unit test for owner propagation and updates CLI/docs references.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/watch-board-capability.test.ts Adds tests asserting configured/default --owner behavior for gh project item-list.
packages/squad-cli/src/cli/commands/watch/index.ts Extends legacy WatchOptions shim to carry boardOwner into capability config.
packages/squad-cli/src/cli/commands/watch/capabilities/board.ts Uses context.config.owner (default @me) when invoking gh project item-list.
packages/squad-cli/src/cli-entry.ts Adds --board-owner help text, parsing, and positional-arg skip list support.
docs/src/content/docs/reference/cli.md Documents --board-project and new --board-owner flags in the CLI reference.
docs/src/content/docs/features/ralph.md Documents --board-owner in Ralph’s opt-in feature flag table.


async execute(context: WatchContext): Promise<CapabilityResult> {
const projectNumber = (context.config['projectNumber'] as number) ?? 1;
const owner = (context.config['owner'] as string) ?? '@me';
Comment on lines +487 to +494
// --board-owner sets the project owner (default @me, override for org-owned ProjectV2 boards)
const boardOwnerIdx = args.indexOf('--board-owner');
if (boardOwnerIdx !== -1 && args[boardOwnerIdx + 1]) {
const existing = capabilities['board'];
capabilities['board'] = typeof existing === 'object' && existing !== null
? { ...existing, owner: args[boardOwnerIdx + 1]! }
: { owner: args[boardOwnerIdx + 1]! };
}
Comment on lines 183 to 187
console.log(` --self-pull git fetch/pull at round start`);
console.log(` --board project board lifecycle + reconciliation`);
console.log(` --board-project N project number (default 1)`);
console.log(` --board-owner X project owner (default @me; use org name for org-owned ProjectV2)`);
console.log(` --monitor-teams scan Teams for actionable messages`);
Comment on lines +487 to +494
// --board-owner sets the project owner (default @me, override for org-owned ProjectV2 boards)
const boardOwnerIdx = args.indexOf('--board-owner');
if (boardOwnerIdx !== -1 && args[boardOwnerIdx + 1]) {
const existing = capabilities['board'];
capabilities['board'] = typeof existing === 'object' && existing !== null
? { ...existing, owner: args[boardOwnerIdx + 1]! }
: { owner: args[boardOwnerIdx + 1]! };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants