Skip to content

feat(platform): add setAssignee() to PlatformAdapter (GitHub + ADO)#1413

Open
babonet wants to merge 1 commit into
bradygaster:devfrom
babonet:squad/forge-set-assignee
Open

feat(platform): add setAssignee() to PlatformAdapter (GitHub + ADO)#1413
babonet wants to merge 1 commit into
bradygaster:devfrom
babonet:squad/forge-set-assignee

Conversation

@babonet

@babonet babonet commented Jun 29, 2026

Copy link
Copy Markdown

Closes part of the ADO-first squad routing gap. Adds setAssignee() to PlatformAdapter so assignee changes route through the platform abstraction instead of inline gh/az branches.

  • GitHubAdapter: gh issue edit --add/--remove-assignee
  • AzureDevOpsAdapter: System.AssignedTo
  • watch editWorkItem delegates to adapter (removes hardcoded gh-vs-ado branch)
  • tests + changeset (sdk minor, cli patch)

Validation: SKIP_BUILD_BUMP=1 npm run build; vitest platform (135 pass).

@github-actions

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #1413

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 7
Files added 1
Files modified 6
Files deleted 0
Modules touched 4
Critical files 1

🎯 Risk Factors

  • 7 files changed (6-20 → MEDIUM)
  • 4 modules touched (2-4 → MEDIUM)
  • Critical files touched: packages/squad-cli/src/cli/commands/watch/index.ts

📦 Modules Affected

root (1 file)
  • .changeset/forge-set-assignee.md
squad-cli (2 files)
  • packages/squad-cli/src/cli/commands/loop.ts
  • packages/squad-cli/src/cli/commands/watch/index.ts
squad-sdk (3 files)
  • packages/squad-sdk/src/platform/azure-devops.ts
  • packages/squad-sdk/src/platform/github.ts
  • packages/squad-sdk/src/platform/types.ts
tests (1 file)
  • test/platform-adapter.test.ts

⚠️ Critical Files

  • packages/squad-cli/src/cli/commands/watch/index.ts

This report is generated automatically for every PR. See #733 for details.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 969886a

PR Scope: 📦🔧 Mixed (product + infrastructure)

⚠️ 2 item(s) to address before review

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 (4 outdated skipped)
CI passing 4 check(s) still running

Files Changed (7 files, +214 −156)

File +/−
.changeset/forge-set-assignee.md +8 −0
packages/squad-cli/src/cli/commands/loop.ts +1 −0
packages/squad-cli/src/cli/commands/watch/index.ts +10 −18
packages/squad-sdk/src/platform/azure-devops.ts +11 −0
packages/squad-sdk/src/platform/github.ts +13 −0
packages/squad-sdk/src/platform/types.ts +5 −0
test/platform-adapter.test.ts +166 −138

Total: +214 −156


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

@babonet babonet marked this pull request as ready for review June 29, 2026 11:34
Copilot AI review requested due to automatic review settings June 29, 2026 11:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a setAssignee() operation to the PlatformAdapter so assignee changes can be routed through the platform abstraction (GitHub + Azure DevOps) instead of being implemented as inline gh/az branches in CLI code.

Changes:

  • Extends PlatformAdapter with setAssignee(workItemId, assignee) and wires implementations for GitHub and Azure DevOps.
  • Updates the watch command’s editWorkItem to delegate assignee changes to the adapter.
  • Adds test coverage for the interface shape and includes a changeset bump (SDK minor, CLI patch).

Reviewed changes

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

Show a summary per file
File Description
packages/squad-sdk/src/platform/types.ts Adds setAssignee() to the platform adapter contract and documents expected behavior.
packages/squad-sdk/src/platform/github.ts Implements GitHubAdapter.setAssignee() via gh issue edit.
packages/squad-sdk/src/platform/azure-devops.ts Implements AzureDevOpsAdapter.setAssignee() via System.AssignedTo.
packages/squad-cli/src/cli/commands/watch/index.ts Replaces inline platform branching with adapter.setAssignee() calls.
packages/squad-cli/src/cli/commands/loop.ts Updates the noop adapter to satisfy the new interface.
test/platform-adapter.test.ts Updates interface conformance mocks and adds a basic interface-shape test for setAssignee.
.changeset/forge-set-assignee.md Records version bumps and describes the new adapter capability.

Comment thread packages/squad-sdk/src/platform/github.ts
Comment thread packages/squad-sdk/src/platform/azure-devops.ts
Comment thread packages/squad-cli/src/cli/commands/watch/index.ts Outdated
Comment thread packages/squad-sdk/src/platform/types.ts Outdated
@babonet babonet force-pushed the squad/forge-set-assignee branch from aeb751e to b6d9d84 Compare June 29, 2026 11:38
Routes assignee changes through the adapter instead of inline gh/az calls in watch. Adds GitHub + ADO impls, refactors editWorkItem, tests + changeset.
@babonet babonet force-pushed the squad/forge-set-assignee branch from b6d9d84 to 969886a Compare June 29, 2026 11:41
@babonet

babonet commented Jun 29, 2026

Copy link
Copy Markdown
Author

Addressed all four review comments in the latest push (969886a):

  1. github.ts unassign — undefined now fetches the current assignee and removes the right user instead of always removing @me.
  2. ADO @me — setAssignee('@me') is now a no-op (matches prior best-effort behavior; no accidental unassign in executeIssue).
  3. watch removeAssignee — retyped as boolean flag; unassign clears current assignee on both platforms.
  4. types.ts doc — clarified @me assigns current user on GitHub only; ADO skips it.

Build green, 134 platform tests pass.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@tamirdresher tamirdresher left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

✅ Approved — clean platform abstraction for setAssignee(). Security review: no new injection vectors (array-based exec, not shell). The TOCTOU race on unassign is harmless (best-effort with try/catch). removeAssignee type change from string→boolean is correct and internal-only. ADO @me no-op is documented and matches prior behavior. Tests cover the contract. Ship it.

@tamirdresher

Copy link
Copy Markdown
Collaborator

Thanks Oren! Clean work on the platform abstraction. 🙌

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.

4 participants