Skip to content

feat(platform): hydrate WorkItem.body; route two-pass scan through adapter#1414

Open
babonet wants to merge 2 commits into
bradygaster:devfrom
babonet:squad/forge-two-pass-adapter
Open

feat(platform): hydrate WorkItem.body; route two-pass scan through adapter#1414
babonet wants to merge 2 commits into
bradygaster:devfrom
babonet:squad/forge-two-pass-adapter

Conversation

@babonet

@babonet babonet commented Jun 29, 2026

Copy link
Copy Markdown

Phase 2 of routing the watch CLI through PlatformAdapter so ADO-first squads work.

  • WorkItem gains optional body; populated by GitHubAdapter (gh issue view --json body) + AzureDevOpsAdapter (System.Description)
  • watch two-pass hydrates via adapter.getWorkItem instead of hardcoded gh issue view; drops the gh requirement
  • changeset (sdk minor, cli patch)

Validation: SKIP_BUILD_BUMP=1 npm run build; vitest (184 pass). Independent of #1413.

…adapter

WorkItem gains optional body (GitHub + ADO); watch two-pass uses adapter.getWorkItem instead of gh issue view, so it works on ADO too.
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #1414

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 5
Files added 1
Files modified 4
Files deleted 0
Modules touched 3

🎯 Risk Factors

  • 5 files changed (≤5 → LOW)
  • 3 modules touched (2-4 → MEDIUM)

📦 Modules Affected

root (1 file)
  • .changeset/forge-two-pass-adapter.md
squad-cli (1 file)
  • packages/squad-cli/src/cli/commands/watch/capabilities/two-pass.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

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 06dd147

PR Scope: 📦🔧 Mixed (product + infrastructure)

⚠️ 3 item(s) to address before review

Status Check Details
Single commit 2 commits — consider squashing before review
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 (1 outdated skipped)
CI passing 6 check(s) still running

Files Changed (5 files, +23 −12)

File +/−
.changeset/forge-two-pass-adapter.md +8 −0
packages/squad-cli/src/cli/commands/watch/capabilities/two-pass.ts +10 −11
packages/squad-sdk/src/platform/azure-devops.ts +1 −0
packages/squad-sdk/src/platform/github.ts +3 −1
packages/squad-sdk/src/platform/types.ts +1 −0

Total: +23 −12


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 13:01
Copilot AI review requested due to automatic review settings June 29, 2026 13:01

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 optional WorkItem.body to the platform abstraction and updates adapters/CLI watch hydration so work-item details (especially body/description) can be fetched via PlatformAdapter.getWorkItem, enabling Azure DevOps–first squads to use the watch two-pass flow without a hard dependency on gh issue view.

Changes:

  • Extend WorkItem with optional body and populate it in GitHubAdapter.getWorkItem() and AzureDevOpsAdapter.getWorkItem().
  • Update watch two-pass capability to hydrate actionable items via context.adapter.getWorkItem() and remove the explicit gh requirement.
  • Add a changeset bumping @bradygaster/squad-sdk (minor) and @bradygaster/squad-cli (patch).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/squad-sdk/src/platform/types.ts Adds optional body?: string to normalized WorkItem.
packages/squad-sdk/src/platform/github.ts Requests/parses body from gh issue view --json ... and returns it on WorkItem.
packages/squad-sdk/src/platform/azure-devops.ts Maps System.Description into WorkItem.body when it’s a string.
packages/squad-cli/src/cli/commands/watch/capabilities/two-pass.ts Routes pass-2 hydration through adapter.getWorkItem() and removes the gh requirement.
.changeset/forge-two-pass-adapter.md Records SDK/CLI version bumps and describes the new behavior.

Comment thread packages/squad-cli/src/cli/commands/watch/capabilities/two-pass.ts Outdated
… hydrated

ADO listWorkItems populates body, so re-fetching each actionable item was wasteful. Reuse the existing body when present.

@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 — surgical and correct. Removes hardcoded gh CLI dependency from two-pass, routes through adapter. body field added with proper type guards (ADO typeof check is defensive coding done right). requires:[] is correct since the adapter owns the dependency now. Narrowed hydrated shape matches the declared type better than the old raw JSON push. No security concerns. Clean.

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